Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Remove leftover code from agent server extensions (#65031)

Finn Evers06afd454ec3f
diff --git a/Cargo.lock b/Cargo.lock
index 51656b167f5..d9e16db01d5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6150,7 +6150,6 @@ dependencies = [
"parking_lot",
"path",
"pretty_assertions",
- "proto",
"semver",
"serde",
"serde_json",
diff --git a/crates/extension/Cargo.toml b/crates/extension/Cargo.toml
index 98835dcd414..d341f8f8700 100644
--- a/crates/extension/Cargo.toml
+++ b/crates/extension/Cargo.toml
@@ -28,7 +28,6 @@ log.workspace = true
lsp.workspace = true
parking_lot.workspace = true
path.workspace = true
-proto.workspace = true
semver.workspace = true
serde.workspace = true
serde_json.workspace = true
diff --git a/crates/extension/src/extension_manifest.rs b/crates/extension/src/extension_manifest.rs
index 5ec589d7183..56bebb80ee7 100644
--- a/crates/extension/src/extension_manifest.rs
+++ b/crates/extension/src/extension_manifest.rs
@@ -228,91 +228,6 @@ pub struct LibManifestEntry {
pub version: Option<Version>,
}
-#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
-pub struct AgentServerManifestEntry {
- /// Display name for the agent (shown in menus).
- pub name: String,
- /// Environment variables to set when launching the agent server.
- #[serde(default)]
- pub env: HashMap<String, String>,
- /// Optional icon path (relative to extension root, e.g., "ai.svg").
- /// Should be a small SVG icon for display in menus.
- #[serde(default)]
- pub icon: Option<String>,
- /// Per-target configuration for archive-based installation.
- /// The key format is "{os}-{arch}" where:
- /// - os: "darwin" (macOS), "linux", "windows"
- /// - arch: "aarch64" (arm64), "x86_64"
- ///
- /// Example:
- /// ```toml
- /// [agent_servers.myagent.targets.darwin-aarch64]
- /// archive = "https://example.com/myagent-darwin-arm64.zip"
- /// cmd = "./myagent"
- /// args = ["--serve"]
- /// sha256 = "abc123..." # optional
- /// ```
- ///
- /// For Node.js-based agents, you can use "node" as the cmd to automatically
- /// use Zed's managed Node.js runtime instead of relying on the user's PATH:
- /// ```toml
- /// [agent_servers.nodeagent.targets.darwin-aarch64]
- /// archive = "https://example.com/nodeagent.zip"
- /// cmd = "node"
- /// args = ["index.js", "--port", "3000"]
- /// ```
- ///
- /// Note: All commands are executed with the archive extraction directory as the
- /// working directory, so relative paths in args (like "index.js") will resolve
- /// relative to the extracted archive contents.
- pub targets: HashMap<String, TargetConfig>,
-}
-
-#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
-pub struct TargetConfig {
- /// URL to download the archive from (e.g., "https://github.com/owner/repo/releases/download/v1.0.0/myagent-darwin-arm64.zip")
- pub archive: String,
- /// Command to run (e.g., "./myagent" or "./myagent.exe")
- pub cmd: String,
- /// Command-line arguments to pass to the agent server.
- #[serde(default)]
- pub args: Vec<String>,
- /// Optional SHA-256 hash of the archive for verification.
- /// If not provided and the URL is a GitHub release, we'll attempt to fetch it from GitHub.
- #[serde(default)]
- pub sha256: Option<String>,
- /// Environment variables to set when launching the agent server.
- /// These target-specific env vars will override any env vars set at the agent level.
- #[serde(default)]
- pub env: HashMap<String, String>,
-}
-
-impl TargetConfig {
- pub fn from_proto(proto: proto::ExternalExtensionAgentTarget) -> Self {
- Self {
- archive: proto.archive,
- cmd: proto.cmd,
- args: proto.args,
- sha256: proto.sha256,
- env: proto.env.into_iter().collect(),
- }
- }
-
- pub fn to_proto(&self) -> proto::ExternalExtensionAgentTarget {
- proto::ExternalExtensionAgentTarget {
- archive: self.archive.clone(),
- cmd: self.cmd.clone(),
- args: self.args.clone(),
- sha256: self.sha256.clone(),
- env: self
- .env
- .iter()
- .map(|(k, v)| (k.clone(), v.clone()))
- .collect(),
- }
- }
-}
-
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
pub enum ExtensionLibraryKind {
Rust,