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
187 changes: 82 additions & 105 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ string_slice = "warn"

[workspace.dependencies]
rmcp = { version = "1.2.0", features = ["schemars", "auth"] }
sacp = "10.1.0"
agent-client-protocol-schema = { version = "0.11", features = ["unstable"] }
sacp = "11.0.0"
anyhow = "1.0"
async-stream = "0.3"
async-trait = "0.1"
Expand Down Expand Up @@ -90,6 +91,9 @@ tree-sitter-typescript = "0.23"

[patch.crates-io]
v8 = { path = "vendor/v8" }
# TODO: switch to crates.io release once it includes the unstable feature and updates org from symposium-dev to agentclientprotocol
sacp = { git = "https://github.com/agentclientprotocol/symposium-acp", rev = "14086c9" }
sacp-derive = { git = "https://github.com/agentclientprotocol/symposium-acp", rev = "14086c9" }
# TODO: switch to released version in opentelemetry 0.32.0
# https://github.com/open-telemetry/opentelemetry-rust/issues/3408
opentelemetry = { git = "https://github.com/open-telemetry/opentelemetry-rust", rev = "345cd74a" }
Expand Down
12 changes: 6 additions & 6 deletions crates/goose-acp-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use syn::{
/// Generates two methods on the impl:
///
/// 1. `handle_custom_request` — a dispatcher that:
/// - Prefixes each method name with `_goose/`
/// - Uses each annotation string as the method name (include `_goose/` for goose-only methods)
/// - Parses JSON params into the handler's typed parameter (if any)
/// - Serializes the handler's return value to JSON
///
Expand Down Expand Up @@ -79,13 +79,13 @@ pub fn custom_methods(_attr: TokenStream, item: TokenStream) -> TokenStream {
let arms: Vec<_> = routes
.iter()
.map(|route| {
let full_method = format!("_goose/{}", route.method_name);
let method = &route.method_name;
let fn_ident = &route.fn_ident;

match &route.param_type {
Some(_) => {
quote! {
#full_method => {
#method => {
let req = serde_json::from_value(params)
.map_err(|e| sacp::Error::invalid_params().data(e.to_string()))?;
let result = self.#fn_ident(req).await?;
Expand All @@ -96,7 +96,7 @@ pub fn custom_methods(_attr: TokenStream, item: TokenStream) -> TokenStream {
}
None => {
quote! {
#full_method => {
#method => {
let result = self.#fn_ident().await?;
serde_json::to_value(&result)
.map_err(|e| sacp::Error::internal_error().data(e.to_string()))
Expand All @@ -111,7 +111,7 @@ pub fn custom_methods(_attr: TokenStream, item: TokenStream) -> TokenStream {
let schema_entries: Vec<_> = routes
.iter()
.map(|route| {
let full_method = format!("_goose/{}", route.method_name);
let method = &route.method_name;

let params_expr = if let Some(pt) = &route.param_type {
if is_json_value(pt) {
Expand Down Expand Up @@ -157,7 +157,7 @@ pub fn custom_methods(_attr: TokenStream, item: TokenStream) -> TokenStream {

quote! {
crate::custom_requests::CustomMethodSchema {
method: #full_method.to_string(),
method: #method.to_string(),
params_schema: #params_expr,
params_type_name: #params_name_expr,
response_schema: #response_expr,
Expand Down
5 changes: 3 additions & 2 deletions crates/goose-acp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ workspace = true
goose = { path = "../goose", default-features = false }
goose-mcp = { path = "../goose-mcp" }
rmcp = { workspace = true }
sacp = { workspace = true }
agent-client-protocol-schema = { version = "0.10", features = ["unstable"] }
sacp = { workspace = true, features = ["unstable"] }
agent-client-protocol-schema = { workspace = true }
async-trait = { workspace = true }
anyhow = { workspace = true }
tokio = { workspace = true }
Expand Down Expand Up @@ -60,6 +60,7 @@ tempfile = { workspace = true }
test-case = { workspace = true }
axum = { workspace = true }
rmcp = { workspace = true, features = ["transport-streamable-http-server"] }
sqlx = { version = "0.8", default-features = false, features = ["runtime-tokio-rustls", "sqlite"] }

[package.metadata.cargo-machete]
# Used to provide extras imports for sacp
Expand Down
21 changes: 8 additions & 13 deletions crates/goose-acp/acp-meta.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
{
"methods": [
{
"method": "extensions/add",
"method": "_goose/extensions/add",
"requestType": "AddExtensionRequest",
"responseType": "EmptyResponse"
},
{
"method": "extensions/remove",
"method": "_goose/extensions/remove",
"requestType": "RemoveExtensionRequest",
"responseType": "EmptyResponse"
},
{
"method": "tools",
"method": "_goose/tools",
"requestType": "GetToolsRequest",
"responseType": "GetToolsResponse"
},
{
"method": "resource/read",
"method": "_goose/resource/read",
"requestType": "ReadResourceRequest",
"responseType": "ReadResourceResponse"
},
{
"method": "working_dir/update",
"method": "_goose/working_dir/update",
"requestType": "UpdateWorkingDirRequest",
"responseType": "EmptyResponse"
},
{
"method": "session/list",
"requestType": null,
"responseType": "ListSessionsResponse"
},
{
"method": "session/get",
"requestType": "GetSessionRequest",
Expand All @@ -41,17 +36,17 @@
"responseType": "EmptyResponse"
},
{
"method": "session/export",
"method": "_goose/session/export",
"requestType": "ExportSessionRequest",
"responseType": "ExportSessionResponse"
},
{
"method": "session/import",
"method": "_goose/session/import",
"requestType": "ImportSessionRequest",
"responseType": "ImportSessionResponse"
},
{
"method": "config/extensions",
"method": "_goose/config/extensions",
"requestType": null,
"responseType": "GetExtensionsResponse"
}
Expand Down
Loading
Loading