@youdotcom-oss/mcp 1.3.10 → 1.4.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/bin/stdio.js +642 -452
- package/dist/search/search.schemas.d.ts +2 -0
- package/dist/search/search.utils.d.ts +2 -0
- package/dist/shared/format-search-results-text.d.ts +1 -1
- package/package.json +6 -6
- package/src/contents/contents.schemas.ts +4 -1
- package/src/express/tests/express.utils.spec.ts +4 -4
- package/src/search/search.schemas.ts +2 -0
- package/src/search/search.utils.ts +15 -10
- package/src/search/tests/search.utils.spec.ts +26 -21
- package/src/shared/format-search-results-text.ts +9 -1
- package/src/tests/tool.spec.ts +2 -2
package/bin/stdio.js
CHANGED
|
@@ -6489,10 +6489,10 @@ var require_dist = __commonJS((exports, module) => {
|
|
|
6489
6489
|
exports.default = formatsPlugin;
|
|
6490
6490
|
});
|
|
6491
6491
|
|
|
6492
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
6492
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
6493
6493
|
import process3 from "node:process";
|
|
6494
6494
|
|
|
6495
|
-
// ../../node_modules/.bun/zod@4.
|
|
6495
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/core/core.js
|
|
6496
6496
|
var NEVER = Object.freeze({
|
|
6497
6497
|
status: "aborted"
|
|
6498
6498
|
});
|
|
@@ -6568,7 +6568,7 @@ function config(newConfig) {
|
|
|
6568
6568
|
Object.assign(globalConfig, newConfig);
|
|
6569
6569
|
return globalConfig;
|
|
6570
6570
|
}
|
|
6571
|
-
// ../../node_modules/.bun/zod@4.
|
|
6571
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/core/util.js
|
|
6572
6572
|
var exports_util = {};
|
|
6573
6573
|
__export(exports_util, {
|
|
6574
6574
|
unwrapMessage: () => unwrapMessage,
|
|
@@ -6587,6 +6587,7 @@ __export(exports_util, {
|
|
|
6587
6587
|
prefixIssues: () => prefixIssues,
|
|
6588
6588
|
pick: () => pick,
|
|
6589
6589
|
partial: () => partial,
|
|
6590
|
+
parsedType: () => parsedType,
|
|
6590
6591
|
optionalKeys: () => optionalKeys,
|
|
6591
6592
|
omit: () => omit,
|
|
6592
6593
|
objectClone: () => objectClone,
|
|
@@ -6944,6 +6945,11 @@ var BIGINT_FORMAT_RANGES = {
|
|
|
6944
6945
|
};
|
|
6945
6946
|
function pick(schema, mask) {
|
|
6946
6947
|
const currDef = schema._zod.def;
|
|
6948
|
+
const checks = currDef.checks;
|
|
6949
|
+
const hasChecks = checks && checks.length > 0;
|
|
6950
|
+
if (hasChecks) {
|
|
6951
|
+
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
6952
|
+
}
|
|
6947
6953
|
const def = mergeDefs(schema._zod.def, {
|
|
6948
6954
|
get shape() {
|
|
6949
6955
|
const newShape = {};
|
|
@@ -6964,6 +6970,11 @@ function pick(schema, mask) {
|
|
|
6964
6970
|
}
|
|
6965
6971
|
function omit(schema, mask) {
|
|
6966
6972
|
const currDef = schema._zod.def;
|
|
6973
|
+
const checks = currDef.checks;
|
|
6974
|
+
const hasChecks = checks && checks.length > 0;
|
|
6975
|
+
if (hasChecks) {
|
|
6976
|
+
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
6977
|
+
}
|
|
6967
6978
|
const def = mergeDefs(schema._zod.def, {
|
|
6968
6979
|
get shape() {
|
|
6969
6980
|
const newShape = { ...schema._zod.def.shape };
|
|
@@ -6989,15 +7000,19 @@ function extend(schema, shape) {
|
|
|
6989
7000
|
const checks = schema._zod.def.checks;
|
|
6990
7001
|
const hasChecks = checks && checks.length > 0;
|
|
6991
7002
|
if (hasChecks) {
|
|
6992
|
-
|
|
7003
|
+
const existingShape = schema._zod.def.shape;
|
|
7004
|
+
for (const key in shape) {
|
|
7005
|
+
if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {
|
|
7006
|
+
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
7007
|
+
}
|
|
7008
|
+
}
|
|
6993
7009
|
}
|
|
6994
7010
|
const def = mergeDefs(schema._zod.def, {
|
|
6995
7011
|
get shape() {
|
|
6996
7012
|
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
6997
7013
|
assignProp(this, "shape", _shape);
|
|
6998
7014
|
return _shape;
|
|
6999
|
-
}
|
|
7000
|
-
checks: []
|
|
7015
|
+
}
|
|
7001
7016
|
});
|
|
7002
7017
|
return clone(schema, def);
|
|
7003
7018
|
}
|
|
@@ -7005,15 +7020,13 @@ function safeExtend(schema, shape) {
|
|
|
7005
7020
|
if (!isPlainObject(shape)) {
|
|
7006
7021
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
7007
7022
|
}
|
|
7008
|
-
const def = {
|
|
7009
|
-
...schema._zod.def,
|
|
7023
|
+
const def = mergeDefs(schema._zod.def, {
|
|
7010
7024
|
get shape() {
|
|
7011
7025
|
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
7012
7026
|
assignProp(this, "shape", _shape);
|
|
7013
7027
|
return _shape;
|
|
7014
|
-
}
|
|
7015
|
-
|
|
7016
|
-
};
|
|
7028
|
+
}
|
|
7029
|
+
});
|
|
7017
7030
|
return clone(schema, def);
|
|
7018
7031
|
}
|
|
7019
7032
|
function merge(a, b) {
|
|
@@ -7031,6 +7044,12 @@ function merge(a, b) {
|
|
|
7031
7044
|
return clone(a, def);
|
|
7032
7045
|
}
|
|
7033
7046
|
function partial(Class, schema, mask) {
|
|
7047
|
+
const currDef = schema._zod.def;
|
|
7048
|
+
const checks = currDef.checks;
|
|
7049
|
+
const hasChecks = checks && checks.length > 0;
|
|
7050
|
+
if (hasChecks) {
|
|
7051
|
+
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
7052
|
+
}
|
|
7034
7053
|
const def = mergeDefs(schema._zod.def, {
|
|
7035
7054
|
get shape() {
|
|
7036
7055
|
const oldShape = schema._zod.def.shape;
|
|
@@ -7089,8 +7108,7 @@ function required(Class, schema, mask) {
|
|
|
7089
7108
|
}
|
|
7090
7109
|
assignProp(this, "shape", shape);
|
|
7091
7110
|
return shape;
|
|
7092
|
-
}
|
|
7093
|
-
checks: []
|
|
7111
|
+
}
|
|
7094
7112
|
});
|
|
7095
7113
|
return clone(schema, def);
|
|
7096
7114
|
}
|
|
@@ -7144,6 +7162,27 @@ function getLengthableOrigin(input) {
|
|
|
7144
7162
|
return "string";
|
|
7145
7163
|
return "unknown";
|
|
7146
7164
|
}
|
|
7165
|
+
function parsedType(data) {
|
|
7166
|
+
const t = typeof data;
|
|
7167
|
+
switch (t) {
|
|
7168
|
+
case "number": {
|
|
7169
|
+
return Number.isNaN(data) ? "nan" : "number";
|
|
7170
|
+
}
|
|
7171
|
+
case "object": {
|
|
7172
|
+
if (data === null) {
|
|
7173
|
+
return "null";
|
|
7174
|
+
}
|
|
7175
|
+
if (Array.isArray(data)) {
|
|
7176
|
+
return "array";
|
|
7177
|
+
}
|
|
7178
|
+
const obj = data;
|
|
7179
|
+
if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) {
|
|
7180
|
+
return obj.constructor.name;
|
|
7181
|
+
}
|
|
7182
|
+
}
|
|
7183
|
+
}
|
|
7184
|
+
return t;
|
|
7185
|
+
}
|
|
7147
7186
|
function issue(...args) {
|
|
7148
7187
|
const [iss, input, inst] = args;
|
|
7149
7188
|
if (typeof iss === "string") {
|
|
@@ -7203,7 +7242,7 @@ class Class {
|
|
|
7203
7242
|
constructor(..._args) {}
|
|
7204
7243
|
}
|
|
7205
7244
|
|
|
7206
|
-
// ../../node_modules/.bun/zod@4.
|
|
7245
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/core/errors.js
|
|
7207
7246
|
var initializer = (inst, def) => {
|
|
7208
7247
|
inst.name = "$ZodError";
|
|
7209
7248
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -7269,7 +7308,7 @@ function formatError(error, mapper = (issue2) => issue2.message) {
|
|
|
7269
7308
|
return fieldErrors;
|
|
7270
7309
|
}
|
|
7271
7310
|
|
|
7272
|
-
// ../../node_modules/.bun/zod@4.
|
|
7311
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/core/parse.js
|
|
7273
7312
|
var _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
7274
7313
|
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
7275
7314
|
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
@@ -7348,7 +7387,7 @@ var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
7348
7387
|
var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
7349
7388
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
7350
7389
|
};
|
|
7351
|
-
// ../../node_modules/.bun/zod@4.
|
|
7390
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/core/regexes.js
|
|
7352
7391
|
var cuid = /^[cC][^\s-]{8,}$/;
|
|
7353
7392
|
var cuid2 = /^[0-9a-z]+$/;
|
|
7354
7393
|
var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
|
|
@@ -7373,7 +7412,7 @@ var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]
|
|
|
7373
7412
|
var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
7374
7413
|
var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
7375
7414
|
var base64url = /^[A-Za-z0-9_-]*$/;
|
|
7376
|
-
var e164 = /^\+
|
|
7415
|
+
var e164 = /^\+[1-9]\d{6,14}$/;
|
|
7377
7416
|
var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
7378
7417
|
var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
|
|
7379
7418
|
function timeSource(args) {
|
|
@@ -7399,13 +7438,13 @@ var string = (params) => {
|
|
|
7399
7438
|
return new RegExp(`^${regex}$`);
|
|
7400
7439
|
};
|
|
7401
7440
|
var integer = /^-?\d+$/;
|
|
7402
|
-
var number = /^-?\d+(?:\.\d+)
|
|
7441
|
+
var number = /^-?\d+(?:\.\d+)?$/;
|
|
7403
7442
|
var boolean = /^(?:true|false)$/i;
|
|
7404
7443
|
var _null = /^null$/i;
|
|
7405
7444
|
var lowercase = /^[^A-Z]*$/;
|
|
7406
7445
|
var uppercase = /^[^a-z]*$/;
|
|
7407
7446
|
|
|
7408
|
-
// ../../node_modules/.bun/zod@4.
|
|
7447
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/core/checks.js
|
|
7409
7448
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
7410
7449
|
var _a;
|
|
7411
7450
|
inst._zod ?? (inst._zod = {});
|
|
@@ -7437,7 +7476,7 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
|
|
|
7437
7476
|
payload.issues.push({
|
|
7438
7477
|
origin,
|
|
7439
7478
|
code: "too_big",
|
|
7440
|
-
maximum: def.value,
|
|
7479
|
+
maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
7441
7480
|
input: payload.value,
|
|
7442
7481
|
inclusive: def.inclusive,
|
|
7443
7482
|
inst,
|
|
@@ -7465,7 +7504,7 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
7465
7504
|
payload.issues.push({
|
|
7466
7505
|
origin,
|
|
7467
7506
|
code: "too_small",
|
|
7468
|
-
minimum: def.value,
|
|
7507
|
+
minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
7469
7508
|
input: payload.value,
|
|
7470
7509
|
inclusive: def.inclusive,
|
|
7471
7510
|
inst,
|
|
@@ -7532,6 +7571,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
7532
7571
|
note: "Integers must be within the safe integer range.",
|
|
7533
7572
|
inst,
|
|
7534
7573
|
origin,
|
|
7574
|
+
inclusive: true,
|
|
7535
7575
|
continue: !def.abort
|
|
7536
7576
|
});
|
|
7537
7577
|
} else {
|
|
@@ -7542,6 +7582,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
7542
7582
|
note: "Integers must be within the safe integer range.",
|
|
7543
7583
|
inst,
|
|
7544
7584
|
origin,
|
|
7585
|
+
inclusive: true,
|
|
7545
7586
|
continue: !def.abort
|
|
7546
7587
|
});
|
|
7547
7588
|
}
|
|
@@ -7565,7 +7606,9 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
7565
7606
|
input,
|
|
7566
7607
|
code: "too_big",
|
|
7567
7608
|
maximum,
|
|
7568
|
-
|
|
7609
|
+
inclusive: true,
|
|
7610
|
+
inst,
|
|
7611
|
+
continue: !def.abort
|
|
7569
7612
|
});
|
|
7570
7613
|
}
|
|
7571
7614
|
};
|
|
@@ -7790,7 +7833,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
7790
7833
|
};
|
|
7791
7834
|
});
|
|
7792
7835
|
|
|
7793
|
-
// ../../node_modules/.bun/zod@4.
|
|
7836
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/core/doc.js
|
|
7794
7837
|
class Doc {
|
|
7795
7838
|
constructor(args = []) {
|
|
7796
7839
|
this.content = [];
|
|
@@ -7828,14 +7871,14 @@ class Doc {
|
|
|
7828
7871
|
}
|
|
7829
7872
|
}
|
|
7830
7873
|
|
|
7831
|
-
// ../../node_modules/.bun/zod@4.
|
|
7874
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/core/versions.js
|
|
7832
7875
|
var version = {
|
|
7833
7876
|
major: 4,
|
|
7834
|
-
minor:
|
|
7835
|
-
patch:
|
|
7877
|
+
minor: 3,
|
|
7878
|
+
patch: 5
|
|
7836
7879
|
};
|
|
7837
7880
|
|
|
7838
|
-
// ../../node_modules/.bun/zod@4.
|
|
7881
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/core/schemas.js
|
|
7839
7882
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
7840
7883
|
var _a;
|
|
7841
7884
|
inst ?? (inst = {});
|
|
@@ -7932,7 +7975,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
7932
7975
|
return runChecks(result, checks, ctx);
|
|
7933
7976
|
};
|
|
7934
7977
|
}
|
|
7935
|
-
inst
|
|
7978
|
+
defineLazy(inst, "~standard", () => ({
|
|
7936
7979
|
validate: (value) => {
|
|
7937
7980
|
try {
|
|
7938
7981
|
const r = safeParse(inst, value);
|
|
@@ -7943,7 +7986,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
7943
7986
|
},
|
|
7944
7987
|
vendor: "zod",
|
|
7945
7988
|
version: 1
|
|
7946
|
-
};
|
|
7989
|
+
}));
|
|
7947
7990
|
});
|
|
7948
7991
|
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
7949
7992
|
$ZodType.init(inst, def);
|
|
@@ -8358,8 +8401,11 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
8358
8401
|
return payload;
|
|
8359
8402
|
};
|
|
8360
8403
|
});
|
|
8361
|
-
function handlePropertyResult(result, final, key, input) {
|
|
8404
|
+
function handlePropertyResult(result, final, key, input, isOptionalOut) {
|
|
8362
8405
|
if (result.issues.length) {
|
|
8406
|
+
if (isOptionalOut && !(key in input)) {
|
|
8407
|
+
return;
|
|
8408
|
+
}
|
|
8363
8409
|
final.issues.push(...prefixIssues(key, result.issues));
|
|
8364
8410
|
}
|
|
8365
8411
|
if (result.value === undefined) {
|
|
@@ -8391,6 +8437,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
8391
8437
|
const keySet = def.keySet;
|
|
8392
8438
|
const _catchall = def.catchall._zod;
|
|
8393
8439
|
const t = _catchall.def.type;
|
|
8440
|
+
const isOptionalOut = _catchall.optout === "optional";
|
|
8394
8441
|
for (const key in input) {
|
|
8395
8442
|
if (keySet.has(key))
|
|
8396
8443
|
continue;
|
|
@@ -8400,9 +8447,9 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
8400
8447
|
}
|
|
8401
8448
|
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
8402
8449
|
if (r instanceof Promise) {
|
|
8403
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
|
|
8450
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalOut)));
|
|
8404
8451
|
} else {
|
|
8405
|
-
handlePropertyResult(r, payload, key, input);
|
|
8452
|
+
handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
8406
8453
|
}
|
|
8407
8454
|
}
|
|
8408
8455
|
if (unrecognized.length) {
|
|
@@ -8468,11 +8515,12 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
8468
8515
|
const shape = value.shape;
|
|
8469
8516
|
for (const key of value.keys) {
|
|
8470
8517
|
const el = shape[key];
|
|
8518
|
+
const isOptionalOut = el._zod.optout === "optional";
|
|
8471
8519
|
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
8472
8520
|
if (r instanceof Promise) {
|
|
8473
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
|
|
8521
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalOut)));
|
|
8474
8522
|
} else {
|
|
8475
|
-
handlePropertyResult(r, payload, key, input);
|
|
8523
|
+
handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
8476
8524
|
}
|
|
8477
8525
|
}
|
|
8478
8526
|
if (!catchall) {
|
|
@@ -8502,8 +8550,31 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
8502
8550
|
for (const key of normalized.keys) {
|
|
8503
8551
|
const id = ids[key];
|
|
8504
8552
|
const k = esc(key);
|
|
8553
|
+
const schema = shape[key];
|
|
8554
|
+
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
8505
8555
|
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
8506
|
-
|
|
8556
|
+
if (isOptionalOut) {
|
|
8557
|
+
doc.write(`
|
|
8558
|
+
if (${id}.issues.length) {
|
|
8559
|
+
if (${k} in input) {
|
|
8560
|
+
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
8561
|
+
...iss,
|
|
8562
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
8563
|
+
})));
|
|
8564
|
+
}
|
|
8565
|
+
}
|
|
8566
|
+
|
|
8567
|
+
if (${id}.value === undefined) {
|
|
8568
|
+
if (${k} in input) {
|
|
8569
|
+
newResult[${k}] = undefined;
|
|
8570
|
+
}
|
|
8571
|
+
} else {
|
|
8572
|
+
newResult[${k}] = ${id}.value;
|
|
8573
|
+
}
|
|
8574
|
+
|
|
8575
|
+
`);
|
|
8576
|
+
} else {
|
|
8577
|
+
doc.write(`
|
|
8507
8578
|
if (${id}.issues.length) {
|
|
8508
8579
|
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
8509
8580
|
...iss,
|
|
@@ -8511,7 +8582,6 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
8511
8582
|
})));
|
|
8512
8583
|
}
|
|
8513
8584
|
|
|
8514
|
-
|
|
8515
8585
|
if (${id}.value === undefined) {
|
|
8516
8586
|
if (${k} in input) {
|
|
8517
8587
|
newResult[${k}] = undefined;
|
|
@@ -8521,6 +8591,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
8521
8591
|
}
|
|
8522
8592
|
|
|
8523
8593
|
`);
|
|
8594
|
+
}
|
|
8524
8595
|
}
|
|
8525
8596
|
doc.write(`payload.value = newResult;`);
|
|
8526
8597
|
doc.write(`return payload;`);
|
|
@@ -8749,11 +8820,34 @@ function mergeValues(a, b) {
|
|
|
8749
8820
|
return { valid: false, mergeErrorPath: [] };
|
|
8750
8821
|
}
|
|
8751
8822
|
function handleIntersectionResults(result, left, right) {
|
|
8752
|
-
|
|
8753
|
-
|
|
8823
|
+
const unrecKeys = new Map;
|
|
8824
|
+
let unrecIssue;
|
|
8825
|
+
for (const iss of left.issues) {
|
|
8826
|
+
if (iss.code === "unrecognized_keys") {
|
|
8827
|
+
unrecIssue ?? (unrecIssue = iss);
|
|
8828
|
+
for (const k of iss.keys) {
|
|
8829
|
+
if (!unrecKeys.has(k))
|
|
8830
|
+
unrecKeys.set(k, {});
|
|
8831
|
+
unrecKeys.get(k).l = true;
|
|
8832
|
+
}
|
|
8833
|
+
} else {
|
|
8834
|
+
result.issues.push(iss);
|
|
8835
|
+
}
|
|
8836
|
+
}
|
|
8837
|
+
for (const iss of right.issues) {
|
|
8838
|
+
if (iss.code === "unrecognized_keys") {
|
|
8839
|
+
for (const k of iss.keys) {
|
|
8840
|
+
if (!unrecKeys.has(k))
|
|
8841
|
+
unrecKeys.set(k, {});
|
|
8842
|
+
unrecKeys.get(k).r = true;
|
|
8843
|
+
}
|
|
8844
|
+
} else {
|
|
8845
|
+
result.issues.push(iss);
|
|
8846
|
+
}
|
|
8754
8847
|
}
|
|
8755
|
-
|
|
8756
|
-
|
|
8848
|
+
const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
|
|
8849
|
+
if (bothKeys.length && unrecIssue) {
|
|
8850
|
+
result.issues.push({ ...unrecIssue, keys: bothKeys });
|
|
8757
8851
|
}
|
|
8758
8852
|
if (aborted(result))
|
|
8759
8853
|
return result;
|
|
@@ -8821,10 +8915,20 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
8821
8915
|
for (const key of Reflect.ownKeys(input)) {
|
|
8822
8916
|
if (key === "__proto__")
|
|
8823
8917
|
continue;
|
|
8824
|
-
|
|
8918
|
+
let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
8825
8919
|
if (keyResult instanceof Promise) {
|
|
8826
8920
|
throw new Error("Async schemas not supported in object keys currently");
|
|
8827
8921
|
}
|
|
8922
|
+
const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length && keyResult.issues.some((iss) => iss.code === "invalid_type" && iss.expected === "number");
|
|
8923
|
+
if (checkNumericKey) {
|
|
8924
|
+
const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
|
|
8925
|
+
if (retryResult instanceof Promise) {
|
|
8926
|
+
throw new Error("Async schemas not supported in object keys currently");
|
|
8927
|
+
}
|
|
8928
|
+
if (retryResult.issues.length === 0) {
|
|
8929
|
+
keyResult = retryResult;
|
|
8930
|
+
}
|
|
8931
|
+
}
|
|
8828
8932
|
if (keyResult.issues.length) {
|
|
8829
8933
|
if (def.mode === "loose") {
|
|
8830
8934
|
payload.value[key] = input[key];
|
|
@@ -8955,6 +9059,14 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
|
8955
9059
|
return def.innerType._zod.run(payload, ctx);
|
|
8956
9060
|
};
|
|
8957
9061
|
});
|
|
9062
|
+
var $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => {
|
|
9063
|
+
$ZodOptional.init(inst, def);
|
|
9064
|
+
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
9065
|
+
defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
|
|
9066
|
+
inst._zod.parse = (payload, ctx) => {
|
|
9067
|
+
return def.innerType._zod.run(payload, ctx);
|
|
9068
|
+
};
|
|
9069
|
+
});
|
|
8958
9070
|
var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
|
|
8959
9071
|
$ZodType.init(inst, def);
|
|
8960
9072
|
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
@@ -9155,38 +9267,19 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
9155
9267
|
payload.issues.push(issue(_iss));
|
|
9156
9268
|
}
|
|
9157
9269
|
}
|
|
9158
|
-
// ../../node_modules/.bun/zod@4.
|
|
9159
|
-
var parsedType = (data) => {
|
|
9160
|
-
const t = typeof data;
|
|
9161
|
-
switch (t) {
|
|
9162
|
-
case "number": {
|
|
9163
|
-
return Number.isNaN(data) ? "NaN" : "number";
|
|
9164
|
-
}
|
|
9165
|
-
case "object": {
|
|
9166
|
-
if (Array.isArray(data)) {
|
|
9167
|
-
return "array";
|
|
9168
|
-
}
|
|
9169
|
-
if (data === null) {
|
|
9170
|
-
return "null";
|
|
9171
|
-
}
|
|
9172
|
-
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
9173
|
-
return data.constructor.name;
|
|
9174
|
-
}
|
|
9175
|
-
}
|
|
9176
|
-
}
|
|
9177
|
-
return t;
|
|
9178
|
-
};
|
|
9270
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/locales/en.js
|
|
9179
9271
|
var error = () => {
|
|
9180
9272
|
const Sizable = {
|
|
9181
9273
|
string: { unit: "characters", verb: "to have" },
|
|
9182
9274
|
file: { unit: "bytes", verb: "to have" },
|
|
9183
9275
|
array: { unit: "items", verb: "to have" },
|
|
9184
|
-
set: { unit: "items", verb: "to have" }
|
|
9276
|
+
set: { unit: "items", verb: "to have" },
|
|
9277
|
+
map: { unit: "entries", verb: "to have" }
|
|
9185
9278
|
};
|
|
9186
9279
|
function getSizing(origin) {
|
|
9187
9280
|
return Sizable[origin] ?? null;
|
|
9188
9281
|
}
|
|
9189
|
-
const
|
|
9282
|
+
const FormatDictionary = {
|
|
9190
9283
|
regex: "input",
|
|
9191
9284
|
email: "email address",
|
|
9192
9285
|
url: "URL",
|
|
@@ -9217,10 +9310,17 @@ var error = () => {
|
|
|
9217
9310
|
jwt: "JWT",
|
|
9218
9311
|
template_literal: "input"
|
|
9219
9312
|
};
|
|
9313
|
+
const TypeDictionary = {
|
|
9314
|
+
nan: "NaN"
|
|
9315
|
+
};
|
|
9220
9316
|
return (issue2) => {
|
|
9221
9317
|
switch (issue2.code) {
|
|
9222
|
-
case "invalid_type":
|
|
9223
|
-
|
|
9318
|
+
case "invalid_type": {
|
|
9319
|
+
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
9320
|
+
const receivedType = parsedType(issue2.input);
|
|
9321
|
+
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
9322
|
+
return `Invalid input: expected ${expected}, received ${received}`;
|
|
9323
|
+
}
|
|
9224
9324
|
case "invalid_value":
|
|
9225
9325
|
if (issue2.values.length === 1)
|
|
9226
9326
|
return `Invalid input: expected ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -9251,7 +9351,7 @@ var error = () => {
|
|
|
9251
9351
|
return `Invalid string: must include "${_issue.includes}"`;
|
|
9252
9352
|
if (_issue.format === "regex")
|
|
9253
9353
|
return `Invalid string: must match pattern ${_issue.pattern}`;
|
|
9254
|
-
return `Invalid ${
|
|
9354
|
+
return `Invalid ${FormatDictionary[_issue.format] ?? issue2.format}`;
|
|
9255
9355
|
}
|
|
9256
9356
|
case "not_multiple_of":
|
|
9257
9357
|
return `Invalid number: must be a multiple of ${issue2.divisor}`;
|
|
@@ -9273,7 +9373,7 @@ function en_default() {
|
|
|
9273
9373
|
localeError: error()
|
|
9274
9374
|
};
|
|
9275
9375
|
}
|
|
9276
|
-
// ../../node_modules/.bun/zod@4.
|
|
9376
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/core/registries.js
|
|
9277
9377
|
var _a;
|
|
9278
9378
|
var $output = Symbol("ZodOutput");
|
|
9279
9379
|
var $input = Symbol("ZodInput");
|
|
@@ -9287,9 +9387,6 @@ class $ZodRegistry {
|
|
|
9287
9387
|
const meta = _meta[0];
|
|
9288
9388
|
this._map.set(schema, meta);
|
|
9289
9389
|
if (meta && typeof meta === "object" && "id" in meta) {
|
|
9290
|
-
if (this._idmap.has(meta.id)) {
|
|
9291
|
-
throw new Error(`ID ${meta.id} already exists in the registry`);
|
|
9292
|
-
}
|
|
9293
9390
|
this._idmap.set(meta.id, schema);
|
|
9294
9391
|
}
|
|
9295
9392
|
return this;
|
|
@@ -9326,7 +9423,7 @@ function registry() {
|
|
|
9326
9423
|
}
|
|
9327
9424
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
9328
9425
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
9329
|
-
// ../../node_modules/.bun/zod@4.
|
|
9426
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/core/api.js
|
|
9330
9427
|
function _string(Class2, params) {
|
|
9331
9428
|
return new Class2({
|
|
9332
9429
|
type: "string",
|
|
@@ -9797,7 +9894,7 @@ function _check(fn, params) {
|
|
|
9797
9894
|
ch._zod.check = fn;
|
|
9798
9895
|
return ch;
|
|
9799
9896
|
}
|
|
9800
|
-
// ../../node_modules/.bun/zod@4.
|
|
9897
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/core/to-json-schema.js
|
|
9801
9898
|
function initializeContext(params) {
|
|
9802
9899
|
let target = params?.target ?? "draft-2020-12";
|
|
9803
9900
|
if (target === "draft-4")
|
|
@@ -9841,12 +9938,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
9841
9938
|
schemaPath: [..._params.schemaPath, schema],
|
|
9842
9939
|
path: _params.path
|
|
9843
9940
|
};
|
|
9844
|
-
|
|
9845
|
-
if (parent) {
|
|
9846
|
-
result.ref = parent;
|
|
9847
|
-
process2(parent, ctx, params);
|
|
9848
|
-
ctx.seen.get(parent).isParent = true;
|
|
9849
|
-
} else if (schema._zod.processJSONSchema) {
|
|
9941
|
+
if (schema._zod.processJSONSchema) {
|
|
9850
9942
|
schema._zod.processJSONSchema(ctx, result.schema, params);
|
|
9851
9943
|
} else {
|
|
9852
9944
|
const _json = result.schema;
|
|
@@ -9856,6 +9948,13 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
9856
9948
|
}
|
|
9857
9949
|
processor(schema, ctx, _json, params);
|
|
9858
9950
|
}
|
|
9951
|
+
const parent = schema._zod.parent;
|
|
9952
|
+
if (parent) {
|
|
9953
|
+
if (!result.ref)
|
|
9954
|
+
result.ref = parent;
|
|
9955
|
+
process2(parent, ctx, params);
|
|
9956
|
+
ctx.seen.get(parent).isParent = true;
|
|
9957
|
+
}
|
|
9859
9958
|
}
|
|
9860
9959
|
const meta = ctx.metadataRegistry.get(schema);
|
|
9861
9960
|
if (meta)
|
|
@@ -9874,6 +9973,17 @@ function extractDefs(ctx, schema) {
|
|
|
9874
9973
|
const root = ctx.seen.get(schema);
|
|
9875
9974
|
if (!root)
|
|
9876
9975
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
9976
|
+
const idToSchema = new Map;
|
|
9977
|
+
for (const entry of ctx.seen.entries()) {
|
|
9978
|
+
const id = ctx.metadataRegistry.get(entry[0])?.id;
|
|
9979
|
+
if (id) {
|
|
9980
|
+
const existing = idToSchema.get(id);
|
|
9981
|
+
if (existing && existing !== entry[0]) {
|
|
9982
|
+
throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
9983
|
+
}
|
|
9984
|
+
idToSchema.set(id, entry[0]);
|
|
9985
|
+
}
|
|
9986
|
+
}
|
|
9877
9987
|
const makeURI = (entry) => {
|
|
9878
9988
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
9879
9989
|
if (ctx.external) {
|
|
@@ -9953,30 +10063,65 @@ function finalize(ctx, schema) {
|
|
|
9953
10063
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
9954
10064
|
const flattenRef = (zodSchema) => {
|
|
9955
10065
|
const seen = ctx.seen.get(zodSchema);
|
|
10066
|
+
if (seen.ref === null)
|
|
10067
|
+
return;
|
|
9956
10068
|
const schema2 = seen.def ?? seen.schema;
|
|
9957
10069
|
const _cached = { ...schema2 };
|
|
9958
|
-
if (seen.ref === null) {
|
|
9959
|
-
return;
|
|
9960
|
-
}
|
|
9961
10070
|
const ref = seen.ref;
|
|
9962
10071
|
seen.ref = null;
|
|
9963
10072
|
if (ref) {
|
|
9964
10073
|
flattenRef(ref);
|
|
9965
|
-
const
|
|
10074
|
+
const refSeen = ctx.seen.get(ref);
|
|
10075
|
+
const refSchema = refSeen.schema;
|
|
9966
10076
|
if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
|
|
9967
10077
|
schema2.allOf = schema2.allOf ?? [];
|
|
9968
10078
|
schema2.allOf.push(refSchema);
|
|
9969
10079
|
} else {
|
|
9970
10080
|
Object.assign(schema2, refSchema);
|
|
9971
|
-
|
|
10081
|
+
}
|
|
10082
|
+
Object.assign(schema2, _cached);
|
|
10083
|
+
const isParentRef = zodSchema._zod.parent === ref;
|
|
10084
|
+
if (isParentRef) {
|
|
10085
|
+
for (const key in schema2) {
|
|
10086
|
+
if (key === "$ref" || key === "allOf")
|
|
10087
|
+
continue;
|
|
10088
|
+
if (!(key in _cached)) {
|
|
10089
|
+
delete schema2[key];
|
|
10090
|
+
}
|
|
10091
|
+
}
|
|
10092
|
+
}
|
|
10093
|
+
if (refSchema.$ref) {
|
|
10094
|
+
for (const key in schema2) {
|
|
10095
|
+
if (key === "$ref" || key === "allOf")
|
|
10096
|
+
continue;
|
|
10097
|
+
if (key in refSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(refSeen.def[key])) {
|
|
10098
|
+
delete schema2[key];
|
|
10099
|
+
}
|
|
10100
|
+
}
|
|
9972
10101
|
}
|
|
9973
10102
|
}
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
10103
|
+
const parent = zodSchema._zod.parent;
|
|
10104
|
+
if (parent && parent !== ref) {
|
|
10105
|
+
flattenRef(parent);
|
|
10106
|
+
const parentSeen = ctx.seen.get(parent);
|
|
10107
|
+
if (parentSeen?.schema.$ref) {
|
|
10108
|
+
schema2.$ref = parentSeen.schema.$ref;
|
|
10109
|
+
if (parentSeen.def) {
|
|
10110
|
+
for (const key in schema2) {
|
|
10111
|
+
if (key === "$ref" || key === "allOf")
|
|
10112
|
+
continue;
|
|
10113
|
+
if (key in parentSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(parentSeen.def[key])) {
|
|
10114
|
+
delete schema2[key];
|
|
10115
|
+
}
|
|
10116
|
+
}
|
|
10117
|
+
}
|
|
10118
|
+
}
|
|
10119
|
+
}
|
|
10120
|
+
ctx.override({
|
|
10121
|
+
zodSchema,
|
|
10122
|
+
jsonSchema: schema2,
|
|
10123
|
+
path: seen.path ?? []
|
|
10124
|
+
});
|
|
9980
10125
|
};
|
|
9981
10126
|
for (const entry of [...ctx.seen.entries()].reverse()) {
|
|
9982
10127
|
flattenRef(entry[0]);
|
|
@@ -10018,8 +10163,8 @@ function finalize(ctx, schema) {
|
|
|
10018
10163
|
value: {
|
|
10019
10164
|
...schema["~standard"],
|
|
10020
10165
|
jsonSchema: {
|
|
10021
|
-
input: createStandardJSONSchemaMethod(schema, "input"),
|
|
10022
|
-
output: createStandardJSONSchemaMethod(schema, "output")
|
|
10166
|
+
input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
|
|
10167
|
+
output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
|
|
10023
10168
|
}
|
|
10024
10169
|
},
|
|
10025
10170
|
enumerable: false,
|
|
@@ -10087,14 +10232,14 @@ var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
|
10087
10232
|
extractDefs(ctx, schema);
|
|
10088
10233
|
return finalize(ctx, schema);
|
|
10089
10234
|
};
|
|
10090
|
-
var createStandardJSONSchemaMethod = (schema, io) => (params) => {
|
|
10235
|
+
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
10091
10236
|
const { libraryOptions, target } = params ?? {};
|
|
10092
|
-
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors
|
|
10237
|
+
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
10093
10238
|
process2(schema, ctx);
|
|
10094
10239
|
extractDefs(ctx, schema);
|
|
10095
10240
|
return finalize(ctx, schema);
|
|
10096
10241
|
};
|
|
10097
|
-
// ../../node_modules/.bun/zod@4.
|
|
10242
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/core/json-schema-processors.js
|
|
10098
10243
|
var formatMap = {
|
|
10099
10244
|
guid: "uuid",
|
|
10100
10245
|
url: "uri",
|
|
@@ -10114,6 +10259,9 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
10114
10259
|
json.format = formatMap[format] ?? format;
|
|
10115
10260
|
if (json.format === "")
|
|
10116
10261
|
delete json.format;
|
|
10262
|
+
if (format === "time") {
|
|
10263
|
+
delete json.format;
|
|
10264
|
+
}
|
|
10117
10265
|
}
|
|
10118
10266
|
if (contentEncoding)
|
|
10119
10267
|
json.contentEncoding = contentEncoding;
|
|
@@ -10294,10 +10442,8 @@ var fileProcessor = (schema, _ctx, json, _params) => {
|
|
|
10294
10442
|
file.contentMediaType = mime[0];
|
|
10295
10443
|
Object.assign(_json, file);
|
|
10296
10444
|
} else {
|
|
10297
|
-
_json
|
|
10298
|
-
|
|
10299
|
-
return mFile;
|
|
10300
|
-
});
|
|
10445
|
+
Object.assign(_json, file);
|
|
10446
|
+
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
10301
10447
|
}
|
|
10302
10448
|
} else {
|
|
10303
10449
|
Object.assign(_json, file);
|
|
@@ -10454,16 +10600,37 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
10454
10600
|
const json = _json;
|
|
10455
10601
|
const def = schema._zod.def;
|
|
10456
10602
|
json.type = "object";
|
|
10457
|
-
|
|
10458
|
-
|
|
10603
|
+
const keyType = def.keyType;
|
|
10604
|
+
const keyBag = keyType._zod.bag;
|
|
10605
|
+
const patterns = keyBag?.patterns;
|
|
10606
|
+
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
10607
|
+
const valueSchema = process2(def.valueType, ctx, {
|
|
10459
10608
|
...params,
|
|
10460
|
-
path: [...params.path, "
|
|
10609
|
+
path: [...params.path, "patternProperties", "*"]
|
|
10610
|
+
});
|
|
10611
|
+
json.patternProperties = {};
|
|
10612
|
+
for (const pattern of patterns) {
|
|
10613
|
+
json.patternProperties[pattern.source] = valueSchema;
|
|
10614
|
+
}
|
|
10615
|
+
} else {
|
|
10616
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
10617
|
+
json.propertyNames = process2(def.keyType, ctx, {
|
|
10618
|
+
...params,
|
|
10619
|
+
path: [...params.path, "propertyNames"]
|
|
10620
|
+
});
|
|
10621
|
+
}
|
|
10622
|
+
json.additionalProperties = process2(def.valueType, ctx, {
|
|
10623
|
+
...params,
|
|
10624
|
+
path: [...params.path, "additionalProperties"]
|
|
10461
10625
|
});
|
|
10462
10626
|
}
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
10466
|
-
|
|
10627
|
+
const keyValues = keyType._zod.values;
|
|
10628
|
+
if (keyValues) {
|
|
10629
|
+
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
10630
|
+
if (validKeyValues.length > 0) {
|
|
10631
|
+
json.required = validKeyValues;
|
|
10632
|
+
}
|
|
10633
|
+
}
|
|
10467
10634
|
};
|
|
10468
10635
|
var nullableProcessor = (schema, ctx, json, params) => {
|
|
10469
10636
|
const def = schema._zod.def;
|
|
@@ -10617,7 +10784,7 @@ function toJSONSchema(input, params) {
|
|
|
10617
10784
|
extractDefs(ctx, input);
|
|
10618
10785
|
return finalize(ctx, input);
|
|
10619
10786
|
}
|
|
10620
|
-
// ../../node_modules/.bun/zod@4.
|
|
10787
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/classic/iso.js
|
|
10621
10788
|
var exports_iso = {};
|
|
10622
10789
|
__export(exports_iso, {
|
|
10623
10790
|
time: () => time2,
|
|
@@ -10658,7 +10825,7 @@ function duration2(params) {
|
|
|
10658
10825
|
return _isoDuration(ZodISODuration, params);
|
|
10659
10826
|
}
|
|
10660
10827
|
|
|
10661
|
-
// ../../node_modules/.bun/zod@4.
|
|
10828
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/classic/errors.js
|
|
10662
10829
|
var initializer2 = (inst, issues) => {
|
|
10663
10830
|
$ZodError.init(inst, issues);
|
|
10664
10831
|
inst.name = "ZodError";
|
|
@@ -10693,7 +10860,7 @@ var ZodRealError = $constructor("ZodError", initializer2, {
|
|
|
10693
10860
|
Parent: Error
|
|
10694
10861
|
});
|
|
10695
10862
|
|
|
10696
|
-
// ../../node_modules/.bun/zod@4.
|
|
10863
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/classic/parse.js
|
|
10697
10864
|
var parse3 = /* @__PURE__ */ _parse(ZodRealError);
|
|
10698
10865
|
var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
10699
10866
|
var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -10707,7 +10874,7 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
10707
10874
|
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
10708
10875
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
10709
10876
|
|
|
10710
|
-
// ../../node_modules/.bun/zod@4.
|
|
10877
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/classic/schemas.js
|
|
10711
10878
|
var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
10712
10879
|
$ZodType.init(inst, def);
|
|
10713
10880
|
Object.assign(inst["~standard"], {
|
|
@@ -10726,8 +10893,11 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
10726
10893
|
...def.checks ?? [],
|
|
10727
10894
|
...checks2.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
10728
10895
|
]
|
|
10729
|
-
})
|
|
10896
|
+
}), {
|
|
10897
|
+
parent: true
|
|
10898
|
+
});
|
|
10730
10899
|
};
|
|
10900
|
+
inst.with = inst.check;
|
|
10731
10901
|
inst.clone = (def2, params) => clone(inst, def2, params);
|
|
10732
10902
|
inst.brand = () => inst;
|
|
10733
10903
|
inst.register = (reg, meta2) => {
|
|
@@ -10751,6 +10921,7 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
10751
10921
|
inst.superRefine = (refinement) => inst.check(superRefine(refinement));
|
|
10752
10922
|
inst.overwrite = (fn) => inst.check(_overwrite(fn));
|
|
10753
10923
|
inst.optional = () => optional(inst);
|
|
10924
|
+
inst.exactOptional = () => exactOptional(inst);
|
|
10754
10925
|
inst.nullable = () => nullable(inst);
|
|
10755
10926
|
inst.nullish = () => optional(nullable(inst));
|
|
10756
10927
|
inst.nonoptional = (params) => nonoptional(inst, params);
|
|
@@ -10784,6 +10955,7 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
10784
10955
|
};
|
|
10785
10956
|
inst.isOptional = () => inst.safeParse(undefined).success;
|
|
10786
10957
|
inst.isNullable = () => inst.safeParse(null).success;
|
|
10958
|
+
inst.apply = (fn) => fn(inst);
|
|
10787
10959
|
return inst;
|
|
10788
10960
|
});
|
|
10789
10961
|
var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
@@ -11224,6 +11396,18 @@ function optional(innerType) {
|
|
|
11224
11396
|
innerType
|
|
11225
11397
|
});
|
|
11226
11398
|
}
|
|
11399
|
+
var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
|
|
11400
|
+
$ZodExactOptional.init(inst, def);
|
|
11401
|
+
ZodType.init(inst, def);
|
|
11402
|
+
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
11403
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
11404
|
+
});
|
|
11405
|
+
function exactOptional(innerType) {
|
|
11406
|
+
return new ZodExactOptional({
|
|
11407
|
+
type: "optional",
|
|
11408
|
+
innerType
|
|
11409
|
+
});
|
|
11410
|
+
}
|
|
11227
11411
|
var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
|
|
11228
11412
|
$ZodNullable.init(inst, def);
|
|
11229
11413
|
ZodType.init(inst, def);
|
|
@@ -11337,10 +11521,10 @@ function superRefine(fn) {
|
|
|
11337
11521
|
function preprocess(fn, schema) {
|
|
11338
11522
|
return pipe(transform(fn), schema);
|
|
11339
11523
|
}
|
|
11340
|
-
// ../../node_modules/.bun/zod@4.
|
|
11524
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/classic/external.js
|
|
11341
11525
|
config(en_default());
|
|
11342
11526
|
|
|
11343
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
11527
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
11344
11528
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
11345
11529
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
11346
11530
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
@@ -11352,34 +11536,36 @@ var TaskCreationParamsSchema = looseObject({
|
|
|
11352
11536
|
ttl: union([number2(), _null3()]).optional(),
|
|
11353
11537
|
pollInterval: number2().optional()
|
|
11354
11538
|
});
|
|
11355
|
-
var
|
|
11539
|
+
var TaskMetadataSchema = object({
|
|
11540
|
+
ttl: number2().optional()
|
|
11541
|
+
});
|
|
11542
|
+
var RelatedTaskMetadataSchema = object({
|
|
11356
11543
|
taskId: string2()
|
|
11357
11544
|
});
|
|
11358
11545
|
var RequestMetaSchema = looseObject({
|
|
11359
11546
|
progressToken: ProgressTokenSchema.optional(),
|
|
11360
11547
|
[RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
|
|
11361
11548
|
});
|
|
11362
|
-
var BaseRequestParamsSchema =
|
|
11363
|
-
task: TaskCreationParamsSchema.optional(),
|
|
11549
|
+
var BaseRequestParamsSchema = object({
|
|
11364
11550
|
_meta: RequestMetaSchema.optional()
|
|
11365
11551
|
});
|
|
11552
|
+
var TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
11553
|
+
task: TaskMetadataSchema.optional()
|
|
11554
|
+
});
|
|
11555
|
+
var isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
|
|
11366
11556
|
var RequestSchema = object({
|
|
11367
11557
|
method: string2(),
|
|
11368
|
-
params: BaseRequestParamsSchema.optional()
|
|
11558
|
+
params: BaseRequestParamsSchema.loose().optional()
|
|
11369
11559
|
});
|
|
11370
|
-
var NotificationsParamsSchema =
|
|
11371
|
-
_meta:
|
|
11372
|
-
[RELATED_TASK_META_KEY]: optional(RelatedTaskMetadataSchema)
|
|
11373
|
-
}).passthrough().optional()
|
|
11560
|
+
var NotificationsParamsSchema = object({
|
|
11561
|
+
_meta: RequestMetaSchema.optional()
|
|
11374
11562
|
});
|
|
11375
11563
|
var NotificationSchema = object({
|
|
11376
11564
|
method: string2(),
|
|
11377
|
-
params: NotificationsParamsSchema.optional()
|
|
11565
|
+
params: NotificationsParamsSchema.loose().optional()
|
|
11378
11566
|
});
|
|
11379
11567
|
var ResultSchema = looseObject({
|
|
11380
|
-
_meta:
|
|
11381
|
-
[RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
|
|
11382
|
-
}).optional()
|
|
11568
|
+
_meta: RequestMetaSchema.optional()
|
|
11383
11569
|
});
|
|
11384
11570
|
var RequestIdSchema = union([string2(), number2().int()]);
|
|
11385
11571
|
var JSONRPCRequestSchema = object({
|
|
@@ -11393,12 +11579,12 @@ var JSONRPCNotificationSchema = object({
|
|
|
11393
11579
|
...NotificationSchema.shape
|
|
11394
11580
|
}).strict();
|
|
11395
11581
|
var isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
|
|
11396
|
-
var
|
|
11582
|
+
var JSONRPCResultResponseSchema = object({
|
|
11397
11583
|
jsonrpc: literal(JSONRPC_VERSION),
|
|
11398
11584
|
id: RequestIdSchema,
|
|
11399
11585
|
result: ResultSchema
|
|
11400
11586
|
}).strict();
|
|
11401
|
-
var
|
|
11587
|
+
var isJSONRPCResultResponse = (value) => JSONRPCResultResponseSchema.safeParse(value).success;
|
|
11402
11588
|
var ErrorCode;
|
|
11403
11589
|
(function(ErrorCode2) {
|
|
11404
11590
|
ErrorCode2[ErrorCode2["ConnectionClosed"] = -32000] = "ConnectionClosed";
|
|
@@ -11410,20 +11596,26 @@ var ErrorCode;
|
|
|
11410
11596
|
ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
|
|
11411
11597
|
ErrorCode2[ErrorCode2["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
|
|
11412
11598
|
})(ErrorCode || (ErrorCode = {}));
|
|
11413
|
-
var
|
|
11599
|
+
var JSONRPCErrorResponseSchema = object({
|
|
11414
11600
|
jsonrpc: literal(JSONRPC_VERSION),
|
|
11415
|
-
id: RequestIdSchema,
|
|
11601
|
+
id: RequestIdSchema.optional(),
|
|
11416
11602
|
error: object({
|
|
11417
11603
|
code: number2().int(),
|
|
11418
11604
|
message: string2(),
|
|
11419
|
-
data:
|
|
11605
|
+
data: unknown().optional()
|
|
11420
11606
|
})
|
|
11421
11607
|
}).strict();
|
|
11422
|
-
var
|
|
11423
|
-
var JSONRPCMessageSchema = union([
|
|
11608
|
+
var isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
|
|
11609
|
+
var JSONRPCMessageSchema = union([
|
|
11610
|
+
JSONRPCRequestSchema,
|
|
11611
|
+
JSONRPCNotificationSchema,
|
|
11612
|
+
JSONRPCResultResponseSchema,
|
|
11613
|
+
JSONRPCErrorResponseSchema
|
|
11614
|
+
]);
|
|
11615
|
+
var JSONRPCResponseSchema = union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
|
|
11424
11616
|
var EmptyResultSchema = ResultSchema.strict();
|
|
11425
11617
|
var CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
11426
|
-
requestId: RequestIdSchema,
|
|
11618
|
+
requestId: RequestIdSchema.optional(),
|
|
11427
11619
|
reason: string2().optional()
|
|
11428
11620
|
});
|
|
11429
11621
|
var CancelledNotificationSchema = NotificationSchema.extend({
|
|
@@ -11433,7 +11625,8 @@ var CancelledNotificationSchema = NotificationSchema.extend({
|
|
|
11433
11625
|
var IconSchema = object({
|
|
11434
11626
|
src: string2(),
|
|
11435
11627
|
mimeType: string2().optional(),
|
|
11436
|
-
sizes: array(string2()).optional()
|
|
11628
|
+
sizes: array(string2()).optional(),
|
|
11629
|
+
theme: _enum(["light", "dark"]).optional()
|
|
11437
11630
|
});
|
|
11438
11631
|
var IconsSchema = object({
|
|
11439
11632
|
icons: array(IconSchema).optional()
|
|
@@ -11446,7 +11639,8 @@ var ImplementationSchema = BaseMetadataSchema.extend({
|
|
|
11446
11639
|
...BaseMetadataSchema.shape,
|
|
11447
11640
|
...IconsSchema.shape,
|
|
11448
11641
|
version: string2(),
|
|
11449
|
-
websiteUrl: string2().optional()
|
|
11642
|
+
websiteUrl: string2().optional(),
|
|
11643
|
+
description: string2().optional()
|
|
11450
11644
|
});
|
|
11451
11645
|
var FormElicitationCapabilitySchema = intersection(object({
|
|
11452
11646
|
applyDefaults: boolean2().optional()
|
|
@@ -11462,27 +11656,27 @@ var ElicitationCapabilitySchema = preprocess((value) => {
|
|
|
11462
11656
|
form: FormElicitationCapabilitySchema.optional(),
|
|
11463
11657
|
url: AssertObjectSchema.optional()
|
|
11464
11658
|
}), record(string2(), unknown()).optional()));
|
|
11465
|
-
var ClientTasksCapabilitySchema =
|
|
11466
|
-
list: optional(
|
|
11467
|
-
cancel: optional(
|
|
11468
|
-
requests:
|
|
11469
|
-
sampling:
|
|
11470
|
-
createMessage: optional(
|
|
11471
|
-
}).
|
|
11472
|
-
elicitation:
|
|
11473
|
-
create: optional(
|
|
11474
|
-
}).
|
|
11475
|
-
}).
|
|
11476
|
-
})
|
|
11477
|
-
var ServerTasksCapabilitySchema =
|
|
11478
|
-
list: optional(
|
|
11479
|
-
cancel: optional(
|
|
11480
|
-
requests:
|
|
11481
|
-
tools:
|
|
11482
|
-
call: optional(
|
|
11483
|
-
}).
|
|
11484
|
-
}).
|
|
11485
|
-
})
|
|
11659
|
+
var ClientTasksCapabilitySchema = looseObject({
|
|
11660
|
+
list: AssertObjectSchema.optional(),
|
|
11661
|
+
cancel: AssertObjectSchema.optional(),
|
|
11662
|
+
requests: looseObject({
|
|
11663
|
+
sampling: looseObject({
|
|
11664
|
+
createMessage: AssertObjectSchema.optional()
|
|
11665
|
+
}).optional(),
|
|
11666
|
+
elicitation: looseObject({
|
|
11667
|
+
create: AssertObjectSchema.optional()
|
|
11668
|
+
}).optional()
|
|
11669
|
+
}).optional()
|
|
11670
|
+
});
|
|
11671
|
+
var ServerTasksCapabilitySchema = looseObject({
|
|
11672
|
+
list: AssertObjectSchema.optional(),
|
|
11673
|
+
cancel: AssertObjectSchema.optional(),
|
|
11674
|
+
requests: looseObject({
|
|
11675
|
+
tools: looseObject({
|
|
11676
|
+
call: AssertObjectSchema.optional()
|
|
11677
|
+
}).optional()
|
|
11678
|
+
}).optional()
|
|
11679
|
+
});
|
|
11486
11680
|
var ClientCapabilitiesSchema = object({
|
|
11487
11681
|
experimental: record(string2(), AssertObjectSchema).optional(),
|
|
11488
11682
|
sampling: object({
|
|
@@ -11493,7 +11687,7 @@ var ClientCapabilitiesSchema = object({
|
|
|
11493
11687
|
roots: object({
|
|
11494
11688
|
listChanged: boolean2().optional()
|
|
11495
11689
|
}).optional(),
|
|
11496
|
-
tasks: optional(
|
|
11690
|
+
tasks: ClientTasksCapabilitySchema.optional()
|
|
11497
11691
|
});
|
|
11498
11692
|
var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
11499
11693
|
protocolVersion: string2(),
|
|
@@ -11508,9 +11702,9 @@ var ServerCapabilitiesSchema = object({
|
|
|
11508
11702
|
experimental: record(string2(), AssertObjectSchema).optional(),
|
|
11509
11703
|
logging: AssertObjectSchema.optional(),
|
|
11510
11704
|
completions: AssertObjectSchema.optional(),
|
|
11511
|
-
prompts:
|
|
11512
|
-
listChanged:
|
|
11513
|
-
})),
|
|
11705
|
+
prompts: object({
|
|
11706
|
+
listChanged: boolean2().optional()
|
|
11707
|
+
}).optional(),
|
|
11514
11708
|
resources: object({
|
|
11515
11709
|
subscribe: boolean2().optional(),
|
|
11516
11710
|
listChanged: boolean2().optional()
|
|
@@ -11518,8 +11712,8 @@ var ServerCapabilitiesSchema = object({
|
|
|
11518
11712
|
tools: object({
|
|
11519
11713
|
listChanged: boolean2().optional()
|
|
11520
11714
|
}).optional(),
|
|
11521
|
-
tasks: optional(
|
|
11522
|
-
})
|
|
11715
|
+
tasks: ServerTasksCapabilitySchema.optional()
|
|
11716
|
+
});
|
|
11523
11717
|
var InitializeResultSchema = ResultSchema.extend({
|
|
11524
11718
|
protocolVersion: string2(),
|
|
11525
11719
|
capabilities: ServerCapabilitiesSchema,
|
|
@@ -11527,10 +11721,12 @@ var InitializeResultSchema = ResultSchema.extend({
|
|
|
11527
11721
|
instructions: string2().optional()
|
|
11528
11722
|
});
|
|
11529
11723
|
var InitializedNotificationSchema = NotificationSchema.extend({
|
|
11530
|
-
method: literal("notifications/initialized")
|
|
11724
|
+
method: literal("notifications/initialized"),
|
|
11725
|
+
params: NotificationsParamsSchema.optional()
|
|
11531
11726
|
});
|
|
11532
11727
|
var PingRequestSchema = RequestSchema.extend({
|
|
11533
|
-
method: literal("ping")
|
|
11728
|
+
method: literal("ping"),
|
|
11729
|
+
params: BaseRequestParamsSchema.optional()
|
|
11534
11730
|
});
|
|
11535
11731
|
var ProgressSchema = object({
|
|
11536
11732
|
progress: number2(),
|
|
@@ -11553,11 +11749,12 @@ var PaginatedRequestSchema = RequestSchema.extend({
|
|
|
11553
11749
|
params: PaginatedRequestParamsSchema.optional()
|
|
11554
11750
|
});
|
|
11555
11751
|
var PaginatedResultSchema = ResultSchema.extend({
|
|
11556
|
-
nextCursor: optional(
|
|
11752
|
+
nextCursor: CursorSchema.optional()
|
|
11557
11753
|
});
|
|
11754
|
+
var TaskStatusSchema = _enum(["working", "input_required", "completed", "failed", "cancelled"]);
|
|
11558
11755
|
var TaskSchema = object({
|
|
11559
11756
|
taskId: string2(),
|
|
11560
|
-
status:
|
|
11757
|
+
status: TaskStatusSchema,
|
|
11561
11758
|
ttl: union([number2(), _null3()]),
|
|
11562
11759
|
createdAt: string2(),
|
|
11563
11760
|
lastUpdatedAt: string2(),
|
|
@@ -11585,6 +11782,7 @@ var GetTaskPayloadRequestSchema = RequestSchema.extend({
|
|
|
11585
11782
|
taskId: string2()
|
|
11586
11783
|
})
|
|
11587
11784
|
});
|
|
11785
|
+
var GetTaskPayloadResultSchema = ResultSchema.loose();
|
|
11588
11786
|
var ListTasksRequestSchema = PaginatedRequestSchema.extend({
|
|
11589
11787
|
method: literal("tasks/list")
|
|
11590
11788
|
});
|
|
@@ -11610,15 +11808,16 @@ var Base64Schema = string2().refine((val) => {
|
|
|
11610
11808
|
try {
|
|
11611
11809
|
atob(val);
|
|
11612
11810
|
return true;
|
|
11613
|
-
} catch
|
|
11811
|
+
} catch {
|
|
11614
11812
|
return false;
|
|
11615
11813
|
}
|
|
11616
11814
|
}, { message: "Invalid Base64 string" });
|
|
11617
11815
|
var BlobResourceContentsSchema = ResourceContentsSchema.extend({
|
|
11618
11816
|
blob: Base64Schema
|
|
11619
11817
|
});
|
|
11818
|
+
var RoleSchema = _enum(["user", "assistant"]);
|
|
11620
11819
|
var AnnotationsSchema = object({
|
|
11621
|
-
audience: array(
|
|
11820
|
+
audience: array(RoleSchema).optional(),
|
|
11622
11821
|
priority: number2().min(0).max(1).optional(),
|
|
11623
11822
|
lastModified: exports_iso.datetime({ offset: true }).optional()
|
|
11624
11823
|
});
|
|
@@ -11664,7 +11863,8 @@ var ReadResourceResultSchema = ResultSchema.extend({
|
|
|
11664
11863
|
contents: array(union([TextResourceContentsSchema, BlobResourceContentsSchema]))
|
|
11665
11864
|
});
|
|
11666
11865
|
var ResourceListChangedNotificationSchema = NotificationSchema.extend({
|
|
11667
|
-
method: literal("notifications/resources/list_changed")
|
|
11866
|
+
method: literal("notifications/resources/list_changed"),
|
|
11867
|
+
params: NotificationsParamsSchema.optional()
|
|
11668
11868
|
});
|
|
11669
11869
|
var SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
11670
11870
|
var SubscribeRequestSchema = RequestSchema.extend({
|
|
@@ -11733,9 +11933,9 @@ var ToolUseContentSchema = object({
|
|
|
11733
11933
|
type: literal("tool_use"),
|
|
11734
11934
|
name: string2(),
|
|
11735
11935
|
id: string2(),
|
|
11736
|
-
input:
|
|
11737
|
-
_meta:
|
|
11738
|
-
})
|
|
11936
|
+
input: record(string2(), unknown()),
|
|
11937
|
+
_meta: record(string2(), unknown()).optional()
|
|
11938
|
+
});
|
|
11739
11939
|
var EmbeddedResourceSchema = object({
|
|
11740
11940
|
type: literal("resource"),
|
|
11741
11941
|
resource: union([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
@@ -11753,15 +11953,16 @@ var ContentBlockSchema = union([
|
|
|
11753
11953
|
EmbeddedResourceSchema
|
|
11754
11954
|
]);
|
|
11755
11955
|
var PromptMessageSchema = object({
|
|
11756
|
-
role:
|
|
11956
|
+
role: RoleSchema,
|
|
11757
11957
|
content: ContentBlockSchema
|
|
11758
11958
|
});
|
|
11759
11959
|
var GetPromptResultSchema = ResultSchema.extend({
|
|
11760
|
-
description:
|
|
11960
|
+
description: string2().optional(),
|
|
11761
11961
|
messages: array(PromptMessageSchema)
|
|
11762
11962
|
});
|
|
11763
11963
|
var PromptListChangedNotificationSchema = NotificationSchema.extend({
|
|
11764
|
-
method: literal("notifications/prompts/list_changed")
|
|
11964
|
+
method: literal("notifications/prompts/list_changed"),
|
|
11965
|
+
params: NotificationsParamsSchema.optional()
|
|
11765
11966
|
});
|
|
11766
11967
|
var ToolAnnotationsSchema = object({
|
|
11767
11968
|
title: string2().optional(),
|
|
@@ -11787,8 +11988,8 @@ var ToolSchema = object({
|
|
|
11787
11988
|
properties: record(string2(), AssertObjectSchema).optional(),
|
|
11788
11989
|
required: array(string2()).optional()
|
|
11789
11990
|
}).catchall(unknown()).optional(),
|
|
11790
|
-
annotations: optional(
|
|
11791
|
-
execution: optional(
|
|
11991
|
+
annotations: ToolAnnotationsSchema.optional(),
|
|
11992
|
+
execution: ToolExecutionSchema.optional(),
|
|
11792
11993
|
_meta: record(string2(), unknown()).optional()
|
|
11793
11994
|
});
|
|
11794
11995
|
var ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
@@ -11800,21 +12001,26 @@ var ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
|
11800
12001
|
var CallToolResultSchema = ResultSchema.extend({
|
|
11801
12002
|
content: array(ContentBlockSchema).default([]),
|
|
11802
12003
|
structuredContent: record(string2(), unknown()).optional(),
|
|
11803
|
-
isError:
|
|
12004
|
+
isError: boolean2().optional()
|
|
11804
12005
|
});
|
|
11805
12006
|
var CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
|
|
11806
12007
|
toolResult: unknown()
|
|
11807
12008
|
}));
|
|
11808
|
-
var CallToolRequestParamsSchema =
|
|
12009
|
+
var CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
11809
12010
|
name: string2(),
|
|
11810
|
-
arguments:
|
|
12011
|
+
arguments: record(string2(), unknown()).optional()
|
|
11811
12012
|
});
|
|
11812
12013
|
var CallToolRequestSchema = RequestSchema.extend({
|
|
11813
12014
|
method: literal("tools/call"),
|
|
11814
12015
|
params: CallToolRequestParamsSchema
|
|
11815
12016
|
});
|
|
11816
12017
|
var ToolListChangedNotificationSchema = NotificationSchema.extend({
|
|
11817
|
-
method: literal("notifications/tools/list_changed")
|
|
12018
|
+
method: literal("notifications/tools/list_changed"),
|
|
12019
|
+
params: NotificationsParamsSchema.optional()
|
|
12020
|
+
});
|
|
12021
|
+
var ListChangedOptionsBaseSchema = object({
|
|
12022
|
+
autoRefresh: boolean2().default(true),
|
|
12023
|
+
debounceMs: number2().int().nonnegative().default(300)
|
|
11818
12024
|
});
|
|
11819
12025
|
var LoggingLevelSchema = _enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
|
11820
12026
|
var SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
@@ -11837,22 +12043,22 @@ var ModelHintSchema = object({
|
|
|
11837
12043
|
name: string2().optional()
|
|
11838
12044
|
});
|
|
11839
12045
|
var ModelPreferencesSchema = object({
|
|
11840
|
-
hints:
|
|
11841
|
-
costPriority:
|
|
11842
|
-
speedPriority:
|
|
11843
|
-
intelligencePriority:
|
|
12046
|
+
hints: array(ModelHintSchema).optional(),
|
|
12047
|
+
costPriority: number2().min(0).max(1).optional(),
|
|
12048
|
+
speedPriority: number2().min(0).max(1).optional(),
|
|
12049
|
+
intelligencePriority: number2().min(0).max(1).optional()
|
|
11844
12050
|
});
|
|
11845
12051
|
var ToolChoiceSchema = object({
|
|
11846
|
-
mode:
|
|
12052
|
+
mode: _enum(["auto", "required", "none"]).optional()
|
|
11847
12053
|
});
|
|
11848
12054
|
var ToolResultContentSchema = object({
|
|
11849
12055
|
type: literal("tool_result"),
|
|
11850
12056
|
toolUseId: string2().describe("The unique identifier for the corresponding tool call."),
|
|
11851
12057
|
content: array(ContentBlockSchema).default([]),
|
|
11852
|
-
structuredContent: object({}).
|
|
11853
|
-
isError:
|
|
11854
|
-
_meta:
|
|
11855
|
-
})
|
|
12058
|
+
structuredContent: object({}).loose().optional(),
|
|
12059
|
+
isError: boolean2().optional(),
|
|
12060
|
+
_meta: record(string2(), unknown()).optional()
|
|
12061
|
+
});
|
|
11856
12062
|
var SamplingContentSchema = discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
|
|
11857
12063
|
var SamplingMessageContentBlockSchema = discriminatedUnion("type", [
|
|
11858
12064
|
TextContentSchema,
|
|
@@ -11862,11 +12068,11 @@ var SamplingMessageContentBlockSchema = discriminatedUnion("type", [
|
|
|
11862
12068
|
ToolResultContentSchema
|
|
11863
12069
|
]);
|
|
11864
12070
|
var SamplingMessageSchema = object({
|
|
11865
|
-
role:
|
|
12071
|
+
role: RoleSchema,
|
|
11866
12072
|
content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)]),
|
|
11867
|
-
_meta:
|
|
11868
|
-
})
|
|
11869
|
-
var CreateMessageRequestParamsSchema =
|
|
12073
|
+
_meta: record(string2(), unknown()).optional()
|
|
12074
|
+
});
|
|
12075
|
+
var CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
11870
12076
|
messages: array(SamplingMessageSchema),
|
|
11871
12077
|
modelPreferences: ModelPreferencesSchema.optional(),
|
|
11872
12078
|
systemPrompt: string2().optional(),
|
|
@@ -11875,8 +12081,8 @@ var CreateMessageRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
|
11875
12081
|
maxTokens: number2().int(),
|
|
11876
12082
|
stopSequences: array(string2()).optional(),
|
|
11877
12083
|
metadata: AssertObjectSchema.optional(),
|
|
11878
|
-
tools:
|
|
11879
|
-
toolChoice: optional(
|
|
12084
|
+
tools: array(ToolSchema).optional(),
|
|
12085
|
+
toolChoice: ToolChoiceSchema.optional()
|
|
11880
12086
|
});
|
|
11881
12087
|
var CreateMessageRequestSchema = RequestSchema.extend({
|
|
11882
12088
|
method: literal("sampling/createMessage"),
|
|
@@ -11885,13 +12091,13 @@ var CreateMessageRequestSchema = RequestSchema.extend({
|
|
|
11885
12091
|
var CreateMessageResultSchema = ResultSchema.extend({
|
|
11886
12092
|
model: string2(),
|
|
11887
12093
|
stopReason: optional(_enum(["endTurn", "stopSequence", "maxTokens"]).or(string2())),
|
|
11888
|
-
role:
|
|
12094
|
+
role: RoleSchema,
|
|
11889
12095
|
content: SamplingContentSchema
|
|
11890
12096
|
});
|
|
11891
12097
|
var CreateMessageResultWithToolsSchema = ResultSchema.extend({
|
|
11892
12098
|
model: string2(),
|
|
11893
12099
|
stopReason: optional(_enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(string2())),
|
|
11894
|
-
role:
|
|
12100
|
+
role: RoleSchema,
|
|
11895
12101
|
content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)])
|
|
11896
12102
|
});
|
|
11897
12103
|
var BooleanSchemaSchema = object({
|
|
@@ -11972,7 +12178,7 @@ var TitledMultiSelectEnumSchemaSchema = object({
|
|
|
11972
12178
|
var MultiSelectEnumSchemaSchema = union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
|
|
11973
12179
|
var EnumSchemaSchema = union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
|
|
11974
12180
|
var PrimitiveSchemaDefinitionSchema = union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
|
|
11975
|
-
var ElicitRequestFormParamsSchema =
|
|
12181
|
+
var ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
11976
12182
|
mode: literal("form").optional(),
|
|
11977
12183
|
message: string2(),
|
|
11978
12184
|
requestedSchema: object({
|
|
@@ -11981,7 +12187,7 @@ var ElicitRequestFormParamsSchema = BaseRequestParamsSchema.extend({
|
|
|
11981
12187
|
required: array(string2()).optional()
|
|
11982
12188
|
})
|
|
11983
12189
|
});
|
|
11984
|
-
var ElicitRequestURLParamsSchema =
|
|
12190
|
+
var ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
11985
12191
|
mode: literal("url"),
|
|
11986
12192
|
message: string2(),
|
|
11987
12193
|
elicitationId: string2(),
|
|
@@ -12048,13 +12254,15 @@ var RootSchema = object({
|
|
|
12048
12254
|
_meta: record(string2(), unknown()).optional()
|
|
12049
12255
|
});
|
|
12050
12256
|
var ListRootsRequestSchema = RequestSchema.extend({
|
|
12051
|
-
method: literal("roots/list")
|
|
12257
|
+
method: literal("roots/list"),
|
|
12258
|
+
params: BaseRequestParamsSchema.optional()
|
|
12052
12259
|
});
|
|
12053
12260
|
var ListRootsResultSchema = ResultSchema.extend({
|
|
12054
12261
|
roots: array(RootSchema)
|
|
12055
12262
|
});
|
|
12056
12263
|
var RootsListChangedNotificationSchema = NotificationSchema.extend({
|
|
12057
|
-
method: literal("notifications/roots/list_changed")
|
|
12264
|
+
method: literal("notifications/roots/list_changed"),
|
|
12265
|
+
params: NotificationsParamsSchema.optional()
|
|
12058
12266
|
});
|
|
12059
12267
|
var ClientRequestSchema = union([
|
|
12060
12268
|
PingRequestSchema,
|
|
@@ -12072,7 +12280,8 @@ var ClientRequestSchema = union([
|
|
|
12072
12280
|
ListToolsRequestSchema,
|
|
12073
12281
|
GetTaskRequestSchema,
|
|
12074
12282
|
GetTaskPayloadRequestSchema,
|
|
12075
|
-
ListTasksRequestSchema
|
|
12283
|
+
ListTasksRequestSchema,
|
|
12284
|
+
CancelTaskRequestSchema
|
|
12076
12285
|
]);
|
|
12077
12286
|
var ClientNotificationSchema = union([
|
|
12078
12287
|
CancelledNotificationSchema,
|
|
@@ -12098,7 +12307,8 @@ var ServerRequestSchema = union([
|
|
|
12098
12307
|
ListRootsRequestSchema,
|
|
12099
12308
|
GetTaskRequestSchema,
|
|
12100
12309
|
GetTaskPayloadRequestSchema,
|
|
12101
|
-
ListTasksRequestSchema
|
|
12310
|
+
ListTasksRequestSchema,
|
|
12311
|
+
CancelTaskRequestSchema
|
|
12102
12312
|
]);
|
|
12103
12313
|
var ServerNotificationSchema = union([
|
|
12104
12314
|
CancelledNotificationSchema,
|
|
@@ -12152,12 +12362,11 @@ class UrlElicitationRequiredError extends McpError {
|
|
|
12152
12362
|
});
|
|
12153
12363
|
}
|
|
12154
12364
|
get elicitations() {
|
|
12155
|
-
|
|
12156
|
-
return (_b = (_a2 = this.data) === null || _a2 === undefined ? undefined : _a2.elicitations) !== null && _b !== undefined ? _b : [];
|
|
12365
|
+
return this.data?.elicitations ?? [];
|
|
12157
12366
|
}
|
|
12158
12367
|
}
|
|
12159
12368
|
|
|
12160
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
12369
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
12161
12370
|
class ReadBuffer {
|
|
12162
12371
|
append(chunk) {
|
|
12163
12372
|
this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
|
|
@@ -12187,7 +12396,7 @@ function serializeMessage(message) {
|
|
|
12187
12396
|
`;
|
|
12188
12397
|
}
|
|
12189
12398
|
|
|
12190
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
12399
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
12191
12400
|
class StdioServerTransport {
|
|
12192
12401
|
constructor(_stdin = process3.stdin, _stdout = process3.stdout) {
|
|
12193
12402
|
this._stdin = _stdin;
|
|
@@ -12199,8 +12408,7 @@ class StdioServerTransport {
|
|
|
12199
12408
|
this.processReadBuffer();
|
|
12200
12409
|
};
|
|
12201
12410
|
this._onerror = (error2) => {
|
|
12202
|
-
|
|
12203
|
-
(_a2 = this.onerror) === null || _a2 === undefined || _a2.call(this, error2);
|
|
12411
|
+
this.onerror?.(error2);
|
|
12204
12412
|
};
|
|
12205
12413
|
}
|
|
12206
12414
|
async start() {
|
|
@@ -12212,21 +12420,19 @@ class StdioServerTransport {
|
|
|
12212
12420
|
this._stdin.on("error", this._onerror);
|
|
12213
12421
|
}
|
|
12214
12422
|
processReadBuffer() {
|
|
12215
|
-
var _a2, _b;
|
|
12216
12423
|
while (true) {
|
|
12217
12424
|
try {
|
|
12218
12425
|
const message = this._readBuffer.readMessage();
|
|
12219
12426
|
if (message === null) {
|
|
12220
12427
|
break;
|
|
12221
12428
|
}
|
|
12222
|
-
|
|
12429
|
+
this.onmessage?.(message);
|
|
12223
12430
|
} catch (error2) {
|
|
12224
|
-
|
|
12431
|
+
this.onerror?.(error2);
|
|
12225
12432
|
}
|
|
12226
12433
|
}
|
|
12227
12434
|
}
|
|
12228
12435
|
async close() {
|
|
12229
|
-
var _a2;
|
|
12230
12436
|
this._stdin.off("data", this._ondata);
|
|
12231
12437
|
this._stdin.off("error", this._onerror);
|
|
12232
12438
|
const remainingDataListeners = this._stdin.listenerCount("data");
|
|
@@ -12234,7 +12440,7 @@ class StdioServerTransport {
|
|
|
12234
12440
|
this._stdin.pause();
|
|
12235
12441
|
}
|
|
12236
12442
|
this._readBuffer.clear();
|
|
12237
|
-
|
|
12443
|
+
this.onclose?.();
|
|
12238
12444
|
}
|
|
12239
12445
|
send(message) {
|
|
12240
12446
|
return new Promise((resolve) => {
|
|
@@ -12250,7 +12456,7 @@ class StdioServerTransport {
|
|
|
12250
12456
|
// package.json
|
|
12251
12457
|
var package_default = {
|
|
12252
12458
|
name: "@youdotcom-oss/mcp",
|
|
12253
|
-
version: "1.
|
|
12459
|
+
version: "1.4.1",
|
|
12254
12460
|
description: "You.com API Model Context Protocol Server",
|
|
12255
12461
|
license: "MIT",
|
|
12256
12462
|
engines: {
|
|
@@ -12318,13 +12524,13 @@ var package_default = {
|
|
|
12318
12524
|
mcpName: "io.github.youdotcom-oss/mcp",
|
|
12319
12525
|
types: "./dist/main.d.ts",
|
|
12320
12526
|
dependencies: {
|
|
12321
|
-
zod: "^4.
|
|
12322
|
-
"@hono/mcp": "^0.2.
|
|
12323
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
12324
|
-
hono: "^4.11.
|
|
12527
|
+
zod: "^4.3.5",
|
|
12528
|
+
"@hono/mcp": "^0.2.3",
|
|
12529
|
+
"@modelcontextprotocol/sdk": "^1.25.2",
|
|
12530
|
+
hono: "^4.11.3"
|
|
12325
12531
|
},
|
|
12326
12532
|
devDependencies: {
|
|
12327
|
-
"@modelcontextprotocol/inspector": "0.
|
|
12533
|
+
"@modelcontextprotocol/inspector": "0.18.0"
|
|
12328
12534
|
}
|
|
12329
12535
|
};
|
|
12330
12536
|
|
|
@@ -12363,7 +12569,7 @@ var getLogger = (mcp) => async (params) => {
|
|
|
12363
12569
|
|
|
12364
12570
|
// src/contents/contents.schemas.ts
|
|
12365
12571
|
var ContentsQuerySchema = object({
|
|
12366
|
-
urls: array(string2().url()).min(1).describe(
|
|
12572
|
+
urls: array(string2().url()).min(1).describe('Array of webpage URLs to extract content from (e.g., ["https://example.com"])'),
|
|
12367
12573
|
format: _enum(["markdown", "html"]).optional().default("markdown").describe("Output format: markdown (text) or html (layout)")
|
|
12368
12574
|
});
|
|
12369
12575
|
var ContentsItemSchema = object({
|
|
@@ -12612,6 +12818,10 @@ var ExpressStructuredContentSchema = object({
|
|
|
12612
12818
|
var formatSearchResultsText = (results) => {
|
|
12613
12819
|
return results.map((result) => {
|
|
12614
12820
|
const parts = [`Title: ${result.title}`];
|
|
12821
|
+
parts.push(`URL: ${result.url}`);
|
|
12822
|
+
if (result.page_age) {
|
|
12823
|
+
parts.push(`Published: ${result.page_age}`);
|
|
12824
|
+
}
|
|
12615
12825
|
if (result.description) {
|
|
12616
12826
|
parts.push(`Description: ${result.description}`);
|
|
12617
12827
|
}
|
|
@@ -12785,7 +12995,7 @@ Report this issue: ${reportLink}`
|
|
|
12785
12995
|
});
|
|
12786
12996
|
};
|
|
12787
12997
|
|
|
12788
|
-
// ../../node_modules/.bun/zod@4.
|
|
12998
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/helpers/util.js
|
|
12789
12999
|
var util;
|
|
12790
13000
|
(function(util2) {
|
|
12791
13001
|
util2.assertEqual = (_) => {};
|
|
@@ -12916,7 +13126,7 @@ var getParsedType2 = (data) => {
|
|
|
12916
13126
|
}
|
|
12917
13127
|
};
|
|
12918
13128
|
|
|
12919
|
-
// ../../node_modules/.bun/zod@4.
|
|
13129
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/ZodError.js
|
|
12920
13130
|
var ZodIssueCode = util.arrayToEnum([
|
|
12921
13131
|
"invalid_type",
|
|
12922
13132
|
"invalid_literal",
|
|
@@ -13030,7 +13240,7 @@ ZodError2.create = (issues) => {
|
|
|
13030
13240
|
return error2;
|
|
13031
13241
|
};
|
|
13032
13242
|
|
|
13033
|
-
// ../../node_modules/.bun/zod@4.
|
|
13243
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/locales/en.js
|
|
13034
13244
|
var errorMap = (issue2, _ctx) => {
|
|
13035
13245
|
let message;
|
|
13036
13246
|
switch (issue2.code) {
|
|
@@ -13133,13 +13343,13 @@ var errorMap = (issue2, _ctx) => {
|
|
|
13133
13343
|
};
|
|
13134
13344
|
var en_default2 = errorMap;
|
|
13135
13345
|
|
|
13136
|
-
// ../../node_modules/.bun/zod@4.
|
|
13346
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/errors.js
|
|
13137
13347
|
var overrideErrorMap = en_default2;
|
|
13138
13348
|
function getErrorMap() {
|
|
13139
13349
|
return overrideErrorMap;
|
|
13140
13350
|
}
|
|
13141
13351
|
|
|
13142
|
-
// ../../node_modules/.bun/zod@4.
|
|
13352
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/helpers/parseUtil.js
|
|
13143
13353
|
var makeIssue = (params) => {
|
|
13144
13354
|
const { data, path, errorMaps, issueData } = params;
|
|
13145
13355
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -13245,14 +13455,14 @@ var isDirty = (x) => x.status === "dirty";
|
|
|
13245
13455
|
var isValid = (x) => x.status === "valid";
|
|
13246
13456
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
13247
13457
|
|
|
13248
|
-
// ../../node_modules/.bun/zod@4.
|
|
13458
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/helpers/errorUtil.js
|
|
13249
13459
|
var errorUtil;
|
|
13250
13460
|
(function(errorUtil2) {
|
|
13251
13461
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
13252
13462
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
13253
13463
|
})(errorUtil || (errorUtil = {}));
|
|
13254
13464
|
|
|
13255
|
-
// ../../node_modules/.bun/zod@4.
|
|
13465
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/types.js
|
|
13256
13466
|
class ParseInputLazyPath {
|
|
13257
13467
|
constructor(parent, value, path, key) {
|
|
13258
13468
|
this._cachedPath = [];
|
|
@@ -16595,7 +16805,7 @@ var optionalType = ZodOptional2.create;
|
|
|
16595
16805
|
var nullableType = ZodNullable2.create;
|
|
16596
16806
|
var preprocessType = ZodEffects.createWithPreprocess;
|
|
16597
16807
|
var pipelineType = ZodPipeline.create;
|
|
16598
|
-
// ../../node_modules/.bun/zod@4.
|
|
16808
|
+
// ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/mini/schemas.js
|
|
16599
16809
|
var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
16600
16810
|
if (!inst._zod)
|
|
16601
16811
|
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
@@ -16613,29 +16823,31 @@ var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
|
16613
16823
|
...def.checks ?? [],
|
|
16614
16824
|
...checks3.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
16615
16825
|
]
|
|
16616
|
-
});
|
|
16826
|
+
}, { parent: true });
|
|
16617
16827
|
};
|
|
16828
|
+
inst.with = inst.check;
|
|
16618
16829
|
inst.clone = (_def, params) => clone(inst, _def, params);
|
|
16619
16830
|
inst.brand = () => inst;
|
|
16620
16831
|
inst.register = (reg, meta2) => {
|
|
16621
16832
|
reg.add(inst, meta2);
|
|
16622
16833
|
return inst;
|
|
16623
16834
|
};
|
|
16835
|
+
inst.apply = (fn) => fn(inst);
|
|
16624
16836
|
});
|
|
16625
16837
|
var ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
16626
16838
|
$ZodObject.init(inst, def);
|
|
16627
16839
|
ZodMiniType.init(inst, def);
|
|
16628
|
-
|
|
16840
|
+
defineLazy(inst, "shape", () => def.shape);
|
|
16629
16841
|
});
|
|
16630
16842
|
function object2(shape, params) {
|
|
16631
16843
|
const def = {
|
|
16632
16844
|
type: "object",
|
|
16633
16845
|
shape: shape ?? {},
|
|
16634
|
-
...
|
|
16846
|
+
...normalizeParams(params)
|
|
16635
16847
|
};
|
|
16636
16848
|
return new ZodMiniObject(def);
|
|
16637
16849
|
}
|
|
16638
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
16850
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
16639
16851
|
function isZ4Schema(s) {
|
|
16640
16852
|
const schema = s;
|
|
16641
16853
|
return !!schema._zod;
|
|
@@ -16671,13 +16883,12 @@ async function safeParseAsync3(schema, data) {
|
|
|
16671
16883
|
return result;
|
|
16672
16884
|
}
|
|
16673
16885
|
function getObjectShape(schema) {
|
|
16674
|
-
var _a2, _b;
|
|
16675
16886
|
if (!schema)
|
|
16676
16887
|
return;
|
|
16677
16888
|
let rawShape;
|
|
16678
16889
|
if (isZ4Schema(schema)) {
|
|
16679
16890
|
const v4Schema = schema;
|
|
16680
|
-
rawShape =
|
|
16891
|
+
rawShape = v4Schema._zod?.def?.shape;
|
|
16681
16892
|
} else {
|
|
16682
16893
|
const v3Schema = schema;
|
|
16683
16894
|
rawShape = v3Schema.shape;
|
|
@@ -16687,14 +16898,13 @@ function getObjectShape(schema) {
|
|
|
16687
16898
|
if (typeof rawShape === "function") {
|
|
16688
16899
|
try {
|
|
16689
16900
|
return rawShape();
|
|
16690
|
-
} catch
|
|
16901
|
+
} catch {
|
|
16691
16902
|
return;
|
|
16692
16903
|
}
|
|
16693
16904
|
}
|
|
16694
16905
|
return rawShape;
|
|
16695
16906
|
}
|
|
16696
16907
|
function normalizeObjectSchema(schema) {
|
|
16697
|
-
var _a2;
|
|
16698
16908
|
if (!schema)
|
|
16699
16909
|
return;
|
|
16700
16910
|
if (typeof schema === "object") {
|
|
@@ -16709,7 +16919,7 @@ function normalizeObjectSchema(schema) {
|
|
|
16709
16919
|
}
|
|
16710
16920
|
if (isZ4Schema(schema)) {
|
|
16711
16921
|
const v4Schema = schema;
|
|
16712
|
-
const def =
|
|
16922
|
+
const def = v4Schema._zod?.def;
|
|
16713
16923
|
if (def && (def.type === "object" || def.shape !== undefined)) {
|
|
16714
16924
|
return schema;
|
|
16715
16925
|
}
|
|
@@ -16734,38 +16944,30 @@ function getParseErrorMessage(error2) {
|
|
|
16734
16944
|
}
|
|
16735
16945
|
try {
|
|
16736
16946
|
return JSON.stringify(error2);
|
|
16737
|
-
} catch
|
|
16947
|
+
} catch {
|
|
16738
16948
|
return String(error2);
|
|
16739
16949
|
}
|
|
16740
16950
|
}
|
|
16741
16951
|
return String(error2);
|
|
16742
16952
|
}
|
|
16743
16953
|
function getSchemaDescription(schema) {
|
|
16744
|
-
|
|
16745
|
-
if (isZ4Schema(schema)) {
|
|
16746
|
-
const v4Schema = schema;
|
|
16747
|
-
return (_b = (_a2 = v4Schema._zod) === null || _a2 === undefined ? undefined : _a2.def) === null || _b === undefined ? undefined : _b.description;
|
|
16748
|
-
}
|
|
16749
|
-
const v3Schema = schema;
|
|
16750
|
-
return (_c = schema.description) !== null && _c !== undefined ? _c : (_d = v3Schema._def) === null || _d === undefined ? undefined : _d.description;
|
|
16954
|
+
return schema.description;
|
|
16751
16955
|
}
|
|
16752
16956
|
function isSchemaOptional(schema) {
|
|
16753
|
-
var _a2, _b, _c;
|
|
16754
16957
|
if (isZ4Schema(schema)) {
|
|
16755
16958
|
const v4Schema = schema;
|
|
16756
|
-
return
|
|
16959
|
+
return v4Schema._zod?.def?.type === "optional";
|
|
16757
16960
|
}
|
|
16758
16961
|
const v3Schema = schema;
|
|
16759
16962
|
if (typeof schema.isOptional === "function") {
|
|
16760
16963
|
return schema.isOptional();
|
|
16761
16964
|
}
|
|
16762
|
-
return
|
|
16965
|
+
return v3Schema._def?.typeName === "ZodOptional";
|
|
16763
16966
|
}
|
|
16764
16967
|
function getLiteralValue(schema) {
|
|
16765
|
-
var _a2;
|
|
16766
16968
|
if (isZ4Schema(schema)) {
|
|
16767
16969
|
const v4Schema = schema;
|
|
16768
|
-
const def2 =
|
|
16970
|
+
const def2 = v4Schema._zod?.def;
|
|
16769
16971
|
if (def2) {
|
|
16770
16972
|
if (def2.value !== undefined)
|
|
16771
16973
|
return def2.value;
|
|
@@ -16789,12 +16991,12 @@ function getLiteralValue(schema) {
|
|
|
16789
16991
|
return;
|
|
16790
16992
|
}
|
|
16791
16993
|
|
|
16792
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
16994
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
16793
16995
|
function isTerminal(status) {
|
|
16794
16996
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
16795
16997
|
}
|
|
16796
16998
|
|
|
16797
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
16999
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
16798
17000
|
var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
16799
17001
|
var defaultOptions = {
|
|
16800
17002
|
name: undefined,
|
|
@@ -16827,7 +17029,7 @@ var getDefaultOptions = (options) => typeof options === "string" ? {
|
|
|
16827
17029
|
...defaultOptions,
|
|
16828
17030
|
...options
|
|
16829
17031
|
};
|
|
16830
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17032
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/Refs.js
|
|
16831
17033
|
var getRefs = (options) => {
|
|
16832
17034
|
const _options = getDefaultOptions(options);
|
|
16833
17035
|
const currentPath = _options.name !== undefined ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
|
|
@@ -16846,7 +17048,7 @@ var getRefs = (options) => {
|
|
|
16846
17048
|
]))
|
|
16847
17049
|
};
|
|
16848
17050
|
};
|
|
16849
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17051
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
16850
17052
|
function addErrorMessage(res, key, errorMessage, refs) {
|
|
16851
17053
|
if (!refs?.errorMessages)
|
|
16852
17054
|
return;
|
|
@@ -16861,7 +17063,7 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
|
|
|
16861
17063
|
res[key] = value;
|
|
16862
17064
|
addErrorMessage(res, key, errorMessage, refs);
|
|
16863
17065
|
}
|
|
16864
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17066
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
|
|
16865
17067
|
var getRelativePath = (pathA, pathB) => {
|
|
16866
17068
|
let i = 0;
|
|
16867
17069
|
for (;i < pathA.length && i < pathB.length; i++) {
|
|
@@ -16870,7 +17072,7 @@ var getRelativePath = (pathA, pathB) => {
|
|
|
16870
17072
|
}
|
|
16871
17073
|
return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
|
|
16872
17074
|
};
|
|
16873
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17075
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
|
|
16874
17076
|
function parseAnyDef(refs) {
|
|
16875
17077
|
if (refs.target !== "openAi") {
|
|
16876
17078
|
return {};
|
|
@@ -16886,7 +17088,7 @@ function parseAnyDef(refs) {
|
|
|
16886
17088
|
};
|
|
16887
17089
|
}
|
|
16888
17090
|
|
|
16889
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17091
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
|
|
16890
17092
|
function parseArrayDef(def, refs) {
|
|
16891
17093
|
const res = {
|
|
16892
17094
|
type: "array"
|
|
@@ -16910,7 +17112,7 @@ function parseArrayDef(def, refs) {
|
|
|
16910
17112
|
return res;
|
|
16911
17113
|
}
|
|
16912
17114
|
|
|
16913
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17115
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
|
|
16914
17116
|
function parseBigintDef(def, refs) {
|
|
16915
17117
|
const res = {
|
|
16916
17118
|
type: "integer",
|
|
@@ -16956,24 +17158,24 @@ function parseBigintDef(def, refs) {
|
|
|
16956
17158
|
return res;
|
|
16957
17159
|
}
|
|
16958
17160
|
|
|
16959
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17161
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
|
|
16960
17162
|
function parseBooleanDef() {
|
|
16961
17163
|
return {
|
|
16962
17164
|
type: "boolean"
|
|
16963
17165
|
};
|
|
16964
17166
|
}
|
|
16965
17167
|
|
|
16966
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17168
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
|
|
16967
17169
|
function parseBrandedDef(_def, refs) {
|
|
16968
17170
|
return parseDef(_def.type._def, refs);
|
|
16969
17171
|
}
|
|
16970
17172
|
|
|
16971
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17173
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
|
|
16972
17174
|
var parseCatchDef = (def, refs) => {
|
|
16973
17175
|
return parseDef(def.innerType._def, refs);
|
|
16974
17176
|
};
|
|
16975
17177
|
|
|
16976
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17178
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
|
|
16977
17179
|
function parseDateDef(def, refs, overrideDateStrategy) {
|
|
16978
17180
|
const strategy = overrideDateStrategy ?? refs.dateStrategy;
|
|
16979
17181
|
if (Array.isArray(strategy)) {
|
|
@@ -17018,7 +17220,7 @@ var integerDateParser = (def, refs) => {
|
|
|
17018
17220
|
return res;
|
|
17019
17221
|
};
|
|
17020
17222
|
|
|
17021
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17223
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
|
|
17022
17224
|
function parseDefaultDef(_def, refs) {
|
|
17023
17225
|
return {
|
|
17024
17226
|
...parseDef(_def.innerType._def, refs),
|
|
@@ -17026,12 +17228,12 @@ function parseDefaultDef(_def, refs) {
|
|
|
17026
17228
|
};
|
|
17027
17229
|
}
|
|
17028
17230
|
|
|
17029
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17231
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
|
|
17030
17232
|
function parseEffectsDef(_def, refs) {
|
|
17031
17233
|
return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(refs);
|
|
17032
17234
|
}
|
|
17033
17235
|
|
|
17034
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17236
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
|
|
17035
17237
|
function parseEnumDef(def) {
|
|
17036
17238
|
return {
|
|
17037
17239
|
type: "string",
|
|
@@ -17039,7 +17241,7 @@ function parseEnumDef(def) {
|
|
|
17039
17241
|
};
|
|
17040
17242
|
}
|
|
17041
17243
|
|
|
17042
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17244
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
|
|
17043
17245
|
var isJsonSchema7AllOfType = (type) => {
|
|
17044
17246
|
if ("type" in type && type.type === "string")
|
|
17045
17247
|
return false;
|
|
@@ -17081,7 +17283,7 @@ function parseIntersectionDef(def, refs) {
|
|
|
17081
17283
|
} : undefined;
|
|
17082
17284
|
}
|
|
17083
17285
|
|
|
17084
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17286
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
|
|
17085
17287
|
function parseLiteralDef(def, refs) {
|
|
17086
17288
|
const parsedType2 = typeof def.value;
|
|
17087
17289
|
if (parsedType2 !== "bigint" && parsedType2 !== "number" && parsedType2 !== "boolean" && parsedType2 !== "string") {
|
|
@@ -17101,7 +17303,7 @@ function parseLiteralDef(def, refs) {
|
|
|
17101
17303
|
};
|
|
17102
17304
|
}
|
|
17103
17305
|
|
|
17104
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17306
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
17105
17307
|
var emojiRegex2 = undefined;
|
|
17106
17308
|
var zodPatterns = {
|
|
17107
17309
|
cuid: /^[cC][^\s-]{8,}$/,
|
|
@@ -17398,7 +17600,7 @@ function stringifyRegExpWithFlags(regex, refs) {
|
|
|
17398
17600
|
return pattern;
|
|
17399
17601
|
}
|
|
17400
17602
|
|
|
17401
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17603
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
17402
17604
|
function parseRecordDef(def, refs) {
|
|
17403
17605
|
if (refs.target === "openAi") {
|
|
17404
17606
|
console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
|
|
@@ -17450,7 +17652,7 @@ function parseRecordDef(def, refs) {
|
|
|
17450
17652
|
return schema;
|
|
17451
17653
|
}
|
|
17452
17654
|
|
|
17453
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17655
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
|
|
17454
17656
|
function parseMapDef(def, refs) {
|
|
17455
17657
|
if (refs.mapStrategy === "record") {
|
|
17456
17658
|
return parseRecordDef(def, refs);
|
|
@@ -17475,7 +17677,7 @@ function parseMapDef(def, refs) {
|
|
|
17475
17677
|
};
|
|
17476
17678
|
}
|
|
17477
17679
|
|
|
17478
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17680
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
|
|
17479
17681
|
function parseNativeEnumDef(def) {
|
|
17480
17682
|
const object3 = def.values;
|
|
17481
17683
|
const actualKeys = Object.keys(def.values).filter((key) => {
|
|
@@ -17489,7 +17691,7 @@ function parseNativeEnumDef(def) {
|
|
|
17489
17691
|
};
|
|
17490
17692
|
}
|
|
17491
17693
|
|
|
17492
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17694
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
|
|
17493
17695
|
function parseNeverDef(refs) {
|
|
17494
17696
|
return refs.target === "openAi" ? undefined : {
|
|
17495
17697
|
not: parseAnyDef({
|
|
@@ -17499,7 +17701,7 @@ function parseNeverDef(refs) {
|
|
|
17499
17701
|
};
|
|
17500
17702
|
}
|
|
17501
17703
|
|
|
17502
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17704
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
|
|
17503
17705
|
function parseNullDef(refs) {
|
|
17504
17706
|
return refs.target === "openApi3" ? {
|
|
17505
17707
|
enum: ["null"],
|
|
@@ -17509,7 +17711,7 @@ function parseNullDef(refs) {
|
|
|
17509
17711
|
};
|
|
17510
17712
|
}
|
|
17511
17713
|
|
|
17512
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17714
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
|
|
17513
17715
|
var primitiveMappings = {
|
|
17514
17716
|
ZodString: "string",
|
|
17515
17717
|
ZodNumber: "number",
|
|
@@ -17577,7 +17779,7 @@ var asAnyOf = (def, refs) => {
|
|
|
17577
17779
|
return anyOf.length ? { anyOf } : undefined;
|
|
17578
17780
|
};
|
|
17579
17781
|
|
|
17580
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17782
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
|
|
17581
17783
|
function parseNullableDef(def, refs) {
|
|
17582
17784
|
if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
|
|
17583
17785
|
if (refs.target === "openApi3") {
|
|
@@ -17609,7 +17811,7 @@ function parseNullableDef(def, refs) {
|
|
|
17609
17811
|
return base && { anyOf: [base, { type: "null" }] };
|
|
17610
17812
|
}
|
|
17611
17813
|
|
|
17612
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17814
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
|
|
17613
17815
|
function parseNumberDef(def, refs) {
|
|
17614
17816
|
const res = {
|
|
17615
17817
|
type: "number"
|
|
@@ -17658,7 +17860,7 @@ function parseNumberDef(def, refs) {
|
|
|
17658
17860
|
return res;
|
|
17659
17861
|
}
|
|
17660
17862
|
|
|
17661
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17863
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
|
|
17662
17864
|
function parseObjectDef(def, refs) {
|
|
17663
17865
|
const forceOptionalIntoNullable = refs.target === "openAi";
|
|
17664
17866
|
const result = {
|
|
@@ -17728,7 +17930,7 @@ function safeIsOptional(schema) {
|
|
|
17728
17930
|
}
|
|
17729
17931
|
}
|
|
17730
17932
|
|
|
17731
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17933
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
|
|
17732
17934
|
var parseOptionalDef = (def, refs) => {
|
|
17733
17935
|
if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
|
|
17734
17936
|
return parseDef(def.innerType._def, refs);
|
|
@@ -17747,7 +17949,7 @@ var parseOptionalDef = (def, refs) => {
|
|
|
17747
17949
|
} : parseAnyDef(refs);
|
|
17748
17950
|
};
|
|
17749
17951
|
|
|
17750
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17952
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
|
|
17751
17953
|
var parsePipelineDef = (def, refs) => {
|
|
17752
17954
|
if (refs.pipeStrategy === "input") {
|
|
17753
17955
|
return parseDef(def.in._def, refs);
|
|
@@ -17767,12 +17969,12 @@ var parsePipelineDef = (def, refs) => {
|
|
|
17767
17969
|
};
|
|
17768
17970
|
};
|
|
17769
17971
|
|
|
17770
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17972
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
|
|
17771
17973
|
function parsePromiseDef(def, refs) {
|
|
17772
17974
|
return parseDef(def.type._def, refs);
|
|
17773
17975
|
}
|
|
17774
17976
|
|
|
17775
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17977
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
|
|
17776
17978
|
function parseSetDef(def, refs) {
|
|
17777
17979
|
const items = parseDef(def.valueType._def, {
|
|
17778
17980
|
...refs,
|
|
@@ -17792,7 +17994,7 @@ function parseSetDef(def, refs) {
|
|
|
17792
17994
|
return schema;
|
|
17793
17995
|
}
|
|
17794
17996
|
|
|
17795
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
17997
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
|
|
17796
17998
|
function parseTupleDef(def, refs) {
|
|
17797
17999
|
if (def.rest) {
|
|
17798
18000
|
return {
|
|
@@ -17820,24 +18022,24 @@ function parseTupleDef(def, refs) {
|
|
|
17820
18022
|
}
|
|
17821
18023
|
}
|
|
17822
18024
|
|
|
17823
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
18025
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
|
|
17824
18026
|
function parseUndefinedDef(refs) {
|
|
17825
18027
|
return {
|
|
17826
18028
|
not: parseAnyDef(refs)
|
|
17827
18029
|
};
|
|
17828
18030
|
}
|
|
17829
18031
|
|
|
17830
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
18032
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
|
|
17831
18033
|
function parseUnknownDef(refs) {
|
|
17832
18034
|
return parseAnyDef(refs);
|
|
17833
18035
|
}
|
|
17834
18036
|
|
|
17835
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
18037
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
|
|
17836
18038
|
var parseReadonlyDef = (def, refs) => {
|
|
17837
18039
|
return parseDef(def.innerType._def, refs);
|
|
17838
18040
|
};
|
|
17839
18041
|
|
|
17840
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
18042
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
17841
18043
|
var selectParser = (def, typeName, refs) => {
|
|
17842
18044
|
switch (typeName) {
|
|
17843
18045
|
case ZodFirstPartyTypeKind.ZodString:
|
|
@@ -17915,7 +18117,7 @@ var selectParser = (def, typeName, refs) => {
|
|
|
17915
18117
|
}
|
|
17916
18118
|
};
|
|
17917
18119
|
|
|
17918
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
18120
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parseDef.js
|
|
17919
18121
|
function parseDef(def, refs, forceResolution = false) {
|
|
17920
18122
|
const seenItem = refs.seen.get(def);
|
|
17921
18123
|
if (refs.override) {
|
|
@@ -17970,7 +18172,7 @@ var addMeta = (def, refs, jsonSchema) => {
|
|
|
17970
18172
|
}
|
|
17971
18173
|
return jsonSchema;
|
|
17972
18174
|
};
|
|
17973
|
-
// ../../node_modules/.bun/zod-to-json-schema@3.25.
|
|
18175
|
+
// ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
|
|
17974
18176
|
var zodToJsonSchema = (schema, options) => {
|
|
17975
18177
|
const refs = getRefs(options);
|
|
17976
18178
|
let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema2]) => ({
|
|
@@ -18030,7 +18232,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
18030
18232
|
}
|
|
18031
18233
|
return combined;
|
|
18032
18234
|
};
|
|
18033
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
18235
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
18034
18236
|
function mapMiniTarget(t) {
|
|
18035
18237
|
if (!t)
|
|
18036
18238
|
return "draft-7";
|
|
@@ -18041,21 +18243,20 @@ function mapMiniTarget(t) {
|
|
|
18041
18243
|
return "draft-7";
|
|
18042
18244
|
}
|
|
18043
18245
|
function toJsonSchemaCompat(schema, opts) {
|
|
18044
|
-
var _a2, _b, _c;
|
|
18045
18246
|
if (isZ4Schema(schema)) {
|
|
18046
18247
|
return toJSONSchema(schema, {
|
|
18047
|
-
target: mapMiniTarget(opts
|
|
18048
|
-
io:
|
|
18248
|
+
target: mapMiniTarget(opts?.target),
|
|
18249
|
+
io: opts?.pipeStrategy ?? "input"
|
|
18049
18250
|
});
|
|
18050
18251
|
}
|
|
18051
18252
|
return zodToJsonSchema(schema, {
|
|
18052
|
-
strictUnions:
|
|
18053
|
-
pipeStrategy:
|
|
18253
|
+
strictUnions: opts?.strictUnions ?? true,
|
|
18254
|
+
pipeStrategy: opts?.pipeStrategy ?? "input"
|
|
18054
18255
|
});
|
|
18055
18256
|
}
|
|
18056
18257
|
function getMethodLiteral(schema) {
|
|
18057
18258
|
const shape = getObjectShape(schema);
|
|
18058
|
-
const methodSchema = shape
|
|
18259
|
+
const methodSchema = shape?.method;
|
|
18059
18260
|
if (!methodSchema) {
|
|
18060
18261
|
throw new Error("Schema is missing a method literal");
|
|
18061
18262
|
}
|
|
@@ -18073,7 +18274,7 @@ function parseWithCompat(schema, data) {
|
|
|
18073
18274
|
return result.data;
|
|
18074
18275
|
}
|
|
18075
18276
|
|
|
18076
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
18277
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
18077
18278
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
|
|
18078
18279
|
|
|
18079
18280
|
class Protocol {
|
|
@@ -18096,8 +18297,8 @@ class Protocol {
|
|
|
18096
18297
|
this._onprogress(notification);
|
|
18097
18298
|
});
|
|
18098
18299
|
this.setRequestHandler(PingRequestSchema, (_request) => ({}));
|
|
18099
|
-
this._taskStore = _options
|
|
18100
|
-
this._taskMessageQueue = _options
|
|
18300
|
+
this._taskStore = _options?.taskStore;
|
|
18301
|
+
this._taskMessageQueue = _options?.taskMessageQueue;
|
|
18101
18302
|
if (this._taskStore) {
|
|
18102
18303
|
this.setRequestHandler(GetTaskRequestSchema, async (request, extra) => {
|
|
18103
18304
|
const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
|
|
@@ -18110,7 +18311,6 @@ class Protocol {
|
|
|
18110
18311
|
});
|
|
18111
18312
|
this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
|
|
18112
18313
|
const handleTaskResult = async () => {
|
|
18113
|
-
var _a2;
|
|
18114
18314
|
const taskId = request.params.taskId;
|
|
18115
18315
|
if (this._taskMessageQueue) {
|
|
18116
18316
|
let queuedMessage;
|
|
@@ -18134,7 +18334,7 @@ class Protocol {
|
|
|
18134
18334
|
}
|
|
18135
18335
|
continue;
|
|
18136
18336
|
}
|
|
18137
|
-
await
|
|
18337
|
+
await this._transport?.send(queuedMessage.message, { relatedRequestId: extra.requestId });
|
|
18138
18338
|
}
|
|
18139
18339
|
}
|
|
18140
18340
|
const task = await this._taskStore.getTask(taskId, extra.sessionId);
|
|
@@ -18163,9 +18363,8 @@ class Protocol {
|
|
|
18163
18363
|
return await handleTaskResult();
|
|
18164
18364
|
});
|
|
18165
18365
|
this.setRequestHandler(ListTasksRequestSchema, async (request, extra) => {
|
|
18166
|
-
var _a2;
|
|
18167
18366
|
try {
|
|
18168
|
-
const { tasks, nextCursor } = await this._taskStore.listTasks(
|
|
18367
|
+
const { tasks, nextCursor } = await this._taskStore.listTasks(request.params?.cursor, extra.sessionId);
|
|
18169
18368
|
return {
|
|
18170
18369
|
tasks,
|
|
18171
18370
|
nextCursor,
|
|
@@ -18204,8 +18403,11 @@ class Protocol {
|
|
|
18204
18403
|
}
|
|
18205
18404
|
}
|
|
18206
18405
|
async _oncancel(notification) {
|
|
18406
|
+
if (!notification.params.requestId) {
|
|
18407
|
+
return;
|
|
18408
|
+
}
|
|
18207
18409
|
const controller = this._requestHandlerAbortControllers.get(notification.params.requestId);
|
|
18208
|
-
controller
|
|
18410
|
+
controller?.abort(notification.params.reason);
|
|
18209
18411
|
}
|
|
18210
18412
|
_setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
|
|
18211
18413
|
this._timeoutInfo.set(messageId, {
|
|
@@ -18241,22 +18443,21 @@ class Protocol {
|
|
|
18241
18443
|
}
|
|
18242
18444
|
}
|
|
18243
18445
|
async connect(transport) {
|
|
18244
|
-
var _a2, _b, _c;
|
|
18245
18446
|
this._transport = transport;
|
|
18246
|
-
const _onclose =
|
|
18447
|
+
const _onclose = this.transport?.onclose;
|
|
18247
18448
|
this._transport.onclose = () => {
|
|
18248
|
-
_onclose
|
|
18449
|
+
_onclose?.();
|
|
18249
18450
|
this._onclose();
|
|
18250
18451
|
};
|
|
18251
|
-
const _onerror =
|
|
18452
|
+
const _onerror = this.transport?.onerror;
|
|
18252
18453
|
this._transport.onerror = (error2) => {
|
|
18253
|
-
_onerror
|
|
18454
|
+
_onerror?.(error2);
|
|
18254
18455
|
this._onerror(error2);
|
|
18255
18456
|
};
|
|
18256
|
-
const _onmessage =
|
|
18457
|
+
const _onmessage = this._transport?.onmessage;
|
|
18257
18458
|
this._transport.onmessage = (message, extra) => {
|
|
18258
|
-
_onmessage
|
|
18259
|
-
if (
|
|
18459
|
+
_onmessage?.(message, extra);
|
|
18460
|
+
if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
|
|
18260
18461
|
this._onresponse(message);
|
|
18261
18462
|
} else if (isJSONRPCRequest(message)) {
|
|
18262
18463
|
this._onrequest(message, extra);
|
|
@@ -18269,7 +18470,6 @@ class Protocol {
|
|
|
18269
18470
|
await this._transport.start();
|
|
18270
18471
|
}
|
|
18271
18472
|
_onclose() {
|
|
18272
|
-
var _a2;
|
|
18273
18473
|
const responseHandlers = this._responseHandlers;
|
|
18274
18474
|
this._responseHandlers = new Map;
|
|
18275
18475
|
this._progressHandlers.clear();
|
|
@@ -18277,28 +18477,25 @@ class Protocol {
|
|
|
18277
18477
|
this._pendingDebouncedNotifications.clear();
|
|
18278
18478
|
const error2 = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed");
|
|
18279
18479
|
this._transport = undefined;
|
|
18280
|
-
|
|
18480
|
+
this.onclose?.();
|
|
18281
18481
|
for (const handler of responseHandlers.values()) {
|
|
18282
18482
|
handler(error2);
|
|
18283
18483
|
}
|
|
18284
18484
|
}
|
|
18285
18485
|
_onerror(error2) {
|
|
18286
|
-
|
|
18287
|
-
(_a2 = this.onerror) === null || _a2 === undefined || _a2.call(this, error2);
|
|
18486
|
+
this.onerror?.(error2);
|
|
18288
18487
|
}
|
|
18289
18488
|
_onnotification(notification) {
|
|
18290
|
-
|
|
18291
|
-
const handler = (_a2 = this._notificationHandlers.get(notification.method)) !== null && _a2 !== undefined ? _a2 : this.fallbackNotificationHandler;
|
|
18489
|
+
const handler = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler;
|
|
18292
18490
|
if (handler === undefined) {
|
|
18293
18491
|
return;
|
|
18294
18492
|
}
|
|
18295
18493
|
Promise.resolve().then(() => handler(notification)).catch((error2) => this._onerror(new Error(`Uncaught error in notification handler: ${error2}`)));
|
|
18296
18494
|
}
|
|
18297
18495
|
_onrequest(request, extra) {
|
|
18298
|
-
|
|
18299
|
-
const handler = (_a2 = this._requestHandlers.get(request.method)) !== null && _a2 !== undefined ? _a2 : this.fallbackRequestHandler;
|
|
18496
|
+
const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
|
|
18300
18497
|
const capturedTransport = this._transport;
|
|
18301
|
-
const relatedTaskId =
|
|
18498
|
+
const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
|
|
18302
18499
|
if (handler === undefined) {
|
|
18303
18500
|
const errorResponse = {
|
|
18304
18501
|
jsonrpc: "2.0",
|
|
@@ -18313,20 +18510,20 @@ class Protocol {
|
|
|
18313
18510
|
type: "error",
|
|
18314
18511
|
message: errorResponse,
|
|
18315
18512
|
timestamp: Date.now()
|
|
18316
|
-
}, capturedTransport
|
|
18513
|
+
}, capturedTransport?.sessionId).catch((error2) => this._onerror(new Error(`Failed to enqueue error response: ${error2}`)));
|
|
18317
18514
|
} else {
|
|
18318
|
-
capturedTransport
|
|
18515
|
+
capturedTransport?.send(errorResponse).catch((error2) => this._onerror(new Error(`Failed to send an error response: ${error2}`)));
|
|
18319
18516
|
}
|
|
18320
18517
|
return;
|
|
18321
18518
|
}
|
|
18322
18519
|
const abortController = new AbortController;
|
|
18323
18520
|
this._requestHandlerAbortControllers.set(request.id, abortController);
|
|
18324
|
-
const taskCreationParams = (
|
|
18325
|
-
const taskStore = this._taskStore ? this.requestTaskStore(request, capturedTransport
|
|
18521
|
+
const taskCreationParams = isTaskAugmentedRequestParams(request.params) ? request.params.task : undefined;
|
|
18522
|
+
const taskStore = this._taskStore ? this.requestTaskStore(request, capturedTransport?.sessionId) : undefined;
|
|
18326
18523
|
const fullExtra = {
|
|
18327
18524
|
signal: abortController.signal,
|
|
18328
|
-
sessionId: capturedTransport
|
|
18329
|
-
_meta:
|
|
18525
|
+
sessionId: capturedTransport?.sessionId,
|
|
18526
|
+
_meta: request.params?._meta,
|
|
18330
18527
|
sendNotification: async (notification) => {
|
|
18331
18528
|
const notificationOptions = { relatedRequestId: request.id };
|
|
18332
18529
|
if (relatedTaskId) {
|
|
@@ -18335,25 +18532,24 @@ class Protocol {
|
|
|
18335
18532
|
await this.notification(notification, notificationOptions);
|
|
18336
18533
|
},
|
|
18337
18534
|
sendRequest: async (r, resultSchema, options) => {
|
|
18338
|
-
var _a3, _b2;
|
|
18339
18535
|
const requestOptions = { ...options, relatedRequestId: request.id };
|
|
18340
18536
|
if (relatedTaskId && !requestOptions.relatedTask) {
|
|
18341
18537
|
requestOptions.relatedTask = { taskId: relatedTaskId };
|
|
18342
18538
|
}
|
|
18343
|
-
const effectiveTaskId =
|
|
18539
|
+
const effectiveTaskId = requestOptions.relatedTask?.taskId ?? relatedTaskId;
|
|
18344
18540
|
if (effectiveTaskId && taskStore) {
|
|
18345
18541
|
await taskStore.updateTaskStatus(effectiveTaskId, "input_required");
|
|
18346
18542
|
}
|
|
18347
18543
|
return await this.request(r, resultSchema, requestOptions);
|
|
18348
18544
|
},
|
|
18349
|
-
authInfo: extra
|
|
18545
|
+
authInfo: extra?.authInfo,
|
|
18350
18546
|
requestId: request.id,
|
|
18351
|
-
requestInfo: extra
|
|
18547
|
+
requestInfo: extra?.requestInfo,
|
|
18352
18548
|
taskId: relatedTaskId,
|
|
18353
18549
|
taskStore,
|
|
18354
|
-
taskRequestedTtl: taskCreationParams
|
|
18355
|
-
closeSSEStream: extra
|
|
18356
|
-
closeStandaloneSSEStream: extra
|
|
18550
|
+
taskRequestedTtl: taskCreationParams?.ttl,
|
|
18551
|
+
closeSSEStream: extra?.closeSSEStream,
|
|
18552
|
+
closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
|
|
18357
18553
|
};
|
|
18358
18554
|
Promise.resolve().then(() => {
|
|
18359
18555
|
if (taskCreationParams) {
|
|
@@ -18373,12 +18569,11 @@ class Protocol {
|
|
|
18373
18569
|
type: "response",
|
|
18374
18570
|
message: response,
|
|
18375
18571
|
timestamp: Date.now()
|
|
18376
|
-
}, capturedTransport
|
|
18572
|
+
}, capturedTransport?.sessionId);
|
|
18377
18573
|
} else {
|
|
18378
|
-
await
|
|
18574
|
+
await capturedTransport?.send(response);
|
|
18379
18575
|
}
|
|
18380
18576
|
}, async (error2) => {
|
|
18381
|
-
var _a3;
|
|
18382
18577
|
if (abortController.signal.aborted) {
|
|
18383
18578
|
return;
|
|
18384
18579
|
}
|
|
@@ -18387,7 +18582,7 @@ class Protocol {
|
|
|
18387
18582
|
id: request.id,
|
|
18388
18583
|
error: {
|
|
18389
18584
|
code: Number.isSafeInteger(error2["code"]) ? error2["code"] : ErrorCode.InternalError,
|
|
18390
|
-
message:
|
|
18585
|
+
message: error2.message ?? "Internal error",
|
|
18391
18586
|
...error2["data"] !== undefined && { data: error2["data"] }
|
|
18392
18587
|
}
|
|
18393
18588
|
};
|
|
@@ -18396,9 +18591,9 @@ class Protocol {
|
|
|
18396
18591
|
type: "error",
|
|
18397
18592
|
message: errorResponse,
|
|
18398
18593
|
timestamp: Date.now()
|
|
18399
|
-
}, capturedTransport
|
|
18594
|
+
}, capturedTransport?.sessionId);
|
|
18400
18595
|
} else {
|
|
18401
|
-
await
|
|
18596
|
+
await capturedTransport?.send(errorResponse);
|
|
18402
18597
|
}
|
|
18403
18598
|
}).catch((error2) => this._onerror(new Error(`Failed to send response: ${error2}`))).finally(() => {
|
|
18404
18599
|
this._requestHandlerAbortControllers.delete(request.id);
|
|
@@ -18432,7 +18627,7 @@ class Protocol {
|
|
|
18432
18627
|
const resolver = this._requestResolvers.get(messageId);
|
|
18433
18628
|
if (resolver) {
|
|
18434
18629
|
this._requestResolvers.delete(messageId);
|
|
18435
|
-
if (
|
|
18630
|
+
if (isJSONRPCResultResponse(response)) {
|
|
18436
18631
|
resolver(response);
|
|
18437
18632
|
} else {
|
|
18438
18633
|
const error2 = new McpError(response.error.code, response.error.message, response.error.data);
|
|
@@ -18448,7 +18643,7 @@ class Protocol {
|
|
|
18448
18643
|
this._responseHandlers.delete(messageId);
|
|
18449
18644
|
this._cleanupTimeout(messageId);
|
|
18450
18645
|
let isTaskResponse = false;
|
|
18451
|
-
if (
|
|
18646
|
+
if (isJSONRPCResultResponse(response) && response.result && typeof response.result === "object") {
|
|
18452
18647
|
const result = response.result;
|
|
18453
18648
|
if (result.task && typeof result.task === "object") {
|
|
18454
18649
|
const task = result.task;
|
|
@@ -18461,7 +18656,7 @@ class Protocol {
|
|
|
18461
18656
|
if (!isTaskResponse) {
|
|
18462
18657
|
this._progressHandlers.delete(messageId);
|
|
18463
18658
|
}
|
|
18464
|
-
if (
|
|
18659
|
+
if (isJSONRPCResultResponse(response)) {
|
|
18465
18660
|
handler(response);
|
|
18466
18661
|
} else {
|
|
18467
18662
|
const error2 = McpError.fromError(response.error.code, response.error.message, response.error.data);
|
|
@@ -18472,12 +18667,10 @@ class Protocol {
|
|
|
18472
18667
|
return this._transport;
|
|
18473
18668
|
}
|
|
18474
18669
|
async close() {
|
|
18475
|
-
|
|
18476
|
-
await ((_a2 = this._transport) === null || _a2 === undefined ? undefined : _a2.close());
|
|
18670
|
+
await this._transport?.close();
|
|
18477
18671
|
}
|
|
18478
18672
|
async* requestStream(request, resultSchema, options) {
|
|
18479
|
-
|
|
18480
|
-
const { task } = options !== null && options !== undefined ? options : {};
|
|
18673
|
+
const { task } = options ?? {};
|
|
18481
18674
|
if (!task) {
|
|
18482
18675
|
try {
|
|
18483
18676
|
const result = await this.request(request, resultSchema, options);
|
|
@@ -18524,9 +18717,9 @@ class Protocol {
|
|
|
18524
18717
|
yield { type: "result", result };
|
|
18525
18718
|
return;
|
|
18526
18719
|
}
|
|
18527
|
-
const pollInterval =
|
|
18720
|
+
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1000;
|
|
18528
18721
|
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
18529
|
-
|
|
18722
|
+
options?.signal?.throwIfAborted();
|
|
18530
18723
|
}
|
|
18531
18724
|
} catch (error2) {
|
|
18532
18725
|
yield {
|
|
@@ -18536,9 +18729,8 @@ class Protocol {
|
|
|
18536
18729
|
}
|
|
18537
18730
|
}
|
|
18538
18731
|
request(request, resultSchema, options) {
|
|
18539
|
-
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options
|
|
18732
|
+
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
18540
18733
|
return new Promise((resolve, reject) => {
|
|
18541
|
-
var _a2, _b, _c, _d, _e, _f, _g;
|
|
18542
18734
|
const earlyReject = (error2) => {
|
|
18543
18735
|
reject(error2);
|
|
18544
18736
|
};
|
|
@@ -18546,7 +18738,7 @@ class Protocol {
|
|
|
18546
18738
|
earlyReject(new Error("Not connected"));
|
|
18547
18739
|
return;
|
|
18548
18740
|
}
|
|
18549
|
-
if (
|
|
18741
|
+
if (this._options?.enforceStrictCapabilities === true) {
|
|
18550
18742
|
try {
|
|
18551
18743
|
this.assertCapabilityForMethod(request.method);
|
|
18552
18744
|
if (task) {
|
|
@@ -18557,19 +18749,19 @@ class Protocol {
|
|
|
18557
18749
|
return;
|
|
18558
18750
|
}
|
|
18559
18751
|
}
|
|
18560
|
-
|
|
18752
|
+
options?.signal?.throwIfAborted();
|
|
18561
18753
|
const messageId = this._requestMessageId++;
|
|
18562
18754
|
const jsonrpcRequest = {
|
|
18563
18755
|
...request,
|
|
18564
18756
|
jsonrpc: "2.0",
|
|
18565
18757
|
id: messageId
|
|
18566
18758
|
};
|
|
18567
|
-
if (options
|
|
18759
|
+
if (options?.onprogress) {
|
|
18568
18760
|
this._progressHandlers.set(messageId, options.onprogress);
|
|
18569
18761
|
jsonrpcRequest.params = {
|
|
18570
18762
|
...request.params,
|
|
18571
18763
|
_meta: {
|
|
18572
|
-
...
|
|
18764
|
+
...request.params?._meta || {},
|
|
18573
18765
|
progressToken: messageId
|
|
18574
18766
|
}
|
|
18575
18767
|
};
|
|
@@ -18584,17 +18776,16 @@ class Protocol {
|
|
|
18584
18776
|
jsonrpcRequest.params = {
|
|
18585
18777
|
...jsonrpcRequest.params,
|
|
18586
18778
|
_meta: {
|
|
18587
|
-
...
|
|
18779
|
+
...jsonrpcRequest.params?._meta || {},
|
|
18588
18780
|
[RELATED_TASK_META_KEY]: relatedTask
|
|
18589
18781
|
}
|
|
18590
18782
|
};
|
|
18591
18783
|
}
|
|
18592
18784
|
const cancel = (reason) => {
|
|
18593
|
-
var _a3;
|
|
18594
18785
|
this._responseHandlers.delete(messageId);
|
|
18595
18786
|
this._progressHandlers.delete(messageId);
|
|
18596
18787
|
this._cleanupTimeout(messageId);
|
|
18597
|
-
|
|
18788
|
+
this._transport?.send({
|
|
18598
18789
|
jsonrpc: "2.0",
|
|
18599
18790
|
method: "notifications/cancelled",
|
|
18600
18791
|
params: {
|
|
@@ -18606,8 +18797,7 @@ class Protocol {
|
|
|
18606
18797
|
reject(error2);
|
|
18607
18798
|
};
|
|
18608
18799
|
this._responseHandlers.set(messageId, (response) => {
|
|
18609
|
-
|
|
18610
|
-
if ((_a3 = options === null || options === undefined ? undefined : options.signal) === null || _a3 === undefined ? undefined : _a3.aborted) {
|
|
18800
|
+
if (options?.signal?.aborted) {
|
|
18611
18801
|
return;
|
|
18612
18802
|
}
|
|
18613
18803
|
if (response instanceof Error) {
|
|
@@ -18624,14 +18814,13 @@ class Protocol {
|
|
|
18624
18814
|
reject(error2);
|
|
18625
18815
|
}
|
|
18626
18816
|
});
|
|
18627
|
-
|
|
18628
|
-
|
|
18629
|
-
cancel((_a3 = options === null || options === undefined ? undefined : options.signal) === null || _a3 === undefined ? undefined : _a3.reason);
|
|
18817
|
+
options?.signal?.addEventListener("abort", () => {
|
|
18818
|
+
cancel(options?.signal?.reason);
|
|
18630
18819
|
});
|
|
18631
|
-
const timeout =
|
|
18820
|
+
const timeout = options?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC;
|
|
18632
18821
|
const timeoutHandler = () => cancel(McpError.fromError(ErrorCode.RequestTimeout, "Request timed out", { timeout }));
|
|
18633
|
-
this._setupTimeout(messageId, timeout, options
|
|
18634
|
-
const relatedTaskId = relatedTask
|
|
18822
|
+
this._setupTimeout(messageId, timeout, options?.maxTotalTimeout, timeoutHandler, options?.resetTimeoutOnProgress ?? false);
|
|
18823
|
+
const relatedTaskId = relatedTask?.taskId;
|
|
18635
18824
|
if (relatedTaskId) {
|
|
18636
18825
|
const responseResolver = (response) => {
|
|
18637
18826
|
const handler = this._responseHandlers.get(messageId);
|
|
@@ -18671,12 +18860,11 @@ class Protocol {
|
|
|
18671
18860
|
return this.request({ method: "tasks/cancel", params }, CancelTaskResultSchema, options);
|
|
18672
18861
|
}
|
|
18673
18862
|
async notification(notification, options) {
|
|
18674
|
-
var _a2, _b, _c, _d, _e;
|
|
18675
18863
|
if (!this._transport) {
|
|
18676
18864
|
throw new Error("Not connected");
|
|
18677
18865
|
}
|
|
18678
18866
|
this.assertNotificationCapability(notification.method);
|
|
18679
|
-
const relatedTaskId =
|
|
18867
|
+
const relatedTaskId = options?.relatedTask?.taskId;
|
|
18680
18868
|
if (relatedTaskId) {
|
|
18681
18869
|
const jsonrpcNotification2 = {
|
|
18682
18870
|
...notification,
|
|
@@ -18684,7 +18872,7 @@ class Protocol {
|
|
|
18684
18872
|
params: {
|
|
18685
18873
|
...notification.params,
|
|
18686
18874
|
_meta: {
|
|
18687
|
-
...
|
|
18875
|
+
...notification.params?._meta || {},
|
|
18688
18876
|
[RELATED_TASK_META_KEY]: options.relatedTask
|
|
18689
18877
|
}
|
|
18690
18878
|
}
|
|
@@ -18696,15 +18884,14 @@ class Protocol {
|
|
|
18696
18884
|
});
|
|
18697
18885
|
return;
|
|
18698
18886
|
}
|
|
18699
|
-
const debouncedMethods =
|
|
18700
|
-
const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !
|
|
18887
|
+
const debouncedMethods = this._options?.debouncedNotificationMethods ?? [];
|
|
18888
|
+
const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !options?.relatedRequestId && !options?.relatedTask;
|
|
18701
18889
|
if (canDebounce) {
|
|
18702
18890
|
if (this._pendingDebouncedNotifications.has(notification.method)) {
|
|
18703
18891
|
return;
|
|
18704
18892
|
}
|
|
18705
18893
|
this._pendingDebouncedNotifications.add(notification.method);
|
|
18706
18894
|
Promise.resolve().then(() => {
|
|
18707
|
-
var _a3, _b2;
|
|
18708
18895
|
this._pendingDebouncedNotifications.delete(notification.method);
|
|
18709
18896
|
if (!this._transport) {
|
|
18710
18897
|
return;
|
|
@@ -18713,19 +18900,19 @@ class Protocol {
|
|
|
18713
18900
|
...notification,
|
|
18714
18901
|
jsonrpc: "2.0"
|
|
18715
18902
|
};
|
|
18716
|
-
if (options
|
|
18903
|
+
if (options?.relatedTask) {
|
|
18717
18904
|
jsonrpcNotification2 = {
|
|
18718
18905
|
...jsonrpcNotification2,
|
|
18719
18906
|
params: {
|
|
18720
18907
|
...jsonrpcNotification2.params,
|
|
18721
18908
|
_meta: {
|
|
18722
|
-
...
|
|
18909
|
+
...jsonrpcNotification2.params?._meta || {},
|
|
18723
18910
|
[RELATED_TASK_META_KEY]: options.relatedTask
|
|
18724
18911
|
}
|
|
18725
18912
|
}
|
|
18726
18913
|
};
|
|
18727
18914
|
}
|
|
18728
|
-
|
|
18915
|
+
this._transport?.send(jsonrpcNotification2, options).catch((error2) => this._onerror(error2));
|
|
18729
18916
|
});
|
|
18730
18917
|
return;
|
|
18731
18918
|
}
|
|
@@ -18733,13 +18920,13 @@ class Protocol {
|
|
|
18733
18920
|
...notification,
|
|
18734
18921
|
jsonrpc: "2.0"
|
|
18735
18922
|
};
|
|
18736
|
-
if (options
|
|
18923
|
+
if (options?.relatedTask) {
|
|
18737
18924
|
jsonrpcNotification = {
|
|
18738
18925
|
...jsonrpcNotification,
|
|
18739
18926
|
params: {
|
|
18740
18927
|
...jsonrpcNotification.params,
|
|
18741
18928
|
_meta: {
|
|
18742
|
-
...
|
|
18929
|
+
...jsonrpcNotification.params?._meta || {},
|
|
18743
18930
|
[RELATED_TASK_META_KEY]: options.relatedTask
|
|
18744
18931
|
}
|
|
18745
18932
|
}
|
|
@@ -18781,11 +18968,10 @@ class Protocol {
|
|
|
18781
18968
|
}
|
|
18782
18969
|
}
|
|
18783
18970
|
async _enqueueTaskMessage(taskId, message, sessionId) {
|
|
18784
|
-
var _a2;
|
|
18785
18971
|
if (!this._taskStore || !this._taskMessageQueue) {
|
|
18786
18972
|
throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
|
|
18787
18973
|
}
|
|
18788
|
-
const maxQueueSize =
|
|
18974
|
+
const maxQueueSize = this._options?.maxTaskQueueSize;
|
|
18789
18975
|
await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
|
|
18790
18976
|
}
|
|
18791
18977
|
async _clearTaskQueue(taskId, sessionId) {
|
|
@@ -18806,14 +18992,13 @@ class Protocol {
|
|
|
18806
18992
|
}
|
|
18807
18993
|
}
|
|
18808
18994
|
async _waitForTaskUpdate(taskId, signal) {
|
|
18809
|
-
|
|
18810
|
-
let interval = (_b = (_a2 = this._options) === null || _a2 === undefined ? undefined : _a2.defaultTaskPollInterval) !== null && _b !== undefined ? _b : 1000;
|
|
18995
|
+
let interval = this._options?.defaultTaskPollInterval ?? 1000;
|
|
18811
18996
|
try {
|
|
18812
|
-
const task = await
|
|
18813
|
-
if (task
|
|
18997
|
+
const task = await this._taskStore?.getTask(taskId);
|
|
18998
|
+
if (task?.pollInterval) {
|
|
18814
18999
|
interval = task.pollInterval;
|
|
18815
19000
|
}
|
|
18816
|
-
} catch
|
|
19001
|
+
} catch {}
|
|
18817
19002
|
return new Promise((resolve, reject) => {
|
|
18818
19003
|
if (signal.aborted) {
|
|
18819
19004
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -18912,11 +19097,11 @@ function mergeCapabilities(base, additional) {
|
|
|
18912
19097
|
return result;
|
|
18913
19098
|
}
|
|
18914
19099
|
|
|
18915
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
19100
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
18916
19101
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
18917
19102
|
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
18918
19103
|
function createDefaultAjvInstance() {
|
|
18919
|
-
const ajv = new import_ajv.
|
|
19104
|
+
const ajv = new import_ajv.default({
|
|
18920
19105
|
strict: false,
|
|
18921
19106
|
validateFormats: true,
|
|
18922
19107
|
validateSchema: false,
|
|
@@ -18929,11 +19114,10 @@ function createDefaultAjvInstance() {
|
|
|
18929
19114
|
|
|
18930
19115
|
class AjvJsonSchemaValidator {
|
|
18931
19116
|
constructor(ajv) {
|
|
18932
|
-
this._ajv = ajv
|
|
19117
|
+
this._ajv = ajv ?? createDefaultAjvInstance();
|
|
18933
19118
|
}
|
|
18934
19119
|
getValidator(schema) {
|
|
18935
|
-
|
|
18936
|
-
const ajvValidator = "$id" in schema && typeof schema.$id === "string" ? (_a2 = this._ajv.getSchema(schema.$id)) !== null && _a2 !== undefined ? _a2 : this._ajv.compile(schema) : this._ajv.compile(schema);
|
|
19120
|
+
const ajvValidator = "$id" in schema && typeof schema.$id === "string" ? this._ajv.getSchema(schema.$id) ?? this._ajv.compile(schema) : this._ajv.compile(schema);
|
|
18937
19121
|
return (input) => {
|
|
18938
19122
|
const valid = ajvValidator(input);
|
|
18939
19123
|
if (valid) {
|
|
@@ -18953,7 +19137,7 @@ class AjvJsonSchemaValidator {
|
|
|
18953
19137
|
}
|
|
18954
19138
|
}
|
|
18955
19139
|
|
|
18956
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
19140
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
18957
19141
|
class ExperimentalServerTasks {
|
|
18958
19142
|
constructor(_server) {
|
|
18959
19143
|
this._server = _server;
|
|
@@ -18975,15 +19159,14 @@ class ExperimentalServerTasks {
|
|
|
18975
19159
|
}
|
|
18976
19160
|
}
|
|
18977
19161
|
|
|
18978
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
19162
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
18979
19163
|
function assertToolsCallTaskCapability(requests, method, entityName) {
|
|
18980
|
-
var _a2;
|
|
18981
19164
|
if (!requests) {
|
|
18982
19165
|
throw new Error(`${entityName} does not support task creation (required for ${method})`);
|
|
18983
19166
|
}
|
|
18984
19167
|
switch (method) {
|
|
18985
19168
|
case "tools/call":
|
|
18986
|
-
if (!
|
|
19169
|
+
if (!requests.tools?.call) {
|
|
18987
19170
|
throw new Error(`${entityName} does not support task creation for tools/call (required for ${method})`);
|
|
18988
19171
|
}
|
|
18989
19172
|
break;
|
|
@@ -18992,18 +19175,17 @@ function assertToolsCallTaskCapability(requests, method, entityName) {
|
|
|
18992
19175
|
}
|
|
18993
19176
|
}
|
|
18994
19177
|
function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
18995
|
-
var _a2, _b;
|
|
18996
19178
|
if (!requests) {
|
|
18997
19179
|
throw new Error(`${entityName} does not support task creation (required for ${method})`);
|
|
18998
19180
|
}
|
|
18999
19181
|
switch (method) {
|
|
19000
19182
|
case "sampling/createMessage":
|
|
19001
|
-
if (!
|
|
19183
|
+
if (!requests.sampling?.createMessage) {
|
|
19002
19184
|
throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method})`);
|
|
19003
19185
|
}
|
|
19004
19186
|
break;
|
|
19005
19187
|
case "elicitation/create":
|
|
19006
|
-
if (!
|
|
19188
|
+
if (!requests.elicitation?.create) {
|
|
19007
19189
|
throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method})`);
|
|
19008
19190
|
}
|
|
19009
19191
|
break;
|
|
@@ -19012,10 +19194,9 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
19012
19194
|
}
|
|
19013
19195
|
}
|
|
19014
19196
|
|
|
19015
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
19197
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
19016
19198
|
class Server extends Protocol {
|
|
19017
19199
|
constructor(_serverInfo, options) {
|
|
19018
|
-
var _a2, _b;
|
|
19019
19200
|
super(options);
|
|
19020
19201
|
this._serverInfo = _serverInfo;
|
|
19021
19202
|
this._loggingLevels = new Map;
|
|
@@ -19024,18 +19205,14 @@ class Server extends Protocol {
|
|
|
19024
19205
|
const currentLevel = this._loggingLevels.get(sessionId);
|
|
19025
19206
|
return currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false;
|
|
19026
19207
|
};
|
|
19027
|
-
this._capabilities =
|
|
19028
|
-
this._instructions = options
|
|
19029
|
-
this._jsonSchemaValidator =
|
|
19208
|
+
this._capabilities = options?.capabilities ?? {};
|
|
19209
|
+
this._instructions = options?.instructions;
|
|
19210
|
+
this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new AjvJsonSchemaValidator;
|
|
19030
19211
|
this.setRequestHandler(InitializeRequestSchema, (request) => this._oninitialize(request));
|
|
19031
|
-
this.setNotificationHandler(InitializedNotificationSchema, () =>
|
|
19032
|
-
var _a3;
|
|
19033
|
-
return (_a3 = this.oninitialized) === null || _a3 === undefined ? undefined : _a3.call(this);
|
|
19034
|
-
});
|
|
19212
|
+
this.setNotificationHandler(InitializedNotificationSchema, () => this.oninitialized?.());
|
|
19035
19213
|
if (this._capabilities.logging) {
|
|
19036
19214
|
this.setRequestHandler(SetLevelRequestSchema, async (request, extra) => {
|
|
19037
|
-
|
|
19038
|
-
const transportSessionId = extra.sessionId || ((_a3 = extra.requestInfo) === null || _a3 === undefined ? undefined : _a3.headers["mcp-session-id"]) || undefined;
|
|
19215
|
+
const transportSessionId = extra.sessionId || extra.requestInfo?.headers["mcp-session-id"] || undefined;
|
|
19039
19216
|
const { level } = request.params;
|
|
19040
19217
|
const parseResult = LoggingLevelSchema.safeParse(level);
|
|
19041
19218
|
if (parseResult.success) {
|
|
@@ -19060,21 +19237,20 @@ class Server extends Protocol {
|
|
|
19060
19237
|
this._capabilities = mergeCapabilities(this._capabilities, capabilities);
|
|
19061
19238
|
}
|
|
19062
19239
|
setRequestHandler(requestSchema, handler) {
|
|
19063
|
-
var _a2, _b, _c;
|
|
19064
19240
|
const shape = getObjectShape(requestSchema);
|
|
19065
|
-
const methodSchema = shape
|
|
19241
|
+
const methodSchema = shape?.method;
|
|
19066
19242
|
if (!methodSchema) {
|
|
19067
19243
|
throw new Error("Schema is missing a method literal");
|
|
19068
19244
|
}
|
|
19069
19245
|
let methodValue;
|
|
19070
19246
|
if (isZ4Schema(methodSchema)) {
|
|
19071
19247
|
const v4Schema = methodSchema;
|
|
19072
|
-
const v4Def =
|
|
19073
|
-
methodValue =
|
|
19248
|
+
const v4Def = v4Schema._zod?.def;
|
|
19249
|
+
methodValue = v4Def?.value ?? v4Schema.value;
|
|
19074
19250
|
} else {
|
|
19075
19251
|
const v3Schema = methodSchema;
|
|
19076
19252
|
const legacyDef = v3Schema._def;
|
|
19077
|
-
methodValue =
|
|
19253
|
+
methodValue = legacyDef?.value ?? v3Schema.value;
|
|
19078
19254
|
}
|
|
19079
19255
|
if (typeof methodValue !== "string") {
|
|
19080
19256
|
throw new Error("Schema method literal must be a string");
|
|
@@ -19109,20 +19285,19 @@ class Server extends Protocol {
|
|
|
19109
19285
|
return super.setRequestHandler(requestSchema, handler);
|
|
19110
19286
|
}
|
|
19111
19287
|
assertCapabilityForMethod(method) {
|
|
19112
|
-
var _a2, _b, _c;
|
|
19113
19288
|
switch (method) {
|
|
19114
19289
|
case "sampling/createMessage":
|
|
19115
|
-
if (!
|
|
19290
|
+
if (!this._clientCapabilities?.sampling) {
|
|
19116
19291
|
throw new Error(`Client does not support sampling (required for ${method})`);
|
|
19117
19292
|
}
|
|
19118
19293
|
break;
|
|
19119
19294
|
case "elicitation/create":
|
|
19120
|
-
if (!
|
|
19295
|
+
if (!this._clientCapabilities?.elicitation) {
|
|
19121
19296
|
throw new Error(`Client does not support elicitation (required for ${method})`);
|
|
19122
19297
|
}
|
|
19123
19298
|
break;
|
|
19124
19299
|
case "roots/list":
|
|
19125
|
-
if (!
|
|
19300
|
+
if (!this._clientCapabilities?.roots) {
|
|
19126
19301
|
throw new Error(`Client does not support listing roots (required for ${method})`);
|
|
19127
19302
|
}
|
|
19128
19303
|
break;
|
|
@@ -19131,7 +19306,6 @@ class Server extends Protocol {
|
|
|
19131
19306
|
}
|
|
19132
19307
|
}
|
|
19133
19308
|
assertNotificationCapability(method) {
|
|
19134
|
-
var _a2, _b;
|
|
19135
19309
|
switch (method) {
|
|
19136
19310
|
case "notifications/message":
|
|
19137
19311
|
if (!this._capabilities.logging) {
|
|
@@ -19155,7 +19329,7 @@ class Server extends Protocol {
|
|
|
19155
19329
|
}
|
|
19156
19330
|
break;
|
|
19157
19331
|
case "notifications/elicitation/complete":
|
|
19158
|
-
if (!
|
|
19332
|
+
if (!this._clientCapabilities?.elicitation?.url) {
|
|
19159
19333
|
throw new Error(`Client does not support URL elicitation (required for ${method})`);
|
|
19160
19334
|
}
|
|
19161
19335
|
break;
|
|
@@ -19213,15 +19387,13 @@ class Server extends Protocol {
|
|
|
19213
19387
|
}
|
|
19214
19388
|
}
|
|
19215
19389
|
assertTaskCapability(method) {
|
|
19216
|
-
|
|
19217
|
-
assertClientRequestTaskCapability((_b = (_a2 = this._clientCapabilities) === null || _a2 === undefined ? undefined : _a2.tasks) === null || _b === undefined ? undefined : _b.requests, method, "Client");
|
|
19390
|
+
assertClientRequestTaskCapability(this._clientCapabilities?.tasks?.requests, method, "Client");
|
|
19218
19391
|
}
|
|
19219
19392
|
assertTaskHandlerCapability(method) {
|
|
19220
|
-
var _a2;
|
|
19221
19393
|
if (!this._capabilities) {
|
|
19222
19394
|
return;
|
|
19223
19395
|
}
|
|
19224
|
-
assertToolsCallTaskCapability(
|
|
19396
|
+
assertToolsCallTaskCapability(this._capabilities.tasks?.requests, method, "Server");
|
|
19225
19397
|
}
|
|
19226
19398
|
async _oninitialize(request) {
|
|
19227
19399
|
const requestedVersion = request.params.protocolVersion;
|
|
@@ -19248,9 +19420,8 @@ class Server extends Protocol {
|
|
|
19248
19420
|
return this.request({ method: "ping" }, EmptyResultSchema);
|
|
19249
19421
|
}
|
|
19250
19422
|
async createMessage(params, options) {
|
|
19251
|
-
var _a2, _b;
|
|
19252
19423
|
if (params.tools || params.toolChoice) {
|
|
19253
|
-
if (!
|
|
19424
|
+
if (!this._clientCapabilities?.sampling?.tools) {
|
|
19254
19425
|
throw new Error("Client does not support sampling tools capability.");
|
|
19255
19426
|
}
|
|
19256
19427
|
}
|
|
@@ -19283,18 +19454,17 @@ class Server extends Protocol {
|
|
|
19283
19454
|
return this.request({ method: "sampling/createMessage", params }, CreateMessageResultSchema, options);
|
|
19284
19455
|
}
|
|
19285
19456
|
async elicitInput(params, options) {
|
|
19286
|
-
|
|
19287
|
-
const mode = (_a2 = params.mode) !== null && _a2 !== undefined ? _a2 : "form";
|
|
19457
|
+
const mode = params.mode ?? "form";
|
|
19288
19458
|
switch (mode) {
|
|
19289
19459
|
case "url": {
|
|
19290
|
-
if (!
|
|
19460
|
+
if (!this._clientCapabilities?.elicitation?.url) {
|
|
19291
19461
|
throw new Error("Client does not support url elicitation.");
|
|
19292
19462
|
}
|
|
19293
19463
|
const urlParams = params;
|
|
19294
19464
|
return this.request({ method: "elicitation/create", params: urlParams }, ElicitResultSchema, options);
|
|
19295
19465
|
}
|
|
19296
19466
|
case "form": {
|
|
19297
|
-
if (!
|
|
19467
|
+
if (!this._clientCapabilities?.elicitation?.form) {
|
|
19298
19468
|
throw new Error("Client does not support form elicitation.");
|
|
19299
19469
|
}
|
|
19300
19470
|
const formParams = params.mode === "form" ? params : { ...params, mode: "form" };
|
|
@@ -19318,8 +19488,7 @@ class Server extends Protocol {
|
|
|
19318
19488
|
}
|
|
19319
19489
|
}
|
|
19320
19490
|
createElicitationCompletionNotifier(elicitationId, options) {
|
|
19321
|
-
|
|
19322
|
-
if (!((_b = (_a2 = this._clientCapabilities) === null || _a2 === undefined ? undefined : _a2.elicitation) === null || _b === undefined ? undefined : _b.url)) {
|
|
19491
|
+
if (!this._clientCapabilities?.elicitation?.url) {
|
|
19323
19492
|
throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");
|
|
19324
19493
|
}
|
|
19325
19494
|
return () => this.notification({
|
|
@@ -19358,21 +19527,21 @@ class Server extends Protocol {
|
|
|
19358
19527
|
}
|
|
19359
19528
|
}
|
|
19360
19529
|
|
|
19361
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
19530
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
19362
19531
|
var COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
|
|
19363
19532
|
function isCompletable(schema) {
|
|
19364
19533
|
return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
|
|
19365
19534
|
}
|
|
19366
19535
|
function getCompleter(schema) {
|
|
19367
19536
|
const meta2 = schema[COMPLETABLE_SYMBOL];
|
|
19368
|
-
return meta2
|
|
19537
|
+
return meta2?.complete;
|
|
19369
19538
|
}
|
|
19370
19539
|
var McpZodTypeKind;
|
|
19371
19540
|
(function(McpZodTypeKind2) {
|
|
19372
19541
|
McpZodTypeKind2["Completable"] = "McpCompletable";
|
|
19373
19542
|
})(McpZodTypeKind || (McpZodTypeKind = {}));
|
|
19374
19543
|
|
|
19375
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
19544
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
|
|
19376
19545
|
var TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
|
|
19377
19546
|
function validateToolName(name) {
|
|
19378
19547
|
const warnings = [];
|
|
@@ -19430,7 +19599,7 @@ function validateAndWarnToolName(name) {
|
|
|
19430
19599
|
return result.isValid;
|
|
19431
19600
|
}
|
|
19432
19601
|
|
|
19433
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
19602
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
|
|
19434
19603
|
class ExperimentalMcpServerTasks {
|
|
19435
19604
|
constructor(_mcpServer) {
|
|
19436
19605
|
this._mcpServer = _mcpServer;
|
|
@@ -19445,7 +19614,7 @@ class ExperimentalMcpServerTasks {
|
|
|
19445
19614
|
}
|
|
19446
19615
|
}
|
|
19447
19616
|
|
|
19448
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
19617
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fd698e00a3b2abce/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
19449
19618
|
class McpServer {
|
|
19450
19619
|
constructor(serverInfo, options) {
|
|
19451
19620
|
this._registeredResources = {};
|
|
@@ -19513,7 +19682,6 @@ class McpServer {
|
|
|
19513
19682
|
})
|
|
19514
19683
|
}));
|
|
19515
19684
|
this.server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
19516
|
-
var _a2;
|
|
19517
19685
|
try {
|
|
19518
19686
|
const tool = this._registeredTools[request.params.name];
|
|
19519
19687
|
if (!tool) {
|
|
@@ -19523,7 +19691,7 @@ class McpServer {
|
|
|
19523
19691
|
throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} disabled`);
|
|
19524
19692
|
}
|
|
19525
19693
|
const isTaskRequest = !!request.params.task;
|
|
19526
|
-
const taskSupport =
|
|
19694
|
+
const taskSupport = tool.execution?.taskSupport;
|
|
19527
19695
|
const isTaskHandler = "createTask" in tool.handler;
|
|
19528
19696
|
if ((taskSupport === "required" || taskSupport === "optional") && !isTaskHandler) {
|
|
19529
19697
|
throw new McpError(ErrorCode.InternalError, `Tool ${request.params.name} has taskSupport '${taskSupport}' but was not registered with registerToolTask`);
|
|
@@ -19568,7 +19736,7 @@ class McpServer {
|
|
|
19568
19736
|
return;
|
|
19569
19737
|
}
|
|
19570
19738
|
const inputObj = normalizeObjectSchema(tool.inputSchema);
|
|
19571
|
-
const schemaToParse = inputObj
|
|
19739
|
+
const schemaToParse = inputObj ?? tool.inputSchema;
|
|
19572
19740
|
const parseResult = await safeParseAsync3(schemaToParse, args);
|
|
19573
19741
|
if (!parseResult.success) {
|
|
19574
19742
|
const error2 = "error" in parseResult ? parseResult.error : "Unknown error";
|
|
@@ -19623,7 +19791,6 @@ class McpServer {
|
|
|
19623
19791
|
}
|
|
19624
19792
|
}
|
|
19625
19793
|
async handleAutomaticTaskPolling(tool, request, extra) {
|
|
19626
|
-
var _a2;
|
|
19627
19794
|
if (!extra.taskStore) {
|
|
19628
19795
|
throw new Error("No task store provided for task-capable tool.");
|
|
19629
19796
|
}
|
|
@@ -19633,7 +19800,7 @@ class McpServer {
|
|
|
19633
19800
|
const createTaskResult = args ? await Promise.resolve(handler.createTask(args, taskExtra)) : await Promise.resolve(handler.createTask(taskExtra));
|
|
19634
19801
|
const taskId = createTaskResult.task.taskId;
|
|
19635
19802
|
let task = createTaskResult.task;
|
|
19636
|
-
const pollInterval =
|
|
19803
|
+
const pollInterval = task.pollInterval ?? 5000;
|
|
19637
19804
|
while (task.status !== "completed" && task.status !== "failed" && task.status !== "cancelled") {
|
|
19638
19805
|
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
19639
19806
|
const updatedTask = await extra.taskStore.getTask(taskId);
|
|
@@ -19678,7 +19845,7 @@ class McpServer {
|
|
|
19678
19845
|
return EMPTY_COMPLETION_RESULT;
|
|
19679
19846
|
}
|
|
19680
19847
|
const promptShape = getObjectShape(prompt.argsSchema);
|
|
19681
|
-
const field = promptShape
|
|
19848
|
+
const field = promptShape?.[request.params.argument.name];
|
|
19682
19849
|
if (!isCompletable(field)) {
|
|
19683
19850
|
return EMPTY_COMPLETION_RESULT;
|
|
19684
19851
|
}
|
|
@@ -19762,7 +19929,6 @@ class McpServer {
|
|
|
19762
19929
|
}
|
|
19763
19930
|
throw new McpError(ErrorCode.InvalidParams, `Resource ${uri} not found`);
|
|
19764
19931
|
});
|
|
19765
|
-
this.setCompletionRequestHandler();
|
|
19766
19932
|
this._resourceHandlersInitialized = true;
|
|
19767
19933
|
}
|
|
19768
19934
|
setPromptRequestHandlers() {
|
|
@@ -19810,7 +19976,6 @@ class McpServer {
|
|
|
19810
19976
|
return await Promise.resolve(cb(extra));
|
|
19811
19977
|
}
|
|
19812
19978
|
});
|
|
19813
|
-
this.setCompletionRequestHandler();
|
|
19814
19979
|
this._promptHandlersInitialized = true;
|
|
19815
19980
|
}
|
|
19816
19981
|
resource(name, uriOrTemplate, ...rest) {
|
|
@@ -19918,6 +20083,11 @@ class McpServer {
|
|
|
19918
20083
|
}
|
|
19919
20084
|
};
|
|
19920
20085
|
this._registeredResourceTemplates[name] = registeredResourceTemplate;
|
|
20086
|
+
const variableNames = template.uriTemplate.variableNames;
|
|
20087
|
+
const hasCompleter = Array.isArray(variableNames) && variableNames.some((v) => !!template.completeCallback(v));
|
|
20088
|
+
if (hasCompleter) {
|
|
20089
|
+
this.setCompletionRequestHandler();
|
|
20090
|
+
}
|
|
19921
20091
|
return registeredResourceTemplate;
|
|
19922
20092
|
}
|
|
19923
20093
|
_createRegisteredPrompt(name, title, description, argsSchema, callback) {
|
|
@@ -19950,6 +20120,15 @@ class McpServer {
|
|
|
19950
20120
|
}
|
|
19951
20121
|
};
|
|
19952
20122
|
this._registeredPrompts[name] = registeredPrompt;
|
|
20123
|
+
if (argsSchema) {
|
|
20124
|
+
const hasCompletable = Object.values(argsSchema).some((field) => {
|
|
20125
|
+
const inner = field instanceof ZodOptional ? field._def?.innerType : field;
|
|
20126
|
+
return isCompletable(inner);
|
|
20127
|
+
});
|
|
20128
|
+
if (hasCompletable) {
|
|
20129
|
+
this.setCompletionRequestHandler();
|
|
20130
|
+
}
|
|
20131
|
+
}
|
|
19953
20132
|
return registeredPrompt;
|
|
19954
20133
|
}
|
|
19955
20134
|
_createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, execution, _meta, handler) {
|
|
@@ -19982,6 +20161,8 @@ class McpServer {
|
|
|
19982
20161
|
registeredTool.description = updates.description;
|
|
19983
20162
|
if (typeof updates.paramsSchema !== "undefined")
|
|
19984
20163
|
registeredTool.inputSchema = objectFromShape(updates.paramsSchema);
|
|
20164
|
+
if (typeof updates.outputSchema !== "undefined")
|
|
20165
|
+
registeredTool.outputSchema = objectFromShape(updates.outputSchema);
|
|
19985
20166
|
if (typeof updates.callback !== "undefined")
|
|
19986
20167
|
registeredTool.handler = updates.callback;
|
|
19987
20168
|
if (typeof updates.annotations !== "undefined")
|
|
@@ -20127,7 +20308,7 @@ function promptArgumentsFromSchema(schema) {
|
|
|
20127
20308
|
}
|
|
20128
20309
|
function getMethodValue(schema) {
|
|
20129
20310
|
const shape = getObjectShape(schema);
|
|
20130
|
-
const methodSchema = shape
|
|
20311
|
+
const methodSchema = shape?.method;
|
|
20131
20312
|
if (!methodSchema) {
|
|
20132
20313
|
throw new Error("Schema is missing a method literal");
|
|
20133
20314
|
}
|
|
@@ -20264,11 +20445,13 @@ var SearchStructuredContentSchema = object({
|
|
|
20264
20445
|
results: object({
|
|
20265
20446
|
web: array(object({
|
|
20266
20447
|
url: string2().describe("URL"),
|
|
20267
|
-
title: string2().describe("Title")
|
|
20448
|
+
title: string2().describe("Title"),
|
|
20449
|
+
page_age: string2().optional().describe("Publication timestamp")
|
|
20268
20450
|
})).optional().describe("Web results"),
|
|
20269
20451
|
news: array(object({
|
|
20270
20452
|
url: string2().describe("URL"),
|
|
20271
|
-
title: string2().describe("Title")
|
|
20453
|
+
title: string2().describe("Title"),
|
|
20454
|
+
page_age: string2().describe("Publication timestamp")
|
|
20272
20455
|
})).optional().describe("News results")
|
|
20273
20456
|
}).optional().describe("Search results")
|
|
20274
20457
|
});
|
|
@@ -20328,6 +20511,7 @@ ${webResults}`;
|
|
|
20328
20511
|
}
|
|
20329
20512
|
if (response.results.news?.length) {
|
|
20330
20513
|
const newsResults = response.results.news.map((article) => `Title: ${article.title}
|
|
20514
|
+
URL: ${article.url}
|
|
20331
20515
|
Description: ${article.description}
|
|
20332
20516
|
Published: ${article.page_age}`).join(`
|
|
20333
20517
|
|
|
@@ -20347,15 +20531,21 @@ ${newsResults}`;
|
|
|
20347
20531
|
}
|
|
20348
20532
|
const structuredResults = {};
|
|
20349
20533
|
if (response.results.web?.length) {
|
|
20350
|
-
structuredResults.web = response.results.web.map((result) =>
|
|
20351
|
-
|
|
20352
|
-
|
|
20353
|
-
|
|
20534
|
+
structuredResults.web = response.results.web.map((result) => {
|
|
20535
|
+
const item = {
|
|
20536
|
+
url: result.url,
|
|
20537
|
+
title: result.title
|
|
20538
|
+
};
|
|
20539
|
+
if (result.page_age)
|
|
20540
|
+
item.page_age = result.page_age;
|
|
20541
|
+
return item;
|
|
20542
|
+
});
|
|
20354
20543
|
}
|
|
20355
20544
|
if (response.results.news?.length) {
|
|
20356
20545
|
structuredResults.news = response.results.news.map((article) => ({
|
|
20357
20546
|
url: article.url,
|
|
20358
|
-
title: article.title
|
|
20547
|
+
title: article.title,
|
|
20548
|
+
page_age: article.page_age
|
|
20359
20549
|
}));
|
|
20360
20550
|
}
|
|
20361
20551
|
return {
|