rmcp upgrade (#4792)
This commit is contained in:
@@ -12,7 +12,7 @@ workspace = true
|
||||
|
||||
[dependencies]
|
||||
goose = { path = "../goose" }
|
||||
rmcp = { version = "0.6.0", features = ["server", "client", "transport-io", "macros"] }
|
||||
rmcp = { version = "0.7.0", features = ["server", "client", "transport-io", "macros"] }
|
||||
anyhow = "1.0.94"
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
tokio-stream = { version = "0.1", features = ["io-util"] }
|
||||
|
||||
@@ -409,6 +409,9 @@ impl ServerHandler for AutoVisualiserRouter {
|
||||
server_info: Implementation {
|
||||
name: "goose-autovisualiser".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_owned(),
|
||||
title: None,
|
||||
icons: None,
|
||||
website_url: None,
|
||||
},
|
||||
capabilities: ServerCapabilities::builder().enable_tools().build(),
|
||||
instructions: Some(self.instructions.clone()),
|
||||
@@ -458,7 +461,7 @@ impl AutoVisualiserRouter {
|
||||
/// show a Sankey diagram from flow data
|
||||
#[tool(
|
||||
name = "render_sankey",
|
||||
description = r#"show a Sankey diagram from flow data
|
||||
description = r#"show a Sankey diagram from flow data
|
||||
The data must contain:
|
||||
- nodes: Array of objects with 'name' and optional 'category' properties
|
||||
- links: Array of objects with 'source', 'target', and 'value' properties
|
||||
@@ -537,7 +540,7 @@ Example:
|
||||
/// show a radar chart (spider chart) for multi-dimensional data comparison
|
||||
#[tool(
|
||||
name = "render_radar",
|
||||
description = r#"show a radar chart (spider chart) for multi-dimensional data comparison
|
||||
description = r#"show a radar chart (spider chart) for multi-dimensional data comparison
|
||||
|
||||
The data must contain:
|
||||
- labels: Array of strings representing the dimensions/axes
|
||||
@@ -552,7 +555,7 @@ Example:
|
||||
"data": [85, 70, 90, 75, 80]
|
||||
},
|
||||
{
|
||||
"label": "Player 2",
|
||||
"label": "Player 2",
|
||||
"data": [75, 85, 80, 90, 70]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -4,9 +4,9 @@ use reqwest::{Client, Url};
|
||||
use rmcp::{
|
||||
handler::server::{router::tool::ToolRouter, wrapper::Parameters},
|
||||
model::{
|
||||
CallToolResult, Content, ErrorCode, ErrorData, Implementation, ListResourcesResult,
|
||||
PaginatedRequestParam, RawResource, ReadResourceRequestParam, ReadResourceResult, Resource,
|
||||
ResourceContents, ServerCapabilities, ServerInfo,
|
||||
AnnotateAble, CallToolResult, Content, ErrorCode, ErrorData, Implementation,
|
||||
ListResourcesResult, PaginatedRequestParam, RawResource, ReadResourceRequestParam,
|
||||
ReadResourceResult, Resource, ResourceContents, ServerCapabilities, ServerInfo,
|
||||
},
|
||||
schemars::JsonSchema,
|
||||
service::RequestContext,
|
||||
@@ -1293,6 +1293,9 @@ impl ServerHandler for ComputerControllerServer {
|
||||
server_info: Implementation {
|
||||
name: "goose-computercontroller".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_owned(),
|
||||
title: None,
|
||||
icons: None,
|
||||
website_url: None,
|
||||
},
|
||||
capabilities: ServerCapabilities::builder()
|
||||
.enable_tools()
|
||||
@@ -1311,15 +1314,12 @@ impl ServerHandler for ComputerControllerServer {
|
||||
let active_resources = self.active_resources.lock().unwrap();
|
||||
let resources: Vec<Resource> = active_resources
|
||||
.keys()
|
||||
.map(|uri| Resource {
|
||||
raw: RawResource {
|
||||
name: uri.split('/').next_back().unwrap_or("").to_string(),
|
||||
uri: uri.clone(),
|
||||
description: None,
|
||||
mime_type: None,
|
||||
size: None,
|
||||
},
|
||||
annotations: None,
|
||||
.map(|uri| {
|
||||
RawResource::new(
|
||||
uri.clone(),
|
||||
uri.split('/').next_back().unwrap_or("").to_string(),
|
||||
)
|
||||
.no_annotation()
|
||||
})
|
||||
.collect();
|
||||
Ok(ListResourcesResult {
|
||||
|
||||
@@ -150,6 +150,7 @@ fn load_prompt_files() -> HashMap<String, Prompt> {
|
||||
name: arg.name,
|
||||
description: arg.description,
|
||||
required: arg.required,
|
||||
title: None,
|
||||
})
|
||||
.collect::<Vec<PromptArgument>>();
|
||||
|
||||
@@ -383,6 +384,9 @@ impl ServerHandler for DeveloperServer {
|
||||
server_info: Implementation {
|
||||
name: "goose-developer".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_owned(),
|
||||
title: None,
|
||||
icons: None,
|
||||
website_url: None,
|
||||
},
|
||||
capabilities: ServerCapabilities::builder()
|
||||
.enable_tools()
|
||||
|
||||
@@ -521,6 +521,9 @@ impl ServerHandler for MemoryServer {
|
||||
server_info: Implementation {
|
||||
name: "goose-memory".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_owned(),
|
||||
title: None,
|
||||
icons: None,
|
||||
website_url: None,
|
||||
},
|
||||
capabilities: ServerCapabilities::builder().enable_tools().build(),
|
||||
instructions: Some(self.instructions.clone()),
|
||||
|
||||
@@ -113,6 +113,9 @@ impl ServerHandler for TutorialServer {
|
||||
server_info: Implementation {
|
||||
name: "goose-tutorial".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_owned(),
|
||||
title: None,
|
||||
icons: None,
|
||||
website_url: None,
|
||||
},
|
||||
capabilities: ServerCapabilities::builder().enable_tools().build(),
|
||||
instructions: Some(self.instructions.clone()),
|
||||
|
||||
Reference in New Issue
Block a user