@youdotcom-oss/mcp 1.3.10 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
6492
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
6493
6493
  import process3 from "node:process";
6494
6494
 
6495
- // ../../node_modules/.bun/zod@4.2.0/node_modules/zod/v4/core/core.js
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.2.0/node_modules/zod/v4/core/util.js
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
- throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
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
- checks: schema._zod.def.checks
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.2.0/node_modules/zod/v4/core/errors.js
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.2.0/node_modules/zod/v4/core/parse.js
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.2.0/node_modules/zod/v4/core/regexes.js
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 = /^\+(?:[0-9]){6,14}[0-9]$/;
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.2.0/node_modules/zod/v4/core/checks.js
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
- inst
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.2.0/node_modules/zod/v4/core/doc.js
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.2.0/node_modules/zod/v4/core/versions.js
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: 2,
7835
- patch: 0
7877
+ minor: 3,
7878
+ patch: 5
7836
7879
  };
7837
7880
 
7838
- // ../../node_modules/.bun/zod@4.2.0/node_modules/zod/v4/core/schemas.js
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["~standard"] = {
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
- doc.write(`
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
- if (left.issues.length) {
8753
- result.issues.push(...left.issues);
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
- if (right.issues.length) {
8756
- result.issues.push(...right.issues);
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
- const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
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.2.0/node_modules/zod/v4/locales/en.js
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 Nouns = {
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
- return `Invalid input: expected ${issue2.expected}, received ${parsedType(issue2.input)}`;
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 ${Nouns[_issue.format] ?? issue2.format}`;
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.2.0/node_modules/zod/v4/core/registries.js
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.2.0/node_modules/zod/v4/core/api.js
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.2.0/node_modules/zod/v4/core/to-json-schema.js
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
- const parent = schema._zod.parent;
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 refSchema = ctx.seen.get(ref).schema;
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
- Object.assign(schema2, _cached);
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
- if (!seen.isParent)
9975
- ctx.override({
9976
- zodSchema,
9977
- jsonSchema: schema2,
9978
- path: seen.path ?? []
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.2.0/node_modules/zod/v4/core/json-schema-processors.js
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.anyOf = mime.map((m) => {
10298
- const mFile = { ...file, contentMediaType: m };
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
- if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
10458
- json.propertyNames = process2(def.keyType, ctx, {
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, {
10608
+ ...params,
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, {
10459
10623
  ...params,
10460
- path: [...params.path, "propertyNames"]
10624
+ path: [...params.path, "additionalProperties"]
10461
10625
  });
10462
10626
  }
10463
- json.additionalProperties = process2(def.valueType, ctx, {
10464
- ...params,
10465
- path: [...params.path, "additionalProperties"]
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.2.0/node_modules/zod/v4/classic/iso.js
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.2.0/node_modules/zod/v4/classic/errors.js
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.2.0/node_modules/zod/v4/classic/parse.js
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.2.0/node_modules/zod/v4/classic/schemas.js
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.2.0/node_modules/zod/v4/classic/external.js
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.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
11527
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/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 RelatedTaskMetadataSchema = looseObject({
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 = looseObject({
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 = looseObject({
11371
- _meta: object({
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: looseObject({
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 JSONRPCResponseSchema = object({
11582
+ var JSONRPCResultResponseSchema = object({
11397
11583
  jsonrpc: literal(JSONRPC_VERSION),
11398
11584
  id: RequestIdSchema,
11399
11585
  result: ResultSchema
11400
11586
  }).strict();
11401
- var isJSONRPCResponse = (value) => JSONRPCResponseSchema.safeParse(value).success;
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 JSONRPCErrorSchema = object({
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: optional(unknown())
11605
+ data: unknown().optional()
11420
11606
  })
11421
11607
  }).strict();
11422
- var isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success;
11423
- var JSONRPCMessageSchema = union([JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, JSONRPCErrorSchema]);
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 = object({
11466
- list: optional(object({}).passthrough()),
11467
- cancel: optional(object({}).passthrough()),
11468
- requests: optional(object({
11469
- sampling: optional(object({
11470
- createMessage: optional(object({}).passthrough())
11471
- }).passthrough()),
11472
- elicitation: optional(object({
11473
- create: optional(object({}).passthrough())
11474
- }).passthrough())
11475
- }).passthrough())
11476
- }).passthrough();
11477
- var ServerTasksCapabilitySchema = object({
11478
- list: optional(object({}).passthrough()),
11479
- cancel: optional(object({}).passthrough()),
11480
- requests: optional(object({
11481
- tools: optional(object({
11482
- call: optional(object({}).passthrough())
11483
- }).passthrough())
11484
- }).passthrough())
11485
- }).passthrough();
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(ClientTasksCapabilitySchema)
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: optional(object({
11512
- listChanged: optional(boolean2())
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(ServerTasksCapabilitySchema)
11522
- }).passthrough();
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(CursorSchema)
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: _enum(["working", "input_required", "completed", "failed", "cancelled"]),
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 (_a2) {
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(_enum(["user", "assistant"])).optional(),
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: object({}).passthrough(),
11737
- _meta: optional(object({}).passthrough())
11738
- }).passthrough();
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: _enum(["user", "assistant"]),
11956
+ role: RoleSchema,
11757
11957
  content: ContentBlockSchema
11758
11958
  });
11759
11959
  var GetPromptResultSchema = ResultSchema.extend({
11760
- description: optional(string2()),
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(ToolAnnotationsSchema),
11791
- execution: optional(ToolExecutionSchema),
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: optional(boolean2())
12004
+ isError: boolean2().optional()
11804
12005
  });
11805
12006
  var CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
11806
12007
  toolResult: unknown()
11807
12008
  }));
11808
- var CallToolRequestParamsSchema = BaseRequestParamsSchema.extend({
12009
+ var CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
11809
12010
  name: string2(),
11810
- arguments: optional(record(string2(), unknown()))
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: optional(array(ModelHintSchema)),
11841
- costPriority: optional(number2().min(0).max(1)),
11842
- speedPriority: optional(number2().min(0).max(1)),
11843
- intelligencePriority: optional(number2().min(0).max(1))
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: optional(_enum(["auto", "required", "none"]))
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({}).passthrough().optional(),
11853
- isError: optional(boolean2()),
11854
- _meta: optional(object({}).passthrough())
11855
- }).passthrough();
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: _enum(["user", "assistant"]),
12071
+ role: RoleSchema,
11866
12072
  content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)]),
11867
- _meta: optional(object({}).passthrough())
11868
- }).passthrough();
11869
- var CreateMessageRequestParamsSchema = BaseRequestParamsSchema.extend({
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: optional(array(ToolSchema)),
11879
- toolChoice: optional(ToolChoiceSchema)
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: _enum(["user", "assistant"]),
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: _enum(["user", "assistant"]),
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 = BaseRequestParamsSchema.extend({
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 = BaseRequestParamsSchema.extend({
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
- var _a2, _b;
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.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
12369
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/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.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
12399
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/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
- var _a2;
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
- (_a2 = this.onmessage) === null || _a2 === undefined || _a2.call(this, message);
12429
+ this.onmessage?.(message);
12223
12430
  } catch (error2) {
12224
- (_b = this.onerror) === null || _b === undefined || _b.call(this, error2);
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
- (_a2 = this.onclose) === null || _a2 === undefined || _a2.call(this);
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.3.10",
12459
+ version: "1.4.0",
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.2.0",
12322
- "@hono/mcp": "^0.2.2",
12323
- "@modelcontextprotocol/sdk": "^1.24.3",
12324
- hono: "^4.11.1"
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.17.5"
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("URLs to extract content from"),
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({
@@ -12785,7 +12991,7 @@ Report this issue: ${reportLink}`
12785
12991
  });
12786
12992
  };
12787
12993
 
12788
- // ../../node_modules/.bun/zod@4.2.0/node_modules/zod/v3/helpers/util.js
12994
+ // ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/helpers/util.js
12789
12995
  var util;
12790
12996
  (function(util2) {
12791
12997
  util2.assertEqual = (_) => {};
@@ -12916,7 +13122,7 @@ var getParsedType2 = (data) => {
12916
13122
  }
12917
13123
  };
12918
13124
 
12919
- // ../../node_modules/.bun/zod@4.2.0/node_modules/zod/v3/ZodError.js
13125
+ // ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/ZodError.js
12920
13126
  var ZodIssueCode = util.arrayToEnum([
12921
13127
  "invalid_type",
12922
13128
  "invalid_literal",
@@ -13030,7 +13236,7 @@ ZodError2.create = (issues) => {
13030
13236
  return error2;
13031
13237
  };
13032
13238
 
13033
- // ../../node_modules/.bun/zod@4.2.0/node_modules/zod/v3/locales/en.js
13239
+ // ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/locales/en.js
13034
13240
  var errorMap = (issue2, _ctx) => {
13035
13241
  let message;
13036
13242
  switch (issue2.code) {
@@ -13133,13 +13339,13 @@ var errorMap = (issue2, _ctx) => {
13133
13339
  };
13134
13340
  var en_default2 = errorMap;
13135
13341
 
13136
- // ../../node_modules/.bun/zod@4.2.0/node_modules/zod/v3/errors.js
13342
+ // ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/errors.js
13137
13343
  var overrideErrorMap = en_default2;
13138
13344
  function getErrorMap() {
13139
13345
  return overrideErrorMap;
13140
13346
  }
13141
13347
 
13142
- // ../../node_modules/.bun/zod@4.2.0/node_modules/zod/v3/helpers/parseUtil.js
13348
+ // ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/helpers/parseUtil.js
13143
13349
  var makeIssue = (params) => {
13144
13350
  const { data, path, errorMaps, issueData } = params;
13145
13351
  const fullPath = [...path, ...issueData.path || []];
@@ -13245,14 +13451,14 @@ var isDirty = (x) => x.status === "dirty";
13245
13451
  var isValid = (x) => x.status === "valid";
13246
13452
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
13247
13453
 
13248
- // ../../node_modules/.bun/zod@4.2.0/node_modules/zod/v3/helpers/errorUtil.js
13454
+ // ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/helpers/errorUtil.js
13249
13455
  var errorUtil;
13250
13456
  (function(errorUtil2) {
13251
13457
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
13252
13458
  errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
13253
13459
  })(errorUtil || (errorUtil = {}));
13254
13460
 
13255
- // ../../node_modules/.bun/zod@4.2.0/node_modules/zod/v3/types.js
13461
+ // ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v3/types.js
13256
13462
  class ParseInputLazyPath {
13257
13463
  constructor(parent, value, path, key) {
13258
13464
  this._cachedPath = [];
@@ -16595,7 +16801,7 @@ var optionalType = ZodOptional2.create;
16595
16801
  var nullableType = ZodNullable2.create;
16596
16802
  var preprocessType = ZodEffects.createWithPreprocess;
16597
16803
  var pipelineType = ZodPipeline.create;
16598
- // ../../node_modules/.bun/zod@4.2.0/node_modules/zod/v4/mini/schemas.js
16804
+ // ../../node_modules/.bun/zod@4.3.5/node_modules/zod/v4/mini/schemas.js
16599
16805
  var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
16600
16806
  if (!inst._zod)
16601
16807
  throw new Error("Uninitialized schema in ZodMiniType.");
@@ -16613,29 +16819,31 @@ var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
16613
16819
  ...def.checks ?? [],
16614
16820
  ...checks3.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
16615
16821
  ]
16616
- });
16822
+ }, { parent: true });
16617
16823
  };
16824
+ inst.with = inst.check;
16618
16825
  inst.clone = (_def, params) => clone(inst, _def, params);
16619
16826
  inst.brand = () => inst;
16620
16827
  inst.register = (reg, meta2) => {
16621
16828
  reg.add(inst, meta2);
16622
16829
  return inst;
16623
16830
  };
16831
+ inst.apply = (fn) => fn(inst);
16624
16832
  });
16625
16833
  var ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
16626
16834
  $ZodObject.init(inst, def);
16627
16835
  ZodMiniType.init(inst, def);
16628
- exports_util.defineLazy(inst, "shape", () => def.shape);
16836
+ defineLazy(inst, "shape", () => def.shape);
16629
16837
  });
16630
16838
  function object2(shape, params) {
16631
16839
  const def = {
16632
16840
  type: "object",
16633
16841
  shape: shape ?? {},
16634
- ...exports_util.normalizeParams(params)
16842
+ ...normalizeParams(params)
16635
16843
  };
16636
16844
  return new ZodMiniObject(def);
16637
16845
  }
16638
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
16846
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
16639
16847
  function isZ4Schema(s) {
16640
16848
  const schema = s;
16641
16849
  return !!schema._zod;
@@ -16671,13 +16879,12 @@ async function safeParseAsync3(schema, data) {
16671
16879
  return result;
16672
16880
  }
16673
16881
  function getObjectShape(schema) {
16674
- var _a2, _b;
16675
16882
  if (!schema)
16676
16883
  return;
16677
16884
  let rawShape;
16678
16885
  if (isZ4Schema(schema)) {
16679
16886
  const v4Schema = schema;
16680
- rawShape = (_b = (_a2 = v4Schema._zod) === null || _a2 === undefined ? undefined : _a2.def) === null || _b === undefined ? undefined : _b.shape;
16887
+ rawShape = v4Schema._zod?.def?.shape;
16681
16888
  } else {
16682
16889
  const v3Schema = schema;
16683
16890
  rawShape = v3Schema.shape;
@@ -16687,14 +16894,13 @@ function getObjectShape(schema) {
16687
16894
  if (typeof rawShape === "function") {
16688
16895
  try {
16689
16896
  return rawShape();
16690
- } catch (_c) {
16897
+ } catch {
16691
16898
  return;
16692
16899
  }
16693
16900
  }
16694
16901
  return rawShape;
16695
16902
  }
16696
16903
  function normalizeObjectSchema(schema) {
16697
- var _a2;
16698
16904
  if (!schema)
16699
16905
  return;
16700
16906
  if (typeof schema === "object") {
@@ -16709,7 +16915,7 @@ function normalizeObjectSchema(schema) {
16709
16915
  }
16710
16916
  if (isZ4Schema(schema)) {
16711
16917
  const v4Schema = schema;
16712
- const def = (_a2 = v4Schema._zod) === null || _a2 === undefined ? undefined : _a2.def;
16918
+ const def = v4Schema._zod?.def;
16713
16919
  if (def && (def.type === "object" || def.shape !== undefined)) {
16714
16920
  return schema;
16715
16921
  }
@@ -16734,38 +16940,30 @@ function getParseErrorMessage(error2) {
16734
16940
  }
16735
16941
  try {
16736
16942
  return JSON.stringify(error2);
16737
- } catch (_a2) {
16943
+ } catch {
16738
16944
  return String(error2);
16739
16945
  }
16740
16946
  }
16741
16947
  return String(error2);
16742
16948
  }
16743
16949
  function getSchemaDescription(schema) {
16744
- var _a2, _b, _c, _d;
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;
16950
+ return schema.description;
16751
16951
  }
16752
16952
  function isSchemaOptional(schema) {
16753
- var _a2, _b, _c;
16754
16953
  if (isZ4Schema(schema)) {
16755
16954
  const v4Schema = schema;
16756
- return ((_b = (_a2 = v4Schema._zod) === null || _a2 === undefined ? undefined : _a2.def) === null || _b === undefined ? undefined : _b.type) === "optional";
16955
+ return v4Schema._zod?.def?.type === "optional";
16757
16956
  }
16758
16957
  const v3Schema = schema;
16759
16958
  if (typeof schema.isOptional === "function") {
16760
16959
  return schema.isOptional();
16761
16960
  }
16762
- return ((_c = v3Schema._def) === null || _c === undefined ? undefined : _c.typeName) === "ZodOptional";
16961
+ return v3Schema._def?.typeName === "ZodOptional";
16763
16962
  }
16764
16963
  function getLiteralValue(schema) {
16765
- var _a2;
16766
16964
  if (isZ4Schema(schema)) {
16767
16965
  const v4Schema = schema;
16768
- const def2 = (_a2 = v4Schema._zod) === null || _a2 === undefined ? undefined : _a2.def;
16966
+ const def2 = v4Schema._zod?.def;
16769
16967
  if (def2) {
16770
16968
  if (def2.value !== undefined)
16771
16969
  return def2.value;
@@ -16789,12 +16987,12 @@ function getLiteralValue(schema) {
16789
16987
  return;
16790
16988
  }
16791
16989
 
16792
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
16990
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
16793
16991
  function isTerminal(status) {
16794
16992
  return status === "completed" || status === "failed" || status === "cancelled";
16795
16993
  }
16796
16994
 
16797
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/Options.js
16995
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/Options.js
16798
16996
  var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
16799
16997
  var defaultOptions = {
16800
16998
  name: undefined,
@@ -16827,7 +17025,7 @@ var getDefaultOptions = (options) => typeof options === "string" ? {
16827
17025
  ...defaultOptions,
16828
17026
  ...options
16829
17027
  };
16830
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/Refs.js
17028
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/Refs.js
16831
17029
  var getRefs = (options) => {
16832
17030
  const _options = getDefaultOptions(options);
16833
17031
  const currentPath = _options.name !== undefined ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
@@ -16846,7 +17044,7 @@ var getRefs = (options) => {
16846
17044
  ]))
16847
17045
  };
16848
17046
  };
16849
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
17047
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
16850
17048
  function addErrorMessage(res, key, errorMessage, refs) {
16851
17049
  if (!refs?.errorMessages)
16852
17050
  return;
@@ -16861,7 +17059,7 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
16861
17059
  res[key] = value;
16862
17060
  addErrorMessage(res, key, errorMessage, refs);
16863
17061
  }
16864
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
17062
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
16865
17063
  var getRelativePath = (pathA, pathB) => {
16866
17064
  let i = 0;
16867
17065
  for (;i < pathA.length && i < pathB.length; i++) {
@@ -16870,7 +17068,7 @@ var getRelativePath = (pathA, pathB) => {
16870
17068
  }
16871
17069
  return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
16872
17070
  };
16873
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
17071
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
16874
17072
  function parseAnyDef(refs) {
16875
17073
  if (refs.target !== "openAi") {
16876
17074
  return {};
@@ -16886,7 +17084,7 @@ function parseAnyDef(refs) {
16886
17084
  };
16887
17085
  }
16888
17086
 
16889
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
17087
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
16890
17088
  function parseArrayDef(def, refs) {
16891
17089
  const res = {
16892
17090
  type: "array"
@@ -16910,7 +17108,7 @@ function parseArrayDef(def, refs) {
16910
17108
  return res;
16911
17109
  }
16912
17110
 
16913
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
17111
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
16914
17112
  function parseBigintDef(def, refs) {
16915
17113
  const res = {
16916
17114
  type: "integer",
@@ -16956,24 +17154,24 @@ function parseBigintDef(def, refs) {
16956
17154
  return res;
16957
17155
  }
16958
17156
 
16959
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
17157
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
16960
17158
  function parseBooleanDef() {
16961
17159
  return {
16962
17160
  type: "boolean"
16963
17161
  };
16964
17162
  }
16965
17163
 
16966
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
17164
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
16967
17165
  function parseBrandedDef(_def, refs) {
16968
17166
  return parseDef(_def.type._def, refs);
16969
17167
  }
16970
17168
 
16971
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
17169
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
16972
17170
  var parseCatchDef = (def, refs) => {
16973
17171
  return parseDef(def.innerType._def, refs);
16974
17172
  };
16975
17173
 
16976
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
17174
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
16977
17175
  function parseDateDef(def, refs, overrideDateStrategy) {
16978
17176
  const strategy = overrideDateStrategy ?? refs.dateStrategy;
16979
17177
  if (Array.isArray(strategy)) {
@@ -17018,7 +17216,7 @@ var integerDateParser = (def, refs) => {
17018
17216
  return res;
17019
17217
  };
17020
17218
 
17021
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
17219
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
17022
17220
  function parseDefaultDef(_def, refs) {
17023
17221
  return {
17024
17222
  ...parseDef(_def.innerType._def, refs),
@@ -17026,12 +17224,12 @@ function parseDefaultDef(_def, refs) {
17026
17224
  };
17027
17225
  }
17028
17226
 
17029
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
17227
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
17030
17228
  function parseEffectsDef(_def, refs) {
17031
17229
  return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(refs);
17032
17230
  }
17033
17231
 
17034
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
17232
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
17035
17233
  function parseEnumDef(def) {
17036
17234
  return {
17037
17235
  type: "string",
@@ -17039,7 +17237,7 @@ function parseEnumDef(def) {
17039
17237
  };
17040
17238
  }
17041
17239
 
17042
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
17240
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
17043
17241
  var isJsonSchema7AllOfType = (type) => {
17044
17242
  if ("type" in type && type.type === "string")
17045
17243
  return false;
@@ -17081,7 +17279,7 @@ function parseIntersectionDef(def, refs) {
17081
17279
  } : undefined;
17082
17280
  }
17083
17281
 
17084
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
17282
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
17085
17283
  function parseLiteralDef(def, refs) {
17086
17284
  const parsedType2 = typeof def.value;
17087
17285
  if (parsedType2 !== "bigint" && parsedType2 !== "number" && parsedType2 !== "boolean" && parsedType2 !== "string") {
@@ -17101,7 +17299,7 @@ function parseLiteralDef(def, refs) {
17101
17299
  };
17102
17300
  }
17103
17301
 
17104
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
17302
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
17105
17303
  var emojiRegex2 = undefined;
17106
17304
  var zodPatterns = {
17107
17305
  cuid: /^[cC][^\s-]{8,}$/,
@@ -17398,7 +17596,7 @@ function stringifyRegExpWithFlags(regex, refs) {
17398
17596
  return pattern;
17399
17597
  }
17400
17598
 
17401
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
17599
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
17402
17600
  function parseRecordDef(def, refs) {
17403
17601
  if (refs.target === "openAi") {
17404
17602
  console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
@@ -17450,7 +17648,7 @@ function parseRecordDef(def, refs) {
17450
17648
  return schema;
17451
17649
  }
17452
17650
 
17453
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
17651
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
17454
17652
  function parseMapDef(def, refs) {
17455
17653
  if (refs.mapStrategy === "record") {
17456
17654
  return parseRecordDef(def, refs);
@@ -17475,7 +17673,7 @@ function parseMapDef(def, refs) {
17475
17673
  };
17476
17674
  }
17477
17675
 
17478
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
17676
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
17479
17677
  function parseNativeEnumDef(def) {
17480
17678
  const object3 = def.values;
17481
17679
  const actualKeys = Object.keys(def.values).filter((key) => {
@@ -17489,7 +17687,7 @@ function parseNativeEnumDef(def) {
17489
17687
  };
17490
17688
  }
17491
17689
 
17492
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
17690
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
17493
17691
  function parseNeverDef(refs) {
17494
17692
  return refs.target === "openAi" ? undefined : {
17495
17693
  not: parseAnyDef({
@@ -17499,7 +17697,7 @@ function parseNeverDef(refs) {
17499
17697
  };
17500
17698
  }
17501
17699
 
17502
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
17700
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
17503
17701
  function parseNullDef(refs) {
17504
17702
  return refs.target === "openApi3" ? {
17505
17703
  enum: ["null"],
@@ -17509,7 +17707,7 @@ function parseNullDef(refs) {
17509
17707
  };
17510
17708
  }
17511
17709
 
17512
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
17710
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
17513
17711
  var primitiveMappings = {
17514
17712
  ZodString: "string",
17515
17713
  ZodNumber: "number",
@@ -17577,7 +17775,7 @@ var asAnyOf = (def, refs) => {
17577
17775
  return anyOf.length ? { anyOf } : undefined;
17578
17776
  };
17579
17777
 
17580
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
17778
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
17581
17779
  function parseNullableDef(def, refs) {
17582
17780
  if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
17583
17781
  if (refs.target === "openApi3") {
@@ -17609,7 +17807,7 @@ function parseNullableDef(def, refs) {
17609
17807
  return base && { anyOf: [base, { type: "null" }] };
17610
17808
  }
17611
17809
 
17612
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
17810
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
17613
17811
  function parseNumberDef(def, refs) {
17614
17812
  const res = {
17615
17813
  type: "number"
@@ -17658,7 +17856,7 @@ function parseNumberDef(def, refs) {
17658
17856
  return res;
17659
17857
  }
17660
17858
 
17661
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
17859
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
17662
17860
  function parseObjectDef(def, refs) {
17663
17861
  const forceOptionalIntoNullable = refs.target === "openAi";
17664
17862
  const result = {
@@ -17728,7 +17926,7 @@ function safeIsOptional(schema) {
17728
17926
  }
17729
17927
  }
17730
17928
 
17731
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
17929
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
17732
17930
  var parseOptionalDef = (def, refs) => {
17733
17931
  if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
17734
17932
  return parseDef(def.innerType._def, refs);
@@ -17747,7 +17945,7 @@ var parseOptionalDef = (def, refs) => {
17747
17945
  } : parseAnyDef(refs);
17748
17946
  };
17749
17947
 
17750
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
17948
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
17751
17949
  var parsePipelineDef = (def, refs) => {
17752
17950
  if (refs.pipeStrategy === "input") {
17753
17951
  return parseDef(def.in._def, refs);
@@ -17767,12 +17965,12 @@ var parsePipelineDef = (def, refs) => {
17767
17965
  };
17768
17966
  };
17769
17967
 
17770
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
17968
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
17771
17969
  function parsePromiseDef(def, refs) {
17772
17970
  return parseDef(def.type._def, refs);
17773
17971
  }
17774
17972
 
17775
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
17973
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
17776
17974
  function parseSetDef(def, refs) {
17777
17975
  const items = parseDef(def.valueType._def, {
17778
17976
  ...refs,
@@ -17792,7 +17990,7 @@ function parseSetDef(def, refs) {
17792
17990
  return schema;
17793
17991
  }
17794
17992
 
17795
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
17993
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
17796
17994
  function parseTupleDef(def, refs) {
17797
17995
  if (def.rest) {
17798
17996
  return {
@@ -17820,24 +18018,24 @@ function parseTupleDef(def, refs) {
17820
18018
  }
17821
18019
  }
17822
18020
 
17823
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
18021
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
17824
18022
  function parseUndefinedDef(refs) {
17825
18023
  return {
17826
18024
  not: parseAnyDef(refs)
17827
18025
  };
17828
18026
  }
17829
18027
 
17830
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
18028
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
17831
18029
  function parseUnknownDef(refs) {
17832
18030
  return parseAnyDef(refs);
17833
18031
  }
17834
18032
 
17835
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
18033
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
17836
18034
  var parseReadonlyDef = (def, refs) => {
17837
18035
  return parseDef(def.innerType._def, refs);
17838
18036
  };
17839
18037
 
17840
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/selectParser.js
18038
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/selectParser.js
17841
18039
  var selectParser = (def, typeName, refs) => {
17842
18040
  switch (typeName) {
17843
18041
  case ZodFirstPartyTypeKind.ZodString:
@@ -17915,7 +18113,7 @@ var selectParser = (def, typeName, refs) => {
17915
18113
  }
17916
18114
  };
17917
18115
 
17918
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/parseDef.js
18116
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/parseDef.js
17919
18117
  function parseDef(def, refs, forceResolution = false) {
17920
18118
  const seenItem = refs.seen.get(def);
17921
18119
  if (refs.override) {
@@ -17970,7 +18168,7 @@ var addMeta = (def, refs, jsonSchema) => {
17970
18168
  }
17971
18169
  return jsonSchema;
17972
18170
  };
17973
- // ../../node_modules/.bun/zod-to-json-schema@3.25.0+d28af003e585004e/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
18171
+ // ../../node_modules/.bun/zod-to-json-schema@3.25.1+3b1ddfa528571d14/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
17974
18172
  var zodToJsonSchema = (schema, options) => {
17975
18173
  const refs = getRefs(options);
17976
18174
  let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema2]) => ({
@@ -18030,7 +18228,7 @@ var zodToJsonSchema = (schema, options) => {
18030
18228
  }
18031
18229
  return combined;
18032
18230
  };
18033
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
18231
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
18034
18232
  function mapMiniTarget(t) {
18035
18233
  if (!t)
18036
18234
  return "draft-7";
@@ -18041,21 +18239,20 @@ function mapMiniTarget(t) {
18041
18239
  return "draft-7";
18042
18240
  }
18043
18241
  function toJsonSchemaCompat(schema, opts) {
18044
- var _a2, _b, _c;
18045
18242
  if (isZ4Schema(schema)) {
18046
18243
  return toJSONSchema(schema, {
18047
- target: mapMiniTarget(opts === null || opts === undefined ? undefined : opts.target),
18048
- io: (_a2 = opts === null || opts === undefined ? undefined : opts.pipeStrategy) !== null && _a2 !== undefined ? _a2 : "input"
18244
+ target: mapMiniTarget(opts?.target),
18245
+ io: opts?.pipeStrategy ?? "input"
18049
18246
  });
18050
18247
  }
18051
18248
  return zodToJsonSchema(schema, {
18052
- strictUnions: (_b = opts === null || opts === undefined ? undefined : opts.strictUnions) !== null && _b !== undefined ? _b : true,
18053
- pipeStrategy: (_c = opts === null || opts === undefined ? undefined : opts.pipeStrategy) !== null && _c !== undefined ? _c : "input"
18249
+ strictUnions: opts?.strictUnions ?? true,
18250
+ pipeStrategy: opts?.pipeStrategy ?? "input"
18054
18251
  });
18055
18252
  }
18056
18253
  function getMethodLiteral(schema) {
18057
18254
  const shape = getObjectShape(schema);
18058
- const methodSchema = shape === null || shape === undefined ? undefined : shape.method;
18255
+ const methodSchema = shape?.method;
18059
18256
  if (!methodSchema) {
18060
18257
  throw new Error("Schema is missing a method literal");
18061
18258
  }
@@ -18073,7 +18270,7 @@ function parseWithCompat(schema, data) {
18073
18270
  return result.data;
18074
18271
  }
18075
18272
 
18076
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
18273
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
18077
18274
  var DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
18078
18275
 
18079
18276
  class Protocol {
@@ -18096,8 +18293,8 @@ class Protocol {
18096
18293
  this._onprogress(notification);
18097
18294
  });
18098
18295
  this.setRequestHandler(PingRequestSchema, (_request) => ({}));
18099
- this._taskStore = _options === null || _options === undefined ? undefined : _options.taskStore;
18100
- this._taskMessageQueue = _options === null || _options === undefined ? undefined : _options.taskMessageQueue;
18296
+ this._taskStore = _options?.taskStore;
18297
+ this._taskMessageQueue = _options?.taskMessageQueue;
18101
18298
  if (this._taskStore) {
18102
18299
  this.setRequestHandler(GetTaskRequestSchema, async (request, extra) => {
18103
18300
  const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
@@ -18110,7 +18307,6 @@ class Protocol {
18110
18307
  });
18111
18308
  this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
18112
18309
  const handleTaskResult = async () => {
18113
- var _a2;
18114
18310
  const taskId = request.params.taskId;
18115
18311
  if (this._taskMessageQueue) {
18116
18312
  let queuedMessage;
@@ -18134,7 +18330,7 @@ class Protocol {
18134
18330
  }
18135
18331
  continue;
18136
18332
  }
18137
- await ((_a2 = this._transport) === null || _a2 === undefined ? undefined : _a2.send(queuedMessage.message, { relatedRequestId: extra.requestId }));
18333
+ await this._transport?.send(queuedMessage.message, { relatedRequestId: extra.requestId });
18138
18334
  }
18139
18335
  }
18140
18336
  const task = await this._taskStore.getTask(taskId, extra.sessionId);
@@ -18163,9 +18359,8 @@ class Protocol {
18163
18359
  return await handleTaskResult();
18164
18360
  });
18165
18361
  this.setRequestHandler(ListTasksRequestSchema, async (request, extra) => {
18166
- var _a2;
18167
18362
  try {
18168
- const { tasks, nextCursor } = await this._taskStore.listTasks((_a2 = request.params) === null || _a2 === undefined ? undefined : _a2.cursor, extra.sessionId);
18363
+ const { tasks, nextCursor } = await this._taskStore.listTasks(request.params?.cursor, extra.sessionId);
18169
18364
  return {
18170
18365
  tasks,
18171
18366
  nextCursor,
@@ -18204,8 +18399,11 @@ class Protocol {
18204
18399
  }
18205
18400
  }
18206
18401
  async _oncancel(notification) {
18402
+ if (!notification.params.requestId) {
18403
+ return;
18404
+ }
18207
18405
  const controller = this._requestHandlerAbortControllers.get(notification.params.requestId);
18208
- controller === null || controller === undefined || controller.abort(notification.params.reason);
18406
+ controller?.abort(notification.params.reason);
18209
18407
  }
18210
18408
  _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
18211
18409
  this._timeoutInfo.set(messageId, {
@@ -18241,22 +18439,21 @@ class Protocol {
18241
18439
  }
18242
18440
  }
18243
18441
  async connect(transport) {
18244
- var _a2, _b, _c;
18245
18442
  this._transport = transport;
18246
- const _onclose = (_a2 = this.transport) === null || _a2 === undefined ? undefined : _a2.onclose;
18443
+ const _onclose = this.transport?.onclose;
18247
18444
  this._transport.onclose = () => {
18248
- _onclose === null || _onclose === undefined || _onclose();
18445
+ _onclose?.();
18249
18446
  this._onclose();
18250
18447
  };
18251
- const _onerror = (_b = this.transport) === null || _b === undefined ? undefined : _b.onerror;
18448
+ const _onerror = this.transport?.onerror;
18252
18449
  this._transport.onerror = (error2) => {
18253
- _onerror === null || _onerror === undefined || _onerror(error2);
18450
+ _onerror?.(error2);
18254
18451
  this._onerror(error2);
18255
18452
  };
18256
- const _onmessage = (_c = this._transport) === null || _c === undefined ? undefined : _c.onmessage;
18453
+ const _onmessage = this._transport?.onmessage;
18257
18454
  this._transport.onmessage = (message, extra) => {
18258
- _onmessage === null || _onmessage === undefined || _onmessage(message, extra);
18259
- if (isJSONRPCResponse(message) || isJSONRPCError(message)) {
18455
+ _onmessage?.(message, extra);
18456
+ if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
18260
18457
  this._onresponse(message);
18261
18458
  } else if (isJSONRPCRequest(message)) {
18262
18459
  this._onrequest(message, extra);
@@ -18269,7 +18466,6 @@ class Protocol {
18269
18466
  await this._transport.start();
18270
18467
  }
18271
18468
  _onclose() {
18272
- var _a2;
18273
18469
  const responseHandlers = this._responseHandlers;
18274
18470
  this._responseHandlers = new Map;
18275
18471
  this._progressHandlers.clear();
@@ -18277,28 +18473,25 @@ class Protocol {
18277
18473
  this._pendingDebouncedNotifications.clear();
18278
18474
  const error2 = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed");
18279
18475
  this._transport = undefined;
18280
- (_a2 = this.onclose) === null || _a2 === undefined || _a2.call(this);
18476
+ this.onclose?.();
18281
18477
  for (const handler of responseHandlers.values()) {
18282
18478
  handler(error2);
18283
18479
  }
18284
18480
  }
18285
18481
  _onerror(error2) {
18286
- var _a2;
18287
- (_a2 = this.onerror) === null || _a2 === undefined || _a2.call(this, error2);
18482
+ this.onerror?.(error2);
18288
18483
  }
18289
18484
  _onnotification(notification) {
18290
- var _a2;
18291
- const handler = (_a2 = this._notificationHandlers.get(notification.method)) !== null && _a2 !== undefined ? _a2 : this.fallbackNotificationHandler;
18485
+ const handler = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler;
18292
18486
  if (handler === undefined) {
18293
18487
  return;
18294
18488
  }
18295
18489
  Promise.resolve().then(() => handler(notification)).catch((error2) => this._onerror(new Error(`Uncaught error in notification handler: ${error2}`)));
18296
18490
  }
18297
18491
  _onrequest(request, extra) {
18298
- var _a2, _b, _c, _d, _e, _f;
18299
- const handler = (_a2 = this._requestHandlers.get(request.method)) !== null && _a2 !== undefined ? _a2 : this.fallbackRequestHandler;
18492
+ const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
18300
18493
  const capturedTransport = this._transport;
18301
- const relatedTaskId = (_d = (_c = (_b = request.params) === null || _b === undefined ? undefined : _b._meta) === null || _c === undefined ? undefined : _c[RELATED_TASK_META_KEY]) === null || _d === undefined ? undefined : _d.taskId;
18494
+ const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
18302
18495
  if (handler === undefined) {
18303
18496
  const errorResponse = {
18304
18497
  jsonrpc: "2.0",
@@ -18313,20 +18506,20 @@ class Protocol {
18313
18506
  type: "error",
18314
18507
  message: errorResponse,
18315
18508
  timestamp: Date.now()
18316
- }, capturedTransport === null || capturedTransport === undefined ? undefined : capturedTransport.sessionId).catch((error2) => this._onerror(new Error(`Failed to enqueue error response: ${error2}`)));
18509
+ }, capturedTransport?.sessionId).catch((error2) => this._onerror(new Error(`Failed to enqueue error response: ${error2}`)));
18317
18510
  } else {
18318
- capturedTransport === null || capturedTransport === undefined || capturedTransport.send(errorResponse).catch((error2) => this._onerror(new Error(`Failed to send an error response: ${error2}`)));
18511
+ capturedTransport?.send(errorResponse).catch((error2) => this._onerror(new Error(`Failed to send an error response: ${error2}`)));
18319
18512
  }
18320
18513
  return;
18321
18514
  }
18322
18515
  const abortController = new AbortController;
18323
18516
  this._requestHandlerAbortControllers.set(request.id, abortController);
18324
- const taskCreationParams = (_e = request.params) === null || _e === undefined ? undefined : _e.task;
18325
- const taskStore = this._taskStore ? this.requestTaskStore(request, capturedTransport === null || capturedTransport === undefined ? undefined : capturedTransport.sessionId) : undefined;
18517
+ const taskCreationParams = isTaskAugmentedRequestParams(request.params) ? request.params.task : undefined;
18518
+ const taskStore = this._taskStore ? this.requestTaskStore(request, capturedTransport?.sessionId) : undefined;
18326
18519
  const fullExtra = {
18327
18520
  signal: abortController.signal,
18328
- sessionId: capturedTransport === null || capturedTransport === undefined ? undefined : capturedTransport.sessionId,
18329
- _meta: (_f = request.params) === null || _f === undefined ? undefined : _f._meta,
18521
+ sessionId: capturedTransport?.sessionId,
18522
+ _meta: request.params?._meta,
18330
18523
  sendNotification: async (notification) => {
18331
18524
  const notificationOptions = { relatedRequestId: request.id };
18332
18525
  if (relatedTaskId) {
@@ -18335,25 +18528,24 @@ class Protocol {
18335
18528
  await this.notification(notification, notificationOptions);
18336
18529
  },
18337
18530
  sendRequest: async (r, resultSchema, options) => {
18338
- var _a3, _b2;
18339
18531
  const requestOptions = { ...options, relatedRequestId: request.id };
18340
18532
  if (relatedTaskId && !requestOptions.relatedTask) {
18341
18533
  requestOptions.relatedTask = { taskId: relatedTaskId };
18342
18534
  }
18343
- const effectiveTaskId = (_b2 = (_a3 = requestOptions.relatedTask) === null || _a3 === undefined ? undefined : _a3.taskId) !== null && _b2 !== undefined ? _b2 : relatedTaskId;
18535
+ const effectiveTaskId = requestOptions.relatedTask?.taskId ?? relatedTaskId;
18344
18536
  if (effectiveTaskId && taskStore) {
18345
18537
  await taskStore.updateTaskStatus(effectiveTaskId, "input_required");
18346
18538
  }
18347
18539
  return await this.request(r, resultSchema, requestOptions);
18348
18540
  },
18349
- authInfo: extra === null || extra === undefined ? undefined : extra.authInfo,
18541
+ authInfo: extra?.authInfo,
18350
18542
  requestId: request.id,
18351
- requestInfo: extra === null || extra === undefined ? undefined : extra.requestInfo,
18543
+ requestInfo: extra?.requestInfo,
18352
18544
  taskId: relatedTaskId,
18353
18545
  taskStore,
18354
- taskRequestedTtl: taskCreationParams === null || taskCreationParams === undefined ? undefined : taskCreationParams.ttl,
18355
- closeSSEStream: extra === null || extra === undefined ? undefined : extra.closeSSEStream,
18356
- closeStandaloneSSEStream: extra === null || extra === undefined ? undefined : extra.closeStandaloneSSEStream
18546
+ taskRequestedTtl: taskCreationParams?.ttl,
18547
+ closeSSEStream: extra?.closeSSEStream,
18548
+ closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
18357
18549
  };
18358
18550
  Promise.resolve().then(() => {
18359
18551
  if (taskCreationParams) {
@@ -18373,12 +18565,11 @@ class Protocol {
18373
18565
  type: "response",
18374
18566
  message: response,
18375
18567
  timestamp: Date.now()
18376
- }, capturedTransport === null || capturedTransport === undefined ? undefined : capturedTransport.sessionId);
18568
+ }, capturedTransport?.sessionId);
18377
18569
  } else {
18378
- await (capturedTransport === null || capturedTransport === undefined ? undefined : capturedTransport.send(response));
18570
+ await capturedTransport?.send(response);
18379
18571
  }
18380
18572
  }, async (error2) => {
18381
- var _a3;
18382
18573
  if (abortController.signal.aborted) {
18383
18574
  return;
18384
18575
  }
@@ -18387,7 +18578,7 @@ class Protocol {
18387
18578
  id: request.id,
18388
18579
  error: {
18389
18580
  code: Number.isSafeInteger(error2["code"]) ? error2["code"] : ErrorCode.InternalError,
18390
- message: (_a3 = error2.message) !== null && _a3 !== undefined ? _a3 : "Internal error",
18581
+ message: error2.message ?? "Internal error",
18391
18582
  ...error2["data"] !== undefined && { data: error2["data"] }
18392
18583
  }
18393
18584
  };
@@ -18396,9 +18587,9 @@ class Protocol {
18396
18587
  type: "error",
18397
18588
  message: errorResponse,
18398
18589
  timestamp: Date.now()
18399
- }, capturedTransport === null || capturedTransport === undefined ? undefined : capturedTransport.sessionId);
18590
+ }, capturedTransport?.sessionId);
18400
18591
  } else {
18401
- await (capturedTransport === null || capturedTransport === undefined ? undefined : capturedTransport.send(errorResponse));
18592
+ await capturedTransport?.send(errorResponse);
18402
18593
  }
18403
18594
  }).catch((error2) => this._onerror(new Error(`Failed to send response: ${error2}`))).finally(() => {
18404
18595
  this._requestHandlerAbortControllers.delete(request.id);
@@ -18432,7 +18623,7 @@ class Protocol {
18432
18623
  const resolver = this._requestResolvers.get(messageId);
18433
18624
  if (resolver) {
18434
18625
  this._requestResolvers.delete(messageId);
18435
- if (isJSONRPCResponse(response)) {
18626
+ if (isJSONRPCResultResponse(response)) {
18436
18627
  resolver(response);
18437
18628
  } else {
18438
18629
  const error2 = new McpError(response.error.code, response.error.message, response.error.data);
@@ -18448,7 +18639,7 @@ class Protocol {
18448
18639
  this._responseHandlers.delete(messageId);
18449
18640
  this._cleanupTimeout(messageId);
18450
18641
  let isTaskResponse = false;
18451
- if (isJSONRPCResponse(response) && response.result && typeof response.result === "object") {
18642
+ if (isJSONRPCResultResponse(response) && response.result && typeof response.result === "object") {
18452
18643
  const result = response.result;
18453
18644
  if (result.task && typeof result.task === "object") {
18454
18645
  const task = result.task;
@@ -18461,7 +18652,7 @@ class Protocol {
18461
18652
  if (!isTaskResponse) {
18462
18653
  this._progressHandlers.delete(messageId);
18463
18654
  }
18464
- if (isJSONRPCResponse(response)) {
18655
+ if (isJSONRPCResultResponse(response)) {
18465
18656
  handler(response);
18466
18657
  } else {
18467
18658
  const error2 = McpError.fromError(response.error.code, response.error.message, response.error.data);
@@ -18472,12 +18663,10 @@ class Protocol {
18472
18663
  return this._transport;
18473
18664
  }
18474
18665
  async close() {
18475
- var _a2;
18476
- await ((_a2 = this._transport) === null || _a2 === undefined ? undefined : _a2.close());
18666
+ await this._transport?.close();
18477
18667
  }
18478
18668
  async* requestStream(request, resultSchema, options) {
18479
- var _a2, _b, _c, _d;
18480
- const { task } = options !== null && options !== undefined ? options : {};
18669
+ const { task } = options ?? {};
18481
18670
  if (!task) {
18482
18671
  try {
18483
18672
  const result = await this.request(request, resultSchema, options);
@@ -18524,9 +18713,9 @@ class Protocol {
18524
18713
  yield { type: "result", result };
18525
18714
  return;
18526
18715
  }
18527
- const pollInterval = (_c = (_a2 = task2.pollInterval) !== null && _a2 !== undefined ? _a2 : (_b = this._options) === null || _b === undefined ? undefined : _b.defaultTaskPollInterval) !== null && _c !== undefined ? _c : 1000;
18716
+ const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1000;
18528
18717
  await new Promise((resolve) => setTimeout(resolve, pollInterval));
18529
- (_d = options === null || options === undefined ? undefined : options.signal) === null || _d === undefined || _d.throwIfAborted();
18718
+ options?.signal?.throwIfAborted();
18530
18719
  }
18531
18720
  } catch (error2) {
18532
18721
  yield {
@@ -18536,9 +18725,8 @@ class Protocol {
18536
18725
  }
18537
18726
  }
18538
18727
  request(request, resultSchema, options) {
18539
- const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options !== null && options !== undefined ? options : {};
18728
+ const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
18540
18729
  return new Promise((resolve, reject) => {
18541
- var _a2, _b, _c, _d, _e, _f, _g;
18542
18730
  const earlyReject = (error2) => {
18543
18731
  reject(error2);
18544
18732
  };
@@ -18546,7 +18734,7 @@ class Protocol {
18546
18734
  earlyReject(new Error("Not connected"));
18547
18735
  return;
18548
18736
  }
18549
- if (((_a2 = this._options) === null || _a2 === undefined ? undefined : _a2.enforceStrictCapabilities) === true) {
18737
+ if (this._options?.enforceStrictCapabilities === true) {
18550
18738
  try {
18551
18739
  this.assertCapabilityForMethod(request.method);
18552
18740
  if (task) {
@@ -18557,19 +18745,19 @@ class Protocol {
18557
18745
  return;
18558
18746
  }
18559
18747
  }
18560
- (_b = options === null || options === undefined ? undefined : options.signal) === null || _b === undefined || _b.throwIfAborted();
18748
+ options?.signal?.throwIfAborted();
18561
18749
  const messageId = this._requestMessageId++;
18562
18750
  const jsonrpcRequest = {
18563
18751
  ...request,
18564
18752
  jsonrpc: "2.0",
18565
18753
  id: messageId
18566
18754
  };
18567
- if (options === null || options === undefined ? undefined : options.onprogress) {
18755
+ if (options?.onprogress) {
18568
18756
  this._progressHandlers.set(messageId, options.onprogress);
18569
18757
  jsonrpcRequest.params = {
18570
18758
  ...request.params,
18571
18759
  _meta: {
18572
- ...((_c = request.params) === null || _c === undefined ? undefined : _c._meta) || {},
18760
+ ...request.params?._meta || {},
18573
18761
  progressToken: messageId
18574
18762
  }
18575
18763
  };
@@ -18584,17 +18772,16 @@ class Protocol {
18584
18772
  jsonrpcRequest.params = {
18585
18773
  ...jsonrpcRequest.params,
18586
18774
  _meta: {
18587
- ...((_d = jsonrpcRequest.params) === null || _d === undefined ? undefined : _d._meta) || {},
18775
+ ...jsonrpcRequest.params?._meta || {},
18588
18776
  [RELATED_TASK_META_KEY]: relatedTask
18589
18777
  }
18590
18778
  };
18591
18779
  }
18592
18780
  const cancel = (reason) => {
18593
- var _a3;
18594
18781
  this._responseHandlers.delete(messageId);
18595
18782
  this._progressHandlers.delete(messageId);
18596
18783
  this._cleanupTimeout(messageId);
18597
- (_a3 = this._transport) === null || _a3 === undefined || _a3.send({
18784
+ this._transport?.send({
18598
18785
  jsonrpc: "2.0",
18599
18786
  method: "notifications/cancelled",
18600
18787
  params: {
@@ -18606,8 +18793,7 @@ class Protocol {
18606
18793
  reject(error2);
18607
18794
  };
18608
18795
  this._responseHandlers.set(messageId, (response) => {
18609
- var _a3;
18610
- if ((_a3 = options === null || options === undefined ? undefined : options.signal) === null || _a3 === undefined ? undefined : _a3.aborted) {
18796
+ if (options?.signal?.aborted) {
18611
18797
  return;
18612
18798
  }
18613
18799
  if (response instanceof Error) {
@@ -18624,14 +18810,13 @@ class Protocol {
18624
18810
  reject(error2);
18625
18811
  }
18626
18812
  });
18627
- (_e = options === null || options === undefined ? undefined : options.signal) === null || _e === undefined || _e.addEventListener("abort", () => {
18628
- var _a3;
18629
- cancel((_a3 = options === null || options === undefined ? undefined : options.signal) === null || _a3 === undefined ? undefined : _a3.reason);
18813
+ options?.signal?.addEventListener("abort", () => {
18814
+ cancel(options?.signal?.reason);
18630
18815
  });
18631
- const timeout = (_f = options === null || options === undefined ? undefined : options.timeout) !== null && _f !== undefined ? _f : DEFAULT_REQUEST_TIMEOUT_MSEC;
18816
+ const timeout = options?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC;
18632
18817
  const timeoutHandler = () => cancel(McpError.fromError(ErrorCode.RequestTimeout, "Request timed out", { timeout }));
18633
- this._setupTimeout(messageId, timeout, options === null || options === undefined ? undefined : options.maxTotalTimeout, timeoutHandler, (_g = options === null || options === undefined ? undefined : options.resetTimeoutOnProgress) !== null && _g !== undefined ? _g : false);
18634
- const relatedTaskId = relatedTask === null || relatedTask === undefined ? undefined : relatedTask.taskId;
18818
+ this._setupTimeout(messageId, timeout, options?.maxTotalTimeout, timeoutHandler, options?.resetTimeoutOnProgress ?? false);
18819
+ const relatedTaskId = relatedTask?.taskId;
18635
18820
  if (relatedTaskId) {
18636
18821
  const responseResolver = (response) => {
18637
18822
  const handler = this._responseHandlers.get(messageId);
@@ -18671,12 +18856,11 @@ class Protocol {
18671
18856
  return this.request({ method: "tasks/cancel", params }, CancelTaskResultSchema, options);
18672
18857
  }
18673
18858
  async notification(notification, options) {
18674
- var _a2, _b, _c, _d, _e;
18675
18859
  if (!this._transport) {
18676
18860
  throw new Error("Not connected");
18677
18861
  }
18678
18862
  this.assertNotificationCapability(notification.method);
18679
- const relatedTaskId = (_a2 = options === null || options === undefined ? undefined : options.relatedTask) === null || _a2 === undefined ? undefined : _a2.taskId;
18863
+ const relatedTaskId = options?.relatedTask?.taskId;
18680
18864
  if (relatedTaskId) {
18681
18865
  const jsonrpcNotification2 = {
18682
18866
  ...notification,
@@ -18684,7 +18868,7 @@ class Protocol {
18684
18868
  params: {
18685
18869
  ...notification.params,
18686
18870
  _meta: {
18687
- ...((_b = notification.params) === null || _b === undefined ? undefined : _b._meta) || {},
18871
+ ...notification.params?._meta || {},
18688
18872
  [RELATED_TASK_META_KEY]: options.relatedTask
18689
18873
  }
18690
18874
  }
@@ -18696,15 +18880,14 @@ class Protocol {
18696
18880
  });
18697
18881
  return;
18698
18882
  }
18699
- const debouncedMethods = (_d = (_c = this._options) === null || _c === undefined ? undefined : _c.debouncedNotificationMethods) !== null && _d !== undefined ? _d : [];
18700
- const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !(options === null || options === undefined ? undefined : options.relatedRequestId) && !(options === null || options === undefined ? undefined : options.relatedTask);
18883
+ const debouncedMethods = this._options?.debouncedNotificationMethods ?? [];
18884
+ const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !options?.relatedRequestId && !options?.relatedTask;
18701
18885
  if (canDebounce) {
18702
18886
  if (this._pendingDebouncedNotifications.has(notification.method)) {
18703
18887
  return;
18704
18888
  }
18705
18889
  this._pendingDebouncedNotifications.add(notification.method);
18706
18890
  Promise.resolve().then(() => {
18707
- var _a3, _b2;
18708
18891
  this._pendingDebouncedNotifications.delete(notification.method);
18709
18892
  if (!this._transport) {
18710
18893
  return;
@@ -18713,19 +18896,19 @@ class Protocol {
18713
18896
  ...notification,
18714
18897
  jsonrpc: "2.0"
18715
18898
  };
18716
- if (options === null || options === undefined ? undefined : options.relatedTask) {
18899
+ if (options?.relatedTask) {
18717
18900
  jsonrpcNotification2 = {
18718
18901
  ...jsonrpcNotification2,
18719
18902
  params: {
18720
18903
  ...jsonrpcNotification2.params,
18721
18904
  _meta: {
18722
- ...((_a3 = jsonrpcNotification2.params) === null || _a3 === undefined ? undefined : _a3._meta) || {},
18905
+ ...jsonrpcNotification2.params?._meta || {},
18723
18906
  [RELATED_TASK_META_KEY]: options.relatedTask
18724
18907
  }
18725
18908
  }
18726
18909
  };
18727
18910
  }
18728
- (_b2 = this._transport) === null || _b2 === undefined || _b2.send(jsonrpcNotification2, options).catch((error2) => this._onerror(error2));
18911
+ this._transport?.send(jsonrpcNotification2, options).catch((error2) => this._onerror(error2));
18729
18912
  });
18730
18913
  return;
18731
18914
  }
@@ -18733,13 +18916,13 @@ class Protocol {
18733
18916
  ...notification,
18734
18917
  jsonrpc: "2.0"
18735
18918
  };
18736
- if (options === null || options === undefined ? undefined : options.relatedTask) {
18919
+ if (options?.relatedTask) {
18737
18920
  jsonrpcNotification = {
18738
18921
  ...jsonrpcNotification,
18739
18922
  params: {
18740
18923
  ...jsonrpcNotification.params,
18741
18924
  _meta: {
18742
- ...((_e = jsonrpcNotification.params) === null || _e === undefined ? undefined : _e._meta) || {},
18925
+ ...jsonrpcNotification.params?._meta || {},
18743
18926
  [RELATED_TASK_META_KEY]: options.relatedTask
18744
18927
  }
18745
18928
  }
@@ -18781,11 +18964,10 @@ class Protocol {
18781
18964
  }
18782
18965
  }
18783
18966
  async _enqueueTaskMessage(taskId, message, sessionId) {
18784
- var _a2;
18785
18967
  if (!this._taskStore || !this._taskMessageQueue) {
18786
18968
  throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
18787
18969
  }
18788
- const maxQueueSize = (_a2 = this._options) === null || _a2 === undefined ? undefined : _a2.maxTaskQueueSize;
18970
+ const maxQueueSize = this._options?.maxTaskQueueSize;
18789
18971
  await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
18790
18972
  }
18791
18973
  async _clearTaskQueue(taskId, sessionId) {
@@ -18806,14 +18988,13 @@ class Protocol {
18806
18988
  }
18807
18989
  }
18808
18990
  async _waitForTaskUpdate(taskId, signal) {
18809
- var _a2, _b, _c;
18810
- let interval = (_b = (_a2 = this._options) === null || _a2 === undefined ? undefined : _a2.defaultTaskPollInterval) !== null && _b !== undefined ? _b : 1000;
18991
+ let interval = this._options?.defaultTaskPollInterval ?? 1000;
18811
18992
  try {
18812
- const task = await ((_c = this._taskStore) === null || _c === undefined ? undefined : _c.getTask(taskId));
18813
- if (task === null || task === undefined ? undefined : task.pollInterval) {
18993
+ const task = await this._taskStore?.getTask(taskId);
18994
+ if (task?.pollInterval) {
18814
18995
  interval = task.pollInterval;
18815
18996
  }
18816
- } catch (_d) {}
18997
+ } catch {}
18817
18998
  return new Promise((resolve, reject) => {
18818
18999
  if (signal.aborted) {
18819
19000
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
@@ -18912,11 +19093,11 @@ function mergeCapabilities(base, additional) {
18912
19093
  return result;
18913
19094
  }
18914
19095
 
18915
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
19096
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
18916
19097
  var import_ajv = __toESM(require_ajv(), 1);
18917
19098
  var import_ajv_formats = __toESM(require_dist(), 1);
18918
19099
  function createDefaultAjvInstance() {
18919
- const ajv = new import_ajv.Ajv({
19100
+ const ajv = new import_ajv.default({
18920
19101
  strict: false,
18921
19102
  validateFormats: true,
18922
19103
  validateSchema: false,
@@ -18929,11 +19110,10 @@ function createDefaultAjvInstance() {
18929
19110
 
18930
19111
  class AjvJsonSchemaValidator {
18931
19112
  constructor(ajv) {
18932
- this._ajv = ajv !== null && ajv !== undefined ? ajv : createDefaultAjvInstance();
19113
+ this._ajv = ajv ?? createDefaultAjvInstance();
18933
19114
  }
18934
19115
  getValidator(schema) {
18935
- var _a2;
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);
19116
+ const ajvValidator = "$id" in schema && typeof schema.$id === "string" ? this._ajv.getSchema(schema.$id) ?? this._ajv.compile(schema) : this._ajv.compile(schema);
18937
19117
  return (input) => {
18938
19118
  const valid = ajvValidator(input);
18939
19119
  if (valid) {
@@ -18953,7 +19133,7 @@ class AjvJsonSchemaValidator {
18953
19133
  }
18954
19134
  }
18955
19135
 
18956
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
19136
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
18957
19137
  class ExperimentalServerTasks {
18958
19138
  constructor(_server) {
18959
19139
  this._server = _server;
@@ -18975,15 +19155,14 @@ class ExperimentalServerTasks {
18975
19155
  }
18976
19156
  }
18977
19157
 
18978
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
19158
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
18979
19159
  function assertToolsCallTaskCapability(requests, method, entityName) {
18980
- var _a2;
18981
19160
  if (!requests) {
18982
19161
  throw new Error(`${entityName} does not support task creation (required for ${method})`);
18983
19162
  }
18984
19163
  switch (method) {
18985
19164
  case "tools/call":
18986
- if (!((_a2 = requests.tools) === null || _a2 === undefined ? undefined : _a2.call)) {
19165
+ if (!requests.tools?.call) {
18987
19166
  throw new Error(`${entityName} does not support task creation for tools/call (required for ${method})`);
18988
19167
  }
18989
19168
  break;
@@ -18992,18 +19171,17 @@ function assertToolsCallTaskCapability(requests, method, entityName) {
18992
19171
  }
18993
19172
  }
18994
19173
  function assertClientRequestTaskCapability(requests, method, entityName) {
18995
- var _a2, _b;
18996
19174
  if (!requests) {
18997
19175
  throw new Error(`${entityName} does not support task creation (required for ${method})`);
18998
19176
  }
18999
19177
  switch (method) {
19000
19178
  case "sampling/createMessage":
19001
- if (!((_a2 = requests.sampling) === null || _a2 === undefined ? undefined : _a2.createMessage)) {
19179
+ if (!requests.sampling?.createMessage) {
19002
19180
  throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method})`);
19003
19181
  }
19004
19182
  break;
19005
19183
  case "elicitation/create":
19006
- if (!((_b = requests.elicitation) === null || _b === undefined ? undefined : _b.create)) {
19184
+ if (!requests.elicitation?.create) {
19007
19185
  throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method})`);
19008
19186
  }
19009
19187
  break;
@@ -19012,10 +19190,9 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
19012
19190
  }
19013
19191
  }
19014
19192
 
19015
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
19193
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
19016
19194
  class Server extends Protocol {
19017
19195
  constructor(_serverInfo, options) {
19018
- var _a2, _b;
19019
19196
  super(options);
19020
19197
  this._serverInfo = _serverInfo;
19021
19198
  this._loggingLevels = new Map;
@@ -19024,18 +19201,14 @@ class Server extends Protocol {
19024
19201
  const currentLevel = this._loggingLevels.get(sessionId);
19025
19202
  return currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false;
19026
19203
  };
19027
- this._capabilities = (_a2 = options === null || options === undefined ? undefined : options.capabilities) !== null && _a2 !== undefined ? _a2 : {};
19028
- this._instructions = options === null || options === undefined ? undefined : options.instructions;
19029
- this._jsonSchemaValidator = (_b = options === null || options === undefined ? undefined : options.jsonSchemaValidator) !== null && _b !== undefined ? _b : new AjvJsonSchemaValidator;
19204
+ this._capabilities = options?.capabilities ?? {};
19205
+ this._instructions = options?.instructions;
19206
+ this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new AjvJsonSchemaValidator;
19030
19207
  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
- });
19208
+ this.setNotificationHandler(InitializedNotificationSchema, () => this.oninitialized?.());
19035
19209
  if (this._capabilities.logging) {
19036
19210
  this.setRequestHandler(SetLevelRequestSchema, async (request, extra) => {
19037
- var _a3;
19038
- const transportSessionId = extra.sessionId || ((_a3 = extra.requestInfo) === null || _a3 === undefined ? undefined : _a3.headers["mcp-session-id"]) || undefined;
19211
+ const transportSessionId = extra.sessionId || extra.requestInfo?.headers["mcp-session-id"] || undefined;
19039
19212
  const { level } = request.params;
19040
19213
  const parseResult = LoggingLevelSchema.safeParse(level);
19041
19214
  if (parseResult.success) {
@@ -19060,21 +19233,20 @@ class Server extends Protocol {
19060
19233
  this._capabilities = mergeCapabilities(this._capabilities, capabilities);
19061
19234
  }
19062
19235
  setRequestHandler(requestSchema, handler) {
19063
- var _a2, _b, _c;
19064
19236
  const shape = getObjectShape(requestSchema);
19065
- const methodSchema = shape === null || shape === undefined ? undefined : shape.method;
19237
+ const methodSchema = shape?.method;
19066
19238
  if (!methodSchema) {
19067
19239
  throw new Error("Schema is missing a method literal");
19068
19240
  }
19069
19241
  let methodValue;
19070
19242
  if (isZ4Schema(methodSchema)) {
19071
19243
  const v4Schema = methodSchema;
19072
- const v4Def = (_a2 = v4Schema._zod) === null || _a2 === undefined ? undefined : _a2.def;
19073
- methodValue = (_b = v4Def === null || v4Def === undefined ? undefined : v4Def.value) !== null && _b !== undefined ? _b : v4Schema.value;
19244
+ const v4Def = v4Schema._zod?.def;
19245
+ methodValue = v4Def?.value ?? v4Schema.value;
19074
19246
  } else {
19075
19247
  const v3Schema = methodSchema;
19076
19248
  const legacyDef = v3Schema._def;
19077
- methodValue = (_c = legacyDef === null || legacyDef === undefined ? undefined : legacyDef.value) !== null && _c !== undefined ? _c : v3Schema.value;
19249
+ methodValue = legacyDef?.value ?? v3Schema.value;
19078
19250
  }
19079
19251
  if (typeof methodValue !== "string") {
19080
19252
  throw new Error("Schema method literal must be a string");
@@ -19109,20 +19281,19 @@ class Server extends Protocol {
19109
19281
  return super.setRequestHandler(requestSchema, handler);
19110
19282
  }
19111
19283
  assertCapabilityForMethod(method) {
19112
- var _a2, _b, _c;
19113
19284
  switch (method) {
19114
19285
  case "sampling/createMessage":
19115
- if (!((_a2 = this._clientCapabilities) === null || _a2 === undefined ? undefined : _a2.sampling)) {
19286
+ if (!this._clientCapabilities?.sampling) {
19116
19287
  throw new Error(`Client does not support sampling (required for ${method})`);
19117
19288
  }
19118
19289
  break;
19119
19290
  case "elicitation/create":
19120
- if (!((_b = this._clientCapabilities) === null || _b === undefined ? undefined : _b.elicitation)) {
19291
+ if (!this._clientCapabilities?.elicitation) {
19121
19292
  throw new Error(`Client does not support elicitation (required for ${method})`);
19122
19293
  }
19123
19294
  break;
19124
19295
  case "roots/list":
19125
- if (!((_c = this._clientCapabilities) === null || _c === undefined ? undefined : _c.roots)) {
19296
+ if (!this._clientCapabilities?.roots) {
19126
19297
  throw new Error(`Client does not support listing roots (required for ${method})`);
19127
19298
  }
19128
19299
  break;
@@ -19131,7 +19302,6 @@ class Server extends Protocol {
19131
19302
  }
19132
19303
  }
19133
19304
  assertNotificationCapability(method) {
19134
- var _a2, _b;
19135
19305
  switch (method) {
19136
19306
  case "notifications/message":
19137
19307
  if (!this._capabilities.logging) {
@@ -19155,7 +19325,7 @@ class Server extends Protocol {
19155
19325
  }
19156
19326
  break;
19157
19327
  case "notifications/elicitation/complete":
19158
- if (!((_b = (_a2 = this._clientCapabilities) === null || _a2 === undefined ? undefined : _a2.elicitation) === null || _b === undefined ? undefined : _b.url)) {
19328
+ if (!this._clientCapabilities?.elicitation?.url) {
19159
19329
  throw new Error(`Client does not support URL elicitation (required for ${method})`);
19160
19330
  }
19161
19331
  break;
@@ -19213,15 +19383,13 @@ class Server extends Protocol {
19213
19383
  }
19214
19384
  }
19215
19385
  assertTaskCapability(method) {
19216
- var _a2, _b;
19217
- assertClientRequestTaskCapability((_b = (_a2 = this._clientCapabilities) === null || _a2 === undefined ? undefined : _a2.tasks) === null || _b === undefined ? undefined : _b.requests, method, "Client");
19386
+ assertClientRequestTaskCapability(this._clientCapabilities?.tasks?.requests, method, "Client");
19218
19387
  }
19219
19388
  assertTaskHandlerCapability(method) {
19220
- var _a2;
19221
19389
  if (!this._capabilities) {
19222
19390
  return;
19223
19391
  }
19224
- assertToolsCallTaskCapability((_a2 = this._capabilities.tasks) === null || _a2 === undefined ? undefined : _a2.requests, method, "Server");
19392
+ assertToolsCallTaskCapability(this._capabilities.tasks?.requests, method, "Server");
19225
19393
  }
19226
19394
  async _oninitialize(request) {
19227
19395
  const requestedVersion = request.params.protocolVersion;
@@ -19248,9 +19416,8 @@ class Server extends Protocol {
19248
19416
  return this.request({ method: "ping" }, EmptyResultSchema);
19249
19417
  }
19250
19418
  async createMessage(params, options) {
19251
- var _a2, _b;
19252
19419
  if (params.tools || params.toolChoice) {
19253
- if (!((_b = (_a2 = this._clientCapabilities) === null || _a2 === undefined ? undefined : _a2.sampling) === null || _b === undefined ? undefined : _b.tools)) {
19420
+ if (!this._clientCapabilities?.sampling?.tools) {
19254
19421
  throw new Error("Client does not support sampling tools capability.");
19255
19422
  }
19256
19423
  }
@@ -19283,18 +19450,17 @@ class Server extends Protocol {
19283
19450
  return this.request({ method: "sampling/createMessage", params }, CreateMessageResultSchema, options);
19284
19451
  }
19285
19452
  async elicitInput(params, options) {
19286
- var _a2, _b, _c, _d, _e;
19287
- const mode = (_a2 = params.mode) !== null && _a2 !== undefined ? _a2 : "form";
19453
+ const mode = params.mode ?? "form";
19288
19454
  switch (mode) {
19289
19455
  case "url": {
19290
- if (!((_c = (_b = this._clientCapabilities) === null || _b === undefined ? undefined : _b.elicitation) === null || _c === undefined ? undefined : _c.url)) {
19456
+ if (!this._clientCapabilities?.elicitation?.url) {
19291
19457
  throw new Error("Client does not support url elicitation.");
19292
19458
  }
19293
19459
  const urlParams = params;
19294
19460
  return this.request({ method: "elicitation/create", params: urlParams }, ElicitResultSchema, options);
19295
19461
  }
19296
19462
  case "form": {
19297
- if (!((_e = (_d = this._clientCapabilities) === null || _d === undefined ? undefined : _d.elicitation) === null || _e === undefined ? undefined : _e.form)) {
19463
+ if (!this._clientCapabilities?.elicitation?.form) {
19298
19464
  throw new Error("Client does not support form elicitation.");
19299
19465
  }
19300
19466
  const formParams = params.mode === "form" ? params : { ...params, mode: "form" };
@@ -19318,8 +19484,7 @@ class Server extends Protocol {
19318
19484
  }
19319
19485
  }
19320
19486
  createElicitationCompletionNotifier(elicitationId, options) {
19321
- var _a2, _b;
19322
- if (!((_b = (_a2 = this._clientCapabilities) === null || _a2 === undefined ? undefined : _a2.elicitation) === null || _b === undefined ? undefined : _b.url)) {
19487
+ if (!this._clientCapabilities?.elicitation?.url) {
19323
19488
  throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");
19324
19489
  }
19325
19490
  return () => this.notification({
@@ -19358,21 +19523,21 @@ class Server extends Protocol {
19358
19523
  }
19359
19524
  }
19360
19525
 
19361
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
19526
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
19362
19527
  var COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
19363
19528
  function isCompletable(schema) {
19364
19529
  return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
19365
19530
  }
19366
19531
  function getCompleter(schema) {
19367
19532
  const meta2 = schema[COMPLETABLE_SYMBOL];
19368
- return meta2 === null || meta2 === undefined ? undefined : meta2.complete;
19533
+ return meta2?.complete;
19369
19534
  }
19370
19535
  var McpZodTypeKind;
19371
19536
  (function(McpZodTypeKind2) {
19372
19537
  McpZodTypeKind2["Completable"] = "McpCompletable";
19373
19538
  })(McpZodTypeKind || (McpZodTypeKind = {}));
19374
19539
 
19375
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
19540
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
19376
19541
  var TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
19377
19542
  function validateToolName(name) {
19378
19543
  const warnings = [];
@@ -19430,7 +19595,7 @@ function validateAndWarnToolName(name) {
19430
19595
  return result.isValid;
19431
19596
  }
19432
19597
 
19433
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
19598
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
19434
19599
  class ExperimentalMcpServerTasks {
19435
19600
  constructor(_mcpServer) {
19436
19601
  this._mcpServer = _mcpServer;
@@ -19445,7 +19610,7 @@ class ExperimentalMcpServerTasks {
19445
19610
  }
19446
19611
  }
19447
19612
 
19448
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.24.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
19613
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.25.2+fde825ba4efdc684/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
19449
19614
  class McpServer {
19450
19615
  constructor(serverInfo, options) {
19451
19616
  this._registeredResources = {};
@@ -19513,7 +19678,6 @@ class McpServer {
19513
19678
  })
19514
19679
  }));
19515
19680
  this.server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
19516
- var _a2;
19517
19681
  try {
19518
19682
  const tool = this._registeredTools[request.params.name];
19519
19683
  if (!tool) {
@@ -19523,7 +19687,7 @@ class McpServer {
19523
19687
  throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} disabled`);
19524
19688
  }
19525
19689
  const isTaskRequest = !!request.params.task;
19526
- const taskSupport = (_a2 = tool.execution) === null || _a2 === undefined ? undefined : _a2.taskSupport;
19690
+ const taskSupport = tool.execution?.taskSupport;
19527
19691
  const isTaskHandler = "createTask" in tool.handler;
19528
19692
  if ((taskSupport === "required" || taskSupport === "optional") && !isTaskHandler) {
19529
19693
  throw new McpError(ErrorCode.InternalError, `Tool ${request.params.name} has taskSupport '${taskSupport}' but was not registered with registerToolTask`);
@@ -19568,7 +19732,7 @@ class McpServer {
19568
19732
  return;
19569
19733
  }
19570
19734
  const inputObj = normalizeObjectSchema(tool.inputSchema);
19571
- const schemaToParse = inputObj !== null && inputObj !== undefined ? inputObj : tool.inputSchema;
19735
+ const schemaToParse = inputObj ?? tool.inputSchema;
19572
19736
  const parseResult = await safeParseAsync3(schemaToParse, args);
19573
19737
  if (!parseResult.success) {
19574
19738
  const error2 = "error" in parseResult ? parseResult.error : "Unknown error";
@@ -19623,7 +19787,6 @@ class McpServer {
19623
19787
  }
19624
19788
  }
19625
19789
  async handleAutomaticTaskPolling(tool, request, extra) {
19626
- var _a2;
19627
19790
  if (!extra.taskStore) {
19628
19791
  throw new Error("No task store provided for task-capable tool.");
19629
19792
  }
@@ -19633,7 +19796,7 @@ class McpServer {
19633
19796
  const createTaskResult = args ? await Promise.resolve(handler.createTask(args, taskExtra)) : await Promise.resolve(handler.createTask(taskExtra));
19634
19797
  const taskId = createTaskResult.task.taskId;
19635
19798
  let task = createTaskResult.task;
19636
- const pollInterval = (_a2 = task.pollInterval) !== null && _a2 !== undefined ? _a2 : 5000;
19799
+ const pollInterval = task.pollInterval ?? 5000;
19637
19800
  while (task.status !== "completed" && task.status !== "failed" && task.status !== "cancelled") {
19638
19801
  await new Promise((resolve) => setTimeout(resolve, pollInterval));
19639
19802
  const updatedTask = await extra.taskStore.getTask(taskId);
@@ -19678,7 +19841,7 @@ class McpServer {
19678
19841
  return EMPTY_COMPLETION_RESULT;
19679
19842
  }
19680
19843
  const promptShape = getObjectShape(prompt.argsSchema);
19681
- const field = promptShape === null || promptShape === undefined ? undefined : promptShape[request.params.argument.name];
19844
+ const field = promptShape?.[request.params.argument.name];
19682
19845
  if (!isCompletable(field)) {
19683
19846
  return EMPTY_COMPLETION_RESULT;
19684
19847
  }
@@ -19762,7 +19925,6 @@ class McpServer {
19762
19925
  }
19763
19926
  throw new McpError(ErrorCode.InvalidParams, `Resource ${uri} not found`);
19764
19927
  });
19765
- this.setCompletionRequestHandler();
19766
19928
  this._resourceHandlersInitialized = true;
19767
19929
  }
19768
19930
  setPromptRequestHandlers() {
@@ -19810,7 +19972,6 @@ class McpServer {
19810
19972
  return await Promise.resolve(cb(extra));
19811
19973
  }
19812
19974
  });
19813
- this.setCompletionRequestHandler();
19814
19975
  this._promptHandlersInitialized = true;
19815
19976
  }
19816
19977
  resource(name, uriOrTemplate, ...rest) {
@@ -19918,6 +20079,11 @@ class McpServer {
19918
20079
  }
19919
20080
  };
19920
20081
  this._registeredResourceTemplates[name] = registeredResourceTemplate;
20082
+ const variableNames = template.uriTemplate.variableNames;
20083
+ const hasCompleter = Array.isArray(variableNames) && variableNames.some((v) => !!template.completeCallback(v));
20084
+ if (hasCompleter) {
20085
+ this.setCompletionRequestHandler();
20086
+ }
19921
20087
  return registeredResourceTemplate;
19922
20088
  }
19923
20089
  _createRegisteredPrompt(name, title, description, argsSchema, callback) {
@@ -19950,6 +20116,15 @@ class McpServer {
19950
20116
  }
19951
20117
  };
19952
20118
  this._registeredPrompts[name] = registeredPrompt;
20119
+ if (argsSchema) {
20120
+ const hasCompletable = Object.values(argsSchema).some((field) => {
20121
+ const inner = field instanceof ZodOptional ? field._def?.innerType : field;
20122
+ return isCompletable(inner);
20123
+ });
20124
+ if (hasCompletable) {
20125
+ this.setCompletionRequestHandler();
20126
+ }
20127
+ }
19953
20128
  return registeredPrompt;
19954
20129
  }
19955
20130
  _createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, execution, _meta, handler) {
@@ -19982,6 +20157,8 @@ class McpServer {
19982
20157
  registeredTool.description = updates.description;
19983
20158
  if (typeof updates.paramsSchema !== "undefined")
19984
20159
  registeredTool.inputSchema = objectFromShape(updates.paramsSchema);
20160
+ if (typeof updates.outputSchema !== "undefined")
20161
+ registeredTool.outputSchema = objectFromShape(updates.outputSchema);
19985
20162
  if (typeof updates.callback !== "undefined")
19986
20163
  registeredTool.handler = updates.callback;
19987
20164
  if (typeof updates.annotations !== "undefined")
@@ -20127,7 +20304,7 @@ function promptArgumentsFromSchema(schema) {
20127
20304
  }
20128
20305
  function getMethodValue(schema) {
20129
20306
  const shape = getObjectShape(schema);
20130
- const methodSchema = shape === null || shape === undefined ? undefined : shape.method;
20307
+ const methodSchema = shape?.method;
20131
20308
  if (!methodSchema) {
20132
20309
  throw new Error("Schema is missing a method literal");
20133
20310
  }