Support Agent Servers on remoting (#42683)
<img width="348" height="359" alt="Screenshot 2025-11-13 at 6 53 39 PM" src="https://github.com/user-attachments/assets/6fe75796-8ceb-4f98-9d35-005c90417fd4" /> Also added support for per-target env vars to Agent Server Extensions Closes https://github.com/zed-industries/zed/issues/42291 Release Notes: - Per-target env vars are now supported on Agent Server Extensions - Agent Server Extensions are now available when doing SSH remoting --------- Co-authored-by: Lukas Wirth <me@lukaswirth.dev> Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
This commit is contained in:
co-authored by
Lukas Wirth
Mikayla Maki
parent
bb46bc167a
commit
4b050b651a
@@ -193,6 +193,36 @@ pub struct TargetConfig {
|
||||
/// 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)]
|
||||
|
||||
Reference in New Issue
Block a user