@decocms/bindings 1.0.9 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
import { WebSocketClientTransport } from "@modelcontextprotocol/sdk/client/websocket.js";
|
|
10
10
|
import { RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
11
11
|
import {
|
|
12
|
-
CallToolRequest,
|
|
13
12
|
Implementation,
|
|
14
13
|
ListToolsRequest,
|
|
15
14
|
ListToolsResult,
|
|
@@ -43,15 +42,15 @@ class Client extends BaseClient {
|
|
|
43
42
|
return result;
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
type CallToolResponse = Awaited<ReturnType<Client["callTool"]>>;
|
|
47
45
|
export interface ServerClient {
|
|
48
46
|
client: {
|
|
49
|
-
callTool:
|
|
47
|
+
callTool: Client["callTool"];
|
|
50
48
|
listTools: () => Promise<ListToolsResult>;
|
|
51
49
|
};
|
|
52
50
|
callStreamableTool: (
|
|
53
51
|
tool: string,
|
|
54
52
|
args: Record<string, unknown>,
|
|
53
|
+
signal?: AbortSignal,
|
|
55
54
|
) => Promise<Response>;
|
|
56
55
|
}
|
|
57
56
|
export const createServerClient = async (
|
|
@@ -74,7 +73,7 @@ export const createServerClient = async (
|
|
|
74
73
|
|
|
75
74
|
return {
|
|
76
75
|
client,
|
|
77
|
-
callStreamableTool: (tool, args) => {
|
|
76
|
+
callStreamableTool: (tool, args, signal) => {
|
|
78
77
|
if (mcpServer.connection.type !== "HTTP") {
|
|
79
78
|
throw new Error("HTTP connection required");
|
|
80
79
|
}
|
|
@@ -101,6 +100,7 @@ export const createServerClient = async (
|
|
|
101
100
|
redirect: "manual",
|
|
102
101
|
body: JSON.stringify(args),
|
|
103
102
|
headers,
|
|
103
|
+
signal,
|
|
104
104
|
});
|
|
105
105
|
},
|
|
106
106
|
};
|