Feature/at agent mention (#8571)
Signed-off-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -136,6 +136,7 @@ pub enum CommandType {
|
||||
Builtin,
|
||||
Recipe,
|
||||
Skill,
|
||||
Agent,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
|
||||
@@ -436,6 +437,26 @@ pub async fn get_slash_commands(
|
||||
});
|
||||
}
|
||||
|
||||
let discover_dir = working_dir
|
||||
.as_deref()
|
||||
.unwrap_or_else(|| std::path::Path::new("."));
|
||||
for source in
|
||||
goose::agents::platform_extensions::summon::discover_filesystem_sources(discover_dir)
|
||||
{
|
||||
use goose::agents::platform_extensions::SourceKind;
|
||||
if matches!(
|
||||
source.kind,
|
||||
SourceKind::Agent | SourceKind::Recipe | SourceKind::Subrecipe
|
||||
) && !source.content.is_empty()
|
||||
{
|
||||
commands.push(SlashCommand {
|
||||
command: source.name,
|
||||
help: source.description,
|
||||
command_type: CommandType::Agent,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Json(SlashCommandsResponse { commands }))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user