@decocms/bindings 1.0.1-alpha-candy.1 → 1.0.1-alpha.10
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 +2 -2
- package/src/core/client/index.ts +0 -8
- package/src/core/client/mcp.ts +0 -32
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/bindings",
|
|
3
|
-
"version": "1.0.1-alpha
|
|
3
|
+
"version": "1.0.1-alpha.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "vitest run",
|
|
7
7
|
"test:watch": "vitest"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@modelcontextprotocol/sdk": "
|
|
10
|
+
"@modelcontextprotocol/sdk": "1.20.2",
|
|
11
11
|
"zod": "^3.25.76",
|
|
12
12
|
"zod-from-json-schema": "^0.0.5",
|
|
13
13
|
"zod-to-json-schema": "3.25.0"
|
package/src/core/client/index.ts
CHANGED
package/src/core/client/mcp.ts
CHANGED
|
@@ -3,38 +3,6 @@ import { z } from "zod";
|
|
|
3
3
|
import type { MCPConnection } from "../connection";
|
|
4
4
|
import { createMCPClientProxy } from "./proxy";
|
|
5
5
|
|
|
6
|
-
export const isStreamableToolBinder = (
|
|
7
|
-
toolBinder: ToolBinder,
|
|
8
|
-
): toolBinder is ToolBinder<string, any, any, true> => {
|
|
9
|
-
return toolBinder.streamable === true;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// Default fetcher instance with API_SERVER_URL and API_HEADERS
|
|
13
|
-
export const MCPClient = new Proxy(
|
|
14
|
-
{} as {
|
|
15
|
-
forConnection: <TDefinition extends readonly ToolBinder[]>(
|
|
16
|
-
connection: MCPConnection,
|
|
17
|
-
) => MCPClientFetchStub<TDefinition>;
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
get(_, name) {
|
|
21
|
-
if (name === "toJSON") {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (name === "forConnection") {
|
|
26
|
-
return <TDefinition extends readonly ToolBinder[]>(
|
|
27
|
-
connection: MCPConnection,
|
|
28
|
-
) =>
|
|
29
|
-
createMCPFetchStub<TDefinition>({
|
|
30
|
-
connection,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return global[name as keyof typeof global];
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
);
|
|
37
|
-
|
|
38
6
|
export interface FetchOptions extends RequestInit {
|
|
39
7
|
path?: string;
|
|
40
8
|
segments?: string[];
|