agent: Add section for agent servers in settings view (#35206)

Release Notes:

- N/A

---------

Co-authored-by: Cole Miller <cole@zed.dev>
This commit is contained in:
Danilo Leal 2025-08-25 15:45:24 -03:00 committed by GitHub
parent 5fd29d37a6
commit c786c0150f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 254 additions and 22 deletions

View file

@ -97,7 +97,7 @@ pub struct AgentServerCommand {
}
impl AgentServerCommand {
pub(crate) async fn resolve(
pub async fn resolve(
path_bin_name: &'static str,
extra_args: &[&'static str],
fallback_path: Option<&Path>,

View file

@ -53,7 +53,7 @@ impl AgentServer for Gemini {
return Err(LoadError::NotInstalled {
error_message: "Failed to find Gemini CLI binary".into(),
install_message: "Install Gemini CLI".into(),
install_command: "npm install -g @google/gemini-cli@preview".into()
install_command: Self::install_command().into(),
}.into());
};
@ -88,7 +88,7 @@ impl AgentServer for Gemini {
current_version
).into(),
upgrade_message: "Upgrade Gemini CLI to latest".into(),
upgrade_command: "npm install -g @google/gemini-cli@preview".into(),
upgrade_command: Self::upgrade_command().into(),
}.into())
}
}
@ -101,6 +101,20 @@ impl AgentServer for Gemini {
}
}
impl Gemini {
pub fn binary_name() -> &'static str {
"gemini"
}
pub fn install_command() -> &'static str {
"npm install -g @google/gemini-cli@preview"
}
pub fn upgrade_command() -> &'static str {
"npm install -g @google/gemini-cli@preview"
}
}
#[cfg(test)]
pub(crate) mod tests {
use super::*;