@voicethere/agent 0.37.0 → 0.37.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/llm/mcp/mcp-tool-source.d.ts +10 -0
- package/dist/llm/mcp/mcp-tool-source.d.ts.map +1 -1
- package/dist/llm/mcp/mcp-tool-source.js +50 -2
- package/dist/llm/mcp/mcp-tool-source.js.map +1 -1
- package/dist/templates/flow-agent/agent.js +42 -3
- package/dist/templates/llm-agent/agent.js +42 -3
- package/dist/templates/llm-board/agent.js +42 -3
- package/dist/templates/llm-docs-rag/agent.js +42 -3
- package/dist/templates/llm-language-switch/agent.js +42 -3
- package/dist/templates/llm-language-tutor/agent.js +42 -3
- package/dist/templates/llm-mcp-service/agent.js +42 -3
- package/dist/templates/llm-store-support/agent.js +42 -3
- package/dist/templates/llm-support-sticky-user/agent.js +42 -3
- package/eject/llm/loop.ts +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,14 @@ export interface McpToolInfo {
|
|
|
2
2
|
name: string;
|
|
3
3
|
description: string;
|
|
4
4
|
inputSchema: Record<string, unknown>;
|
|
5
|
+
/**
|
|
6
|
+
* The server's MCP ToolAnnotations hints we act on. A call that failed on a dropped connection is
|
|
7
|
+
* retried once only when the server marks the tool read-only or idempotent.
|
|
8
|
+
*/
|
|
9
|
+
annotations?: {
|
|
10
|
+
readOnlyHint?: boolean;
|
|
11
|
+
idempotentHint?: boolean;
|
|
12
|
+
};
|
|
5
13
|
}
|
|
6
14
|
export type McpSourceStatus = "idle" | "connecting" | "ready" | "closed";
|
|
7
15
|
export type McpLogFn = (level: "info" | "warn", message: string, fields?: Record<string, unknown>) => void;
|
|
@@ -56,6 +64,8 @@ export declare class McpToolSource {
|
|
|
56
64
|
signal?: AbortSignal;
|
|
57
65
|
timeoutMs: number;
|
|
58
66
|
}): Promise<McpCallResult>;
|
|
67
|
+
/** One call on the current connection; CONNECTION_LOST when the transport failed. */
|
|
68
|
+
private callOnce;
|
|
59
69
|
close(): Promise<void>;
|
|
60
70
|
private isClosed;
|
|
61
71
|
private kickLoop;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-tool-source.d.ts","sourceRoot":"","sources":["../../../src/llm/mcp/mcp-tool-source.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp-tool-source.d.ts","sourceRoot":"","sources":["../../../src/llm/mcp/mcp-tool-source.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACpE;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzE,MAAM,MAAM,QAAQ,GAAG,CACrB,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,IAAI,CAAC;AAEV,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,yDAAyD;IACzD,IAAI,CAAC,EAAE,KAA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W,EAAE;IAKhB,QAAQ,CACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,IAAI,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAChD,OAAO,CAAC,aAAa,CAAC;IAsBzB,qFAAqF;YACvE,QAAQ;IAuChB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAe5B,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,QAAQ;YAQF,IAAI;IAkClB,OAAO,CAAC,KAAK;IAUb,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,MAAM;YAQA,OAAO;YAoCP,WAAW;CAyD1B"}
|
|
@@ -4,6 +4,8 @@ const DEFAULT_BACKOFF_MS = [1_000, 2_000, 4_000, 8_000, 16_000, 30_000];
|
|
|
4
4
|
const MAX_LIST_PAGES = 10;
|
|
5
5
|
/** JSON-RPC code the MCP SDK uses for a request timeout (`ErrorCode.RequestTimeout`). */
|
|
6
6
|
const REQUEST_TIMEOUT_CODE = -32001;
|
|
7
|
+
/** callOnce result when the transport failed (the source is reconnecting). */
|
|
8
|
+
const CONNECTION_LOST = Symbol("connection-lost");
|
|
7
9
|
function readPackageVersion() {
|
|
8
10
|
try {
|
|
9
11
|
const require = createRequire(import.meta.url);
|
|
@@ -19,12 +21,26 @@ function errorFields(err) {
|
|
|
19
21
|
if (err instanceof Error) {
|
|
20
22
|
const code = err.code;
|
|
21
23
|
const name = err.constructor.name || err.name;
|
|
22
|
-
|
|
24
|
+
const out = {
|
|
23
25
|
error: code !== undefined ? `${name} ${String(code)}` : name,
|
|
24
26
|
};
|
|
27
|
+
// fetch wraps socket errors (`TypeError: fetch failed`); the cause names the hop that failed.
|
|
28
|
+
// Class and code only: a message can carry a URL or request content.
|
|
29
|
+
const cause = err.cause;
|
|
30
|
+
if (cause instanceof Error) {
|
|
31
|
+
out.cause = cause.constructor.name || cause.name;
|
|
32
|
+
const causeCode = cause.code;
|
|
33
|
+
if (causeCode !== undefined)
|
|
34
|
+
out.causeCode = String(causeCode);
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
25
37
|
}
|
|
26
38
|
return { error: typeof err };
|
|
27
39
|
}
|
|
40
|
+
function retryableAfterReconnect(tool) {
|
|
41
|
+
return (tool?.annotations?.readOnlyHint === true ||
|
|
42
|
+
tool?.annotations?.idempotentHint === true);
|
|
43
|
+
}
|
|
28
44
|
function urlOrigin(url) {
|
|
29
45
|
try {
|
|
30
46
|
return new URL(url).origin;
|
|
@@ -135,12 +151,36 @@ export class McpToolSource {
|
|
|
135
151
|
return this.cached.map((t) => ({ ...t }));
|
|
136
152
|
}
|
|
137
153
|
async callTool(name, args, opts) {
|
|
154
|
+
const deadline = Date.now() + opts.timeoutMs;
|
|
155
|
+
const tool = this.cached.find((t) => t.name === name);
|
|
156
|
+
const first = await this.callOnce(name, args, opts.signal, opts.timeoutMs);
|
|
157
|
+
if (first !== CONNECTION_LOST)
|
|
158
|
+
return first;
|
|
159
|
+
const unavailable = {
|
|
160
|
+
isError: true,
|
|
161
|
+
content: `tool ${name} failed: unavailable`,
|
|
162
|
+
};
|
|
163
|
+
// The request may have reached the server before the connection dropped, so only a tool the
|
|
164
|
+
// server marks read-only or idempotent is sent again, once, on the new connection and within
|
|
165
|
+
// the time left of this call's bound.
|
|
166
|
+
if (!retryableAfterReconnect(tool) || opts.signal?.aborted)
|
|
167
|
+
return unavailable;
|
|
168
|
+
const reconnected = await this.ready(deadline - Date.now());
|
|
169
|
+
const remaining = deadline - Date.now();
|
|
170
|
+
if (!reconnected || remaining <= 0 || opts.signal?.aborted)
|
|
171
|
+
return unavailable;
|
|
172
|
+
const second = await this.callOnce(name, args, opts.signal, remaining);
|
|
173
|
+
return second === CONNECTION_LOST ? unavailable : second;
|
|
174
|
+
}
|
|
175
|
+
/** One call on the current connection; CONNECTION_LOST when the transport failed. */
|
|
176
|
+
async callOnce(name, args, signal, timeoutMs) {
|
|
138
177
|
const client = this.client;
|
|
139
178
|
if (this.state !== "ready" ||
|
|
140
179
|
!client ||
|
|
141
180
|
!this.cached.some((t) => t.name === name)) {
|
|
142
181
|
return { isError: true, content: `tool ${name} is not available` };
|
|
143
182
|
}
|
|
183
|
+
const opts = { signal, timeoutMs };
|
|
144
184
|
try {
|
|
145
185
|
const result = await client.callTool({ name, arguments: (args ?? {}) }, undefined, { signal: opts.signal, timeout: opts.timeoutMs });
|
|
146
186
|
return mapToolResult(result);
|
|
@@ -158,7 +198,7 @@ export class McpToolSource {
|
|
|
158
198
|
return { isError: true, content: `tool ${name} failed: unavailable` };
|
|
159
199
|
}
|
|
160
200
|
this.connectionLost(client, err);
|
|
161
|
-
return
|
|
201
|
+
return CONNECTION_LOST;
|
|
162
202
|
}
|
|
163
203
|
}
|
|
164
204
|
async close() {
|
|
@@ -265,6 +305,14 @@ export class McpToolSource {
|
|
|
265
305
|
name: t.name,
|
|
266
306
|
description: t.description ?? "",
|
|
267
307
|
inputSchema: t.inputSchema,
|
|
308
|
+
...(t.annotations
|
|
309
|
+
? {
|
|
310
|
+
annotations: {
|
|
311
|
+
readOnlyHint: t.annotations.readOnlyHint,
|
|
312
|
+
idempotentHint: t.annotations.idempotentHint,
|
|
313
|
+
},
|
|
314
|
+
}
|
|
315
|
+
: {}),
|
|
268
316
|
});
|
|
269
317
|
}
|
|
270
318
|
cursor = res.nextCursor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-tool-source.js","sourceRoot":"","sources":["../../../src/llm/mcp/mcp-tool-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAoCjE,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACxE,MAAM,cAAc,GAAG,EAAE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
|
|
25306
25306
|
var MAX_LIST_PAGES = 10;
|
|
25307
25307
|
var REQUEST_TIMEOUT_CODE = -32001;
|
|
25308
|
+
var CONNECTION_LOST = Symbol("connection-lost");
|
|
25308
25309
|
function readPackageVersion() {
|
|
25309
25310
|
try {
|
|
25310
25311
|
const require2 = createRequire(import.meta.url);
|
|
@@ -25319,12 +25320,23 @@ function errorFields(err) {
|
|
|
25319
25320
|
if (err instanceof Error) {
|
|
25320
25321
|
const code = err.code;
|
|
25321
25322
|
const name = err.constructor.name || err.name;
|
|
25322
|
-
|
|
25323
|
+
const out = {
|
|
25323
25324
|
error: code !== void 0 ? `${name} ${String(code)}` : name
|
|
25324
25325
|
};
|
|
25326
|
+
const cause = err.cause;
|
|
25327
|
+
if (cause instanceof Error) {
|
|
25328
|
+
out.cause = cause.constructor.name || cause.name;
|
|
25329
|
+
const causeCode = cause.code;
|
|
25330
|
+
if (causeCode !== void 0)
|
|
25331
|
+
out.causeCode = String(causeCode);
|
|
25332
|
+
}
|
|
25333
|
+
return out;
|
|
25325
25334
|
}
|
|
25326
25335
|
return { error: typeof err };
|
|
25327
25336
|
}
|
|
25337
|
+
function retryableAfterReconnect(tool) {
|
|
25338
|
+
return tool?.annotations?.readOnlyHint === true || tool?.annotations?.idempotentHint === true;
|
|
25339
|
+
}
|
|
25328
25340
|
function urlOrigin(url2) {
|
|
25329
25341
|
try {
|
|
25330
25342
|
return new URL(url2).origin;
|
|
@@ -25426,10 +25438,31 @@ var McpToolSource = class {
|
|
|
25426
25438
|
return this.cached.map((t) => ({ ...t }));
|
|
25427
25439
|
}
|
|
25428
25440
|
async callTool(name, args, opts) {
|
|
25441
|
+
const deadline = Date.now() + opts.timeoutMs;
|
|
25442
|
+
const tool = this.cached.find((t) => t.name === name);
|
|
25443
|
+
const first = await this.callOnce(name, args, opts.signal, opts.timeoutMs);
|
|
25444
|
+
if (first !== CONNECTION_LOST)
|
|
25445
|
+
return first;
|
|
25446
|
+
const unavailable = {
|
|
25447
|
+
isError: true,
|
|
25448
|
+
content: `tool ${name} failed: unavailable`
|
|
25449
|
+
};
|
|
25450
|
+
if (!retryableAfterReconnect(tool) || opts.signal?.aborted)
|
|
25451
|
+
return unavailable;
|
|
25452
|
+
const reconnected = await this.ready(deadline - Date.now());
|
|
25453
|
+
const remaining = deadline - Date.now();
|
|
25454
|
+
if (!reconnected || remaining <= 0 || opts.signal?.aborted)
|
|
25455
|
+
return unavailable;
|
|
25456
|
+
const second = await this.callOnce(name, args, opts.signal, remaining);
|
|
25457
|
+
return second === CONNECTION_LOST ? unavailable : second;
|
|
25458
|
+
}
|
|
25459
|
+
/** One call on the current connection; CONNECTION_LOST when the transport failed. */
|
|
25460
|
+
async callOnce(name, args, signal, timeoutMs) {
|
|
25429
25461
|
const client = this.client;
|
|
25430
25462
|
if (this.state !== "ready" || !client || !this.cached.some((t) => t.name === name)) {
|
|
25431
25463
|
return { isError: true, content: `tool ${name} is not available` };
|
|
25432
25464
|
}
|
|
25465
|
+
const opts = { signal, timeoutMs };
|
|
25433
25466
|
try {
|
|
25434
25467
|
const result = await client.callTool({ name, arguments: args ?? {} }, void 0, { signal: opts.signal, timeout: opts.timeoutMs });
|
|
25435
25468
|
return mapToolResult(result);
|
|
@@ -25445,7 +25478,7 @@ var McpToolSource = class {
|
|
|
25445
25478
|
return { isError: true, content: `tool ${name} failed: unavailable` };
|
|
25446
25479
|
}
|
|
25447
25480
|
this.connectionLost(client, err);
|
|
25448
|
-
return
|
|
25481
|
+
return CONNECTION_LOST;
|
|
25449
25482
|
}
|
|
25450
25483
|
}
|
|
25451
25484
|
async close() {
|
|
@@ -25551,7 +25584,13 @@ var McpToolSource = class {
|
|
|
25551
25584
|
out.push({
|
|
25552
25585
|
name: t.name,
|
|
25553
25586
|
description: t.description ?? "",
|
|
25554
|
-
inputSchema: t.inputSchema
|
|
25587
|
+
inputSchema: t.inputSchema,
|
|
25588
|
+
...t.annotations ? {
|
|
25589
|
+
annotations: {
|
|
25590
|
+
readOnlyHint: t.annotations.readOnlyHint,
|
|
25591
|
+
idempotentHint: t.annotations.idempotentHint
|
|
25592
|
+
}
|
|
25593
|
+
} : {}
|
|
25555
25594
|
});
|
|
25556
25595
|
}
|
|
25557
25596
|
cursor = res.nextCursor;
|
|
@@ -32639,6 +32639,7 @@ function toolsHash(all) {
|
|
|
32639
32639
|
var DEFAULT_BACKOFF_MS = [1e3, 2e3, 4e3, 8e3, 16e3, 3e4];
|
|
32640
32640
|
var MAX_LIST_PAGES = 10;
|
|
32641
32641
|
var REQUEST_TIMEOUT_CODE = -32001;
|
|
32642
|
+
var CONNECTION_LOST = Symbol("connection-lost");
|
|
32642
32643
|
function readPackageVersion() {
|
|
32643
32644
|
try {
|
|
32644
32645
|
const require2 = createRequire(import.meta.url);
|
|
@@ -32653,12 +32654,23 @@ function errorFields(err) {
|
|
|
32653
32654
|
if (err instanceof Error) {
|
|
32654
32655
|
const code = err.code;
|
|
32655
32656
|
const name = err.constructor.name || err.name;
|
|
32656
|
-
|
|
32657
|
+
const out = {
|
|
32657
32658
|
error: code !== void 0 ? `${name} ${String(code)}` : name
|
|
32658
32659
|
};
|
|
32660
|
+
const cause = err.cause;
|
|
32661
|
+
if (cause instanceof Error) {
|
|
32662
|
+
out.cause = cause.constructor.name || cause.name;
|
|
32663
|
+
const causeCode = cause.code;
|
|
32664
|
+
if (causeCode !== void 0)
|
|
32665
|
+
out.causeCode = String(causeCode);
|
|
32666
|
+
}
|
|
32667
|
+
return out;
|
|
32659
32668
|
}
|
|
32660
32669
|
return { error: typeof err };
|
|
32661
32670
|
}
|
|
32671
|
+
function retryableAfterReconnect(tool) {
|
|
32672
|
+
return tool?.annotations?.readOnlyHint === true || tool?.annotations?.idempotentHint === true;
|
|
32673
|
+
}
|
|
32662
32674
|
function urlOrigin(url2) {
|
|
32663
32675
|
try {
|
|
32664
32676
|
return new URL(url2).origin;
|
|
@@ -32760,10 +32772,31 @@ var McpToolSource = class {
|
|
|
32760
32772
|
return this.cached.map((t) => ({ ...t }));
|
|
32761
32773
|
}
|
|
32762
32774
|
async callTool(name, args, opts) {
|
|
32775
|
+
const deadline = Date.now() + opts.timeoutMs;
|
|
32776
|
+
const tool = this.cached.find((t) => t.name === name);
|
|
32777
|
+
const first = await this.callOnce(name, args, opts.signal, opts.timeoutMs);
|
|
32778
|
+
if (first !== CONNECTION_LOST)
|
|
32779
|
+
return first;
|
|
32780
|
+
const unavailable = {
|
|
32781
|
+
isError: true,
|
|
32782
|
+
content: `tool ${name} failed: unavailable`
|
|
32783
|
+
};
|
|
32784
|
+
if (!retryableAfterReconnect(tool) || opts.signal?.aborted)
|
|
32785
|
+
return unavailable;
|
|
32786
|
+
const reconnected = await this.ready(deadline - Date.now());
|
|
32787
|
+
const remaining = deadline - Date.now();
|
|
32788
|
+
if (!reconnected || remaining <= 0 || opts.signal?.aborted)
|
|
32789
|
+
return unavailable;
|
|
32790
|
+
const second = await this.callOnce(name, args, opts.signal, remaining);
|
|
32791
|
+
return second === CONNECTION_LOST ? unavailable : second;
|
|
32792
|
+
}
|
|
32793
|
+
/** One call on the current connection; CONNECTION_LOST when the transport failed. */
|
|
32794
|
+
async callOnce(name, args, signal, timeoutMs) {
|
|
32763
32795
|
const client = this.client;
|
|
32764
32796
|
if (this.state !== "ready" || !client || !this.cached.some((t) => t.name === name)) {
|
|
32765
32797
|
return { isError: true, content: `tool ${name} is not available` };
|
|
32766
32798
|
}
|
|
32799
|
+
const opts = { signal, timeoutMs };
|
|
32767
32800
|
try {
|
|
32768
32801
|
const result = await client.callTool({ name, arguments: args ?? {} }, void 0, { signal: opts.signal, timeout: opts.timeoutMs });
|
|
32769
32802
|
return mapToolResult(result);
|
|
@@ -32779,7 +32812,7 @@ var McpToolSource = class {
|
|
|
32779
32812
|
return { isError: true, content: `tool ${name} failed: unavailable` };
|
|
32780
32813
|
}
|
|
32781
32814
|
this.connectionLost(client, err);
|
|
32782
|
-
return
|
|
32815
|
+
return CONNECTION_LOST;
|
|
32783
32816
|
}
|
|
32784
32817
|
}
|
|
32785
32818
|
async close() {
|
|
@@ -32885,7 +32918,13 @@ var McpToolSource = class {
|
|
|
32885
32918
|
out.push({
|
|
32886
32919
|
name: t.name,
|
|
32887
32920
|
description: t.description ?? "",
|
|
32888
|
-
inputSchema: t.inputSchema
|
|
32921
|
+
inputSchema: t.inputSchema,
|
|
32922
|
+
...t.annotations ? {
|
|
32923
|
+
annotations: {
|
|
32924
|
+
readOnlyHint: t.annotations.readOnlyHint,
|
|
32925
|
+
idempotentHint: t.annotations.idempotentHint
|
|
32926
|
+
}
|
|
32927
|
+
} : {}
|
|
32889
32928
|
});
|
|
32890
32929
|
}
|
|
32891
32930
|
cursor = res.nextCursor;
|
|
@@ -32639,6 +32639,7 @@ function toolsHash(all) {
|
|
|
32639
32639
|
var DEFAULT_BACKOFF_MS = [1e3, 2e3, 4e3, 8e3, 16e3, 3e4];
|
|
32640
32640
|
var MAX_LIST_PAGES = 10;
|
|
32641
32641
|
var REQUEST_TIMEOUT_CODE = -32001;
|
|
32642
|
+
var CONNECTION_LOST = Symbol("connection-lost");
|
|
32642
32643
|
function readPackageVersion() {
|
|
32643
32644
|
try {
|
|
32644
32645
|
const require2 = createRequire(import.meta.url);
|
|
@@ -32653,12 +32654,23 @@ function errorFields(err) {
|
|
|
32653
32654
|
if (err instanceof Error) {
|
|
32654
32655
|
const code = err.code;
|
|
32655
32656
|
const name = err.constructor.name || err.name;
|
|
32656
|
-
|
|
32657
|
+
const out = {
|
|
32657
32658
|
error: code !== void 0 ? `${name} ${String(code)}` : name
|
|
32658
32659
|
};
|
|
32660
|
+
const cause = err.cause;
|
|
32661
|
+
if (cause instanceof Error) {
|
|
32662
|
+
out.cause = cause.constructor.name || cause.name;
|
|
32663
|
+
const causeCode = cause.code;
|
|
32664
|
+
if (causeCode !== void 0)
|
|
32665
|
+
out.causeCode = String(causeCode);
|
|
32666
|
+
}
|
|
32667
|
+
return out;
|
|
32659
32668
|
}
|
|
32660
32669
|
return { error: typeof err };
|
|
32661
32670
|
}
|
|
32671
|
+
function retryableAfterReconnect(tool) {
|
|
32672
|
+
return tool?.annotations?.readOnlyHint === true || tool?.annotations?.idempotentHint === true;
|
|
32673
|
+
}
|
|
32662
32674
|
function urlOrigin(url2) {
|
|
32663
32675
|
try {
|
|
32664
32676
|
return new URL(url2).origin;
|
|
@@ -32760,10 +32772,31 @@ var McpToolSource = class {
|
|
|
32760
32772
|
return this.cached.map((t) => ({ ...t }));
|
|
32761
32773
|
}
|
|
32762
32774
|
async callTool(name, args, opts) {
|
|
32775
|
+
const deadline = Date.now() + opts.timeoutMs;
|
|
32776
|
+
const tool = this.cached.find((t) => t.name === name);
|
|
32777
|
+
const first = await this.callOnce(name, args, opts.signal, opts.timeoutMs);
|
|
32778
|
+
if (first !== CONNECTION_LOST)
|
|
32779
|
+
return first;
|
|
32780
|
+
const unavailable = {
|
|
32781
|
+
isError: true,
|
|
32782
|
+
content: `tool ${name} failed: unavailable`
|
|
32783
|
+
};
|
|
32784
|
+
if (!retryableAfterReconnect(tool) || opts.signal?.aborted)
|
|
32785
|
+
return unavailable;
|
|
32786
|
+
const reconnected = await this.ready(deadline - Date.now());
|
|
32787
|
+
const remaining = deadline - Date.now();
|
|
32788
|
+
if (!reconnected || remaining <= 0 || opts.signal?.aborted)
|
|
32789
|
+
return unavailable;
|
|
32790
|
+
const second = await this.callOnce(name, args, opts.signal, remaining);
|
|
32791
|
+
return second === CONNECTION_LOST ? unavailable : second;
|
|
32792
|
+
}
|
|
32793
|
+
/** One call on the current connection; CONNECTION_LOST when the transport failed. */
|
|
32794
|
+
async callOnce(name, args, signal, timeoutMs) {
|
|
32763
32795
|
const client = this.client;
|
|
32764
32796
|
if (this.state !== "ready" || !client || !this.cached.some((t) => t.name === name)) {
|
|
32765
32797
|
return { isError: true, content: `tool ${name} is not available` };
|
|
32766
32798
|
}
|
|
32799
|
+
const opts = { signal, timeoutMs };
|
|
32767
32800
|
try {
|
|
32768
32801
|
const result = await client.callTool({ name, arguments: args ?? {} }, void 0, { signal: opts.signal, timeout: opts.timeoutMs });
|
|
32769
32802
|
return mapToolResult(result);
|
|
@@ -32779,7 +32812,7 @@ var McpToolSource = class {
|
|
|
32779
32812
|
return { isError: true, content: `tool ${name} failed: unavailable` };
|
|
32780
32813
|
}
|
|
32781
32814
|
this.connectionLost(client, err);
|
|
32782
|
-
return
|
|
32815
|
+
return CONNECTION_LOST;
|
|
32783
32816
|
}
|
|
32784
32817
|
}
|
|
32785
32818
|
async close() {
|
|
@@ -32885,7 +32918,13 @@ var McpToolSource = class {
|
|
|
32885
32918
|
out.push({
|
|
32886
32919
|
name: t.name,
|
|
32887
32920
|
description: t.description ?? "",
|
|
32888
|
-
inputSchema: t.inputSchema
|
|
32921
|
+
inputSchema: t.inputSchema,
|
|
32922
|
+
...t.annotations ? {
|
|
32923
|
+
annotations: {
|
|
32924
|
+
readOnlyHint: t.annotations.readOnlyHint,
|
|
32925
|
+
idempotentHint: t.annotations.idempotentHint
|
|
32926
|
+
}
|
|
32927
|
+
} : {}
|
|
32889
32928
|
});
|
|
32890
32929
|
}
|
|
32891
32930
|
cursor = res.nextCursor;
|
|
@@ -32639,6 +32639,7 @@ function toolsHash(all) {
|
|
|
32639
32639
|
var DEFAULT_BACKOFF_MS = [1e3, 2e3, 4e3, 8e3, 16e3, 3e4];
|
|
32640
32640
|
var MAX_LIST_PAGES = 10;
|
|
32641
32641
|
var REQUEST_TIMEOUT_CODE = -32001;
|
|
32642
|
+
var CONNECTION_LOST = Symbol("connection-lost");
|
|
32642
32643
|
function readPackageVersion() {
|
|
32643
32644
|
try {
|
|
32644
32645
|
const require2 = createRequire(import.meta.url);
|
|
@@ -32653,12 +32654,23 @@ function errorFields(err) {
|
|
|
32653
32654
|
if (err instanceof Error) {
|
|
32654
32655
|
const code = err.code;
|
|
32655
32656
|
const name = err.constructor.name || err.name;
|
|
32656
|
-
|
|
32657
|
+
const out = {
|
|
32657
32658
|
error: code !== void 0 ? `${name} ${String(code)}` : name
|
|
32658
32659
|
};
|
|
32660
|
+
const cause = err.cause;
|
|
32661
|
+
if (cause instanceof Error) {
|
|
32662
|
+
out.cause = cause.constructor.name || cause.name;
|
|
32663
|
+
const causeCode = cause.code;
|
|
32664
|
+
if (causeCode !== void 0)
|
|
32665
|
+
out.causeCode = String(causeCode);
|
|
32666
|
+
}
|
|
32667
|
+
return out;
|
|
32659
32668
|
}
|
|
32660
32669
|
return { error: typeof err };
|
|
32661
32670
|
}
|
|
32671
|
+
function retryableAfterReconnect(tool) {
|
|
32672
|
+
return tool?.annotations?.readOnlyHint === true || tool?.annotations?.idempotentHint === true;
|
|
32673
|
+
}
|
|
32662
32674
|
function urlOrigin(url2) {
|
|
32663
32675
|
try {
|
|
32664
32676
|
return new URL(url2).origin;
|
|
@@ -32760,10 +32772,31 @@ var McpToolSource = class {
|
|
|
32760
32772
|
return this.cached.map((t) => ({ ...t }));
|
|
32761
32773
|
}
|
|
32762
32774
|
async callTool(name, args, opts) {
|
|
32775
|
+
const deadline = Date.now() + opts.timeoutMs;
|
|
32776
|
+
const tool = this.cached.find((t) => t.name === name);
|
|
32777
|
+
const first = await this.callOnce(name, args, opts.signal, opts.timeoutMs);
|
|
32778
|
+
if (first !== CONNECTION_LOST)
|
|
32779
|
+
return first;
|
|
32780
|
+
const unavailable = {
|
|
32781
|
+
isError: true,
|
|
32782
|
+
content: `tool ${name} failed: unavailable`
|
|
32783
|
+
};
|
|
32784
|
+
if (!retryableAfterReconnect(tool) || opts.signal?.aborted)
|
|
32785
|
+
return unavailable;
|
|
32786
|
+
const reconnected = await this.ready(deadline - Date.now());
|
|
32787
|
+
const remaining = deadline - Date.now();
|
|
32788
|
+
if (!reconnected || remaining <= 0 || opts.signal?.aborted)
|
|
32789
|
+
return unavailable;
|
|
32790
|
+
const second = await this.callOnce(name, args, opts.signal, remaining);
|
|
32791
|
+
return second === CONNECTION_LOST ? unavailable : second;
|
|
32792
|
+
}
|
|
32793
|
+
/** One call on the current connection; CONNECTION_LOST when the transport failed. */
|
|
32794
|
+
async callOnce(name, args, signal, timeoutMs) {
|
|
32763
32795
|
const client = this.client;
|
|
32764
32796
|
if (this.state !== "ready" || !client || !this.cached.some((t) => t.name === name)) {
|
|
32765
32797
|
return { isError: true, content: `tool ${name} is not available` };
|
|
32766
32798
|
}
|
|
32799
|
+
const opts = { signal, timeoutMs };
|
|
32767
32800
|
try {
|
|
32768
32801
|
const result = await client.callTool({ name, arguments: args ?? {} }, void 0, { signal: opts.signal, timeout: opts.timeoutMs });
|
|
32769
32802
|
return mapToolResult(result);
|
|
@@ -32779,7 +32812,7 @@ var McpToolSource = class {
|
|
|
32779
32812
|
return { isError: true, content: `tool ${name} failed: unavailable` };
|
|
32780
32813
|
}
|
|
32781
32814
|
this.connectionLost(client, err);
|
|
32782
|
-
return
|
|
32815
|
+
return CONNECTION_LOST;
|
|
32783
32816
|
}
|
|
32784
32817
|
}
|
|
32785
32818
|
async close() {
|
|
@@ -32885,7 +32918,13 @@ var McpToolSource = class {
|
|
|
32885
32918
|
out.push({
|
|
32886
32919
|
name: t.name,
|
|
32887
32920
|
description: t.description ?? "",
|
|
32888
|
-
inputSchema: t.inputSchema
|
|
32921
|
+
inputSchema: t.inputSchema,
|
|
32922
|
+
...t.annotations ? {
|
|
32923
|
+
annotations: {
|
|
32924
|
+
readOnlyHint: t.annotations.readOnlyHint,
|
|
32925
|
+
idempotentHint: t.annotations.idempotentHint
|
|
32926
|
+
}
|
|
32927
|
+
} : {}
|
|
32889
32928
|
});
|
|
32890
32929
|
}
|
|
32891
32930
|
cursor = res.nextCursor;
|
|
@@ -32643,6 +32643,7 @@ function toolsHash(all) {
|
|
|
32643
32643
|
var DEFAULT_BACKOFF_MS = [1e3, 2e3, 4e3, 8e3, 16e3, 3e4];
|
|
32644
32644
|
var MAX_LIST_PAGES = 10;
|
|
32645
32645
|
var REQUEST_TIMEOUT_CODE = -32001;
|
|
32646
|
+
var CONNECTION_LOST = Symbol("connection-lost");
|
|
32646
32647
|
function readPackageVersion() {
|
|
32647
32648
|
try {
|
|
32648
32649
|
const require2 = createRequire(import.meta.url);
|
|
@@ -32657,12 +32658,23 @@ function errorFields(err) {
|
|
|
32657
32658
|
if (err instanceof Error) {
|
|
32658
32659
|
const code = err.code;
|
|
32659
32660
|
const name = err.constructor.name || err.name;
|
|
32660
|
-
|
|
32661
|
+
const out = {
|
|
32661
32662
|
error: code !== void 0 ? `${name} ${String(code)}` : name
|
|
32662
32663
|
};
|
|
32664
|
+
const cause = err.cause;
|
|
32665
|
+
if (cause instanceof Error) {
|
|
32666
|
+
out.cause = cause.constructor.name || cause.name;
|
|
32667
|
+
const causeCode = cause.code;
|
|
32668
|
+
if (causeCode !== void 0)
|
|
32669
|
+
out.causeCode = String(causeCode);
|
|
32670
|
+
}
|
|
32671
|
+
return out;
|
|
32663
32672
|
}
|
|
32664
32673
|
return { error: typeof err };
|
|
32665
32674
|
}
|
|
32675
|
+
function retryableAfterReconnect(tool) {
|
|
32676
|
+
return tool?.annotations?.readOnlyHint === true || tool?.annotations?.idempotentHint === true;
|
|
32677
|
+
}
|
|
32666
32678
|
function urlOrigin(url2) {
|
|
32667
32679
|
try {
|
|
32668
32680
|
return new URL(url2).origin;
|
|
@@ -32764,10 +32776,31 @@ var McpToolSource = class {
|
|
|
32764
32776
|
return this.cached.map((t) => ({ ...t }));
|
|
32765
32777
|
}
|
|
32766
32778
|
async callTool(name, args, opts) {
|
|
32779
|
+
const deadline = Date.now() + opts.timeoutMs;
|
|
32780
|
+
const tool = this.cached.find((t) => t.name === name);
|
|
32781
|
+
const first = await this.callOnce(name, args, opts.signal, opts.timeoutMs);
|
|
32782
|
+
if (first !== CONNECTION_LOST)
|
|
32783
|
+
return first;
|
|
32784
|
+
const unavailable = {
|
|
32785
|
+
isError: true,
|
|
32786
|
+
content: `tool ${name} failed: unavailable`
|
|
32787
|
+
};
|
|
32788
|
+
if (!retryableAfterReconnect(tool) || opts.signal?.aborted)
|
|
32789
|
+
return unavailable;
|
|
32790
|
+
const reconnected = await this.ready(deadline - Date.now());
|
|
32791
|
+
const remaining = deadline - Date.now();
|
|
32792
|
+
if (!reconnected || remaining <= 0 || opts.signal?.aborted)
|
|
32793
|
+
return unavailable;
|
|
32794
|
+
const second = await this.callOnce(name, args, opts.signal, remaining);
|
|
32795
|
+
return second === CONNECTION_LOST ? unavailable : second;
|
|
32796
|
+
}
|
|
32797
|
+
/** One call on the current connection; CONNECTION_LOST when the transport failed. */
|
|
32798
|
+
async callOnce(name, args, signal, timeoutMs) {
|
|
32767
32799
|
const client = this.client;
|
|
32768
32800
|
if (this.state !== "ready" || !client || !this.cached.some((t) => t.name === name)) {
|
|
32769
32801
|
return { isError: true, content: `tool ${name} is not available` };
|
|
32770
32802
|
}
|
|
32803
|
+
const opts = { signal, timeoutMs };
|
|
32771
32804
|
try {
|
|
32772
32805
|
const result = await client.callTool({ name, arguments: args ?? {} }, void 0, { signal: opts.signal, timeout: opts.timeoutMs });
|
|
32773
32806
|
return mapToolResult(result);
|
|
@@ -32783,7 +32816,7 @@ var McpToolSource = class {
|
|
|
32783
32816
|
return { isError: true, content: `tool ${name} failed: unavailable` };
|
|
32784
32817
|
}
|
|
32785
32818
|
this.connectionLost(client, err);
|
|
32786
|
-
return
|
|
32819
|
+
return CONNECTION_LOST;
|
|
32787
32820
|
}
|
|
32788
32821
|
}
|
|
32789
32822
|
async close() {
|
|
@@ -32889,7 +32922,13 @@ var McpToolSource = class {
|
|
|
32889
32922
|
out.push({
|
|
32890
32923
|
name: t.name,
|
|
32891
32924
|
description: t.description ?? "",
|
|
32892
|
-
inputSchema: t.inputSchema
|
|
32925
|
+
inputSchema: t.inputSchema,
|
|
32926
|
+
...t.annotations ? {
|
|
32927
|
+
annotations: {
|
|
32928
|
+
readOnlyHint: t.annotations.readOnlyHint,
|
|
32929
|
+
idempotentHint: t.annotations.idempotentHint
|
|
32930
|
+
}
|
|
32931
|
+
} : {}
|
|
32893
32932
|
});
|
|
32894
32933
|
}
|
|
32895
32934
|
cursor = res.nextCursor;
|
|
@@ -32639,6 +32639,7 @@ function toolsHash(all) {
|
|
|
32639
32639
|
var DEFAULT_BACKOFF_MS = [1e3, 2e3, 4e3, 8e3, 16e3, 3e4];
|
|
32640
32640
|
var MAX_LIST_PAGES = 10;
|
|
32641
32641
|
var REQUEST_TIMEOUT_CODE = -32001;
|
|
32642
|
+
var CONNECTION_LOST = Symbol("connection-lost");
|
|
32642
32643
|
function readPackageVersion() {
|
|
32643
32644
|
try {
|
|
32644
32645
|
const require2 = createRequire(import.meta.url);
|
|
@@ -32653,12 +32654,23 @@ function errorFields(err) {
|
|
|
32653
32654
|
if (err instanceof Error) {
|
|
32654
32655
|
const code = err.code;
|
|
32655
32656
|
const name = err.constructor.name || err.name;
|
|
32656
|
-
|
|
32657
|
+
const out = {
|
|
32657
32658
|
error: code !== void 0 ? `${name} ${String(code)}` : name
|
|
32658
32659
|
};
|
|
32660
|
+
const cause = err.cause;
|
|
32661
|
+
if (cause instanceof Error) {
|
|
32662
|
+
out.cause = cause.constructor.name || cause.name;
|
|
32663
|
+
const causeCode = cause.code;
|
|
32664
|
+
if (causeCode !== void 0)
|
|
32665
|
+
out.causeCode = String(causeCode);
|
|
32666
|
+
}
|
|
32667
|
+
return out;
|
|
32659
32668
|
}
|
|
32660
32669
|
return { error: typeof err };
|
|
32661
32670
|
}
|
|
32671
|
+
function retryableAfterReconnect(tool) {
|
|
32672
|
+
return tool?.annotations?.readOnlyHint === true || tool?.annotations?.idempotentHint === true;
|
|
32673
|
+
}
|
|
32662
32674
|
function urlOrigin(url2) {
|
|
32663
32675
|
try {
|
|
32664
32676
|
return new URL(url2).origin;
|
|
@@ -32760,10 +32772,31 @@ var McpToolSource = class {
|
|
|
32760
32772
|
return this.cached.map((t) => ({ ...t }));
|
|
32761
32773
|
}
|
|
32762
32774
|
async callTool(name, args, opts) {
|
|
32775
|
+
const deadline = Date.now() + opts.timeoutMs;
|
|
32776
|
+
const tool = this.cached.find((t) => t.name === name);
|
|
32777
|
+
const first = await this.callOnce(name, args, opts.signal, opts.timeoutMs);
|
|
32778
|
+
if (first !== CONNECTION_LOST)
|
|
32779
|
+
return first;
|
|
32780
|
+
const unavailable = {
|
|
32781
|
+
isError: true,
|
|
32782
|
+
content: `tool ${name} failed: unavailable`
|
|
32783
|
+
};
|
|
32784
|
+
if (!retryableAfterReconnect(tool) || opts.signal?.aborted)
|
|
32785
|
+
return unavailable;
|
|
32786
|
+
const reconnected = await this.ready(deadline - Date.now());
|
|
32787
|
+
const remaining = deadline - Date.now();
|
|
32788
|
+
if (!reconnected || remaining <= 0 || opts.signal?.aborted)
|
|
32789
|
+
return unavailable;
|
|
32790
|
+
const second = await this.callOnce(name, args, opts.signal, remaining);
|
|
32791
|
+
return second === CONNECTION_LOST ? unavailable : second;
|
|
32792
|
+
}
|
|
32793
|
+
/** One call on the current connection; CONNECTION_LOST when the transport failed. */
|
|
32794
|
+
async callOnce(name, args, signal, timeoutMs) {
|
|
32763
32795
|
const client = this.client;
|
|
32764
32796
|
if (this.state !== "ready" || !client || !this.cached.some((t) => t.name === name)) {
|
|
32765
32797
|
return { isError: true, content: `tool ${name} is not available` };
|
|
32766
32798
|
}
|
|
32799
|
+
const opts = { signal, timeoutMs };
|
|
32767
32800
|
try {
|
|
32768
32801
|
const result = await client.callTool({ name, arguments: args ?? {} }, void 0, { signal: opts.signal, timeout: opts.timeoutMs });
|
|
32769
32802
|
return mapToolResult(result);
|
|
@@ -32779,7 +32812,7 @@ var McpToolSource = class {
|
|
|
32779
32812
|
return { isError: true, content: `tool ${name} failed: unavailable` };
|
|
32780
32813
|
}
|
|
32781
32814
|
this.connectionLost(client, err);
|
|
32782
|
-
return
|
|
32815
|
+
return CONNECTION_LOST;
|
|
32783
32816
|
}
|
|
32784
32817
|
}
|
|
32785
32818
|
async close() {
|
|
@@ -32885,7 +32918,13 @@ var McpToolSource = class {
|
|
|
32885
32918
|
out.push({
|
|
32886
32919
|
name: t.name,
|
|
32887
32920
|
description: t.description ?? "",
|
|
32888
|
-
inputSchema: t.inputSchema
|
|
32921
|
+
inputSchema: t.inputSchema,
|
|
32922
|
+
...t.annotations ? {
|
|
32923
|
+
annotations: {
|
|
32924
|
+
readOnlyHint: t.annotations.readOnlyHint,
|
|
32925
|
+
idempotentHint: t.annotations.idempotentHint
|
|
32926
|
+
}
|
|
32927
|
+
} : {}
|
|
32889
32928
|
});
|
|
32890
32929
|
}
|
|
32891
32930
|
cursor = res.nextCursor;
|
|
@@ -32639,6 +32639,7 @@ function toolsHash(all) {
|
|
|
32639
32639
|
var DEFAULT_BACKOFF_MS = [1e3, 2e3, 4e3, 8e3, 16e3, 3e4];
|
|
32640
32640
|
var MAX_LIST_PAGES = 10;
|
|
32641
32641
|
var REQUEST_TIMEOUT_CODE = -32001;
|
|
32642
|
+
var CONNECTION_LOST = Symbol("connection-lost");
|
|
32642
32643
|
function readPackageVersion() {
|
|
32643
32644
|
try {
|
|
32644
32645
|
const require2 = createRequire(import.meta.url);
|
|
@@ -32653,12 +32654,23 @@ function errorFields(err) {
|
|
|
32653
32654
|
if (err instanceof Error) {
|
|
32654
32655
|
const code = err.code;
|
|
32655
32656
|
const name = err.constructor.name || err.name;
|
|
32656
|
-
|
|
32657
|
+
const out = {
|
|
32657
32658
|
error: code !== void 0 ? `${name} ${String(code)}` : name
|
|
32658
32659
|
};
|
|
32660
|
+
const cause = err.cause;
|
|
32661
|
+
if (cause instanceof Error) {
|
|
32662
|
+
out.cause = cause.constructor.name || cause.name;
|
|
32663
|
+
const causeCode = cause.code;
|
|
32664
|
+
if (causeCode !== void 0)
|
|
32665
|
+
out.causeCode = String(causeCode);
|
|
32666
|
+
}
|
|
32667
|
+
return out;
|
|
32659
32668
|
}
|
|
32660
32669
|
return { error: typeof err };
|
|
32661
32670
|
}
|
|
32671
|
+
function retryableAfterReconnect(tool) {
|
|
32672
|
+
return tool?.annotations?.readOnlyHint === true || tool?.annotations?.idempotentHint === true;
|
|
32673
|
+
}
|
|
32662
32674
|
function urlOrigin(url2) {
|
|
32663
32675
|
try {
|
|
32664
32676
|
return new URL(url2).origin;
|
|
@@ -32760,10 +32772,31 @@ var McpToolSource = class {
|
|
|
32760
32772
|
return this.cached.map((t) => ({ ...t }));
|
|
32761
32773
|
}
|
|
32762
32774
|
async callTool(name, args, opts) {
|
|
32775
|
+
const deadline = Date.now() + opts.timeoutMs;
|
|
32776
|
+
const tool = this.cached.find((t) => t.name === name);
|
|
32777
|
+
const first = await this.callOnce(name, args, opts.signal, opts.timeoutMs);
|
|
32778
|
+
if (first !== CONNECTION_LOST)
|
|
32779
|
+
return first;
|
|
32780
|
+
const unavailable = {
|
|
32781
|
+
isError: true,
|
|
32782
|
+
content: `tool ${name} failed: unavailable`
|
|
32783
|
+
};
|
|
32784
|
+
if (!retryableAfterReconnect(tool) || opts.signal?.aborted)
|
|
32785
|
+
return unavailable;
|
|
32786
|
+
const reconnected = await this.ready(deadline - Date.now());
|
|
32787
|
+
const remaining = deadline - Date.now();
|
|
32788
|
+
if (!reconnected || remaining <= 0 || opts.signal?.aborted)
|
|
32789
|
+
return unavailable;
|
|
32790
|
+
const second = await this.callOnce(name, args, opts.signal, remaining);
|
|
32791
|
+
return second === CONNECTION_LOST ? unavailable : second;
|
|
32792
|
+
}
|
|
32793
|
+
/** One call on the current connection; CONNECTION_LOST when the transport failed. */
|
|
32794
|
+
async callOnce(name, args, signal, timeoutMs) {
|
|
32763
32795
|
const client = this.client;
|
|
32764
32796
|
if (this.state !== "ready" || !client || !this.cached.some((t) => t.name === name)) {
|
|
32765
32797
|
return { isError: true, content: `tool ${name} is not available` };
|
|
32766
32798
|
}
|
|
32799
|
+
const opts = { signal, timeoutMs };
|
|
32767
32800
|
try {
|
|
32768
32801
|
const result = await client.callTool({ name, arguments: args ?? {} }, void 0, { signal: opts.signal, timeout: opts.timeoutMs });
|
|
32769
32802
|
return mapToolResult(result);
|
|
@@ -32779,7 +32812,7 @@ var McpToolSource = class {
|
|
|
32779
32812
|
return { isError: true, content: `tool ${name} failed: unavailable` };
|
|
32780
32813
|
}
|
|
32781
32814
|
this.connectionLost(client, err);
|
|
32782
|
-
return
|
|
32815
|
+
return CONNECTION_LOST;
|
|
32783
32816
|
}
|
|
32784
32817
|
}
|
|
32785
32818
|
async close() {
|
|
@@ -32885,7 +32918,13 @@ var McpToolSource = class {
|
|
|
32885
32918
|
out.push({
|
|
32886
32919
|
name: t.name,
|
|
32887
32920
|
description: t.description ?? "",
|
|
32888
|
-
inputSchema: t.inputSchema
|
|
32921
|
+
inputSchema: t.inputSchema,
|
|
32922
|
+
...t.annotations ? {
|
|
32923
|
+
annotations: {
|
|
32924
|
+
readOnlyHint: t.annotations.readOnlyHint,
|
|
32925
|
+
idempotentHint: t.annotations.idempotentHint
|
|
32926
|
+
}
|
|
32927
|
+
} : {}
|
|
32889
32928
|
});
|
|
32890
32929
|
}
|
|
32891
32930
|
cursor = res.nextCursor;
|
|
@@ -32639,6 +32639,7 @@ function toolsHash(all) {
|
|
|
32639
32639
|
var DEFAULT_BACKOFF_MS = [1e3, 2e3, 4e3, 8e3, 16e3, 3e4];
|
|
32640
32640
|
var MAX_LIST_PAGES = 10;
|
|
32641
32641
|
var REQUEST_TIMEOUT_CODE = -32001;
|
|
32642
|
+
var CONNECTION_LOST = Symbol("connection-lost");
|
|
32642
32643
|
function readPackageVersion() {
|
|
32643
32644
|
try {
|
|
32644
32645
|
const require2 = createRequire(import.meta.url);
|
|
@@ -32653,12 +32654,23 @@ function errorFields(err) {
|
|
|
32653
32654
|
if (err instanceof Error) {
|
|
32654
32655
|
const code = err.code;
|
|
32655
32656
|
const name = err.constructor.name || err.name;
|
|
32656
|
-
|
|
32657
|
+
const out = {
|
|
32657
32658
|
error: code !== void 0 ? `${name} ${String(code)}` : name
|
|
32658
32659
|
};
|
|
32660
|
+
const cause = err.cause;
|
|
32661
|
+
if (cause instanceof Error) {
|
|
32662
|
+
out.cause = cause.constructor.name || cause.name;
|
|
32663
|
+
const causeCode = cause.code;
|
|
32664
|
+
if (causeCode !== void 0)
|
|
32665
|
+
out.causeCode = String(causeCode);
|
|
32666
|
+
}
|
|
32667
|
+
return out;
|
|
32659
32668
|
}
|
|
32660
32669
|
return { error: typeof err };
|
|
32661
32670
|
}
|
|
32671
|
+
function retryableAfterReconnect(tool) {
|
|
32672
|
+
return tool?.annotations?.readOnlyHint === true || tool?.annotations?.idempotentHint === true;
|
|
32673
|
+
}
|
|
32662
32674
|
function urlOrigin(url2) {
|
|
32663
32675
|
try {
|
|
32664
32676
|
return new URL(url2).origin;
|
|
@@ -32760,10 +32772,31 @@ var McpToolSource = class {
|
|
|
32760
32772
|
return this.cached.map((t) => ({ ...t }));
|
|
32761
32773
|
}
|
|
32762
32774
|
async callTool(name, args, opts) {
|
|
32775
|
+
const deadline = Date.now() + opts.timeoutMs;
|
|
32776
|
+
const tool = this.cached.find((t) => t.name === name);
|
|
32777
|
+
const first = await this.callOnce(name, args, opts.signal, opts.timeoutMs);
|
|
32778
|
+
if (first !== CONNECTION_LOST)
|
|
32779
|
+
return first;
|
|
32780
|
+
const unavailable = {
|
|
32781
|
+
isError: true,
|
|
32782
|
+
content: `tool ${name} failed: unavailable`
|
|
32783
|
+
};
|
|
32784
|
+
if (!retryableAfterReconnect(tool) || opts.signal?.aborted)
|
|
32785
|
+
return unavailable;
|
|
32786
|
+
const reconnected = await this.ready(deadline - Date.now());
|
|
32787
|
+
const remaining = deadline - Date.now();
|
|
32788
|
+
if (!reconnected || remaining <= 0 || opts.signal?.aborted)
|
|
32789
|
+
return unavailable;
|
|
32790
|
+
const second = await this.callOnce(name, args, opts.signal, remaining);
|
|
32791
|
+
return second === CONNECTION_LOST ? unavailable : second;
|
|
32792
|
+
}
|
|
32793
|
+
/** One call on the current connection; CONNECTION_LOST when the transport failed. */
|
|
32794
|
+
async callOnce(name, args, signal, timeoutMs) {
|
|
32763
32795
|
const client = this.client;
|
|
32764
32796
|
if (this.state !== "ready" || !client || !this.cached.some((t) => t.name === name)) {
|
|
32765
32797
|
return { isError: true, content: `tool ${name} is not available` };
|
|
32766
32798
|
}
|
|
32799
|
+
const opts = { signal, timeoutMs };
|
|
32767
32800
|
try {
|
|
32768
32801
|
const result = await client.callTool({ name, arguments: args ?? {} }, void 0, { signal: opts.signal, timeout: opts.timeoutMs });
|
|
32769
32802
|
return mapToolResult(result);
|
|
@@ -32779,7 +32812,7 @@ var McpToolSource = class {
|
|
|
32779
32812
|
return { isError: true, content: `tool ${name} failed: unavailable` };
|
|
32780
32813
|
}
|
|
32781
32814
|
this.connectionLost(client, err);
|
|
32782
|
-
return
|
|
32815
|
+
return CONNECTION_LOST;
|
|
32783
32816
|
}
|
|
32784
32817
|
}
|
|
32785
32818
|
async close() {
|
|
@@ -32885,7 +32918,13 @@ var McpToolSource = class {
|
|
|
32885
32918
|
out.push({
|
|
32886
32919
|
name: t.name,
|
|
32887
32920
|
description: t.description ?? "",
|
|
32888
|
-
inputSchema: t.inputSchema
|
|
32921
|
+
inputSchema: t.inputSchema,
|
|
32922
|
+
...t.annotations ? {
|
|
32923
|
+
annotations: {
|
|
32924
|
+
readOnlyHint: t.annotations.readOnlyHint,
|
|
32925
|
+
idempotentHint: t.annotations.idempotentHint
|
|
32926
|
+
}
|
|
32927
|
+
} : {}
|
|
32889
32928
|
});
|
|
32890
32929
|
}
|
|
32891
32930
|
cursor = res.nextCursor;
|
|
@@ -32639,6 +32639,7 @@ function toolsHash(all) {
|
|
|
32639
32639
|
var DEFAULT_BACKOFF_MS = [1e3, 2e3, 4e3, 8e3, 16e3, 3e4];
|
|
32640
32640
|
var MAX_LIST_PAGES = 10;
|
|
32641
32641
|
var REQUEST_TIMEOUT_CODE = -32001;
|
|
32642
|
+
var CONNECTION_LOST = Symbol("connection-lost");
|
|
32642
32643
|
function readPackageVersion() {
|
|
32643
32644
|
try {
|
|
32644
32645
|
const require2 = createRequire(import.meta.url);
|
|
@@ -32653,12 +32654,23 @@ function errorFields(err) {
|
|
|
32653
32654
|
if (err instanceof Error) {
|
|
32654
32655
|
const code = err.code;
|
|
32655
32656
|
const name = err.constructor.name || err.name;
|
|
32656
|
-
|
|
32657
|
+
const out = {
|
|
32657
32658
|
error: code !== void 0 ? `${name} ${String(code)}` : name
|
|
32658
32659
|
};
|
|
32660
|
+
const cause = err.cause;
|
|
32661
|
+
if (cause instanceof Error) {
|
|
32662
|
+
out.cause = cause.constructor.name || cause.name;
|
|
32663
|
+
const causeCode = cause.code;
|
|
32664
|
+
if (causeCode !== void 0)
|
|
32665
|
+
out.causeCode = String(causeCode);
|
|
32666
|
+
}
|
|
32667
|
+
return out;
|
|
32659
32668
|
}
|
|
32660
32669
|
return { error: typeof err };
|
|
32661
32670
|
}
|
|
32671
|
+
function retryableAfterReconnect(tool) {
|
|
32672
|
+
return tool?.annotations?.readOnlyHint === true || tool?.annotations?.idempotentHint === true;
|
|
32673
|
+
}
|
|
32662
32674
|
function urlOrigin(url2) {
|
|
32663
32675
|
try {
|
|
32664
32676
|
return new URL(url2).origin;
|
|
@@ -32760,10 +32772,31 @@ var McpToolSource = class {
|
|
|
32760
32772
|
return this.cached.map((t) => ({ ...t }));
|
|
32761
32773
|
}
|
|
32762
32774
|
async callTool(name, args, opts) {
|
|
32775
|
+
const deadline = Date.now() + opts.timeoutMs;
|
|
32776
|
+
const tool = this.cached.find((t) => t.name === name);
|
|
32777
|
+
const first = await this.callOnce(name, args, opts.signal, opts.timeoutMs);
|
|
32778
|
+
if (first !== CONNECTION_LOST)
|
|
32779
|
+
return first;
|
|
32780
|
+
const unavailable = {
|
|
32781
|
+
isError: true,
|
|
32782
|
+
content: `tool ${name} failed: unavailable`
|
|
32783
|
+
};
|
|
32784
|
+
if (!retryableAfterReconnect(tool) || opts.signal?.aborted)
|
|
32785
|
+
return unavailable;
|
|
32786
|
+
const reconnected = await this.ready(deadline - Date.now());
|
|
32787
|
+
const remaining = deadline - Date.now();
|
|
32788
|
+
if (!reconnected || remaining <= 0 || opts.signal?.aborted)
|
|
32789
|
+
return unavailable;
|
|
32790
|
+
const second = await this.callOnce(name, args, opts.signal, remaining);
|
|
32791
|
+
return second === CONNECTION_LOST ? unavailable : second;
|
|
32792
|
+
}
|
|
32793
|
+
/** One call on the current connection; CONNECTION_LOST when the transport failed. */
|
|
32794
|
+
async callOnce(name, args, signal, timeoutMs) {
|
|
32763
32795
|
const client = this.client;
|
|
32764
32796
|
if (this.state !== "ready" || !client || !this.cached.some((t) => t.name === name)) {
|
|
32765
32797
|
return { isError: true, content: `tool ${name} is not available` };
|
|
32766
32798
|
}
|
|
32799
|
+
const opts = { signal, timeoutMs };
|
|
32767
32800
|
try {
|
|
32768
32801
|
const result = await client.callTool({ name, arguments: args ?? {} }, void 0, { signal: opts.signal, timeout: opts.timeoutMs });
|
|
32769
32802
|
return mapToolResult(result);
|
|
@@ -32779,7 +32812,7 @@ var McpToolSource = class {
|
|
|
32779
32812
|
return { isError: true, content: `tool ${name} failed: unavailable` };
|
|
32780
32813
|
}
|
|
32781
32814
|
this.connectionLost(client, err);
|
|
32782
|
-
return
|
|
32815
|
+
return CONNECTION_LOST;
|
|
32783
32816
|
}
|
|
32784
32817
|
}
|
|
32785
32818
|
async close() {
|
|
@@ -32885,7 +32918,13 @@ var McpToolSource = class {
|
|
|
32885
32918
|
out.push({
|
|
32886
32919
|
name: t.name,
|
|
32887
32920
|
description: t.description ?? "",
|
|
32888
|
-
inputSchema: t.inputSchema
|
|
32921
|
+
inputSchema: t.inputSchema,
|
|
32922
|
+
...t.annotations ? {
|
|
32923
|
+
annotations: {
|
|
32924
|
+
readOnlyHint: t.annotations.readOnlyHint,
|
|
32925
|
+
idempotentHint: t.annotations.idempotentHint
|
|
32926
|
+
}
|
|
32927
|
+
} : {}
|
|
32889
32928
|
});
|
|
32890
32929
|
}
|
|
32891
32930
|
cursor = res.nextCursor;
|
package/eject/llm/loop.ts
CHANGED