Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 53 additions & 1 deletion crates/goose-sdk-types/src/custom_requests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use agent_client_protocol::schema::{ContentBlock, McpServer, SessionInfo};
use agent_client_protocol::schema::{AvailableCommand, ContentBlock, McpServer, SessionInfo};
use agent_client_protocol::{JsonRpcRequest, JsonRpcResponse};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -1134,6 +1134,58 @@ pub struct ListSourcesResponse {
pub sources: Vec<SourceEntry>,
}

/// A user-facing `@` mention target backed by an agent, recipe, or subrecipe source.
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct AgentMention {
pub name: String,
pub description: String,
pub source_type: SourceType,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub source_path: Option<String>,
pub mention: String,
}

/// List user-facing agent mention targets for `@` autocomplete.
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)]
#[request(
method = "_goose/unstable/agent-mentions/list",
response = ListAgentMentionsResponse
Comment on lines +1151 to +1153

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Regenerate ACP schema and SDK types

These new custom methods are not reflected in the tracked generated artifacts: I checked crates/goose/acp-schema.json, crates/goose/acp-meta.json, and ui/sdk/src/generated with rg for agent-mentions/slash-commands and found no matches. Since just check-acp-schema regenerates and diffs those paths, this change will leave the schema check failing and TypeScript SDK consumers without typed access to the new methods.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generated schema already

)]
#[serde(rename_all = "camelCase")]
pub struct ListAgentMentionsRequest {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cwd: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub session_id: Option<String>,
}

#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcResponse)]
#[serde(rename_all = "camelCase")]
pub struct ListAgentMentionsResponse {
pub agents: Vec<AgentMention>,
}

/// List slash commands available for `/` autocomplete.
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)]
#[request(
method = "_goose/unstable/slash-commands/list",
response = ListSlashCommandsResponse
)]
#[serde(rename_all = "camelCase")]
pub struct ListSlashCommandsRequest {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cwd: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub session_id: Option<String>,
}

#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcResponse)]
#[serde(rename_all = "camelCase")]
pub struct ListSlashCommandsResponse {
pub available_commands: Vec<AvailableCommand>,
}

/// Update an existing source's name, description, and content by absolute path.
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)]
#[request(method = "_goose/unstable/sources/update", response = UpdateSourceResponse)]
Expand Down
10 changes: 10 additions & 0 deletions crates/goose/acp-meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,16 @@
"requestType": "ListSourcesRequest_unstable",
"responseType": "ListSourcesResponse_unstable"
},
{
"method": "_goose/unstable/agent-mentions/list",
"requestType": "ListAgentMentionsRequest_unstable",
"responseType": "ListAgentMentionsResponse_unstable"
},
{
"method": "_goose/unstable/slash-commands/list",
"requestType": "ListSlashCommandsRequest_unstable",
"responseType": "ListSlashCommandsResponse_unstable"
},
{
"method": "_goose/unstable/sources/update",
"requestType": "UpdateSourceRequest_unstable",
Expand Down
203 changes: 203 additions & 0 deletions crates/goose/acp-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3887,6 +3887,175 @@
"x-side": "agent",
"x-method": "_goose/unstable/sources/list"
},
"ListAgentMentionsRequest_unstable": {
"type": "object",
"properties": {
"cwd": {
"type": [
"string",
"null"
]
},
"sessionId": {
"type": [
"string",
"null"
]
}
},
"description": "List user-facing agent mention targets for `@` autocomplete.",
"x-side": "agent",
"x-method": "_goose/unstable/agent-mentions/list"
},
"ListAgentMentionsResponse_unstable": {
"type": "object",
"properties": {
"agents": {
"type": "array",
"items": {
"$ref": "#/$defs/AgentMention"
}
}
},
"required": [
"agents"
],
"x-side": "agent",
"x-method": "_goose/unstable/agent-mentions/list"
},
"AgentMention": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"sourceType": {
"$ref": "#/$defs/SourceType"
},
"sourcePath": {
"type": [
"string",
"null"
]
},
"mention": {
"type": "string"
}
},
"required": [
"name",
"description",
"sourceType",
"mention"
],
"description": "A user-facing `@` mention target backed by an agent, recipe, or subrecipe source."
},
"ListSlashCommandsRequest_unstable": {
"type": "object",
"properties": {
"cwd": {
"type": [
"string",
"null"
]
},
"sessionId": {
"type": [
"string",
"null"
]
}
},
"description": "List slash commands available for `/` autocomplete.",
"x-side": "agent",
"x-method": "_goose/unstable/slash-commands/list"
},
"ListSlashCommandsResponse_unstable": {
"type": "object",
"properties": {
"availableCommands": {
"type": "array",
"items": {
"$ref": "#/$defs/AvailableCommand"
}
}
},
"required": [
"availableCommands"
],
"x-side": "agent",
"x-method": "_goose/unstable/slash-commands/list"
},
"AvailableCommand": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Command name (e.g., `create_plan`, `research_codebase`)."
},
"description": {
"type": "string",
"description": "Human-readable description of what the command does."
},
"input": {
"anyOf": [
{
"$ref": "#/$defs/AvailableCommandInput"
},
{
"type": "null"
}
],
"description": "Input for the command if required"
},
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": {},
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)"
}
},
"required": [
"name",
"description"
],
"description": "Information about a command."
},
"AvailableCommandInput": {
"anyOf": [
{
"$ref": "#/$defs/UnstructuredCommandInput",
"description": "All text that was typed after the command name is provided as input."
}
],
"description": "The input specification for a command."
},
"UnstructuredCommandInput": {
"type": "object",
"properties": {
"hint": {
"type": "string",
"description": "A hint to display when the input hasn't been provided yet"
},
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": {},
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)"
}
},
"required": [
"hint"
],
"description": "All text that was typed after the command name is provided as input."
},
"UpdateSourceRequest_unstable": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -5098,6 +5267,24 @@
"description": "Params for _goose/unstable/sources/list",
"title": "ListSourcesRequest_unstable"
},
{
"allOf": [
{
"$ref": "#/$defs/ListAgentMentionsRequest_unstable"
}
],
"description": "Params for _goose/unstable/agent-mentions/list",
"title": "ListAgentMentionsRequest_unstable"
},
{
"allOf": [
{
"$ref": "#/$defs/ListSlashCommandsRequest_unstable"
}
],
"description": "Params for _goose/unstable/slash-commands/list",
"title": "ListSlashCommandsRequest_unstable"
},
{
"allOf": [
{
Expand Down Expand Up @@ -5558,6 +5745,22 @@
],
"title": "ListSourcesResponse_unstable"
},
{
"allOf": [
{
"$ref": "#/$defs/ListAgentMentionsResponse_unstable"
}
],
"title": "ListAgentMentionsResponse_unstable"
},
{
"allOf": [
{
"$ref": "#/$defs/ListSlashCommandsResponse_unstable"
}
],
"title": "ListSlashCommandsResponse_unstable"
},
{
"allOf": [
{
Expand Down
Loading
Loading