fix(acp): prevent large-session disconnects (#11159)
Signed-off-by: Lifei Zhou <lifei@squareup.com>
This commit is contained in:
Generated
+22
-12
@@ -51,17 +51,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "agent-client-protocol"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "16302d16c7531355db16593d99c38c8297db0c4653aa7dd80c3556bb17f4cd8c"
|
||||
version = "2.0.0"
|
||||
source = "git+https://github.com/agentclientprotocol/rust-sdk?rev=c97a5203d3392f7f231514d84eea014f9f43e6fb#c97a5203d3392f7f231514d84eea014f9f43e6fb"
|
||||
dependencies = [
|
||||
"agent-client-protocol-derive",
|
||||
"agent-client-protocol-schema",
|
||||
"async-io",
|
||||
"async-process",
|
||||
"blocking",
|
||||
"futures",
|
||||
"futures-concurrency",
|
||||
"rustc-hash 2.1.3",
|
||||
"rustix 1.1.4",
|
||||
"schemars 1.2.1",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -73,19 +74,17 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "agent-client-protocol-derive"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd5ca63f112bd2459bcaf9eda0683b9ba95fc3b5e5fdd9036ca941c6a09345b1"
|
||||
version = "2.0.0"
|
||||
source = "git+https://github.com/agentclientprotocol/rust-sdk?rev=c97a5203d3392f7f231514d84eea014f9f43e6fb#c97a5203d3392f7f231514d84eea014f9f43e6fb"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 2.0.118",
|
||||
"syn 3.0.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "agent-client-protocol-http"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "31ff55efe7a6bb92a5d0226f6055c2f277b7591060d5095c7764f445289ebda3"
|
||||
version = "2.0.0"
|
||||
source = "git+https://github.com/agentclientprotocol/rust-sdk?rev=c97a5203d3392f7f231514d84eea014f9f43e6fb#c97a5203d3392f7f231514d84eea014f9f43e6fb"
|
||||
dependencies = [
|
||||
"agent-client-protocol",
|
||||
"async-stream",
|
||||
@@ -100,9 +99,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "agent-client-protocol-schema"
|
||||
version = "1.1.0"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac542aba230234b1591ace7286a47c0514fe3efc3037d43296bde31ba7ee5728"
|
||||
checksum = "d5c231915b4ab578c722eca2d1bd7df4d300bfd6cac3b8e9f0d1e3ddc95b187c"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"derive_more",
|
||||
@@ -11393,6 +11392,17 @@ dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "3.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn-match"
|
||||
version = "0.3.1"
|
||||
|
||||
+5
-3
@@ -21,9 +21,9 @@ string_slice = "warn"
|
||||
|
||||
[workspace.dependencies]
|
||||
rmcp = { version = "3.0.0", default-features = false, features = ["schemars", "auth"] }
|
||||
agent-client-protocol-schema = { version = "1.1", default-features = false, features = ["unstable"] }
|
||||
agent-client-protocol = { version = "1.0", default-features = false }
|
||||
agent-client-protocol-http = { version = "1.0", default-features = false, features = ["server", "unstable_cancel_request"] }
|
||||
agent-client-protocol-schema = { version = "=1.5.0", default-features = false, features = ["unstable"] }
|
||||
agent-client-protocol = { version = "2.0.0", default-features = false }
|
||||
agent-client-protocol-http = { version = "2.0.0", default-features = false, features = ["server"] }
|
||||
arboard = { version = "3", default-features = false }
|
||||
anyhow = { version = "1.0.102", default-features = false, features = ["std"] }
|
||||
async-stream = { version = "0.3.6", default-features = false }
|
||||
@@ -111,6 +111,8 @@ icu_calendar = { version = "=2.1.1", default-features = false }
|
||||
icu_locale = { version = "=2.1.1", default-features = false }
|
||||
|
||||
[patch.crates-io]
|
||||
agent-client-protocol = { git = "https://github.com/agentclientprotocol/rust-sdk", rev = "c97a5203d3392f7f231514d84eea014f9f43e6fb" }
|
||||
agent-client-protocol-http = { git = "https://github.com/agentclientprotocol/rust-sdk", rev = "c97a5203d3392f7f231514d84eea014f9f43e6fb" }
|
||||
v8 = { path = "vendor/v8" }
|
||||
cudaforge = { git = "https://github.com/jbg/cudaforge", rev = "e7c1967340e40673db98dc9e17da0f04834a456f" }
|
||||
|
||||
|
||||
@@ -244,7 +244,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -277,7 +278,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
@@ -316,7 +318,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
@@ -342,7 +345,7 @@
|
||||
"type": "string",
|
||||
"description": "Human-readable name identifying this MCP server."
|
||||
},
|
||||
"id": {
|
||||
"serverId": {
|
||||
"$ref": "#/$defs/McpServerAcpId",
|
||||
"description": "Unique identifier for this MCP server, generated by the component providing it.\n\nProviders MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible\non the same ACP connection."
|
||||
},
|
||||
@@ -352,12 +355,13 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"id"
|
||||
"serverId"
|
||||
],
|
||||
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nACP transport configuration for MCP.\n\nThe MCP server is provided by an ACP component and communicates over the ACP channel\nusing `mcp/connect`, `mcp/message`, and `mcp/disconnect`."
|
||||
},
|
||||
@@ -370,7 +374,7 @@
|
||||
},
|
||||
"command": {
|
||||
"type": "string",
|
||||
"description": "Path to the MCP server executable."
|
||||
"description": "Absolute path to the MCP server executable."
|
||||
},
|
||||
"args": {
|
||||
"type": "array",
|
||||
@@ -392,7 +396,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -420,7 +425,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -958,7 +964,8 @@
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"description": "Timestamp indicating when the underlying resource was last modified."
|
||||
"description": "Timestamp indicating when the underlying resource was last modified.",
|
||||
"x-deserialize-default-on-error": {}
|
||||
},
|
||||
"priority": {
|
||||
"type": [
|
||||
@@ -966,7 +973,8 @@
|
||||
"null"
|
||||
],
|
||||
"format": "double",
|
||||
"description": "Relative importance of this content when clients choose what to surface."
|
||||
"description": "Relative importance of this content when clients choose what to surface.",
|
||||
"x-deserialize-default-on-error": {}
|
||||
},
|
||||
"_meta": {
|
||||
"type": [
|
||||
@@ -974,7 +982,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"description": "Optional annotations for the client. The client can use annotations to inform how objects are used or displayed"
|
||||
@@ -1019,7 +1028,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -1055,7 +1065,8 @@
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"description": "URI associated with this resource or media payload."
|
||||
"description": "URI associated with this resource or media payload.",
|
||||
"x-deserialize-default-on-error": {}
|
||||
},
|
||||
"_meta": {
|
||||
"type": [
|
||||
@@ -1063,7 +1074,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -1101,7 +1113,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -1130,14 +1143,16 @@
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"description": "Optional human-readable details shown with this protocol object."
|
||||
"description": "Optional human-readable details shown with this protocol object.",
|
||||
"x-deserialize-default-on-error": {}
|
||||
},
|
||||
"mimeType": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"description": "MIME type describing the encoded media payload."
|
||||
"description": "MIME type describing the encoded media payload.",
|
||||
"x-deserialize-default-on-error": {}
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
@@ -1148,6 +1163,7 @@
|
||||
"integer",
|
||||
"null"
|
||||
],
|
||||
"x-deserialize-default-on-error": {},
|
||||
"description": "Optional size of the linked resource in bytes, if known."
|
||||
},
|
||||
"title": {
|
||||
@@ -1155,7 +1171,8 @@
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"description": "Optional display title for end-user UI."
|
||||
"description": "Optional display title for end-user UI.",
|
||||
"x-deserialize-default-on-error": {}
|
||||
},
|
||||
"uri": {
|
||||
"type": "string",
|
||||
@@ -1167,7 +1184,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -1197,7 +1215,8 @@
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"description": "MIME type describing the encoded media payload."
|
||||
"description": "MIME type describing the encoded media payload.",
|
||||
"x-deserialize-default-on-error": {}
|
||||
},
|
||||
"text": {
|
||||
"type": "string",
|
||||
@@ -1213,7 +1232,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -1234,7 +1254,8 @@
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"description": "MIME type describing the encoded media payload."
|
||||
"description": "MIME type describing the encoded media payload.",
|
||||
"x-deserialize-default-on-error": {}
|
||||
},
|
||||
"uri": {
|
||||
"type": "string",
|
||||
@@ -1246,7 +1267,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -1280,7 +1302,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -4511,7 +4534,9 @@
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Additional workspace roots reported for this session. Each path must be absolute.\n\nWhen present, this is the complete ordered additional-root list reported\nby the Agent. Omitted and empty values are equivalent: the response\nreports no additional roots."
|
||||
"description": "Additional workspace roots reported for this session. Each path must be absolute.\n\nWhen present, this is the complete ordered additional-root list reported\nby the Agent. Omitted and empty values are equivalent: the response\nreports no additional roots.",
|
||||
"x-deserialize-default-on-error": {},
|
||||
"x-deserialize-skip-invalid-items": {}
|
||||
},
|
||||
"title": {
|
||||
"type": [
|
||||
@@ -4535,7 +4560,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -5207,7 +5233,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -5238,7 +5265,8 @@
|
||||
"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)"
|
||||
"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)",
|
||||
"x-deserialize-default-on-error": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
@@ -449,7 +449,7 @@ impl HandleDispatchFrom<Client> for GooseAcpHandler {
|
||||
}
|
||||
Dispatch::Response(result, router) => {
|
||||
debug!(method = %router.method(), id = %router.id(), ok = result.is_ok(), "routing response");
|
||||
router.respond_with_result(result)?;
|
||||
router.route_with_result(result)?;
|
||||
Ok(())
|
||||
}
|
||||
Dispatch::Notification(notif) => {
|
||||
|
||||
@@ -303,13 +303,31 @@ impl OpenAiFixture {
|
||||
}
|
||||
}
|
||||
|
||||
pub type DuplexTransport = agent_client_protocol::ByteStreams<
|
||||
tokio_util::compat::Compat<tokio::io::DuplexStream>,
|
||||
tokio_util::compat::Compat<tokio::io::DuplexStream>,
|
||||
>;
|
||||
type CompatDuplexStream = tokio_util::compat::Compat<tokio::io::DuplexStream>;
|
||||
|
||||
pub struct DuplexTransport {
|
||||
outgoing: CompatDuplexStream,
|
||||
incoming: CompatDuplexStream,
|
||||
}
|
||||
|
||||
impl DuplexTransport {
|
||||
fn new(outgoing: CompatDuplexStream, incoming: CompatDuplexStream) -> Self {
|
||||
Self { outgoing, incoming }
|
||||
}
|
||||
|
||||
fn into_byte_streams(
|
||||
self,
|
||||
) -> agent_client_protocol::ByteStreams<CompatDuplexStream, CompatDuplexStream> {
|
||||
agent_client_protocol::ByteStreams::new(self.outgoing, self.incoming)
|
||||
}
|
||||
|
||||
fn into_parts(self) -> (CompatDuplexStream, CompatDuplexStream) {
|
||||
(self.outgoing, self.incoming)
|
||||
}
|
||||
}
|
||||
|
||||
/// Wires up duplex streams, spawns `serve` for the given agent, and returns
|
||||
/// a ready-to-use agent_client_protocol transport plus the server handle.
|
||||
/// the client transport plus the server handle.
|
||||
#[allow(dead_code)]
|
||||
pub async fn serve_agent_in_process(
|
||||
agent: Arc<GooseAcpAgent>,
|
||||
@@ -323,8 +341,7 @@ pub async fn serve_agent_in_process(
|
||||
}
|
||||
});
|
||||
|
||||
let transport =
|
||||
agent_client_protocol::ByteStreams::new(client_write.compat_write(), client_read.compat());
|
||||
let transport = DuplexTransport::new(client_write.compat_write(), client_read.compat());
|
||||
(transport, handle)
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ impl Connection for AcpProviderConnection {
|
||||
})),
|
||||
};
|
||||
|
||||
let transport: DynConnectTo<Client> = DynConnectTo::new(transport);
|
||||
let transport: DynConnectTo<Client> = DynConnectTo::new(transport.into_byte_streams());
|
||||
let provider = AcpProvider::connect_with_transport(
|
||||
"acp-test".to_string(),
|
||||
goose_mode,
|
||||
|
||||
@@ -110,10 +110,7 @@ pub async fn assert_session_response_precedes_available_commands(
|
||||
method: &str,
|
||||
params: serde_json::Value,
|
||||
) {
|
||||
let agent_client_protocol::ByteStreams {
|
||||
mut outgoing,
|
||||
incoming,
|
||||
} = transport;
|
||||
let (mut outgoing, incoming) = transport.into_parts();
|
||||
let mut incoming = BufReader::new(incoming).lines();
|
||||
|
||||
let initialize = serde_json::json!({
|
||||
@@ -344,7 +341,7 @@ impl Connection for AcpServerConnection {
|
||||
},
|
||||
agent_client_protocol::on_receive_request!(),
|
||||
)
|
||||
.connect_with(transport, {
|
||||
.connect_with(transport.into_byte_streams(), {
|
||||
let cx_holder = cx_holder_clone;
|
||||
async move |cx: ConnectionTo<Agent>| {
|
||||
let resp = cx
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useMemo, useRef } from 'react';
|
||||
import { memo, useMemo, useRef } from 'react';
|
||||
import { AlertTriangle } from 'lucide-react';
|
||||
import ImagePreview from './ImagePreview';
|
||||
import { formatMessageTimestamp } from '../utils/timeUtils';
|
||||
@@ -39,7 +39,7 @@ interface GooseMessageProps {
|
||||
) => Promise<boolean>;
|
||||
}
|
||||
|
||||
export default function GooseMessage({
|
||||
function GooseMessage({
|
||||
sessionId,
|
||||
message,
|
||||
messages,
|
||||
@@ -255,3 +255,5 @@ export default function GooseMessage({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default memo(GooseMessage);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
||||
import ImagePreview from './ImagePreview';
|
||||
import MarkdownContent from './MarkdownContent';
|
||||
import {
|
||||
@@ -96,7 +96,7 @@ interface UserMessageProps {
|
||||
) => void;
|
||||
}
|
||||
|
||||
export default function UserMessage({ message, onMessageUpdate }: UserMessageProps) {
|
||||
function UserMessage({ message, onMessageUpdate }: UserMessageProps) {
|
||||
const intl = useIntl();
|
||||
const contentRef = useRef<HTMLDivElement | null>(null);
|
||||
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
||||
@@ -375,3 +375,5 @@ export default function UserMessage({ message, onMessageUpdate }: UserMessagePro
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default memo(UserMessage);
|
||||
|
||||
@@ -170,7 +170,7 @@ export type McpServerAcp = {
|
||||
* Providers MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible
|
||||
* on the same ACP connection.
|
||||
*/
|
||||
id: McpServerAcpId;
|
||||
serverId: McpServerAcpId;
|
||||
/**
|
||||
* The _meta property is reserved by ACP to allow clients and agents to attach additional
|
||||
* metadata to their interactions. Implementations MUST NOT make assumptions about values at
|
||||
@@ -192,7 +192,7 @@ export type McpServerStdio = {
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Path to the MCP server executable.
|
||||
* Absolute path to the MCP server executable.
|
||||
*/
|
||||
command: string;
|
||||
/**
|
||||
|
||||
@@ -67,7 +67,7 @@ export const zMcpServerAcpId = z.string();
|
||||
*/
|
||||
export const zMcpServerAcp = z.object({
|
||||
name: z.string(),
|
||||
id: zMcpServerAcpId,
|
||||
serverId: zMcpServerAcpId,
|
||||
_meta: z.union([
|
||||
z.record(z.unknown()),
|
||||
z.null()
|
||||
|
||||
Reference in New Issue
Block a user