@dxos/mcp-client 0.10.0 → 0.11.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/dist/lib/index.mjs +172 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/McpToolkit.test.ts +2 -2
- package/dist/lib/neutral/index.mjs +0 -168
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/mcp-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "MCP client.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
".": {
|
|
16
16
|
"source": "./src/index.ts",
|
|
17
17
|
"types": "./dist/types/src/index.d.ts",
|
|
18
|
-
"
|
|
18
|
+
"import": "./dist/lib/index.mjs"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"@effect/ai": "0.36.0",
|
|
27
27
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
28
28
|
"effect": "3.21.4",
|
|
29
|
-
"@dxos/ai": "0.
|
|
30
|
-
"@dxos/effect": "0.
|
|
31
|
-
"@dxos/invariant": "0.
|
|
32
|
-
"@dxos/keys": "0.
|
|
33
|
-
"@dxos/log": "0.
|
|
29
|
+
"@dxos/ai": "0.11.1",
|
|
30
|
+
"@dxos/effect": "0.11.1",
|
|
31
|
+
"@dxos/invariant": "0.11.1",
|
|
32
|
+
"@dxos/keys": "0.11.1",
|
|
33
|
+
"@dxos/log": "0.11.1"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
package/src/McpToolkit.test.ts
CHANGED
|
@@ -81,7 +81,7 @@ describe('Browser Automation', () => {
|
|
|
81
81
|
),
|
|
82
82
|
{
|
|
83
83
|
timeout: 120_000,
|
|
84
|
-
tags: ['
|
|
84
|
+
tags: ['manual'],
|
|
85
85
|
},
|
|
86
86
|
);
|
|
87
87
|
|
|
@@ -142,7 +142,7 @@ describe('Browser Automation', () => {
|
|
|
142
142
|
),
|
|
143
143
|
{
|
|
144
144
|
timeout: 120_000,
|
|
145
|
-
tags: ['
|
|
145
|
+
tags: ['manual'],
|
|
146
146
|
},
|
|
147
147
|
);
|
|
148
148
|
});
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
// src/McpToolkit.ts
|
|
8
|
-
var McpToolkit_exports = {};
|
|
9
|
-
__export(McpToolkit_exports, {
|
|
10
|
-
McpConnectionError: () => McpConnectionError,
|
|
11
|
-
is405: () => is405,
|
|
12
|
-
make: () => make3
|
|
13
|
-
});
|
|
14
|
-
import * as Tool from "@effect/ai/Tool";
|
|
15
|
-
import * as Toolkit from "@effect/ai/Toolkit";
|
|
16
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
17
|
-
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
18
|
-
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
19
|
-
import * as Cause from "effect/Cause";
|
|
20
|
-
import * as Effect from "effect/Effect";
|
|
21
|
-
import * as Schema from "effect/Schema";
|
|
22
|
-
import { OpaqueToolkit } from "@dxos/ai";
|
|
23
|
-
import { invariant } from "@dxos/invariant";
|
|
24
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/core/compute/mcp-client/src/McpToolkit.ts";
|
|
25
|
-
var McpConnectionError = class extends Schema.TaggedError("McpConnectionError")("McpConnectionError", {
|
|
26
|
-
url: Schema.String,
|
|
27
|
-
protocol: Schema.Literal("sse", "http"),
|
|
28
|
-
message: Schema.String
|
|
29
|
-
}) {
|
|
30
|
-
};
|
|
31
|
-
var CLIENT_INFO = {
|
|
32
|
-
name: "@dxos/mcp-client",
|
|
33
|
-
version: "0.8.3"
|
|
34
|
-
};
|
|
35
|
-
var make3 = (options) => Effect.gen(function* () {
|
|
36
|
-
const { client, protocol } = yield* connectWithFallback(options);
|
|
37
|
-
const { tools } = yield* Effect.tryPromise({
|
|
38
|
-
try: () => client.listTools(),
|
|
39
|
-
catch: (cause) => new McpConnectionError({
|
|
40
|
-
url: options.url,
|
|
41
|
-
protocol,
|
|
42
|
-
message: `Failed to list MCP tools: ${formatCause(cause)}`
|
|
43
|
-
})
|
|
44
|
-
});
|
|
45
|
-
if (tools.length === 0) {
|
|
46
|
-
return OpaqueToolkit.empty;
|
|
47
|
-
}
|
|
48
|
-
const effectTools = tools.map((mcpTool) => {
|
|
49
|
-
const parameters = {};
|
|
50
|
-
for (const [key, value] of Object.entries(mcpTool.inputSchema.properties ?? {})) {
|
|
51
|
-
if (mcpTool.inputSchema.required?.includes(key)) {
|
|
52
|
-
parameters[key] = Schema.Unknown.pipe(Schema.annotations({
|
|
53
|
-
jsonSchema: value
|
|
54
|
-
}));
|
|
55
|
-
} else {
|
|
56
|
-
parameters[key] = Schema.Unknown.pipe(Schema.annotations({
|
|
57
|
-
jsonSchema: value
|
|
58
|
-
})).pipe(Schema.optional);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return Tool.make(sanitizeToolName(mcpTool.name), {
|
|
62
|
-
description: mcpTool.description ?? `MCP tool: ${mcpTool.name}`,
|
|
63
|
-
parameters,
|
|
64
|
-
success: Schema.String,
|
|
65
|
-
failure: Schema.Never
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
const toolkit = Toolkit.make(...effectTools);
|
|
69
|
-
const handlers = Object.fromEntries(tools.map((mcpTool) => {
|
|
70
|
-
const toolName = sanitizeToolName(mcpTool.name);
|
|
71
|
-
return [
|
|
72
|
-
toolName,
|
|
73
|
-
Effect.fn(function* (args) {
|
|
74
|
-
const result = yield* Effect.promise(() => client.callTool({
|
|
75
|
-
name: mcpTool.name,
|
|
76
|
-
arguments: args
|
|
77
|
-
}));
|
|
78
|
-
return formatToolResult(result);
|
|
79
|
-
})
|
|
80
|
-
];
|
|
81
|
-
}));
|
|
82
|
-
const layer = toolkit.toLayer(handlers);
|
|
83
|
-
return OpaqueToolkit.make(toolkit, layer);
|
|
84
|
-
}).pipe(Effect.withSpan("McpToolkit.make"));
|
|
85
|
-
var is405 = (error) => {
|
|
86
|
-
const cause = error != null && typeof error === "object" && "error" in error ? error.error : error;
|
|
87
|
-
return cause instanceof Error && cause.message.includes("405");
|
|
88
|
-
};
|
|
89
|
-
var connectWithFallback = (options) => Effect.gen(function* () {
|
|
90
|
-
const fallbackProtocol = options.protocol === "sse" ? "http" : "sse";
|
|
91
|
-
const primary = yield* connectClient(options.url, options.protocol, options.apiKey).pipe(Effect.either);
|
|
92
|
-
if (primary._tag === "Right") {
|
|
93
|
-
return {
|
|
94
|
-
client: primary.right,
|
|
95
|
-
protocol: options.protocol
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
if (is405(primary.left)) {
|
|
99
|
-
const fallback = yield* connectClient(options.url, fallbackProtocol, options.apiKey).pipe(Effect.either);
|
|
100
|
-
if (fallback._tag === "Right") {
|
|
101
|
-
return {
|
|
102
|
-
client: fallback.right,
|
|
103
|
-
protocol: fallbackProtocol
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
return yield* Effect.fail(new McpConnectionError({
|
|
107
|
-
url: options.url,
|
|
108
|
-
protocol: fallbackProtocol,
|
|
109
|
-
message: `Failed to connect via ${fallbackProtocol} after 405 fallback: ${formatCause(fallback.left)}`
|
|
110
|
-
}));
|
|
111
|
-
}
|
|
112
|
-
return yield* Effect.fail(new McpConnectionError({
|
|
113
|
-
url: options.url,
|
|
114
|
-
protocol: options.protocol,
|
|
115
|
-
message: `Failed to connect via ${options.protocol}: ${formatCause(primary.left)}`
|
|
116
|
-
}));
|
|
117
|
-
});
|
|
118
|
-
var connectClient = (url, protocol, apiKey) => Effect.tryPromise(() => {
|
|
119
|
-
const client = new Client(CLIENT_INFO);
|
|
120
|
-
const transport = createTransport(url, protocol, apiKey);
|
|
121
|
-
return client.connect(transport).then(() => client);
|
|
122
|
-
});
|
|
123
|
-
var formatCause = (error) => {
|
|
124
|
-
const inner = error != null && typeof error === "object" && "error" in error ? error.error : error;
|
|
125
|
-
if (inner instanceof Error) {
|
|
126
|
-
return inner.message;
|
|
127
|
-
}
|
|
128
|
-
if (Cause.isCause(error)) {
|
|
129
|
-
return Cause.pretty(error);
|
|
130
|
-
}
|
|
131
|
-
return String(inner);
|
|
132
|
-
};
|
|
133
|
-
var createTransport = (url, protocol, apiKey) => {
|
|
134
|
-
const urlObj = new URL(url);
|
|
135
|
-
const requestInit = apiKey ? {
|
|
136
|
-
headers: {
|
|
137
|
-
Authorization: `Bearer ${apiKey}`
|
|
138
|
-
}
|
|
139
|
-
} : void 0;
|
|
140
|
-
switch (protocol) {
|
|
141
|
-
case "sse":
|
|
142
|
-
return new SSEClientTransport(urlObj, {
|
|
143
|
-
requestInit
|
|
144
|
-
});
|
|
145
|
-
case "http":
|
|
146
|
-
return new StreamableHTTPClientTransport(urlObj, {
|
|
147
|
-
requestInit
|
|
148
|
-
});
|
|
149
|
-
default: {
|
|
150
|
-
const _exhaustive = protocol;
|
|
151
|
-
return invariant(false, `Unsupported MCP transport protocol: ${_exhaustive}`, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 169, S: void 0, A: ["false", "`Unsupported MCP transport protocol: ${_exhaustive}`"] });
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
var sanitizeToolName = (name) => name.replace(/\//g, "_");
|
|
156
|
-
var formatToolResult = (result) => {
|
|
157
|
-
if ("toolResult" in result && result.toolResult !== void 0) {
|
|
158
|
-
return JSON.stringify(result.toolResult);
|
|
159
|
-
}
|
|
160
|
-
if ("content" in result && Array.isArray(result.content)) {
|
|
161
|
-
return result.content.filter((part) => part.type === "text").map((part) => part.text).join("\n");
|
|
162
|
-
}
|
|
163
|
-
return String(result);
|
|
164
|
-
};
|
|
165
|
-
export {
|
|
166
|
-
McpToolkit_exports as McpToolkit
|
|
167
|
-
};
|
|
168
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/McpToolkit.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Tool from '@effect/ai/Tool';\nimport * as Toolkit from '@effect/ai/Toolkit';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\n// SSEClientTransport is marked @deprecated in the SDK in favor of StreamableHTTP, but the\n// SDK itself notes that clients should keep supporting both while servers migrate.\n// `connectWithFallback` below tries the configured protocol first, then the other on 405.\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nimport { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';\nimport { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';\nimport * as Cause from 'effect/Cause';\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { OpaqueToolkit } from '@dxos/ai';\nimport { invariant } from '@dxos/invariant';\n\n/**\n * Typed failure raised when the MCP client cannot connect or list tools.\n * Carries the underlying cause and the server URL for diagnostics.\n */\nexport class McpConnectionError extends Schema.TaggedError<McpConnectionError>('McpConnectionError')(\n 'McpConnectionError',\n {\n url: Schema.String,\n protocol: Schema.Literal('sse', 'http'),\n message: Schema.String,\n },\n) {}\n\n/**\n * Creates an OpaqueToolkit that connects to an MCP server and exposes its tools to the assistant.\n *\n * @param options MCP server URL and transport protocol ('http' for Streamable HTTP, 'sse' for SSE).\n * @returns An OpaqueToolkit containing all tools from the MCP server.\n */\nconst CLIENT_INFO = { name: '@dxos/mcp-client', version: '0.8.3' };\n\nexport interface McpToolkitOptions {\n url: string;\n protocol: 'sse' | 'http';\n apiKey?: string;\n}\n\nexport const make = (options: McpToolkitOptions): Effect.Effect<OpaqueToolkit.OpaqueToolkit, McpConnectionError> =>\n Effect.gen(function* () {\n const { client, protocol } = yield* connectWithFallback(options);\n\n const { tools } = yield* Effect.tryPromise({\n try: () => client.listTools(),\n catch: (cause) =>\n new McpConnectionError({\n url: options.url,\n protocol,\n message: `Failed to list MCP tools: ${formatCause(cause)}`,\n }),\n });\n if (tools.length === 0) {\n return OpaqueToolkit.empty;\n }\n\n const effectTools = tools.map((mcpTool) => {\n const parameters: any = {};\n for (const [key, value] of Object.entries(mcpTool.inputSchema.properties ?? {})) {\n if (mcpTool.inputSchema.required?.includes(key)) {\n parameters[key] = Schema.Unknown.pipe(Schema.annotations({ jsonSchema: value }));\n } else {\n parameters[key] = Schema.Unknown.pipe(Schema.annotations({ jsonSchema: value })).pipe(Schema.optional);\n }\n }\n\n return Tool.make(sanitizeToolName(mcpTool.name), {\n description: mcpTool.description ?? `MCP tool: ${mcpTool.name}`,\n parameters,\n success: Schema.String,\n failure: Schema.Never,\n });\n });\n\n const toolkit = Toolkit.make(...effectTools);\n\n const handlers = Object.fromEntries(\n tools.map((mcpTool) => {\n const toolName = sanitizeToolName(mcpTool.name);\n return [\n toolName,\n Effect.fn(function* (args: unknown) {\n const result = yield* Effect.promise(() =>\n client.callTool({\n name: mcpTool.name,\n arguments: args as any,\n }),\n );\n return formatToolResult(result);\n }),\n ];\n }),\n ) as any;\n\n const layer = toolkit.toLayer(handlers);\n\n return OpaqueToolkit.make(toolkit, layer);\n }).pipe(Effect.withSpan('McpToolkit.make'));\n\n/**\n * Returns true when the error (or its wrapped cause) contains a 405 status code.\n * `Effect.tryPromise` wraps thrown errors in `UnknownException`, so we unwrap first.\n */\nexport const is405 = (error: unknown): boolean => {\n const cause = error != null && typeof error === 'object' && 'error' in error ? (error as any).error : error;\n return cause instanceof Error && cause.message.includes('405');\n};\n\n/**\n * Connects to an MCP server, falling back to the alternate transport on 405 errors.\n * Per the MCP spec, a 405 indicates the server uses the other transport protocol.\n * Returns the connected Client (a fresh instance is created for the fallback attempt).\n *\n * Failures are surfaced as typed `McpConnectionError` so callers can recover (e.g. drop\n * the misconfigured server) without breaking the surrounding effect.\n */\nconst connectWithFallback = (\n options: McpToolkitOptions,\n): Effect.Effect<{ client: Client; protocol: McpToolkitOptions['protocol'] }, McpConnectionError> =>\n Effect.gen(function* () {\n const fallbackProtocol = options.protocol === 'sse' ? 'http' : 'sse';\n const primary = yield* connectClient(options.url, options.protocol, options.apiKey).pipe(Effect.either);\n if (primary._tag === 'Right') {\n return { client: primary.right, protocol: options.protocol };\n }\n if (is405(primary.left)) {\n const fallback = yield* connectClient(options.url, fallbackProtocol, options.apiKey).pipe(Effect.either);\n if (fallback._tag === 'Right') {\n return { client: fallback.right, protocol: fallbackProtocol };\n }\n return yield* Effect.fail(\n new McpConnectionError({\n url: options.url,\n protocol: fallbackProtocol,\n message: `Failed to connect via ${fallbackProtocol} after 405 fallback: ${formatCause(fallback.left)}`,\n }),\n );\n }\n return yield* Effect.fail(\n new McpConnectionError({\n url: options.url,\n protocol: options.protocol,\n message: `Failed to connect via ${options.protocol}: ${formatCause(primary.left)}`,\n }),\n );\n });\n\nconst connectClient = (url: string, protocol: McpToolkitOptions['protocol'], apiKey?: string) =>\n Effect.tryPromise(() => {\n const client = new Client(CLIENT_INFO);\n const transport = createTransport(url, protocol, apiKey);\n return client.connect(transport).then(() => client);\n });\n\n/**\n * Renders a thrown value to a short string for inclusion in error messages.\n * `Effect.tryPromise` wraps thrown errors in `UnknownException`; unwrap when present.\n */\nconst formatCause = (error: unknown): string => {\n const inner = error != null && typeof error === 'object' && 'error' in error ? (error as any).error : error;\n if (inner instanceof Error) {\n return inner.message;\n }\n if (Cause.isCause(error)) {\n return Cause.pretty(error);\n }\n\n return String(inner);\n};\n\n/**\n * Creates a transport for the given MCP server URL and protocol.\n */\nconst createTransport = (\n url: string,\n protocol: McpToolkitOptions['protocol'],\n apiKey?: string,\n): SSEClientTransport | StreamableHTTPClientTransport => {\n const urlObj = new URL(url);\n const requestInit: RequestInit | undefined = apiKey ? { headers: { Authorization: `Bearer ${apiKey}` } } : undefined;\n switch (protocol) {\n case 'sse':\n return new SSEClientTransport(urlObj, { requestInit });\n case 'http':\n return new StreamableHTTPClientTransport(urlObj, { requestInit });\n default: {\n const _exhaustive: never = protocol;\n return invariant(false, `Unsupported MCP transport protocol: ${_exhaustive}`) as never;\n }\n }\n};\n\n/**\n * Sanitizes MCP tool names for use as Effect tool names (replaces / with _).\n */\nconst sanitizeToolName = (name: string): string => name.replace(/\\//g, '_');\n\n/**\n * Formats MCP callTool result content for the assistant.\n */\nconst formatToolResult = (result: Awaited<ReturnType<Client['callTool']>>): string => {\n if ('toolResult' in result && result.toolResult !== undefined) {\n return JSON.stringify(result.toolResult);\n }\n if ('content' in result && Array.isArray(result.content)) {\n return result.content\n .filter((part): part is { type: 'text'; text: string } => part.type === 'text')\n .map((part) => part.text)\n .join('\\n');\n }\n\n return String(result);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAAA;;;;cAAAA;;AAMA,YAAYC,UAAU;AACtB,YAAYC,aAAa;AACzB,SAASC,cAAc;AAKvB,SAASC,0BAA0B;AACnC,SAASC,qCAAqC;AAC9C,YAAYC,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,qBAAqB;AAC9B,SAASC,iBAAiB;AAE1B,IAAA,eAAA;AAQIC,IAAUH,qBAAVG,cAAgC,mBAAA,oBAAA,EAAA,sBAAA;EAChCC,KAASJ;EACX,UAAA,eAAA,OAAA,MAAA;EACC,SAAA;AAEH,CAAA,EAAA;;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AA;AACtB,MAAA,iBAAA,OAAA;AACIN,WAAMoD,MAAO;;AAEjB,MAAA,cAAA,KAAA,GAAA;AAEA,WAAcD,aAAAA,KAAAA;EAChB;AAEA,SAAA,OAAA,KAAA;;AASE,IAAME,kBAAuCJ,CAAAA,KAAS,UAAA,WAAA;QAAEK,SAAS,IAAA,IAAA,GAAA;sBAAEC,SAAgB;IAAkB,SAAA;MAAMC,eAAAA,UAAAA,MAAAA;IAC3G;MACE;oBACS;;AAA6C,aAAA,IAAA,mBAAA,QAAA;QACjD;MACH,CAAA;;AAA+D,aAAA,IAAA,8BAAA,QAAA;QACjE;MAAS,CAAA;;AAGT,YAAA,cAAA;AACF,aAAA,UAAA,OAAA,uCAAA,WAAA,IAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,KAAA,GAAA,QAAA,GAAA,CAAA,SAAA,sDAAA,EAAA,CAAA;IACF;EAEA;;;IAUI,mBAAqB,CAACC,WAAOC;AAC/B,MAAA,gBAAA,UAAA,OAAA,eAAA,QAAA;AACI,WAAA,KAAA,UAAaD,OAAgBE,UAAQF;;AAKzC,MAAA,aAAA,UAAA,MAAA,QAAA,OAAA,OAAA,GAAA;AAEA,WAAO3B,OAAO2B,QAAAA,OAAAA,CAAAA,SAAAA,KAAAA,SAAAA,MAAAA,EAAAA,IAAAA,CAAAA,SAAAA,KAAAA,IAAAA,EAAAA,KAAAA,IAAAA;EAChB;;;",
|
|
6
|
-
"names": ["make", "Tool", "Toolkit", "Client", "SSEClientTransport", "StreamableHTTPClientTransport", "Cause", "Effect", "Schema", "OpaqueToolkit", "invariant", "protocol", "message", "version", "tools", "tryPromise", "try", "client", "listTools", "catch", "cause", "McpConnectionError", "url", "options", "effectTools", "key", "value", "Object", "entries", "inputSchema", "parameters", "Unknown", "pipe", "annotations", "jsonSchema", "success", "String", "failure", "sanitizeToolName", "mcpTool", "toolName", "name", "arguments", "args", "formatToolResult", "withSpan", "Error", "connectClient", "primary", "is405", "fallback", "_tag", "fallbackProtocol", "transport", "createTransport", "apiKey", "connect", "inner", "isCause", "requestInit", "headers", "Authorization", "undefined", "result", "toolResult", "isArray"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"src/McpToolkit.ts":{"bytes":26854,"imports":[{"path":"@effect/ai/Tool","kind":"import-statement","external":true},{"path":"@effect/ai/Toolkit","kind":"import-statement","external":true},{"path":"@modelcontextprotocol/sdk/client/index.js","kind":"import-statement","external":true},{"path":"@modelcontextprotocol/sdk/client/sse.js","kind":"import-statement","external":true},{"path":"@modelcontextprotocol/sdk/client/streamableHttp.js","kind":"import-statement","external":true},{"path":"effect/Cause","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":452,"imports":[{"path":"src/McpToolkit.ts","kind":"import-statement","original":"./McpToolkit"}],"format":"esm"}},"outputs":{"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12362},"dist/lib/neutral/index.mjs":{"imports":[{"path":"@effect/ai/Tool","kind":"import-statement","external":true},{"path":"@effect/ai/Toolkit","kind":"import-statement","external":true},{"path":"@modelcontextprotocol/sdk/client/index.js","kind":"import-statement","external":true},{"path":"@modelcontextprotocol/sdk/client/sse.js","kind":"import-statement","external":true},{"path":"@modelcontextprotocol/sdk/client/streamableHttp.js","kind":"import-statement","external":true},{"path":"effect/Cause","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"exports":["McpToolkit"],"entryPoint":"src/index.ts","inputs":{"src/McpToolkit.ts":{"bytesInOutput":5642},"src/index.ts":{"bytesInOutput":0}},"bytes":5913}}}
|