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
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ description = "An AI agent"
uninlined_format_args = "allow"

[workspace.dependencies]
rmcp = { version = "0.6.0", features = ["schemars", "auth"] }
rmcp = { version = "0.6.2", features = ["schemars", "auth"] }

# Patch for Windows cross-compilation issue with crunchy
[patch.crates-io]
Expand Down
3 changes: 2 additions & 1 deletion crates/goose-cli/src/scenario_tests/mock_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ impl McpClientTrait for MockClient {
if let Some(handler) = self.handlers.get(name) {
match handler(&arguments) {
Ok(content) => Ok(CallToolResult {
content: content,
content,
is_error: None,
structured_content: None,
meta: None,
}),
Err(_e) => Err(Error::UnexpectedResponse),
}
Expand Down
20 changes: 20 additions & 0 deletions crates/goose-cli/src/session/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ pub fn tool_response_to_markdown(resp: &ToolResponse, export_all_content: bool)
uri,
mime_type,
text,
meta: _,
} => {
// Extract file extension from the URI for syntax highlighting
let file_extension = uri.split('.').next_back().unwrap_or("");
Expand Down Expand Up @@ -287,6 +288,7 @@ pub fn tool_response_to_markdown(resp: &ToolResponse, export_all_content: bool)
uri,
mime_type,
blob,
..
} => {
md.push_str(&format!(
"**Binary File:** `{}` (type: {}, {} bytes)\n\n",
Expand All @@ -297,6 +299,10 @@ pub fn tool_response_to_markdown(resp: &ToolResponse, export_all_content: bool)
}
}
}
RawContent::ResourceLink(_link) => {
// Show a simple placeholder for resource links when exporting
md.push_str("[resource link]\n\n");
}
RawContent::Audio(_) => {
md.push_str("[audio content not displayed in Markdown export]\n\n")
}
Expand Down Expand Up @@ -527,6 +533,7 @@ mod tests {
let text_content = TextContent {
raw: RawTextContent {
text: "Command executed successfully".to_string(),
meta: None,
},
annotations: None,
};
Expand All @@ -546,6 +553,7 @@ mod tests {
let text_content = TextContent {
raw: RawTextContent {
text: json_text.to_string(),
meta: None,
},
annotations: None,
};
Expand Down Expand Up @@ -650,6 +658,7 @@ if __name__ == "__main__":
let text_content = TextContent {
raw: RawTextContent {
text: python_code.to_string(),
meta: None,
},
annotations: None,
};
Expand Down Expand Up @@ -689,6 +698,7 @@ if __name__ == "__main__":
let text_content = TextContent {
raw: RawTextContent {
text: git_output.to_string(),
meta: None,
},
annotations: None,
};
Expand Down Expand Up @@ -736,6 +746,7 @@ warning: unused variable `x`
let text_content = TextContent {
raw: RawTextContent {
text: build_output.to_string(),
meta: None,
},
annotations: None,
};
Expand Down Expand Up @@ -781,6 +792,7 @@ warning: unused variable `x`
let text_content = TextContent {
raw: RawTextContent {
text: api_response.to_string(),
meta: None,
},
annotations: None,
};
Expand Down Expand Up @@ -815,6 +827,7 @@ warning: unused variable `x`
let text_content = TextContent {
raw: RawTextContent {
text: "File created successfully".to_string(),
meta: None,
},
annotations: None,
};
Expand Down Expand Up @@ -870,6 +883,7 @@ def process_data(data: List[Dict]) -> List[Dict]:
let text_content = TextContent {
raw: RawTextContent {
text: python_code.to_string(),
meta: None,
},
annotations: None,
};
Expand Down Expand Up @@ -905,6 +919,7 @@ Command failed with exit code 2"#;
let text_content = TextContent {
raw: RawTextContent {
text: error_output.to_string(),
meta: None,
},
annotations: None,
};
Expand Down Expand Up @@ -943,6 +958,7 @@ Command failed with exit code 2"#;
let text_content = TextContent {
raw: RawTextContent {
text: script_output.to_string(),
meta: None,
},
annotations: None,
};
Expand Down Expand Up @@ -988,6 +1004,7 @@ drwx------ 3 user staff 96 Dec 6 16:20 com.apple.launchd.abc
let text_content = TextContent {
raw: RawTextContent {
text: multi_output.to_string(),
meta: None,
},
annotations: None,
};
Expand Down Expand Up @@ -1029,6 +1046,7 @@ src/middleware.rs:12:async fn auth_middleware(req: Request, next: Next) -> Resul
let text_content = TextContent {
raw: RawTextContent {
text: grep_output.to_string(),
meta: None,
},
annotations: None,
};
Expand Down Expand Up @@ -1067,6 +1085,7 @@ src/middleware.rs:12:async fn auth_middleware(req: Request, next: Next) -> Resul
let text_content = TextContent {
raw: RawTextContent {
text: json_output.to_string(),
meta: None,
},
annotations: None,
};
Expand Down Expand Up @@ -1106,6 +1125,7 @@ found 0 vulnerabilities"#;
let text_content = TextContent {
raw: RawTextContent {
text: npm_output.to_string(),
meta: None,
},
annotations: None,
};
Expand Down
16 changes: 12 additions & 4 deletions crates/goose-mcp/src/autovisualiser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ impl AutoVisualiserRouter {
uri: "ui://sankey/diagram".to_string(),
mime_type: Some("text/html".to_string()),
blob: base64_encoded,
meta: None,
};

Ok(vec![
Expand Down Expand Up @@ -686,6 +687,7 @@ impl AutoVisualiserRouter {
uri: "ui://radar/chart".to_string(),
mime_type: Some("text/html".to_string()),
blob: base64_encoded,
meta: None,
};

Ok(vec![
Expand Down Expand Up @@ -730,6 +732,7 @@ impl AutoVisualiserRouter {
uri: "ui://treemap/visualization".to_string(),
mime_type: Some("text/html".to_string()),
blob: base64_encoded,
meta: None,
};

Ok(vec![
Expand Down Expand Up @@ -774,6 +777,7 @@ impl AutoVisualiserRouter {
uri: "ui://chord/diagram".to_string(),
mime_type: Some("text/html".to_string()),
blob: base64_encoded,
meta: None,
};

Ok(vec![
Expand Down Expand Up @@ -818,6 +822,7 @@ impl AutoVisualiserRouter {
uri: "ui://donut/chart".to_string(),
mime_type: Some("text/html".to_string()),
blob: base64_encoded,
meta: None,
};

Ok(vec![
Expand Down Expand Up @@ -879,6 +884,7 @@ impl AutoVisualiserRouter {
uri: "ui://map/visualization".to_string(),
mime_type: Some("text/html".to_string()),
blob: base64_encoded,
meta: None,
};

Ok(vec![
Expand Down Expand Up @@ -923,6 +929,7 @@ impl AutoVisualiserRouter {
uri: "ui://chart/interactive".to_string(),
mime_type: Some("text/html".to_string()),
blob: base64_encoded,
meta: None,
};

Ok(vec![
Expand Down Expand Up @@ -1175,8 +1182,8 @@ mod tests {
assert_eq!(content[0].audience().unwrap(), &vec![Role::User]);

// Check it's a resource with HTML content
// Content is Annotated<RawContent>, deref to get RawContent
if let RawContent::Resource(resource) = &**&content[0] {
// Content is Annotated<RawContent>, access underlying RawContent via *
if let RawContent::Resource(resource) = &*content[0] {
if let ResourceContents::BlobResourceContents { uri, mime_type, .. } =
&resource.resource
{
Expand Down Expand Up @@ -1212,12 +1219,13 @@ mod tests {
assert_eq!(content[0].audience().unwrap(), &vec![Role::User]);

// Check it's a resource with HTML content
// Content is Annotated<RawContent>, deref to get RawContent
if let RawContent::Resource(resource) = &**&content[0] {
// Content is Annotated<RawContent>, access underlying RawContent via *
if let RawContent::Resource(resource) = &*content[0] {
if let ResourceContents::BlobResourceContents {
uri,
mime_type,
blob,
..
} = &resource.resource
{
assert_eq!(uri, "ui://radar/chart");
Expand Down
4 changes: 2 additions & 2 deletions crates/goose-mcp/src/developer/rmcp_developer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ignore::gitignore::{Gitignore, GitignoreBuilder};
use include_dir::{include_dir, Dir};
use indoc::{formatdoc, indoc};
use rmcp::{
handler::server::{router::tool::ToolRouter, tool::Parameters},
handler::server::{router::tool::ToolRouter, wrapper::Parameters},
model::{
CallToolResult, Content, ErrorCode, ErrorData, GetPromptRequestParam, GetPromptResult,
Implementation, ListPromptsResult, LoggingLevel, LoggingMessageNotificationParam,
Expand Down Expand Up @@ -1242,7 +1242,7 @@ impl DeveloperServer {
#[cfg(test)]
mod tests {
use super::*;
use rmcp::handler::server::tool::Parameters;
use rmcp::handler::server::wrapper::Parameters;
use rmcp::model::NumberOrString;
use rmcp::service::serve_directly;
use serial_test::serial;
Expand Down
4 changes: 3 additions & 1 deletion crates/goose-server/src/openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use goose::session::info::SessionInfo;
use goose::session::SessionMetadata;
use rmcp::model::{
Annotations, Content, EmbeddedResource, ImageContent, RawEmbeddedResource, RawImageContent,
RawTextContent, ResourceContents, Role, TextContent, Tool, ToolAnnotations,
RawResource, RawTextContent, ResourceContents, Role, TextContent, Tool, ToolAnnotations,
};
use utoipa::{OpenApi, ToSchema};

Expand Down Expand Up @@ -319,6 +319,7 @@ derive_utoipa!(TextContent as TextContentSchema);
derive_utoipa!(RawTextContent as RawTextContentSchema);
derive_utoipa!(RawImageContent as RawImageContentSchema);
derive_utoipa!(RawEmbeddedResource as RawEmbeddedResourceSchema);
derive_utoipa!(RawResource as RawResourceSchema);
derive_utoipa!(Tool as ToolSchema);
derive_utoipa!(ToolAnnotations as ToolAnnotationsSchema);
derive_utoipa!(Annotations as AnnotationsSchema);
Expand Down Expand Up @@ -425,6 +426,7 @@ impl<'__s> ToSchema<'__s> for AnnotatedSchema {
RawTextContentSchema,
RawImageContentSchema,
RawEmbeddedResourceSchema,
RawResourceSchema,
AnnotatedSchema,
ToolResponse,
ToolRequest,
Expand Down
2 changes: 2 additions & 0 deletions crates/goose/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ rmcp = { workspace = true, features = [
"reqwest",
"transport-child-process",
"transport-sse-client",
"transport-sse-client-reqwest",
"transport-streamable-http-client",
"transport-streamable-http-client-reqwest",
] }
anyhow = "1.0"
thiserror = "1.0"
Expand Down
1 change: 1 addition & 0 deletions crates/goose/src/agents/extension_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,7 @@ mod tests {
content: vec![],
is_error: None,
structured_content: None,
meta: None,
}),
_ => Err(Error::TransportClosed),
}
Expand Down
1 change: 1 addition & 0 deletions crates/goose/src/context_mgmt/auto_compact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ mod tests {
vec![MessageContent::Text(
RawTextContent {
text: "Summary of conversation".to_string(),
meta: None,
}
.no_annotation(),
)],
Expand Down
1 change: 1 addition & 0 deletions crates/goose/src/context_mgmt/summarize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ mod tests {
vec![MessageContent::Text(
RawTextContent {
text: "Summarized content".to_string(),
meta: None,
}
.no_annotation(),
)],
Expand Down
Loading
Loading