mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
install plugins to ~/.agents/plugins (#9088)
This commit is contained in:
@@ -161,6 +161,7 @@ impl Agent {
|
||||
output.push_str("No skills installed.\n\n");
|
||||
output.push_str("Skills are loaded from SKILL.md files in:\n");
|
||||
output.push_str(" - ~/.agents/skills/ (global)\n");
|
||||
output.push_str(" - ~/.agents/plugins/*/skills/ (installed plugins)\n");
|
||||
output.push_str(" - .agents/skills/ (in current project)\n");
|
||||
} else {
|
||||
output.push_str(&format!("**Installed skills ({}):**\n\n", skills.len()));
|
||||
|
||||
@@ -11,6 +11,7 @@ impl Paths {
|
||||
DirType::Config => base.join("config"),
|
||||
DirType::Data => base.join("data"),
|
||||
DirType::State => base.join("state"),
|
||||
DirType::Plugins => base.join(".agents").join("plugins"),
|
||||
}
|
||||
} else {
|
||||
// NOTE: "Block" is kept here for backwards compatibility with existing
|
||||
@@ -27,6 +28,7 @@ impl Paths {
|
||||
DirType::Config => strategy.config_dir(),
|
||||
DirType::Data => strategy.data_dir(),
|
||||
DirType::State => strategy.state_dir().unwrap_or(strategy.data_dir()),
|
||||
DirType::Plugins => strategy.home_dir().join(".agents").join("plugins"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,6 +45,10 @@ impl Paths {
|
||||
Self::get_dir(DirType::State)
|
||||
}
|
||||
|
||||
pub fn plugins_dir() -> PathBuf {
|
||||
Self::get_dir(DirType::Plugins)
|
||||
}
|
||||
|
||||
pub fn in_state_dir(subpath: &str) -> PathBuf {
|
||||
Self::state_dir().join(subpath)
|
||||
}
|
||||
@@ -60,4 +66,5 @@ enum DirType {
|
||||
Config,
|
||||
Data,
|
||||
State,
|
||||
Plugins,
|
||||
}
|
||||
|
||||
@@ -69,12 +69,8 @@ struct InstallMetadata {
|
||||
last_update_check: Option<DateTime<Utc>>,
|
||||
}
|
||||
|
||||
pub fn plugin_install_dir() -> PathBuf {
|
||||
Paths::data_dir().join("plugins")
|
||||
}
|
||||
|
||||
pub fn installed_plugin_skill_dirs() -> Vec<PathBuf> {
|
||||
let plugins_dir = plugin_install_dir();
|
||||
let plugins_dir = Paths::plugins_dir();
|
||||
for update in auto_update_plugins_at_root(Utc::now(), &plugins_dir) {
|
||||
if let Err(err) = update.result {
|
||||
warn!(
|
||||
@@ -104,7 +100,7 @@ pub fn install_plugin_with_options(
|
||||
source: &str,
|
||||
options: PluginInstallOptions,
|
||||
) -> Result<PluginInstall> {
|
||||
install_plugin_with_options_at_root(source, options, &plugin_install_dir())
|
||||
install_plugin_with_options_at_root(source, options, &Paths::plugins_dir())
|
||||
}
|
||||
|
||||
fn install_plugin_with_options_at_root(
|
||||
@@ -130,11 +126,11 @@ fn install_plugin_with_options_at_root(
|
||||
}
|
||||
|
||||
pub fn update_plugin(name: &str) -> Result<PluginInstall> {
|
||||
update_plugin_at_root(Utc::now(), &plugin_install_dir(), name)
|
||||
update_plugin_at_root(Utc::now(), &Paths::plugins_dir(), name)
|
||||
}
|
||||
|
||||
pub fn auto_update_plugins() -> Vec<PluginAutoUpdateResult> {
|
||||
auto_update_plugins_at_root(Utc::now(), &plugin_install_dir())
|
||||
auto_update_plugins_at_root(Utc::now(), &Paths::plugins_dir())
|
||||
}
|
||||
|
||||
fn auto_update_plugins_at_root(
|
||||
|
||||
@@ -112,6 +112,7 @@ fn inferred_discoverable_skill_root(path: &Path) -> Option<PathBuf> {
|
||||
global_roots.push(home.join(".claude").join("skills"));
|
||||
global_roots.push(home.join(".config").join("agents").join("skills"));
|
||||
}
|
||||
global_roots.extend(installed_plugin_skill_dirs());
|
||||
|
||||
for root in global_roots {
|
||||
let canonical_root = canonicalize_or_original(&root);
|
||||
|
||||
Reference in New Issue
Block a user