@introspection-ai/recipes 0.35.0 → 0.36.0
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/mcp-chunks/{auth-command-SDTBVC2R.js → auth-command-GMMLBU24.js} +23 -23
- package/dist/mcp-chunks/call-arguments-WSURHOLV.js +16 -0
- package/dist/mcp-chunks/{call-command-WOZT2DLX.js → call-command-2VF6IKAZ.js} +33 -33
- package/dist/mcp-chunks/{chunk-WQBESOWG.js → chunk-22WCLO4D.js} +7 -6
- package/dist/mcp-chunks/{chunk-2IO3FXZJ.js → chunk-2JTXIMGE.js} +1 -1
- package/dist/mcp-chunks/{chunk-SVCKS5MW.js → chunk-347GOMV4.js} +5 -5
- package/dist/mcp-chunks/{chunk-IR5SMKTP.js → chunk-35LLRCRA.js} +303 -128
- package/dist/mcp-chunks/{chunk-EIXFNLU6.js → chunk-3AAF3FSI.js} +1 -1
- package/dist/mcp-chunks/{chunk-TKZA4MPW.js → chunk-4PN2J74H.js} +4 -4
- package/dist/mcp-chunks/{chunk-FWWPRZ37.js → chunk-4U4BUXQD.js} +16 -16
- package/dist/mcp-chunks/{chunk-XDARNDP3.js → chunk-5OO6WVPL.js} +1 -1
- package/dist/mcp-chunks/{chunk-4IXQQER3.js → chunk-5UK2JLTN.js} +5 -5
- package/dist/mcp-chunks/{chunk-M7VINGHY.js → chunk-6TIU2CDB.js} +7 -7
- package/dist/mcp-chunks/{chunk-VRTH73R5.js → chunk-6XC5JJWD.js} +73 -36
- package/dist/mcp-chunks/{chunk-OURSGEZX.js → chunk-7BVYBZ4J.js} +8 -8
- package/dist/mcp-chunks/{chunk-HM26TIPK.js → chunk-7IVXKYTI.js} +42 -22
- package/dist/mcp-chunks/{chunk-CO4CYU5W.js → chunk-ANNJGB6F.js} +62 -32
- package/dist/mcp-chunks/{chunk-TL7V3OBY.js → chunk-BIVX2WFX.js} +3 -3
- package/dist/mcp-chunks/{chunk-JRU5LZJQ.js → chunk-C4TJGC4F.js} +1 -1
- package/dist/mcp-chunks/{chunk-7X3JHUMH.js → chunk-CN5KSNWG.js} +1 -1
- package/dist/mcp-chunks/{chunk-UXI26V4F.js → chunk-D2SZ7KRY.js} +1 -1
- package/dist/mcp-chunks/{chunk-VWNF5PIF.js → chunk-D65GOMYV.js} +2 -2
- package/dist/mcp-chunks/{chunk-27XDYSXJ.js → chunk-DBNBEWRX.js} +4 -1
- package/dist/mcp-chunks/{chunk-P3S4OJPI.js → chunk-DUBQHYW4.js} +9 -9
- package/dist/mcp-chunks/{chunk-FMYP6JXX.js → chunk-ENBJFQ6H.js} +1 -1
- package/dist/mcp-chunks/{chunk-YTO7DITJ.js → chunk-FLUF2FRN.js} +3 -3
- package/dist/mcp-chunks/{chunk-IJTZ2ZRM.js → chunk-HFHIY5TO.js} +4 -4
- package/dist/mcp-chunks/{chunk-35JUFDQI.js → chunk-HI6VG5LR.js} +2 -2
- package/dist/mcp-chunks/{chunk-7OQUF6V6.js → chunk-IHOU2BEL.js} +2 -2
- package/dist/mcp-chunks/{chunk-7CI6DKEP.js → chunk-IMXPLUKE.js} +20 -20
- package/dist/mcp-chunks/{chunk-UHXTAPEC.js → chunk-LISNXOIQ.js} +1 -1
- package/dist/mcp-chunks/{chunk-ASFI5AJK.js → chunk-LRGMFF5S.js} +7 -7
- package/dist/mcp-chunks/{chunk-ALLS7CUV.js → chunk-LUVLTUKR.js} +1 -1
- package/dist/mcp-chunks/{chunk-SONMFI3S.js → chunk-LZUKBEQZ.js} +12 -12
- package/dist/mcp-chunks/{chunk-FQAJT6U2.js → chunk-O2C3HXGS.js} +1 -1
- package/dist/mcp-chunks/{chunk-EIF7GALA.js → chunk-OI3RTQXY.js} +1 -1
- package/dist/mcp-chunks/{chunk-CRX2G22W.js → chunk-OSTHIELS.js} +1 -1
- package/dist/mcp-chunks/{chunk-R636HUNL.js → chunk-P5YLK5G2.js} +17 -12
- package/dist/mcp-chunks/{chunk-YGRORKGT.js → chunk-QDFL757K.js} +99 -74
- package/dist/mcp-chunks/{chunk-DUJ5WAHC.js → chunk-QNZGFUKC.js} +2 -2
- package/dist/mcp-chunks/{chunk-GJ7DWMRT.js → chunk-R4OYHQ4V.js} +1 -1
- package/dist/mcp-chunks/{chunk-7ZZZ7MR2.js → chunk-RHXZKYM7.js} +1 -1
- package/dist/mcp-chunks/{chunk-POYT6GCW.js → chunk-RKQC2EE6.js} +2 -2
- package/dist/mcp-chunks/{chunk-43QNQO5C.js → chunk-RZZO3ZD4.js} +4 -4
- package/dist/mcp-chunks/{chunk-FUKRLUU7.js → chunk-SS7V7GVT.js} +4 -4
- package/dist/mcp-chunks/{chunk-FVZKQMZS.js → chunk-TYL2NVXI.js} +2 -2
- package/dist/mcp-chunks/{chunk-TDBM2UIR.js → chunk-U5QZHPCC.js} +10 -1
- package/dist/mcp-chunks/{chunk-6XBQDCGX.js → chunk-UQUM7ICD.js} +36 -17
- package/dist/mcp-chunks/{chunk-JQCSGX6E.js → chunk-VWPKJFK4.js} +2 -5
- package/dist/mcp-chunks/{chunk-AHDUZPNI.js → chunk-WXNGATQ7.js} +1 -1
- package/dist/mcp-chunks/{chunk-VCPUZFU7.js → chunk-YFCNRWLV.js} +2 -2
- package/dist/mcp-chunks/{chunk-IWXEOLJL.js → chunk-YPSODIQX.js} +18 -18
- package/dist/mcp-chunks/{chunk-CMDB57MS.js → chunk-YWFQPA4D.js} +2 -2
- package/dist/mcp-chunks/{chunk-YM7ZVYI2.js → chunk-ZI5XYM4C.js} +23 -7
- package/dist/mcp-chunks/{chunk-UYG7PAN2.js → chunk-ZJWZY54X.js} +2 -2
- package/dist/mcp-chunks/{chunk-ZLV5S5UP.js → chunk-ZXIF7MKN.js} +2 -2
- package/dist/mcp-chunks/{cli-67GWFF4R.js → cli-4OQD3H4N.js} +77 -70
- package/dist/mcp-chunks/client-LXKCCVMT.js +31 -0
- package/dist/mcp-chunks/{config-command-3IKIRWMW.js → config-command-72TCIWPV.js} +63 -36
- package/dist/mcp-chunks/daemon-command-QHS3ACBM.js +31 -0
- package/dist/mcp-chunks/{dist-YL3LFKVP.js → dist-74UCKZK5.js} +95 -69
- package/dist/mcp-chunks/{emit-ts-command-YWKROLL2.js → emit-ts-command-KD4ON2SE.js} +34 -22
- package/dist/mcp-chunks/{generate-cli-runner-CZEVY2Y7.js → generate-cli-runner-HWGI6HPL.js} +55 -49
- package/dist/mcp-chunks/generated-daemon-runtime-7ORS5KBR.js +31 -0
- package/dist/mcp-chunks/{inspect-cli-command-5Y2LORK5.js → inspect-cli-command-FT5JSB7V.js} +9 -9
- package/dist/mcp-chunks/{launch-43TA3HYF.js → launch-AHLKP2VM.js} +1 -1
- package/dist/mcp-chunks/{lifecycle-BY2ILXTB.js → lifecycle-BJDITFWN.js} +1 -1
- package/dist/mcp-chunks/{list-command-7RU7NNAV.js → list-command-YKF7RN6Y.js} +30 -30
- package/dist/mcp-chunks/{output-utils-2R3SA6KR.js → output-utils-LYB5IJRD.js} +3 -3
- package/dist/mcp-chunks/{prompt-CH6TK0bC-GKQOEUY4.js → prompt-CH6TK0bC-B3USYOND.js} +1 -1
- package/dist/mcp-chunks/{record-command-ROIRRNFS.js → record-command-MJW3Z5E5.js} +5 -5
- package/dist/mcp-chunks/{replay-command-Y2MYVQTL.js → replay-command-5ZHBUOLE.js} +6 -6
- package/dist/mcp-chunks/{resource-command-VUV7AYYQ.js → resource-command-L4I24AX5.js} +9 -9
- package/dist/mcp-chunks/{result-utils-5U7NVXDZ.js → result-utils-5WRI66KV.js} +3 -3
- package/dist/mcp-chunks/runtime-IKWDQLZF.js +38 -0
- package/dist/mcp-chunks/{runtime-wrapper-3BVFTSWJ.js → runtime-wrapper-WFMNIHD5.js} +3 -3
- package/dist/mcp-chunks/{serve-command-BXLQWHFW.js → serve-command-KNCSJUXS.js} +185 -78
- package/dist/mcp-chunks/{timeouts-6GL2F44N.js → timeouts-2ZHGSB3R.js} +3 -3
- package/dist/mcp-chunks/{vault-command-JCMW3DQA.js → vault-command-7EDL45AA.js} +4 -4
- package/dist/mcp-chunks/{webapi-UMWFGMQV.js → webapi-NNCZGUMZ.js} +46 -46
- package/dist/mcp-daemon.js +27 -27
- package/dist/mcp-run-worker.js +27 -27
- package/dist/pi-extension.d.ts.map +1 -1
- package/dist/pi-extension.js +8 -1
- package/dist/pi-extension.js.map +1 -1
- package/docs/slack.md +6 -0
- package/package.json +10 -10
- package/dist/mcp-chunks/call-arguments-ER7NWEPS.js +0 -16
- package/dist/mcp-chunks/client-MQMNAYYW.js +0 -31
- package/dist/mcp-chunks/daemon-command-OMOZ5MP7.js +0 -31
- package/dist/mcp-chunks/generated-daemon-runtime-SRFULTIT.js +0 -31
- package/dist/mcp-chunks/runtime-Q4SCCOQE.js +0 -38
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
createKeepAliveRuntime
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FLUF2FRN.js";
|
|
5
5
|
import {
|
|
6
6
|
DaemonClient
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6XC5JJWD.js";
|
|
8
8
|
import {
|
|
9
9
|
createRuntime
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-QDFL757K.js";
|
|
11
|
+
import "./chunk-R4OYHQ4V.js";
|
|
12
12
|
import {
|
|
13
13
|
createNonInteractiveElicitationResponder
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-RHXZKYM7.js";
|
|
15
|
+
import "./chunk-TYL2NVXI.js";
|
|
16
|
+
import "./chunk-LZUKBEQZ.js";
|
|
17
|
+
import "./chunk-7BVYBZ4J.js";
|
|
18
|
+
import "./chunk-6TIU2CDB.js";
|
|
19
|
+
import "./chunk-C4TJGC4F.js";
|
|
20
|
+
import "./chunk-2JTXIMGE.js";
|
|
21
21
|
import {
|
|
22
22
|
MCPORTER_VERSION
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-YPSODIQX.js";
|
|
24
|
+
import "./chunk-DUBQHYW4.js";
|
|
25
|
+
import "./chunk-4U4BUXQD.js";
|
|
26
|
+
import "./chunk-5OO6WVPL.js";
|
|
27
|
+
import "./chunk-IHOU2BEL.js";
|
|
28
|
+
import "./chunk-RZZO3ZD4.js";
|
|
29
|
+
import "./chunk-ZXIF7MKN.js";
|
|
30
30
|
import "./chunk-T4MQCFIK.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-VWPKJFK4.js";
|
|
32
32
|
import {
|
|
33
33
|
isKeepAliveServer
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
34
|
+
} from "./chunk-3AAF3FSI.js";
|
|
35
|
+
import "./chunk-HI6VG5LR.js";
|
|
36
|
+
import "./chunk-35LLRCRA.js";
|
|
37
37
|
import {
|
|
38
38
|
__export
|
|
39
39
|
} from "./chunk-LRKZP7DJ.js";
|
|
40
40
|
|
|
41
|
-
// node_modules/.pnpm/mcporter@0.
|
|
41
|
+
// node_modules/.pnpm/mcporter@0.15.0/node_modules/mcporter/dist/serve.js
|
|
42
42
|
import http from "node:http";
|
|
43
43
|
import { Readable } from "node:stream";
|
|
44
44
|
import { pipeline } from "node:stream/promises";
|
|
45
45
|
|
|
46
|
-
// node_modules/.pnpm/@modelcontextprotocol+server@2.
|
|
46
|
+
// node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs
|
|
47
47
|
var __create = Object.create;
|
|
48
48
|
var __defProp = Object.defineProperty;
|
|
49
49
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -83,7 +83,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
83
83
|
enumerable: true
|
|
84
84
|
}) : target, mod));
|
|
85
85
|
|
|
86
|
-
// node_modules/.pnpm/@modelcontextprotocol+server@2.
|
|
86
|
+
// node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs
|
|
87
87
|
var DRAFT_2020_12_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft/2020-12/schema", "http://json-schema.org/draft/2020-12/schema"]);
|
|
88
88
|
var DRAFT_2019_09_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft/2019-09/schema", "http://json-schema.org/draft/2019-09/schema"]);
|
|
89
89
|
var DRAFT_07_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft-07/schema", "http://json-schema.org/draft-07/schema"]);
|
|
@@ -100,7 +100,7 @@ function declaredDialect(schema, remedy) {
|
|
|
100
100
|
throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${schema.$schema.slice(0, 200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${remedy}`);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
// node_modules/.pnpm/zod@4.6.
|
|
103
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.js
|
|
104
104
|
var util_exports = {};
|
|
105
105
|
__export(util_exports, {
|
|
106
106
|
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
@@ -171,6 +171,7 @@ __export(util_exports, {
|
|
|
171
171
|
required: () => required,
|
|
172
172
|
safeExtend: () => safeExtend,
|
|
173
173
|
shallowClone: () => shallowClone,
|
|
174
|
+
sizeCaps: () => sizeCaps,
|
|
174
175
|
slugify: () => slugify,
|
|
175
176
|
stringifyPrimitive: () => stringifyPrimitive,
|
|
176
177
|
toZod: () => toZod,
|
|
@@ -690,6 +691,18 @@ function prefixIssues(path, issues) {
|
|
|
690
691
|
function unwrapMessage(message) {
|
|
691
692
|
return typeof message === "string" ? message : message?.message;
|
|
692
693
|
}
|
|
694
|
+
function sizeCaps(defChecks) {
|
|
695
|
+
const caps = [];
|
|
696
|
+
for (const ch of defChecks ?? []) {
|
|
697
|
+
const d = ch._zod.def;
|
|
698
|
+
if (!/_(length|size)$|_equals$/.test(d.check))
|
|
699
|
+
break;
|
|
700
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
701
|
+
if (max >= 0)
|
|
702
|
+
caps.push([max, ch]);
|
|
703
|
+
}
|
|
704
|
+
return caps;
|
|
705
|
+
}
|
|
693
706
|
function attachSchema(issues, start, inst) {
|
|
694
707
|
var _a3;
|
|
695
708
|
for (let i = start; i < issues.length; i++) {
|
|
@@ -943,7 +956,7 @@ function constantCatch(value) {
|
|
|
943
956
|
return fn;
|
|
944
957
|
}
|
|
945
958
|
|
|
946
|
-
// node_modules/.pnpm/zod@4.6.
|
|
959
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/core.js
|
|
947
960
|
var _a;
|
|
948
961
|
var NEVER = /* @__PURE__ */ Object.freeze({
|
|
949
962
|
status: "aborted"
|
|
@@ -1064,7 +1077,7 @@ function config(newConfig) {
|
|
|
1064
1077
|
return globalConfig;
|
|
1065
1078
|
}
|
|
1066
1079
|
|
|
1067
|
-
// node_modules/.pnpm/zod@4.6.
|
|
1080
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/errors.js
|
|
1068
1081
|
function _getMessage() {
|
|
1069
1082
|
const internals = this._zod;
|
|
1070
1083
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -1179,7 +1192,7 @@ function formatError(error2, mapper = (issue2) => issue2.message) {
|
|
|
1179
1192
|
return fieldErrors;
|
|
1180
1193
|
}
|
|
1181
1194
|
|
|
1182
|
-
// node_modules/.pnpm/zod@4.6.
|
|
1195
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/parse.js
|
|
1183
1196
|
function finalizeParams(callee, params) {
|
|
1184
1197
|
return { callee: params?.callee ?? callee, Err: params?.Err };
|
|
1185
1198
|
}
|
|
@@ -1327,7 +1340,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
1327
1340
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
1328
1341
|
};
|
|
1329
1342
|
|
|
1330
|
-
// node_modules/.pnpm/zod@4.6.
|
|
1343
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/regexes.js
|
|
1331
1344
|
var cuid = /^[cC][0-9a-z]{6,}$/;
|
|
1332
1345
|
var cuid2 = /^[0-9a-z]+$/;
|
|
1333
1346
|
var ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
|
|
@@ -1387,7 +1400,7 @@ var _null = /^null$/i;
|
|
|
1387
1400
|
var lowercase = /^[^A-Z]*$/;
|
|
1388
1401
|
var uppercase = /^[^a-z]*$/;
|
|
1389
1402
|
|
|
1390
|
-
// node_modules/.pnpm/zod@4.6.
|
|
1403
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/checks.js
|
|
1391
1404
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
1392
1405
|
var _a3;
|
|
1393
1406
|
inst._zod ?? (inst._zod = {});
|
|
@@ -1707,7 +1720,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
1707
1720
|
};
|
|
1708
1721
|
});
|
|
1709
1722
|
|
|
1710
|
-
// node_modules/.pnpm/zod@4.6.
|
|
1723
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/doc.js
|
|
1711
1724
|
var Doc = class {
|
|
1712
1725
|
constructor(args = [], closed = {}) {
|
|
1713
1726
|
this.content = [];
|
|
@@ -1748,14 +1761,14 @@ ${content.join("\n")}
|
|
|
1748
1761
|
}
|
|
1749
1762
|
};
|
|
1750
1763
|
|
|
1751
|
-
// node_modules/.pnpm/zod@4.6.
|
|
1764
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/versions.js
|
|
1752
1765
|
var version = {
|
|
1753
1766
|
major: 4,
|
|
1754
1767
|
minor: 6,
|
|
1755
|
-
patch:
|
|
1768
|
+
patch: 7
|
|
1756
1769
|
};
|
|
1757
1770
|
|
|
1758
|
-
// node_modules/.pnpm/zod@4.6.
|
|
1771
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/schemas.js
|
|
1759
1772
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
1760
1773
|
var _a3;
|
|
1761
1774
|
inst ?? (inst = {});
|
|
@@ -2374,6 +2387,29 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
2374
2387
|
return payload;
|
|
2375
2388
|
};
|
|
2376
2389
|
});
|
|
2390
|
+
function capSize(inst, size) {
|
|
2391
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
2392
|
+
if (!caps.length)
|
|
2393
|
+
return;
|
|
2394
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
2395
|
+
const parse2 = inst._zod.parse;
|
|
2396
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2397
|
+
const n = size(payload.value);
|
|
2398
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
2399
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
|
|
2400
|
+
if (n > max && ch._zod.def.when(payload)) {
|
|
2401
|
+
const start = payload.issues.length;
|
|
2402
|
+
ch._zod.check(payload);
|
|
2403
|
+
payload.issues[start].continue = false;
|
|
2404
|
+
attachSchema(payload.issues, start, inst);
|
|
2405
|
+
return payload;
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
return parse2(payload, ctx);
|
|
2410
|
+
};
|
|
2411
|
+
}
|
|
2412
|
+
var arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
2377
2413
|
function handleArrayResult(result, final, index) {
|
|
2378
2414
|
if (result.issues.length) {
|
|
2379
2415
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -2417,6 +2453,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
2417
2453
|
}
|
|
2418
2454
|
return payload;
|
|
2419
2455
|
};
|
|
2456
|
+
capSize(inst, arraySize);
|
|
2420
2457
|
});
|
|
2421
2458
|
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
2422
2459
|
const isPresent = key in input;
|
|
@@ -3463,7 +3500,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
3463
3500
|
}
|
|
3464
3501
|
}
|
|
3465
3502
|
|
|
3466
|
-
// node_modules/.pnpm/zod@4.6.
|
|
3503
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/memoizer.js
|
|
3467
3504
|
var $ZodCyclicError = class extends Error {
|
|
3468
3505
|
constructor() {
|
|
3469
3506
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3737,7 +3774,7 @@ function isBackEdge(ctx, value) {
|
|
|
3737
3774
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3738
3775
|
}
|
|
3739
3776
|
|
|
3740
|
-
// node_modules/.pnpm/zod@4.6.
|
|
3777
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/en.js
|
|
3741
3778
|
var error = () => {
|
|
3742
3779
|
const Sizable = {
|
|
3743
3780
|
string: { unit: "characters", verb: "to have" },
|
|
@@ -3862,7 +3899,7 @@ function en_default() {
|
|
|
3862
3899
|
};
|
|
3863
3900
|
}
|
|
3864
3901
|
|
|
3865
|
-
// node_modules/.pnpm/zod@4.6.
|
|
3902
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/registries.js
|
|
3866
3903
|
var _a2;
|
|
3867
3904
|
var $ZodRegistry = class {
|
|
3868
3905
|
constructor() {
|
|
@@ -3910,7 +3947,7 @@ function registry() {
|
|
|
3910
3947
|
(_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
|
|
3911
3948
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
3912
3949
|
|
|
3913
|
-
// node_modules/.pnpm/zod@4.6.
|
|
3950
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/api.js
|
|
3914
3951
|
function snapshotChecks(def) {
|
|
3915
3952
|
if (def.checks)
|
|
3916
3953
|
def.checks = [...def.checks];
|
|
@@ -4463,7 +4500,7 @@ function _check(fn, params) {
|
|
|
4463
4500
|
return ch;
|
|
4464
4501
|
}
|
|
4465
4502
|
|
|
4466
|
-
// node_modules/.pnpm/zod@4.6.
|
|
4503
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.js
|
|
4467
4504
|
function assignProps(target, ...sources) {
|
|
4468
4505
|
for (const source of sources) {
|
|
4469
4506
|
for (const key of Reflect.ownKeys(source)) {
|
|
@@ -4993,7 +5030,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
4993
5030
|
return finalize(ctx, schema);
|
|
4994
5031
|
};
|
|
4995
5032
|
|
|
4996
|
-
// node_modules/.pnpm/zod@4.6.
|
|
5033
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.js
|
|
4997
5034
|
var narrowMin = (agg, key, value) => {
|
|
4998
5035
|
if (agg[key] === void 0 || value > agg[key])
|
|
4999
5036
|
agg[key] = value;
|
|
@@ -5741,7 +5778,7 @@ function toJSONSchema(input, params) {
|
|
|
5741
5778
|
return finalize(ctx, input);
|
|
5742
5779
|
}
|
|
5743
5780
|
|
|
5744
|
-
// node_modules/.pnpm/zod@4.6.
|
|
5781
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.js
|
|
5745
5782
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
5746
5783
|
function _lazyMethod(proto, key, make) {
|
|
5747
5784
|
Object.defineProperty(proto, key, {
|
|
@@ -5786,7 +5823,7 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, void 0
|
|
|
5786
5823
|
Parent: Error
|
|
5787
5824
|
});
|
|
5788
5825
|
|
|
5789
|
-
// node_modules/.pnpm/zod@4.6.
|
|
5826
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.js
|
|
5790
5827
|
var parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
5791
5828
|
var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
5792
5829
|
var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -5800,7 +5837,7 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
5800
5837
|
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
5801
5838
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
5802
5839
|
|
|
5803
|
-
// node_modules/.pnpm/zod@4.6.
|
|
5840
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.js
|
|
5804
5841
|
function _ensureDefaultLocale() {
|
|
5805
5842
|
if (!globalConfig.localeError)
|
|
5806
5843
|
config(en_default());
|
|
@@ -6834,7 +6871,7 @@ function preprocess(fn, schema) {
|
|
|
6834
6871
|
});
|
|
6835
6872
|
}
|
|
6836
6873
|
|
|
6837
|
-
// node_modules/.pnpm/zod@4.6.
|
|
6874
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/compat.js
|
|
6838
6875
|
var ZodIssueCode = {
|
|
6839
6876
|
invalid_type: "invalid_type",
|
|
6840
6877
|
too_big: "too_big",
|
|
@@ -6852,7 +6889,7 @@ var ZodFirstPartyTypeKind;
|
|
|
6852
6889
|
/* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
|
|
6853
6890
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
6854
6891
|
|
|
6855
|
-
// node_modules/.pnpm/zod@4.6.
|
|
6892
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/iso.js
|
|
6856
6893
|
var iso_exports = {};
|
|
6857
6894
|
__export(iso_exports, {
|
|
6858
6895
|
ZodISODate: () => ZodISODate,
|
|
@@ -6877,7 +6914,7 @@ function duration2(params) {
|
|
|
6877
6914
|
return _isoDuration(ZodISODuration, params);
|
|
6878
6915
|
}
|
|
6879
6916
|
|
|
6880
|
-
// node_modules/.pnpm/zod@4.6.
|
|
6917
|
+
// node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/coerce.js
|
|
6881
6918
|
var coerce_exports = {};
|
|
6882
6919
|
__export(coerce_exports, {
|
|
6883
6920
|
bigint: () => bigint2,
|
|
@@ -6902,7 +6939,7 @@ function date3(params) {
|
|
|
6902
6939
|
return _coercedDate(ZodDate, params);
|
|
6903
6940
|
}
|
|
6904
6941
|
|
|
6905
|
-
// node_modules/.pnpm/@modelcontextprotocol+core@2.
|
|
6942
|
+
// node_modules/.pnpm/@modelcontextprotocol+core@2.3.1/node_modules/@modelcontextprotocol/core/dist/auth-BNDyLTqp.mjs
|
|
6906
6943
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
6907
6944
|
var DEFAULT_NEGOTIATED_PROTOCOL_VERSION = "2025-03-26";
|
|
6908
6945
|
var SUPPORTED_PROTOCOL_VERSIONS = [
|
|
@@ -7844,7 +7881,7 @@ var OAuthTokenRevocationRequestSchema = object({
|
|
|
7844
7881
|
token_type_hint: string2().optional()
|
|
7845
7882
|
}).strip();
|
|
7846
7883
|
|
|
7847
|
-
// node_modules/.pnpm/@modelcontextprotocol+server@2.
|
|
7884
|
+
// node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/src-Cqbh3MYc.mjs
|
|
7848
7885
|
var BRANDS = /* @__PURE__ */ Symbol.for("mcp.sdk.errorBrands");
|
|
7849
7886
|
function stampErrorBrands(instance, ctor) {
|
|
7850
7887
|
const brands = /* @__PURE__ */ new Set();
|
|
@@ -10114,7 +10151,8 @@ function build() {
|
|
|
10114
10151
|
ListResourceTemplatesResultResponseSchema: wireResultResponse(ListResourceTemplatesResultSchema$1),
|
|
10115
10152
|
ReadResourceResultResponseSchema: wireResultResponse(union([ReadResourceResultSchema$1, InputRequiredResultSchema])),
|
|
10116
10153
|
CompleteResultResponseSchema: wireResultResponse(CompleteResultSchema$1),
|
|
10117
|
-
DiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1)
|
|
10154
|
+
DiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1),
|
|
10155
|
+
SubscriptionsListenResultResponseSchema: wireResultResponse(SubscriptionsListenResultSchema$1)
|
|
10118
10156
|
};
|
|
10119
10157
|
}
|
|
10120
10158
|
var memo2;
|
|
@@ -10622,6 +10660,9 @@ function isSpecRequestMethod(method) {
|
|
|
10622
10660
|
function isSpecNotificationMethod(method) {
|
|
10623
10661
|
return ALL_CODECS.some((codec) => codec.hasNotificationMethod(method));
|
|
10624
10662
|
}
|
|
10663
|
+
function isExtensionReusedRequestMethod(method) {
|
|
10664
|
+
return method === "tasks/get" || method === "tasks/cancel";
|
|
10665
|
+
}
|
|
10625
10666
|
var ALL_CODECS = [rev2025Codec, rev2026Codec];
|
|
10626
10667
|
function isPlainObject$3(value) {
|
|
10627
10668
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -11854,6 +11895,8 @@ var Protocol = class {
|
|
|
11854
11895
|
_transport;
|
|
11855
11896
|
_requestMessageId = 0;
|
|
11856
11897
|
_requestHandlers = /* @__PURE__ */ new Map();
|
|
11898
|
+
/** Methods registered with an explicit schema; the era gate in `_onrequest` reads it for the Tasks extension names. */
|
|
11899
|
+
_customSchemaRequestMethods = /* @__PURE__ */ new Set();
|
|
11857
11900
|
_requestHandlerAbortControllers = /* @__PURE__ */ new Map();
|
|
11858
11901
|
_notificationHandlers = /* @__PURE__ */ new Map();
|
|
11859
11902
|
_responseHandlers = /* @__PURE__ */ new Map();
|
|
@@ -12137,7 +12180,7 @@ var Protocol = class {
|
|
|
12137
12180
|
return;
|
|
12138
12181
|
}
|
|
12139
12182
|
}
|
|
12140
|
-
if (isSpecRequestMethod(request.method) && !codec.hasRequestMethod(request.method)) {
|
|
12183
|
+
if (isSpecRequestMethod(request.method) && !codec.hasRequestMethod(request.method) && !(isExtensionReusedRequestMethod(request.method) && this._customSchemaRequestMethods.has(request.method))) {
|
|
12141
12184
|
sendErrorResponse(ProtocolErrorCode.MethodNotFound, "Method not found");
|
|
12142
12185
|
return;
|
|
12143
12186
|
}
|
|
@@ -12270,8 +12313,11 @@ var Protocol = class {
|
|
|
12270
12313
|
}
|
|
12271
12314
|
request(request, schemaOrOptions, maybeOptions) {
|
|
12272
12315
|
const codec = this._resolveOutboundCodec(request.method);
|
|
12316
|
+
if (isStandardSchema(schemaOrOptions)) {
|
|
12317
|
+
if (!isExtensionReusedRequestMethod(request.method)) this._assertOutboundRequestInEra(codec, request.method);
|
|
12318
|
+
return this._requestWithSchemaViaCodec(codec, request, schemaOrOptions, maybeOptions);
|
|
12319
|
+
}
|
|
12273
12320
|
this._assertOutboundRequestInEra(codec, request.method);
|
|
12274
|
-
if (isStandardSchema(schemaOrOptions)) return this._requestWithSchemaViaCodec(codec, request, schemaOrOptions, maybeOptions);
|
|
12275
12321
|
const validate2 = codecResultValidator(codec, request.method);
|
|
12276
12322
|
if (validate2 === void 0) throw new TypeError(`'${request.method}' is not a spec method; pass a result schema as the second argument to request().`);
|
|
12277
12323
|
return this._requestWithSchemaViaCodec(codec, request, validate2, schemaOrOptions);
|
|
@@ -12515,6 +12561,8 @@ var Protocol = class {
|
|
|
12515
12561
|
return maybeHandler(parsed.data, ctx);
|
|
12516
12562
|
};
|
|
12517
12563
|
else throw new TypeError("setRequestHandler: handler is required");
|
|
12564
|
+
if (typeof schemasOrHandler === "function") this._customSchemaRequestMethods.delete(method);
|
|
12565
|
+
else this._customSchemaRequestMethods.add(method);
|
|
12518
12566
|
this._requestHandlers.set(method, this._wrapHandler(method, stored));
|
|
12519
12567
|
}
|
|
12520
12568
|
/**
|
|
@@ -12544,6 +12592,7 @@ var Protocol = class {
|
|
|
12544
12592
|
*/
|
|
12545
12593
|
removeRequestHandler(method) {
|
|
12546
12594
|
this._requestHandlers.delete(method);
|
|
12595
|
+
this._customSchemaRequestMethods.delete(method);
|
|
12547
12596
|
}
|
|
12548
12597
|
/**
|
|
12549
12598
|
* Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
|
|
@@ -12787,7 +12836,7 @@ function normalizeRawShapeSchema(schema) {
|
|
|
12787
12836
|
return schema;
|
|
12788
12837
|
}
|
|
12789
12838
|
|
|
12790
|
-
// node_modules/.pnpm/@modelcontextprotocol+server@2.
|
|
12839
|
+
// node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs
|
|
12791
12840
|
var require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
12792
12841
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12793
12842
|
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
|
|
@@ -19797,10 +19846,10 @@ var AjvJsonSchemaValidator = class {
|
|
|
19797
19846
|
};
|
|
19798
19847
|
var Ajv = import_ajv.Ajv;
|
|
19799
19848
|
|
|
19800
|
-
// node_modules/.pnpm/@modelcontextprotocol+server@2.
|
|
19849
|
+
// node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs
|
|
19801
19850
|
import process2 from "node:process";
|
|
19802
19851
|
|
|
19803
|
-
// node_modules/.pnpm/@modelcontextprotocol+server@2.
|
|
19852
|
+
// node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/mcp-DIH4cS6P.mjs
|
|
19804
19853
|
var COMPLETABLE_SYMBOL = /* @__PURE__ */ Symbol.for("mcp.completable");
|
|
19805
19854
|
function isCompletable(schema) {
|
|
19806
19855
|
return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
|
|
@@ -20056,7 +20105,7 @@ var StdioListenRouter = class {
|
|
|
20056
20105
|
_serverCapabilities;
|
|
20057
20106
|
/**
|
|
20058
20107
|
* The serving instance's identity, stamped onto the graceful-close
|
|
20059
|
-
* results' `_meta` (the spec's `
|
|
20108
|
+
* results' `_meta` (the spec's `SubscriptionsListenResultMetaObject` extends
|
|
20060
20109
|
* `ResultMetaObject`). Handed over together with the capabilities.
|
|
20061
20110
|
*/
|
|
20062
20111
|
_serverInfo;
|
|
@@ -20469,6 +20518,11 @@ var Server = class extends Protocol {
|
|
|
20469
20518
|
if (modernProtocolVersions(this._supportedProtocolVersions).length > 0) this.setRequestHandler("server/discover", () => this._ondiscover());
|
|
20470
20519
|
if (this._capabilities.logging) this._registerLoggingHandler();
|
|
20471
20520
|
}
|
|
20521
|
+
/** Attaches to the given transport; rejects while this instance is connected to another one. */
|
|
20522
|
+
async connect(transport) {
|
|
20523
|
+
if (this.transport !== void 0) throw new SdkError(SdkErrorCode.AlreadyConnected, "Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");
|
|
20524
|
+
await super.connect(transport);
|
|
20525
|
+
}
|
|
20472
20526
|
/**
|
|
20473
20527
|
* Registers the built-in `logging/setLevel` request handler.
|
|
20474
20528
|
*
|
|
@@ -21022,21 +21076,41 @@ var Server = class extends Protocol {
|
|
|
21022
21076
|
function discoverAdvertisedCapabilities(capabilities) {
|
|
21023
21077
|
return { ...capabilities };
|
|
21024
21078
|
}
|
|
21079
|
+
function toolInputElementCount(value, max) {
|
|
21080
|
+
let count = 0;
|
|
21081
|
+
const stack = [value];
|
|
21082
|
+
while (stack.length > 0) {
|
|
21083
|
+
const node2 = stack.pop();
|
|
21084
|
+
if (node2 === null || typeof node2 !== "object") continue;
|
|
21085
|
+
if (Array.isArray(node2)) for (const child of node2) {
|
|
21086
|
+
if (++count > max) return count;
|
|
21087
|
+
if (child !== null && typeof child === "object") stack.push(child);
|
|
21088
|
+
}
|
|
21089
|
+
else for (const key in node2) {
|
|
21090
|
+
if (!Object.prototype.hasOwnProperty.call(node2, key)) continue;
|
|
21091
|
+
if (++count > max) return count;
|
|
21092
|
+
const child = node2[key];
|
|
21093
|
+
if (child !== null && typeof child === "object") stack.push(child);
|
|
21094
|
+
}
|
|
21095
|
+
}
|
|
21096
|
+
return count;
|
|
21097
|
+
}
|
|
21098
|
+
function resolveMaxToolInputElements(value) {
|
|
21099
|
+
if (value === void 0 || value === Infinity) return void 0;
|
|
21100
|
+
if (typeof value !== "number" || Number.isNaN(value) || value < 1) throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(value)}`);
|
|
21101
|
+
return value;
|
|
21102
|
+
}
|
|
21025
21103
|
var McpServer = class {
|
|
21026
21104
|
/**
|
|
21027
21105
|
* The underlying {@linkcode Server} instance, useful for advanced operations like sending notifications.
|
|
21028
21106
|
*/
|
|
21029
21107
|
server;
|
|
21108
|
+
_maxToolInputElements;
|
|
21030
21109
|
_registeredResources = {};
|
|
21031
21110
|
_registeredResourceTemplates = {};
|
|
21032
21111
|
_registeredTools = {};
|
|
21033
21112
|
_registeredPrompts = {};
|
|
21034
|
-
/**
|
|
21035
|
-
* Per-tool JSON-converted `inputSchema`, memoized so the SEP-2243
|
|
21036
|
-
* registration-time scan and the pre-dispatch validation step share one
|
|
21037
|
-
* conversion instead of paying it twice per request under the
|
|
21038
|
-
* per-request-factory `createMcpHandler` model.
|
|
21039
|
-
*/
|
|
21113
|
+
/** Per-tool JSON-converted `inputSchema`, filled on first use by `toolInputSchemaJson()`. */
|
|
21040
21114
|
_toolInputSchemaJson = {};
|
|
21041
21115
|
/**
|
|
21042
21116
|
* The JSON-serialized `inputSchema` of a registered tool, or `undefined`
|
|
@@ -21061,6 +21135,7 @@ var McpServer = class {
|
|
|
21061
21135
|
}
|
|
21062
21136
|
constructor(serverInfo, options) {
|
|
21063
21137
|
this.server = new Server(serverInfo, options);
|
|
21138
|
+
this._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);
|
|
21064
21139
|
if (options?.capabilities?.tools) this.setToolRequestHandlers();
|
|
21065
21140
|
if (options?.capabilities?.resources) this.setResourceRequestHandlers();
|
|
21066
21141
|
if (options?.capabilities?.prompts) this.setPromptRequestHandlers();
|
|
@@ -21133,7 +21208,7 @@ var McpServer = class {
|
|
|
21133
21208
|
name,
|
|
21134
21209
|
title: tool.title,
|
|
21135
21210
|
description: tool.description,
|
|
21136
|
-
inputSchema: tool.inputSchema ?
|
|
21211
|
+
inputSchema: tool.inputSchema ? convertListedInputSchema(name, tool.inputSchema) : EMPTY_OBJECT_JSON_SCHEMA,
|
|
21137
21212
|
annotations: tool.annotations,
|
|
21138
21213
|
icons: tool.icons,
|
|
21139
21214
|
execution: tool.execution,
|
|
@@ -21178,6 +21253,7 @@ var McpServer = class {
|
|
|
21178
21253
|
* Validates tool input arguments against the tool's input schema.
|
|
21179
21254
|
*/
|
|
21180
21255
|
async validateToolInput(tool, args, toolName) {
|
|
21256
|
+
if (this._maxToolInputElements !== void 0 && toolInputElementCount(args, this._maxToolInputElements) > this._maxToolInputElements) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for tool ${toolName}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);
|
|
21181
21257
|
if (!tool.inputSchema) return;
|
|
21182
21258
|
const parseResult = await validateStandardSchema(tool.inputSchema, args ?? {});
|
|
21183
21259
|
if (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Input validation error: Invalid arguments for tool ${toolName}: ${parseResult.error}`);
|
|
@@ -21452,20 +21528,19 @@ var McpServer = class {
|
|
|
21452
21528
|
}
|
|
21453
21529
|
_createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, icons, execution, scopeChallenge, _meta, handler) {
|
|
21454
21530
|
validateAndWarnToolName(name);
|
|
21455
|
-
if (inputSchema !== void 0) try {
|
|
21456
|
-
const json = standardSchemaToJsonSchema(inputSchema, "input");
|
|
21457
|
-
this._toolInputSchemaJson[name] = json;
|
|
21458
|
-
const scan = scanXMcpHeaderDeclarations(json);
|
|
21459
|
-
if (!scan.valid) console.warn(`[mcp-sdk] tool '${name}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);
|
|
21460
|
-
} catch {
|
|
21461
|
-
}
|
|
21462
21531
|
let currentHandler = handler;
|
|
21532
|
+
let outputSchemaJson;
|
|
21463
21533
|
const registeredTool = {
|
|
21464
21534
|
title,
|
|
21465
21535
|
description,
|
|
21466
21536
|
inputSchema,
|
|
21467
21537
|
outputSchema,
|
|
21468
|
-
outputSchemaJson
|
|
21538
|
+
get outputSchemaJson() {
|
|
21539
|
+
return outputSchemaJson ??= convertOutputSchemaJson(registeredTool.outputSchema);
|
|
21540
|
+
},
|
|
21541
|
+
set outputSchemaJson(value) {
|
|
21542
|
+
outputSchemaJson = value;
|
|
21543
|
+
},
|
|
21469
21544
|
annotations,
|
|
21470
21545
|
icons,
|
|
21471
21546
|
execution,
|
|
@@ -21592,6 +21667,12 @@ var EMPTY_OBJECT_JSON_SCHEMA = {
|
|
|
21592
21667
|
type: "object",
|
|
21593
21668
|
properties: {}
|
|
21594
21669
|
};
|
|
21670
|
+
function convertListedInputSchema(name, inputSchema) {
|
|
21671
|
+
const json = standardSchemaToJsonSchema(inputSchema, "input");
|
|
21672
|
+
const scan = scanXMcpHeaderDeclarations(json);
|
|
21673
|
+
if (!scan.valid) console.warn(`[mcp-sdk] tool '${name}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);
|
|
21674
|
+
return json;
|
|
21675
|
+
}
|
|
21595
21676
|
function convertOutputSchemaJson(outputSchema) {
|
|
21596
21677
|
if (outputSchema === void 0) return void 0;
|
|
21597
21678
|
try {
|
|
@@ -21604,7 +21685,7 @@ function createPromptHandler(name, argsSchema, callback) {
|
|
|
21604
21685
|
if (argsSchema) {
|
|
21605
21686
|
const typedCallback = callback;
|
|
21606
21687
|
return async (args, ctx) => {
|
|
21607
|
-
const parseResult = await validateStandardSchema(argsSchema, args);
|
|
21688
|
+
const parseResult = await validateStandardSchema(argsSchema, args ?? {});
|
|
21608
21689
|
if (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for prompt ${name}: ${parseResult.error}`);
|
|
21609
21690
|
return typedCallback(parseResult.data, ctx);
|
|
21610
21691
|
};
|
|
@@ -21638,7 +21719,7 @@ function unwrapOptionalSchema(schema) {
|
|
|
21638
21719
|
return schema.def?.innerType ?? schema;
|
|
21639
21720
|
}
|
|
21640
21721
|
|
|
21641
|
-
// node_modules/.pnpm/@modelcontextprotocol+server@2.
|
|
21722
|
+
// node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/index.mjs
|
|
21642
21723
|
var PerRequestHTTPServerTransport = class {
|
|
21643
21724
|
onclose;
|
|
21644
21725
|
onerror;
|
|
@@ -21905,6 +21986,7 @@ async function readRequestBody(request, maxBytes = DEFAULT_MAX_REQUEST_BODY_SIZE
|
|
|
21905
21986
|
var WebStandardStreamableHTTPServerTransport = class {
|
|
21906
21987
|
sessionIdGenerator;
|
|
21907
21988
|
_started = false;
|
|
21989
|
+
_hasHandledRequest = false;
|
|
21908
21990
|
_closed = false;
|
|
21909
21991
|
_streamMapping = /* @__PURE__ */ new Map();
|
|
21910
21992
|
_requestToStreamMapping = /* @__PURE__ */ new Map();
|
|
@@ -22026,6 +22108,8 @@ var WebStandardStreamableHTTPServerTransport = class {
|
|
|
22026
22108
|
*/
|
|
22027
22109
|
async handleRequest(req, options) {
|
|
22028
22110
|
if (this._closed) return this.createJsonErrorResponse(404, -32001, "Session not found");
|
|
22111
|
+
if (!this.sessionIdGenerator && this._hasHandledRequest) throw new Error("Stateless transport cannot be reused across requests. Create a new transport per request.");
|
|
22112
|
+
this._hasHandledRequest = true;
|
|
22029
22113
|
const validationError = this.validateRequestHeaders(req);
|
|
22030
22114
|
if (validationError) return validationError;
|
|
22031
22115
|
switch (req.method) {
|
|
@@ -22587,6 +22671,9 @@ function toError(value) {
|
|
|
22587
22671
|
function internalServerErrorResponse(id = null) {
|
|
22588
22672
|
return jsonRpcErrorResponse(500, -32603, "Internal server error", void 0, id);
|
|
22589
22673
|
}
|
|
22674
|
+
function assertNotServing(server) {
|
|
22675
|
+
if (server.transport !== void 0) throw new Error("The factory returned an instance that is still serving another request. Return a new instance for each request.");
|
|
22676
|
+
}
|
|
22590
22677
|
function createLegacyStatelessFallback(factory, onerror, keepAliveMs, maxRequestBodySize) {
|
|
22591
22678
|
return async (request, options) => {
|
|
22592
22679
|
if (request.method.toUpperCase() !== "POST") return jsonRpcErrorResponse(405, -32e3, "Method not allowed.");
|
|
@@ -22767,6 +22854,7 @@ function createMcpHandler(factory, options = {}) {
|
|
|
22767
22854
|
requestInfo: request
|
|
22768
22855
|
});
|
|
22769
22856
|
const server = product instanceof McpServer ? product.server : product;
|
|
22857
|
+
assertNotServing(server);
|
|
22770
22858
|
if (route.messageKind === "request" && route.message.method === "subscriptions/listen") {
|
|
22771
22859
|
const capabilities = server.getCapabilities();
|
|
22772
22860
|
const serverInfo = serverIdentityOf(server);
|
|
@@ -22800,6 +22888,7 @@ function createMcpHandler(factory, options = {}) {
|
|
|
22800
22888
|
reportError(toError(error2));
|
|
22801
22889
|
return internalServerErrorResponse(route.message.id);
|
|
22802
22890
|
}
|
|
22891
|
+
assertNotServing(server);
|
|
22803
22892
|
setNegotiatedProtocolVersion(server, claimedRevision);
|
|
22804
22893
|
installModernOnlyHandlers(server, SUPPORTED_MODERN_PROTOCOL_VERSIONS);
|
|
22805
22894
|
if (meta2 !== void 0) seedClientIdentityFromEnvelope(server, {
|
|
@@ -22897,7 +22986,7 @@ function createMcpHandler(factory, options = {}) {
|
|
|
22897
22986
|
};
|
|
22898
22987
|
}
|
|
22899
22988
|
|
|
22900
|
-
// node_modules/.pnpm/@modelcontextprotocol+server@2.
|
|
22989
|
+
// node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/stdio.mjs
|
|
22901
22990
|
var swallowsErrorsAfterClose = /* @__PURE__ */ Symbol("swallowsErrorsAfterClose");
|
|
22902
22991
|
var StdioServerTransport = class {
|
|
22903
22992
|
_readBuffer;
|
|
@@ -23395,7 +23484,7 @@ function toError2(value) {
|
|
|
23395
23484
|
return value instanceof Error ? value : new Error(String(value));
|
|
23396
23485
|
}
|
|
23397
23486
|
|
|
23398
|
-
// node_modules/.pnpm/mcporter@0.
|
|
23487
|
+
// node_modules/.pnpm/mcporter@0.15.0/node_modules/mcporter/dist/serve.js
|
|
23399
23488
|
var TOOL_SEPARATOR = "__";
|
|
23400
23489
|
var DEFAULT_OBJECT_SCHEMA = { type: "object" };
|
|
23401
23490
|
var DEFAULT_SERVE_HTTP_HOST = "127.0.0.1";
|
|
@@ -23515,8 +23604,16 @@ function createBridgeServer(options) {
|
|
|
23515
23604
|
});
|
|
23516
23605
|
server.server.setRequestHandler("tools/list", async () => {
|
|
23517
23606
|
const tools = [];
|
|
23607
|
+
const failures = [];
|
|
23518
23608
|
for (const served of servedServers) {
|
|
23519
|
-
|
|
23609
|
+
let listed;
|
|
23610
|
+
try {
|
|
23611
|
+
listed = await listRuntimeTools(served.name);
|
|
23612
|
+
} catch (error2) {
|
|
23613
|
+
failures.push(error2);
|
|
23614
|
+
console.warn(`[mcporter] serve: skipping tools from '${served.name}': ${describeError(error2)}`);
|
|
23615
|
+
continue;
|
|
23616
|
+
}
|
|
23520
23617
|
for (const tool of listed) {
|
|
23521
23618
|
const name = bare ? tool.name : encodeToolName(served.name, tool.name);
|
|
23522
23619
|
const outputSchema = normalizeOutputSchema(tool.outputSchema);
|
|
@@ -23532,6 +23629,9 @@ function createBridgeServer(options) {
|
|
|
23532
23629
|
});
|
|
23533
23630
|
}
|
|
23534
23631
|
}
|
|
23632
|
+
if (failures.length === servedServers.length) {
|
|
23633
|
+
throw failures[0];
|
|
23634
|
+
}
|
|
23535
23635
|
return { tools };
|
|
23536
23636
|
});
|
|
23537
23637
|
server.server.setRequestHandler("tools/call", async (request) => {
|
|
@@ -23664,8 +23764,11 @@ function isObjectSchema(schema) {
|
|
|
23664
23764
|
function isSchemaRecord(schema) {
|
|
23665
23765
|
return !!schema && typeof schema === "object" && !Array.isArray(schema);
|
|
23666
23766
|
}
|
|
23767
|
+
function describeError(error2) {
|
|
23768
|
+
return error2 instanceof Error ? error2.message : String(error2);
|
|
23769
|
+
}
|
|
23667
23770
|
|
|
23668
|
-
// node_modules/.pnpm/mcporter@0.
|
|
23771
|
+
// node_modules/.pnpm/mcporter@0.15.0/node_modules/mcporter/dist/cli/serve-command.js
|
|
23669
23772
|
async function handleServeCli(args, options) {
|
|
23670
23773
|
const parsed = parseServeArgs(args);
|
|
23671
23774
|
const elicitation = createNonInteractiveElicitationResponder({
|
|
@@ -23721,7 +23824,11 @@ async function handleServeCli(args, options) {
|
|
|
23721
23824
|
});
|
|
23722
23825
|
});
|
|
23723
23826
|
const address = server.address();
|
|
23724
|
-
|
|
23827
|
+
let location = "listening";
|
|
23828
|
+
if (typeof address === "object" && address) {
|
|
23829
|
+
const host = address.address === "::" ? "localhost" : address.address;
|
|
23830
|
+
location = `http://${host.includes(":") ? `[${host}]` : host}:${address.port}/mcp`;
|
|
23831
|
+
}
|
|
23725
23832
|
console.error(`MCPorter serve HTTP bridge ${location}`);
|
|
23726
23833
|
return;
|
|
23727
23834
|
}
|