More slash commands (#5858)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2025-12-16 19:26:49 -05:00
committed by GitHub
parent 07de82ba9b
commit fd9582a45f
7 changed files with 454 additions and 82 deletions
@@ -18,7 +18,10 @@ use goose::providers::pricing::{
get_all_pricing, get_model_pricing, parse_model_id, refresh_pricing,
};
use goose::providers::providers as get_providers;
use goose::{agents::ExtensionConfig, config::permission::PermissionLevel, slash_commands};
use goose::{
agents::execute_commands, agents::ExtensionConfig, config::permission::PermissionLevel,
slash_commands,
};
use http::StatusCode;
use serde::{Deserialize, Serialize};
use serde_json::Value;
@@ -437,11 +440,15 @@ pub async fn get_slash_commands() -> Result<Json<SlashCommandsResponse>, StatusC
command_type: CommandType::Recipe,
})
.collect();
commands.push(SlashCommand {
command: "compact".to_string(),
help: "Compact the current conversation to save tokens".to_string(),
command_type: CommandType::Builtin,
});
for cmd_def in execute_commands::list_commands() {
commands.push(SlashCommand {
command: cmd_def.name.to_string(),
help: cmd_def.description.to_string(),
command_type: CommandType::Builtin,
});
}
Ok(Json(SlashCommandsResponse { commands }))
}