@hvgllc/hvgerp-mcp 3.0.0 → 3.0.2

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.
Files changed (3) hide show
  1. package/README.md +0 -3
  2. package/hvgerp-mcp.mjs +1117 -112
  3. package/package.json +1 -1
package/hvgerp-mcp.mjs CHANGED
@@ -1769,7 +1769,7 @@ var require_code2 = __commonJS({
1769
1769
  return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
1770
1770
  }
1771
1771
  exports.schemaProperties = schemaProperties;
1772
- function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
1772
+ function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context2, passSchema) {
1773
1773
  const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
1774
1774
  const valCxt = [
1775
1775
  [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],
@@ -1780,7 +1780,7 @@ var require_code2 = __commonJS({
1780
1780
  if (it.opts.dynamicRef)
1781
1781
  valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);
1782
1782
  const args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
1783
- return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args})` : (0, codegen_1._)`${func}(${args})`;
1783
+ return context2 !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context2}, ${args})` : (0, codegen_1._)`${func}(${args})`;
1784
1784
  }
1785
1785
  exports.callValidateCode = callValidateCode;
1786
1786
  var newRegExp = (0, codegen_1._)`new RegExp`;
@@ -6921,6 +6921,830 @@ var require_dist = __commonJS({
6921
6921
  }
6922
6922
  });
6923
6923
 
6924
+ // node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js
6925
+ var require_dynamicAnchor = __commonJS({
6926
+ "node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js"(exports) {
6927
+ "use strict";
6928
+ Object.defineProperty(exports, "__esModule", { value: true });
6929
+ exports.dynamicAnchor = void 0;
6930
+ var codegen_1 = require_codegen();
6931
+ var names_1 = require_names();
6932
+ var compile_1 = require_compile();
6933
+ var ref_1 = require_ref();
6934
+ var def = {
6935
+ keyword: "$dynamicAnchor",
6936
+ schemaType: "string",
6937
+ code: (cxt) => dynamicAnchor(cxt, cxt.schema)
6938
+ };
6939
+ function dynamicAnchor(cxt, anchor) {
6940
+ const { gen, it } = cxt;
6941
+ it.schemaEnv.root.dynamicAnchors[anchor] = true;
6942
+ const v = (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;
6943
+ const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt);
6944
+ gen.if((0, codegen_1._)`!${v}`, () => gen.assign(v, validate));
6945
+ }
6946
+ exports.dynamicAnchor = dynamicAnchor;
6947
+ function _getValidate(cxt) {
6948
+ const { schemaEnv, schema, self: self2 } = cxt.it;
6949
+ const { root, baseId, localRefs, meta: meta2 } = schemaEnv.root;
6950
+ const { schemaId } = self2.opts;
6951
+ const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta: meta2 });
6952
+ compile_1.compileSchema.call(self2, sch);
6953
+ return (0, ref_1.getValidate)(cxt, sch);
6954
+ }
6955
+ exports.default = def;
6956
+ }
6957
+ });
6958
+
6959
+ // node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js
6960
+ var require_dynamicRef = __commonJS({
6961
+ "node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js"(exports) {
6962
+ "use strict";
6963
+ Object.defineProperty(exports, "__esModule", { value: true });
6964
+ exports.dynamicRef = void 0;
6965
+ var codegen_1 = require_codegen();
6966
+ var names_1 = require_names();
6967
+ var ref_1 = require_ref();
6968
+ var def = {
6969
+ keyword: "$dynamicRef",
6970
+ schemaType: "string",
6971
+ code: (cxt) => dynamicRef(cxt, cxt.schema)
6972
+ };
6973
+ function dynamicRef(cxt, ref) {
6974
+ const { gen, keyword, it } = cxt;
6975
+ if (ref[0] !== "#")
6976
+ throw new Error(`"${keyword}" only supports hash fragment reference`);
6977
+ const anchor = ref.slice(1);
6978
+ if (it.allErrors) {
6979
+ _dynamicRef();
6980
+ } else {
6981
+ const valid = gen.let("valid", false);
6982
+ _dynamicRef(valid);
6983
+ cxt.ok(valid);
6984
+ }
6985
+ function _dynamicRef(valid) {
6986
+ if (it.schemaEnv.root.dynamicAnchors[anchor]) {
6987
+ const v = gen.let("_v", (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);
6988
+ gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));
6989
+ } else {
6990
+ _callRef(it.validateName, valid)();
6991
+ }
6992
+ }
6993
+ function _callRef(validate, valid) {
6994
+ return valid ? () => gen.block(() => {
6995
+ (0, ref_1.callRef)(cxt, validate);
6996
+ gen.let(valid, true);
6997
+ }) : () => (0, ref_1.callRef)(cxt, validate);
6998
+ }
6999
+ }
7000
+ exports.dynamicRef = dynamicRef;
7001
+ exports.default = def;
7002
+ }
7003
+ });
7004
+
7005
+ // node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js
7006
+ var require_recursiveAnchor = __commonJS({
7007
+ "node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js"(exports) {
7008
+ "use strict";
7009
+ Object.defineProperty(exports, "__esModule", { value: true });
7010
+ var dynamicAnchor_1 = require_dynamicAnchor();
7011
+ var util_1 = require_util();
7012
+ var def = {
7013
+ keyword: "$recursiveAnchor",
7014
+ schemaType: "boolean",
7015
+ code(cxt) {
7016
+ if (cxt.schema)
7017
+ (0, dynamicAnchor_1.dynamicAnchor)(cxt, "");
7018
+ else
7019
+ (0, util_1.checkStrictMode)(cxt.it, "$recursiveAnchor: false is ignored");
7020
+ }
7021
+ };
7022
+ exports.default = def;
7023
+ }
7024
+ });
7025
+
7026
+ // node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js
7027
+ var require_recursiveRef = __commonJS({
7028
+ "node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js"(exports) {
7029
+ "use strict";
7030
+ Object.defineProperty(exports, "__esModule", { value: true });
7031
+ var dynamicRef_1 = require_dynamicRef();
7032
+ var def = {
7033
+ keyword: "$recursiveRef",
7034
+ schemaType: "string",
7035
+ code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema)
7036
+ };
7037
+ exports.default = def;
7038
+ }
7039
+ });
7040
+
7041
+ // node_modules/ajv/dist/vocabularies/dynamic/index.js
7042
+ var require_dynamic = __commonJS({
7043
+ "node_modules/ajv/dist/vocabularies/dynamic/index.js"(exports) {
7044
+ "use strict";
7045
+ Object.defineProperty(exports, "__esModule", { value: true });
7046
+ var dynamicAnchor_1 = require_dynamicAnchor();
7047
+ var dynamicRef_1 = require_dynamicRef();
7048
+ var recursiveAnchor_1 = require_recursiveAnchor();
7049
+ var recursiveRef_1 = require_recursiveRef();
7050
+ var dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default];
7051
+ exports.default = dynamic;
7052
+ }
7053
+ });
7054
+
7055
+ // node_modules/ajv/dist/vocabularies/validation/dependentRequired.js
7056
+ var require_dependentRequired = __commonJS({
7057
+ "node_modules/ajv/dist/vocabularies/validation/dependentRequired.js"(exports) {
7058
+ "use strict";
7059
+ Object.defineProperty(exports, "__esModule", { value: true });
7060
+ var dependencies_1 = require_dependencies();
7061
+ var def = {
7062
+ keyword: "dependentRequired",
7063
+ type: "object",
7064
+ schemaType: "object",
7065
+ error: dependencies_1.error,
7066
+ code: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt)
7067
+ };
7068
+ exports.default = def;
7069
+ }
7070
+ });
7071
+
7072
+ // node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js
7073
+ var require_dependentSchemas = __commonJS({
7074
+ "node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js"(exports) {
7075
+ "use strict";
7076
+ Object.defineProperty(exports, "__esModule", { value: true });
7077
+ var dependencies_1 = require_dependencies();
7078
+ var def = {
7079
+ keyword: "dependentSchemas",
7080
+ type: "object",
7081
+ schemaType: "object",
7082
+ code: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt)
7083
+ };
7084
+ exports.default = def;
7085
+ }
7086
+ });
7087
+
7088
+ // node_modules/ajv/dist/vocabularies/validation/limitContains.js
7089
+ var require_limitContains = __commonJS({
7090
+ "node_modules/ajv/dist/vocabularies/validation/limitContains.js"(exports) {
7091
+ "use strict";
7092
+ Object.defineProperty(exports, "__esModule", { value: true });
7093
+ var util_1 = require_util();
7094
+ var def = {
7095
+ keyword: ["maxContains", "minContains"],
7096
+ type: "array",
7097
+ schemaType: "number",
7098
+ code({ keyword, parentSchema, it }) {
7099
+ if (parentSchema.contains === void 0) {
7100
+ (0, util_1.checkStrictMode)(it, `"${keyword}" without "contains" is ignored`);
7101
+ }
7102
+ }
7103
+ };
7104
+ exports.default = def;
7105
+ }
7106
+ });
7107
+
7108
+ // node_modules/ajv/dist/vocabularies/next.js
7109
+ var require_next = __commonJS({
7110
+ "node_modules/ajv/dist/vocabularies/next.js"(exports) {
7111
+ "use strict";
7112
+ Object.defineProperty(exports, "__esModule", { value: true });
7113
+ var dependentRequired_1 = require_dependentRequired();
7114
+ var dependentSchemas_1 = require_dependentSchemas();
7115
+ var limitContains_1 = require_limitContains();
7116
+ var next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default];
7117
+ exports.default = next;
7118
+ }
7119
+ });
7120
+
7121
+ // node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js
7122
+ var require_unevaluatedProperties = __commonJS({
7123
+ "node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js"(exports) {
7124
+ "use strict";
7125
+ Object.defineProperty(exports, "__esModule", { value: true });
7126
+ var codegen_1 = require_codegen();
7127
+ var util_1 = require_util();
7128
+ var names_1 = require_names();
7129
+ var error2 = {
7130
+ message: "must NOT have unevaluated properties",
7131
+ params: ({ params }) => (0, codegen_1._)`{unevaluatedProperty: ${params.unevaluatedProperty}}`
7132
+ };
7133
+ var def = {
7134
+ keyword: "unevaluatedProperties",
7135
+ type: "object",
7136
+ schemaType: ["boolean", "object"],
7137
+ trackErrors: true,
7138
+ error: error2,
7139
+ code(cxt) {
7140
+ const { gen, schema, data, errsCount, it } = cxt;
7141
+ if (!errsCount)
7142
+ throw new Error("ajv implementation error");
7143
+ const { allErrors, props } = it;
7144
+ if (props instanceof codegen_1.Name) {
7145
+ gen.if((0, codegen_1._)`${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))));
7146
+ } else if (props !== true) {
7147
+ gen.forIn("key", data, (key) => props === void 0 ? unevaluatedPropCode(key) : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)));
7148
+ }
7149
+ it.props = true;
7150
+ cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
7151
+ function unevaluatedPropCode(key) {
7152
+ if (schema === false) {
7153
+ cxt.setParams({ unevaluatedProperty: key });
7154
+ cxt.error();
7155
+ if (!allErrors)
7156
+ gen.break();
7157
+ return;
7158
+ }
7159
+ if (!(0, util_1.alwaysValidSchema)(it, schema)) {
7160
+ const valid = gen.name("valid");
7161
+ cxt.subschema({
7162
+ keyword: "unevaluatedProperties",
7163
+ dataProp: key,
7164
+ dataPropType: util_1.Type.Str
7165
+ }, valid);
7166
+ if (!allErrors)
7167
+ gen.if((0, codegen_1.not)(valid), () => gen.break());
7168
+ }
7169
+ }
7170
+ function unevaluatedDynamic(evaluatedProps, key) {
7171
+ return (0, codegen_1._)`!${evaluatedProps} || !${evaluatedProps}[${key}]`;
7172
+ }
7173
+ function unevaluatedStatic(evaluatedProps, key) {
7174
+ const ps = [];
7175
+ for (const p in evaluatedProps) {
7176
+ if (evaluatedProps[p] === true)
7177
+ ps.push((0, codegen_1._)`${key} !== ${p}`);
7178
+ }
7179
+ return (0, codegen_1.and)(...ps);
7180
+ }
7181
+ }
7182
+ };
7183
+ exports.default = def;
7184
+ }
7185
+ });
7186
+
7187
+ // node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js
7188
+ var require_unevaluatedItems = __commonJS({
7189
+ "node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js"(exports) {
7190
+ "use strict";
7191
+ Object.defineProperty(exports, "__esModule", { value: true });
7192
+ var codegen_1 = require_codegen();
7193
+ var util_1 = require_util();
7194
+ var error2 = {
7195
+ message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
7196
+ params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
7197
+ };
7198
+ var def = {
7199
+ keyword: "unevaluatedItems",
7200
+ type: "array",
7201
+ schemaType: ["boolean", "object"],
7202
+ error: error2,
7203
+ code(cxt) {
7204
+ const { gen, schema, data, it } = cxt;
7205
+ const items = it.items || 0;
7206
+ if (items === true)
7207
+ return;
7208
+ const len = gen.const("len", (0, codegen_1._)`${data}.length`);
7209
+ if (schema === false) {
7210
+ cxt.setParams({ len: items });
7211
+ cxt.fail((0, codegen_1._)`${len} > ${items}`);
7212
+ } else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
7213
+ const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items}`);
7214
+ gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));
7215
+ cxt.ok(valid);
7216
+ }
7217
+ it.items = true;
7218
+ function validateItems(valid, from) {
7219
+ gen.forRange("i", from, len, (i) => {
7220
+ cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid);
7221
+ if (!it.allErrors)
7222
+ gen.if((0, codegen_1.not)(valid), () => gen.break());
7223
+ });
7224
+ }
7225
+ }
7226
+ };
7227
+ exports.default = def;
7228
+ }
7229
+ });
7230
+
7231
+ // node_modules/ajv/dist/vocabularies/unevaluated/index.js
7232
+ var require_unevaluated = __commonJS({
7233
+ "node_modules/ajv/dist/vocabularies/unevaluated/index.js"(exports) {
7234
+ "use strict";
7235
+ Object.defineProperty(exports, "__esModule", { value: true });
7236
+ var unevaluatedProperties_1 = require_unevaluatedProperties();
7237
+ var unevaluatedItems_1 = require_unevaluatedItems();
7238
+ var unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];
7239
+ exports.default = unevaluated;
7240
+ }
7241
+ });
7242
+
7243
+ // node_modules/ajv/dist/vocabularies/draft2020.js
7244
+ var require_draft2020 = __commonJS({
7245
+ "node_modules/ajv/dist/vocabularies/draft2020.js"(exports) {
7246
+ "use strict";
7247
+ Object.defineProperty(exports, "__esModule", { value: true });
7248
+ var core_1 = require_core2();
7249
+ var validation_1 = require_validation();
7250
+ var applicator_1 = require_applicator();
7251
+ var dynamic_1 = require_dynamic();
7252
+ var next_1 = require_next();
7253
+ var unevaluated_1 = require_unevaluated();
7254
+ var format_1 = require_format2();
7255
+ var metadata_1 = require_metadata();
7256
+ var draft2020Vocabularies = [
7257
+ dynamic_1.default,
7258
+ core_1.default,
7259
+ validation_1.default,
7260
+ (0, applicator_1.default)(true),
7261
+ format_1.default,
7262
+ metadata_1.metadataVocabulary,
7263
+ metadata_1.contentVocabulary,
7264
+ next_1.default,
7265
+ unevaluated_1.default
7266
+ ];
7267
+ exports.default = draft2020Vocabularies;
7268
+ }
7269
+ });
7270
+
7271
+ // node_modules/ajv/dist/refs/json-schema-2020-12/schema.json
7272
+ var require_schema = __commonJS({
7273
+ "node_modules/ajv/dist/refs/json-schema-2020-12/schema.json"(exports, module) {
7274
+ module.exports = {
7275
+ $schema: "https://json-schema.org/draft/2020-12/schema",
7276
+ $id: "https://json-schema.org/draft/2020-12/schema",
7277
+ $vocabulary: {
7278
+ "https://json-schema.org/draft/2020-12/vocab/core": true,
7279
+ "https://json-schema.org/draft/2020-12/vocab/applicator": true,
7280
+ "https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
7281
+ "https://json-schema.org/draft/2020-12/vocab/validation": true,
7282
+ "https://json-schema.org/draft/2020-12/vocab/meta-data": true,
7283
+ "https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
7284
+ "https://json-schema.org/draft/2020-12/vocab/content": true
7285
+ },
7286
+ $dynamicAnchor: "meta",
7287
+ title: "Core and Validation specifications meta-schema",
7288
+ allOf: [
7289
+ { $ref: "meta/core" },
7290
+ { $ref: "meta/applicator" },
7291
+ { $ref: "meta/unevaluated" },
7292
+ { $ref: "meta/validation" },
7293
+ { $ref: "meta/meta-data" },
7294
+ { $ref: "meta/format-annotation" },
7295
+ { $ref: "meta/content" }
7296
+ ],
7297
+ type: ["object", "boolean"],
7298
+ $comment: "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",
7299
+ properties: {
7300
+ definitions: {
7301
+ $comment: '"definitions" has been replaced by "$defs".',
7302
+ type: "object",
7303
+ additionalProperties: { $dynamicRef: "#meta" },
7304
+ deprecated: true,
7305
+ default: {}
7306
+ },
7307
+ dependencies: {
7308
+ $comment: '"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',
7309
+ type: "object",
7310
+ additionalProperties: {
7311
+ anyOf: [{ $dynamicRef: "#meta" }, { $ref: "meta/validation#/$defs/stringArray" }]
7312
+ },
7313
+ deprecated: true,
7314
+ default: {}
7315
+ },
7316
+ $recursiveAnchor: {
7317
+ $comment: '"$recursiveAnchor" has been replaced by "$dynamicAnchor".',
7318
+ $ref: "meta/core#/$defs/anchorString",
7319
+ deprecated: true
7320
+ },
7321
+ $recursiveRef: {
7322
+ $comment: '"$recursiveRef" has been replaced by "$dynamicRef".',
7323
+ $ref: "meta/core#/$defs/uriReferenceString",
7324
+ deprecated: true
7325
+ }
7326
+ }
7327
+ };
7328
+ }
7329
+ });
7330
+
7331
+ // node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json
7332
+ var require_applicator2 = __commonJS({
7333
+ "node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json"(exports, module) {
7334
+ module.exports = {
7335
+ $schema: "https://json-schema.org/draft/2020-12/schema",
7336
+ $id: "https://json-schema.org/draft/2020-12/meta/applicator",
7337
+ $vocabulary: {
7338
+ "https://json-schema.org/draft/2020-12/vocab/applicator": true
7339
+ },
7340
+ $dynamicAnchor: "meta",
7341
+ title: "Applicator vocabulary meta-schema",
7342
+ type: ["object", "boolean"],
7343
+ properties: {
7344
+ prefixItems: { $ref: "#/$defs/schemaArray" },
7345
+ items: { $dynamicRef: "#meta" },
7346
+ contains: { $dynamicRef: "#meta" },
7347
+ additionalProperties: { $dynamicRef: "#meta" },
7348
+ properties: {
7349
+ type: "object",
7350
+ additionalProperties: { $dynamicRef: "#meta" },
7351
+ default: {}
7352
+ },
7353
+ patternProperties: {
7354
+ type: "object",
7355
+ additionalProperties: { $dynamicRef: "#meta" },
7356
+ propertyNames: { format: "regex" },
7357
+ default: {}
7358
+ },
7359
+ dependentSchemas: {
7360
+ type: "object",
7361
+ additionalProperties: { $dynamicRef: "#meta" },
7362
+ default: {}
7363
+ },
7364
+ propertyNames: { $dynamicRef: "#meta" },
7365
+ if: { $dynamicRef: "#meta" },
7366
+ then: { $dynamicRef: "#meta" },
7367
+ else: { $dynamicRef: "#meta" },
7368
+ allOf: { $ref: "#/$defs/schemaArray" },
7369
+ anyOf: { $ref: "#/$defs/schemaArray" },
7370
+ oneOf: { $ref: "#/$defs/schemaArray" },
7371
+ not: { $dynamicRef: "#meta" }
7372
+ },
7373
+ $defs: {
7374
+ schemaArray: {
7375
+ type: "array",
7376
+ minItems: 1,
7377
+ items: { $dynamicRef: "#meta" }
7378
+ }
7379
+ }
7380
+ };
7381
+ }
7382
+ });
7383
+
7384
+ // node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json
7385
+ var require_unevaluated2 = __commonJS({
7386
+ "node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json"(exports, module) {
7387
+ module.exports = {
7388
+ $schema: "https://json-schema.org/draft/2020-12/schema",
7389
+ $id: "https://json-schema.org/draft/2020-12/meta/unevaluated",
7390
+ $vocabulary: {
7391
+ "https://json-schema.org/draft/2020-12/vocab/unevaluated": true
7392
+ },
7393
+ $dynamicAnchor: "meta",
7394
+ title: "Unevaluated applicator vocabulary meta-schema",
7395
+ type: ["object", "boolean"],
7396
+ properties: {
7397
+ unevaluatedItems: { $dynamicRef: "#meta" },
7398
+ unevaluatedProperties: { $dynamicRef: "#meta" }
7399
+ }
7400
+ };
7401
+ }
7402
+ });
7403
+
7404
+ // node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json
7405
+ var require_content = __commonJS({
7406
+ "node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json"(exports, module) {
7407
+ module.exports = {
7408
+ $schema: "https://json-schema.org/draft/2020-12/schema",
7409
+ $id: "https://json-schema.org/draft/2020-12/meta/content",
7410
+ $vocabulary: {
7411
+ "https://json-schema.org/draft/2020-12/vocab/content": true
7412
+ },
7413
+ $dynamicAnchor: "meta",
7414
+ title: "Content vocabulary meta-schema",
7415
+ type: ["object", "boolean"],
7416
+ properties: {
7417
+ contentEncoding: { type: "string" },
7418
+ contentMediaType: { type: "string" },
7419
+ contentSchema: { $dynamicRef: "#meta" }
7420
+ }
7421
+ };
7422
+ }
7423
+ });
7424
+
7425
+ // node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json
7426
+ var require_core3 = __commonJS({
7427
+ "node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json"(exports, module) {
7428
+ module.exports = {
7429
+ $schema: "https://json-schema.org/draft/2020-12/schema",
7430
+ $id: "https://json-schema.org/draft/2020-12/meta/core",
7431
+ $vocabulary: {
7432
+ "https://json-schema.org/draft/2020-12/vocab/core": true
7433
+ },
7434
+ $dynamicAnchor: "meta",
7435
+ title: "Core vocabulary meta-schema",
7436
+ type: ["object", "boolean"],
7437
+ properties: {
7438
+ $id: {
7439
+ $ref: "#/$defs/uriReferenceString",
7440
+ $comment: "Non-empty fragments not allowed.",
7441
+ pattern: "^[^#]*#?$"
7442
+ },
7443
+ $schema: { $ref: "#/$defs/uriString" },
7444
+ $ref: { $ref: "#/$defs/uriReferenceString" },
7445
+ $anchor: { $ref: "#/$defs/anchorString" },
7446
+ $dynamicRef: { $ref: "#/$defs/uriReferenceString" },
7447
+ $dynamicAnchor: { $ref: "#/$defs/anchorString" },
7448
+ $vocabulary: {
7449
+ type: "object",
7450
+ propertyNames: { $ref: "#/$defs/uriString" },
7451
+ additionalProperties: {
7452
+ type: "boolean"
7453
+ }
7454
+ },
7455
+ $comment: {
7456
+ type: "string"
7457
+ },
7458
+ $defs: {
7459
+ type: "object",
7460
+ additionalProperties: { $dynamicRef: "#meta" }
7461
+ }
7462
+ },
7463
+ $defs: {
7464
+ anchorString: {
7465
+ type: "string",
7466
+ pattern: "^[A-Za-z_][-A-Za-z0-9._]*$"
7467
+ },
7468
+ uriString: {
7469
+ type: "string",
7470
+ format: "uri"
7471
+ },
7472
+ uriReferenceString: {
7473
+ type: "string",
7474
+ format: "uri-reference"
7475
+ }
7476
+ }
7477
+ };
7478
+ }
7479
+ });
7480
+
7481
+ // node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json
7482
+ var require_format_annotation = __commonJS({
7483
+ "node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json"(exports, module) {
7484
+ module.exports = {
7485
+ $schema: "https://json-schema.org/draft/2020-12/schema",
7486
+ $id: "https://json-schema.org/draft/2020-12/meta/format-annotation",
7487
+ $vocabulary: {
7488
+ "https://json-schema.org/draft/2020-12/vocab/format-annotation": true
7489
+ },
7490
+ $dynamicAnchor: "meta",
7491
+ title: "Format vocabulary meta-schema for annotation results",
7492
+ type: ["object", "boolean"],
7493
+ properties: {
7494
+ format: { type: "string" }
7495
+ }
7496
+ };
7497
+ }
7498
+ });
7499
+
7500
+ // node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json
7501
+ var require_meta_data = __commonJS({
7502
+ "node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json"(exports, module) {
7503
+ module.exports = {
7504
+ $schema: "https://json-schema.org/draft/2020-12/schema",
7505
+ $id: "https://json-schema.org/draft/2020-12/meta/meta-data",
7506
+ $vocabulary: {
7507
+ "https://json-schema.org/draft/2020-12/vocab/meta-data": true
7508
+ },
7509
+ $dynamicAnchor: "meta",
7510
+ title: "Meta-data vocabulary meta-schema",
7511
+ type: ["object", "boolean"],
7512
+ properties: {
7513
+ title: {
7514
+ type: "string"
7515
+ },
7516
+ description: {
7517
+ type: "string"
7518
+ },
7519
+ default: true,
7520
+ deprecated: {
7521
+ type: "boolean",
7522
+ default: false
7523
+ },
7524
+ readOnly: {
7525
+ type: "boolean",
7526
+ default: false
7527
+ },
7528
+ writeOnly: {
7529
+ type: "boolean",
7530
+ default: false
7531
+ },
7532
+ examples: {
7533
+ type: "array",
7534
+ items: true
7535
+ }
7536
+ }
7537
+ };
7538
+ }
7539
+ });
7540
+
7541
+ // node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json
7542
+ var require_validation2 = __commonJS({
7543
+ "node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json"(exports, module) {
7544
+ module.exports = {
7545
+ $schema: "https://json-schema.org/draft/2020-12/schema",
7546
+ $id: "https://json-schema.org/draft/2020-12/meta/validation",
7547
+ $vocabulary: {
7548
+ "https://json-schema.org/draft/2020-12/vocab/validation": true
7549
+ },
7550
+ $dynamicAnchor: "meta",
7551
+ title: "Validation vocabulary meta-schema",
7552
+ type: ["object", "boolean"],
7553
+ properties: {
7554
+ type: {
7555
+ anyOf: [
7556
+ { $ref: "#/$defs/simpleTypes" },
7557
+ {
7558
+ type: "array",
7559
+ items: { $ref: "#/$defs/simpleTypes" },
7560
+ minItems: 1,
7561
+ uniqueItems: true
7562
+ }
7563
+ ]
7564
+ },
7565
+ const: true,
7566
+ enum: {
7567
+ type: "array",
7568
+ items: true
7569
+ },
7570
+ multipleOf: {
7571
+ type: "number",
7572
+ exclusiveMinimum: 0
7573
+ },
7574
+ maximum: {
7575
+ type: "number"
7576
+ },
7577
+ exclusiveMaximum: {
7578
+ type: "number"
7579
+ },
7580
+ minimum: {
7581
+ type: "number"
7582
+ },
7583
+ exclusiveMinimum: {
7584
+ type: "number"
7585
+ },
7586
+ maxLength: { $ref: "#/$defs/nonNegativeInteger" },
7587
+ minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
7588
+ pattern: {
7589
+ type: "string",
7590
+ format: "regex"
7591
+ },
7592
+ maxItems: { $ref: "#/$defs/nonNegativeInteger" },
7593
+ minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
7594
+ uniqueItems: {
7595
+ type: "boolean",
7596
+ default: false
7597
+ },
7598
+ maxContains: { $ref: "#/$defs/nonNegativeInteger" },
7599
+ minContains: {
7600
+ $ref: "#/$defs/nonNegativeInteger",
7601
+ default: 1
7602
+ },
7603
+ maxProperties: { $ref: "#/$defs/nonNegativeInteger" },
7604
+ minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
7605
+ required: { $ref: "#/$defs/stringArray" },
7606
+ dependentRequired: {
7607
+ type: "object",
7608
+ additionalProperties: {
7609
+ $ref: "#/$defs/stringArray"
7610
+ }
7611
+ }
7612
+ },
7613
+ $defs: {
7614
+ nonNegativeInteger: {
7615
+ type: "integer",
7616
+ minimum: 0
7617
+ },
7618
+ nonNegativeIntegerDefault0: {
7619
+ $ref: "#/$defs/nonNegativeInteger",
7620
+ default: 0
7621
+ },
7622
+ simpleTypes: {
7623
+ enum: ["array", "boolean", "integer", "null", "number", "object", "string"]
7624
+ },
7625
+ stringArray: {
7626
+ type: "array",
7627
+ items: { type: "string" },
7628
+ uniqueItems: true,
7629
+ default: []
7630
+ }
7631
+ }
7632
+ };
7633
+ }
7634
+ });
7635
+
7636
+ // node_modules/ajv/dist/refs/json-schema-2020-12/index.js
7637
+ var require_json_schema_2020_12 = __commonJS({
7638
+ "node_modules/ajv/dist/refs/json-schema-2020-12/index.js"(exports) {
7639
+ "use strict";
7640
+ Object.defineProperty(exports, "__esModule", { value: true });
7641
+ var metaSchema = require_schema();
7642
+ var applicator = require_applicator2();
7643
+ var unevaluated = require_unevaluated2();
7644
+ var content = require_content();
7645
+ var core = require_core3();
7646
+ var format = require_format_annotation();
7647
+ var metadata = require_meta_data();
7648
+ var validation = require_validation2();
7649
+ var META_SUPPORT_DATA = ["/properties"];
7650
+ function addMetaSchema2020($data) {
7651
+ ;
7652
+ [
7653
+ metaSchema,
7654
+ applicator,
7655
+ unevaluated,
7656
+ content,
7657
+ core,
7658
+ with$data(this, format),
7659
+ metadata,
7660
+ with$data(this, validation)
7661
+ ].forEach((sch) => this.addMetaSchema(sch, void 0, false));
7662
+ return this;
7663
+ function with$data(ajv, sch) {
7664
+ return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;
7665
+ }
7666
+ }
7667
+ exports.default = addMetaSchema2020;
7668
+ }
7669
+ });
7670
+
7671
+ // node_modules/ajv/dist/2020.js
7672
+ var require__ = __commonJS({
7673
+ "node_modules/ajv/dist/2020.js"(exports, module) {
7674
+ "use strict";
7675
+ Object.defineProperty(exports, "__esModule", { value: true });
7676
+ exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2020 = void 0;
7677
+ var core_1 = require_core();
7678
+ var draft2020_1 = require_draft2020();
7679
+ var discriminator_1 = require_discriminator();
7680
+ var json_schema_2020_12_1 = require_json_schema_2020_12();
7681
+ var META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema";
7682
+ var Ajv2020 = class extends core_1.default {
7683
+ constructor(opts = {}) {
7684
+ super({
7685
+ ...opts,
7686
+ dynamicRef: true,
7687
+ next: true,
7688
+ unevaluated: true
7689
+ });
7690
+ }
7691
+ _addVocabularies() {
7692
+ super._addVocabularies();
7693
+ draft2020_1.default.forEach((v) => this.addVocabulary(v));
7694
+ if (this.opts.discriminator)
7695
+ this.addKeyword(discriminator_1.default);
7696
+ }
7697
+ _addDefaultMetaSchema() {
7698
+ super._addDefaultMetaSchema();
7699
+ const { $data, meta: meta2 } = this.opts;
7700
+ if (!meta2)
7701
+ return;
7702
+ json_schema_2020_12_1.default.call(this, $data);
7703
+ this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
7704
+ }
7705
+ defaultMeta() {
7706
+ return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
7707
+ }
7708
+ };
7709
+ exports.Ajv2020 = Ajv2020;
7710
+ module.exports = exports = Ajv2020;
7711
+ module.exports.Ajv2020 = Ajv2020;
7712
+ Object.defineProperty(exports, "__esModule", { value: true });
7713
+ exports.default = Ajv2020;
7714
+ var validate_1 = require_validate();
7715
+ Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
7716
+ return validate_1.KeywordCxt;
7717
+ } });
7718
+ var codegen_1 = require_codegen();
7719
+ Object.defineProperty(exports, "_", { enumerable: true, get: function() {
7720
+ return codegen_1._;
7721
+ } });
7722
+ Object.defineProperty(exports, "str", { enumerable: true, get: function() {
7723
+ return codegen_1.str;
7724
+ } });
7725
+ Object.defineProperty(exports, "stringify", { enumerable: true, get: function() {
7726
+ return codegen_1.stringify;
7727
+ } });
7728
+ Object.defineProperty(exports, "nil", { enumerable: true, get: function() {
7729
+ return codegen_1.nil;
7730
+ } });
7731
+ Object.defineProperty(exports, "Name", { enumerable: true, get: function() {
7732
+ return codegen_1.Name;
7733
+ } });
7734
+ Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() {
7735
+ return codegen_1.CodeGen;
7736
+ } });
7737
+ var validation_error_1 = require_validation_error();
7738
+ Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function() {
7739
+ return validation_error_1.default;
7740
+ } });
7741
+ var ref_error_1 = require_ref_error();
7742
+ Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function() {
7743
+ return ref_error_1.default;
7744
+ } });
7745
+ }
7746
+ });
7747
+
6924
7748
  // node_modules/@casys/mcp-server/src/runtime/runtime.deno.ts
6925
7749
  var runtime_deno_exports = {};
6926
7750
  __export(runtime_deno_exports, {
@@ -9692,7 +10516,7 @@ var require_int = __commonJS({
9692
10516
  });
9693
10517
 
9694
10518
  // node_modules/yaml/dist/schema/core/schema.js
9695
- var require_schema = __commonJS({
10519
+ var require_schema2 = __commonJS({
9696
10520
  "node_modules/yaml/dist/schema/core/schema.js"(exports) {
9697
10521
  "use strict";
9698
10522
  var map = require_map();
@@ -9720,7 +10544,7 @@ var require_schema = __commonJS({
9720
10544
  });
9721
10545
 
9722
10546
  // node_modules/yaml/dist/schema/json/schema.js
9723
- var require_schema2 = __commonJS({
10547
+ var require_schema3 = __commonJS({
9724
10548
  "node_modules/yaml/dist/schema/json/schema.js"(exports) {
9725
10549
  "use strict";
9726
10550
  var Scalar = require_Scalar();
@@ -10346,7 +11170,7 @@ var require_timestamp = __commonJS({
10346
11170
  });
10347
11171
 
10348
11172
  // node_modules/yaml/dist/schema/yaml-1.1/schema.js
10349
- var require_schema3 = __commonJS({
11173
+ var require_schema4 = __commonJS({
10350
11174
  "node_modules/yaml/dist/schema/yaml-1.1/schema.js"(exports) {
10351
11175
  "use strict";
10352
11176
  var map = require_map();
@@ -10400,13 +11224,13 @@ var require_tags = __commonJS({
10400
11224
  var bool = require_bool();
10401
11225
  var float = require_float();
10402
11226
  var int2 = require_int();
10403
- var schema = require_schema();
10404
- var schema$1 = require_schema2();
11227
+ var schema = require_schema2();
11228
+ var schema$1 = require_schema3();
10405
11229
  var binary = require_binary();
10406
11230
  var merge2 = require_merge();
10407
11231
  var omap = require_omap();
10408
11232
  var pairs = require_pairs();
10409
- var schema$2 = require_schema3();
11233
+ var schema$2 = require_schema4();
10410
11234
  var set = require_set();
10411
11235
  var timestamp = require_timestamp();
10412
11236
  var schemas = /* @__PURE__ */ new Map([
@@ -12539,15 +13363,15 @@ var require_cst_scalar = __commonJS({
12539
13363
  }
12540
13364
  return null;
12541
13365
  }
12542
- function createScalarToken(value, context) {
12543
- const { implicitKey = false, indent, inFlow = false, offset = -1, type = "PLAIN" } = context;
13366
+ function createScalarToken(value, context2) {
13367
+ const { implicitKey = false, indent, inFlow = false, offset = -1, type = "PLAIN" } = context2;
12544
13368
  const source = stringifyString.stringifyString({ type, value }, {
12545
13369
  implicitKey,
12546
13370
  indent: indent > 0 ? " ".repeat(indent) : "",
12547
13371
  inFlow,
12548
13372
  options: { blockQuote: true, lineWidth: -1 }
12549
13373
  });
12550
- const end = context.end ?? [
13374
+ const end = context2.end ?? [
12551
13375
  { type: "newline", offset: -1, indent, source: "\n" }
12552
13376
  ];
12553
13377
  switch (source[0]) {
@@ -12571,8 +13395,8 @@ var require_cst_scalar = __commonJS({
12571
13395
  return { type: "scalar", offset, indent, source, end };
12572
13396
  }
12573
13397
  }
12574
- function setScalarValue(token, value, context = {}) {
12575
- let { afterKey = false, implicitKey = false, inFlow = false, type } = context;
13398
+ function setScalarValue(token, value, context2 = {}) {
13399
+ let { afterKey = false, implicitKey = false, inFlow = false, type } = context2;
12576
13400
  let indent = "indent" in token ? token.indent : null;
12577
13401
  if (afterKey && typeof indent === "number")
12578
13402
  indent += 2;
@@ -29659,7 +30483,7 @@ var StdioServerTransport = class {
29659
30483
 
29660
30484
  // node_modules/hono/dist/compose.js
29661
30485
  var compose = (middleware, onError, onNotFound) => {
29662
- return (context, next) => {
30486
+ return (context2, next) => {
29663
30487
  let index = -1;
29664
30488
  return dispatch(0);
29665
30489
  async function dispatch(i) {
@@ -29672,31 +30496,31 @@ var compose = (middleware, onError, onNotFound) => {
29672
30496
  let handler;
29673
30497
  if (middleware[i]) {
29674
30498
  handler = middleware[i][0][0];
29675
- context.req.routeIndex = i;
30499
+ context2.req.routeIndex = i;
29676
30500
  } else {
29677
30501
  handler = i === middleware.length && next || void 0;
29678
30502
  }
29679
30503
  if (handler) {
29680
30504
  try {
29681
- res = await handler(context, () => dispatch(i + 1));
30505
+ res = await handler(context2, () => dispatch(i + 1));
29682
30506
  } catch (err) {
29683
30507
  if (err instanceof Error && onError) {
29684
- context.error = err;
29685
- res = await onError(err, context);
30508
+ context2.error = err;
30509
+ res = await onError(err, context2);
29686
30510
  isError = true;
29687
30511
  } else {
29688
30512
  throw err;
29689
30513
  }
29690
30514
  }
29691
30515
  } else {
29692
- if (context.finalized === false && onNotFound) {
29693
- res = await onNotFound(context);
30516
+ if (context2.finalized === false && onNotFound) {
30517
+ res = await onNotFound(context2);
29694
30518
  }
29695
30519
  }
29696
- if (res && (context.finalized === false || isError)) {
29697
- context.res = res;
30520
+ if (res && (context2.finalized === false || isError)) {
30521
+ context2.res = res;
29698
30522
  }
29699
- return context;
30523
+ return context2;
29700
30524
  }
29701
30525
  };
29702
30526
  };
@@ -29907,13 +30731,13 @@ var checkOptionalParameter = (path) => {
29907
30731
  if (segment !== "" && !/\:/.test(segment)) {
29908
30732
  basePath += "/" + segment;
29909
30733
  } else if (/\:/.test(segment)) {
29910
- if (/\?/.test(segment)) {
30734
+ if (segment.charCodeAt(segment.length - 1) === 63) {
29911
30735
  if (results.length === 0 && basePath === "") {
29912
30736
  results.push("/");
29913
30737
  } else {
29914
30738
  results.push(basePath);
29915
30739
  }
29916
- const optionalSegment = segment.replace("?", "");
30740
+ const optionalSegment = segment.slice(0, -1);
29917
30741
  basePath += "/" + optionalSegment;
29918
30742
  results.push(basePath);
29919
30743
  } else {
@@ -30296,7 +31120,7 @@ var raw = (value, callbacks) => {
30296
31120
  escapedString.callbacks = callbacks;
30297
31121
  return escapedString;
30298
31122
  };
30299
- var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
31123
+ var resolveCallback = async (str, phase, preserveCallbacks, context2, buffer) => {
30300
31124
  if (typeof str === "object" && !(str instanceof String)) {
30301
31125
  if (!(str instanceof Promise)) {
30302
31126
  str = str.toString();
@@ -30314,9 +31138,9 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
30314
31138
  } else {
30315
31139
  buffer = [str];
30316
31140
  }
30317
- const resStr = Promise.all(callbacks.map((c) => c({ phase, buffer, context }))).then(
31141
+ const resStr = Promise.all(callbacks.map((c) => c({ phase, buffer, context: context2 }))).then(
30318
31142
  (res) => Promise.all(
30319
- res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context, buffer))
31143
+ res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context2, buffer))
30320
31144
  ).then(() => buffer[0])
30321
31145
  );
30322
31146
  if (preserveCallbacks) {
@@ -31060,13 +31884,13 @@ var Hono = class _Hono {
31060
31884
  const composed = compose(matchResult[0], this.errorHandler, this.#notFoundHandler);
31061
31885
  return (async () => {
31062
31886
  try {
31063
- const context = await composed(c);
31064
- if (!context.finalized) {
31887
+ const context2 = await composed(c);
31888
+ if (!context2.finalized) {
31065
31889
  throw new Error(
31066
31890
  "Context is not finalized. Did you forget to return a Response object or `await next()`?"
31067
31891
  );
31068
31892
  }
31069
- return context.res;
31893
+ return context2.res;
31070
31894
  } catch (err) {
31071
31895
  return this.#handleError(err, c);
31072
31896
  }
@@ -31187,7 +32011,7 @@ var Node = class _Node {
31187
32011
  #index;
31188
32012
  #varIndex;
31189
32013
  #children = /* @__PURE__ */ Object.create(null);
31190
- insert(tokens, index, paramMap, context, isStatic) {
32014
+ insert(tokens, index, paramMap, context2, isStatic) {
31191
32015
  let node = this;
31192
32016
  for (let i = 0, len = tokens.length; i < len; i++) {
31193
32017
  const token = tokens[i];
@@ -31223,7 +32047,7 @@ var Node = class _Node {
31223
32047
  nextNode = node.#children[regexpStr] = new _Node();
31224
32048
  }
31225
32049
  if (name !== "") {
31226
- nextNode.#varIndex ??= context.varIndex++;
32050
+ nextNode.#varIndex ??= context2.varIndex++;
31227
32051
  paramMap.push([name, nextNode.#varIndex]);
31228
32052
  }
31229
32053
  } else {
@@ -31771,6 +32595,8 @@ var cors = (options) => {
31771
32595
  exposeHeaders: [],
31772
32596
  ...options
31773
32597
  };
32598
+ const exposeHeadersStr = opts.exposeHeaders?.length ? opts.exposeHeaders.join(",") : void 0;
32599
+ const allowHeadersStr = opts.allowHeaders?.length ? opts.allowHeaders.join(",") : void 0;
31774
32600
  const findAllowOrigin = ((optsOrigin) => {
31775
32601
  if (typeof optsOrigin === "string") {
31776
32602
  if (optsOrigin === "*") {
@@ -31786,11 +32612,12 @@ var cors = (options) => {
31786
32612
  })(opts.origin);
31787
32613
  const findAllowMethods = ((optsAllowMethods) => {
31788
32614
  if (typeof optsAllowMethods === "function") {
31789
- return optsAllowMethods;
32615
+ return async (origin, c) => (await optsAllowMethods(origin, c)).join(",");
31790
32616
  } else if (Array.isArray(optsAllowMethods)) {
31791
- return () => optsAllowMethods;
32617
+ const methodsStr = optsAllowMethods.join(",");
32618
+ return () => methodsStr;
31792
32619
  } else {
31793
- return () => [];
32620
+ return () => "";
31794
32621
  }
31795
32622
  })(opts.allowMethods);
31796
32623
  return async function cors2(c, next) {
@@ -31804,8 +32631,8 @@ var cors = (options) => {
31804
32631
  if (opts.credentials) {
31805
32632
  set("Access-Control-Allow-Credentials", "true");
31806
32633
  }
31807
- if (opts.exposeHeaders?.length) {
31808
- set("Access-Control-Expose-Headers", opts.exposeHeaders.join(","));
32634
+ if (exposeHeadersStr) {
32635
+ set("Access-Control-Expose-Headers", exposeHeadersStr);
31809
32636
  }
31810
32637
  if (c.req.method === "OPTIONS") {
31811
32638
  if (opts.origin !== "*") {
@@ -31815,18 +32642,18 @@ var cors = (options) => {
31815
32642
  set("Access-Control-Max-Age", opts.maxAge.toString());
31816
32643
  }
31817
32644
  const allowMethods = await findAllowMethods(c.req.header("origin") || "", c);
31818
- if (allowMethods.length) {
31819
- set("Access-Control-Allow-Methods", allowMethods.join(","));
32645
+ if (allowMethods) {
32646
+ set("Access-Control-Allow-Methods", allowMethods);
31820
32647
  }
31821
- let headers = opts.allowHeaders;
31822
- if (!headers?.length) {
32648
+ let headersStr = allowHeadersStr;
32649
+ if (!headersStr) {
31823
32650
  const requestHeaders = c.req.header("Access-Control-Request-Headers");
31824
32651
  if (requestHeaders) {
31825
- headers = requestHeaders.split(",").map((h) => h.trim());
32652
+ headersStr = requestHeaders.split(",").map((h) => h.trim()).join(",");
31826
32653
  }
31827
32654
  }
31828
- if (headers?.length) {
31829
- set("Access-Control-Allow-Headers", headers.join(","));
32655
+ if (headersStr) {
32656
+ set("Access-Control-Allow-Headers", headersStr);
31830
32657
  c.res.headers.append("Vary", "Access-Control-Request-Headers");
31831
32658
  }
31832
32659
  c.res.headers.delete("Content-Length");
@@ -32064,8 +32891,8 @@ var RateLimiter = class _RateLimiter {
32064
32891
  };
32065
32892
 
32066
32893
  // node_modules/@casys/mcp-server/src/validation/schema-validator.ts
32067
- var import_ajv2 = __toESM(require_ajv(), 1);
32068
- var Ajv2 = import_ajv2.default.default ?? import_ajv2.default;
32894
+ var import__ = __toESM(require__(), 1);
32895
+ var Ajv2 = import__.default.default ?? import__.default;
32069
32896
  function plural(n, singular, plural2 = `${singular}s`) {
32070
32897
  return `${n} ${n === 1 ? singular : plural2}`;
32071
32898
  }
@@ -32550,19 +33377,19 @@ var BaseContext = class _BaseContext {
32550
33377
  *
32551
33378
  * @param parentContext a context from which to inherit values
32552
33379
  */
32553
- constructor(parentContext) {
33380
+ constructor(parentContext2) {
32554
33381
  const self2 = this;
32555
- self2._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
33382
+ self2._currentContext = parentContext2 ? new Map(parentContext2) : /* @__PURE__ */ new Map();
32556
33383
  self2.getValue = (key) => self2._currentContext.get(key);
32557
33384
  self2.setValue = (key, value) => {
32558
- const context = new _BaseContext(self2._currentContext);
32559
- context._currentContext.set(key, value);
32560
- return context;
33385
+ const context2 = new _BaseContext(self2._currentContext);
33386
+ context2._currentContext.set(key, value);
33387
+ return context2;
32561
33388
  };
32562
33389
  self2.deleteValue = (key) => {
32563
- const context = new _BaseContext(self2._currentContext);
32564
- context._currentContext.delete(key);
32565
- return context;
33390
+ const context2 = new _BaseContext(self2._currentContext);
33391
+ context2._currentContext.delete(key);
33392
+ return context2;
32566
33393
  };
32567
33394
  }
32568
33395
  };
@@ -32623,8 +33450,8 @@ var ContextAPI = class _ContextAPI {
32623
33450
  * @param thisArg optional receiver to be used for calling fn
32624
33451
  * @param args optional arguments forwarded to fn
32625
33452
  */
32626
- with(context, fn, thisArg, ...args) {
32627
- return this._getContextManager().with(context, fn, thisArg, ...args);
33453
+ with(context2, fn, thisArg, ...args) {
33454
+ return this._getContextManager().with(context2, fn, thisArg, ...args);
32628
33455
  }
32629
33456
  /**
32630
33457
  * Bind a context to a target function or event emitter
@@ -32632,8 +33459,8 @@ var ContextAPI = class _ContextAPI {
32632
33459
  * @param context context to bind to the event emitter or function. Defaults to the currently active context
32633
33460
  * @param target function or event emitter to bind
32634
33461
  */
32635
- bind(context, target) {
32636
- return this._getContextManager().bind(context, target);
33462
+ bind(context2, target) {
33463
+ return this._getContextManager().bind(context2, target);
32637
33464
  }
32638
33465
  _getContextManager() {
32639
33466
  return getGlobal(API_NAME2) || NOOP_CONTEXT_MANAGER;
@@ -32710,24 +33537,24 @@ var NonRecordingSpan = class {
32710
33537
 
32711
33538
  // node_modules/@opentelemetry/api/build/esm/trace/context-utils.js
32712
33539
  var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
32713
- function getSpan(context) {
32714
- return context.getValue(SPAN_KEY) || void 0;
33540
+ function getSpan(context2) {
33541
+ return context2.getValue(SPAN_KEY) || void 0;
32715
33542
  }
32716
33543
  function getActiveSpan() {
32717
33544
  return getSpan(ContextAPI.getInstance().active());
32718
33545
  }
32719
- function setSpan(context, span) {
32720
- return context.setValue(SPAN_KEY, span);
33546
+ function setSpan(context2, span) {
33547
+ return context2.setValue(SPAN_KEY, span);
32721
33548
  }
32722
- function deleteSpan(context) {
32723
- return context.deleteValue(SPAN_KEY);
33549
+ function deleteSpan(context2) {
33550
+ return context2.deleteValue(SPAN_KEY);
32724
33551
  }
32725
- function setSpanContext(context, spanContext) {
32726
- return setSpan(context, new NonRecordingSpan(spanContext));
33552
+ function setSpanContext(context2, spanContext) {
33553
+ return setSpan(context2, new NonRecordingSpan(spanContext));
32727
33554
  }
32728
- function getSpanContext(context) {
33555
+ function getSpanContext(context2) {
32729
33556
  var _a3;
32730
- return (_a3 = getSpan(context)) === null || _a3 === void 0 ? void 0 : _a3.spanContext();
33557
+ return (_a3 = getSpan(context2)) === null || _a3 === void 0 ? void 0 : _a3.spanContext();
32731
33558
  }
32732
33559
 
32733
33560
  // node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js
@@ -32862,12 +33689,12 @@ function wrapSpanContext(spanContext) {
32862
33689
  var contextApi = ContextAPI.getInstance();
32863
33690
  var NoopTracer = class {
32864
33691
  // startSpan starts a noop span.
32865
- startSpan(name, options, context = contextApi.active()) {
33692
+ startSpan(name, options, context2 = contextApi.active()) {
32866
33693
  const root = Boolean(options === null || options === void 0 ? void 0 : options.root);
32867
33694
  if (root) {
32868
33695
  return new NonRecordingSpan();
32869
33696
  }
32870
- const parentFromContext = context && getSpanContext(context);
33697
+ const parentFromContext = context2 && getSpanContext(context2);
32871
33698
  if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) {
32872
33699
  return new NonRecordingSpan(parentFromContext);
32873
33700
  } else {
@@ -32890,9 +33717,9 @@ var NoopTracer = class {
32890
33717
  ctx = arg3;
32891
33718
  fn = arg4;
32892
33719
  }
32893
- const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
32894
- const span = this.startSpan(name, opts, parentContext);
32895
- const contextWithSpanSet = setSpan(parentContext, span);
33720
+ const parentContext2 = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
33721
+ const span = this.startSpan(name, opts, parentContext2);
33722
+ const contextWithSpanSet = setSpan(parentContext2, span);
32896
33723
  return contextApi.with(contextWithSpanSet, fn, void 0, span);
32897
33724
  }
32898
33725
  };
@@ -32909,8 +33736,8 @@ var ProxyTracer = class {
32909
33736
  this.version = version2;
32910
33737
  this.options = options;
32911
33738
  }
32912
- startSpan(name, options, context) {
32913
- return this._getTracer().startSpan(name, options, context);
33739
+ startSpan(name, options, context2) {
33740
+ return this._getTracer().startSpan(name, options, context2);
32914
33741
  }
32915
33742
  startActiveSpan(_name, _options, _context, _fn) {
32916
33743
  const tracer = this._getTracer();
@@ -32974,6 +33801,9 @@ var SpanStatusCode;
32974
33801
  SpanStatusCode2[SpanStatusCode2["ERROR"] = 2] = "ERROR";
32975
33802
  })(SpanStatusCode || (SpanStatusCode = {}));
32976
33803
 
33804
+ // node_modules/@opentelemetry/api/build/esm/context-api.js
33805
+ var context = ContextAPI.getInstance();
33806
+
32977
33807
  // node_modules/@opentelemetry/api/build/esm/api/trace.js
32978
33808
  var API_NAME3 = "trace";
32979
33809
  var TraceAPI = class _TraceAPI {
@@ -33032,15 +33862,101 @@ var trace = TraceAPI.getInstance();
33032
33862
 
33033
33863
  // node_modules/@casys/mcp-server/src/observability/otel.ts
33034
33864
  var serverTracer = null;
33865
+ var TRACEPARENT = /^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})/;
33866
+ var TRACEPARENT_PREFIX_LENGTH = 55;
33867
+ var INVALID_TRACE_ID = "0".repeat(32);
33868
+ var INVALID_SPAN_ID = "0".repeat(16);
33869
+ var TRACESTATE_MAX_MEMBERS = 32;
33870
+ var TRACESTATE_KEY = /^(?:[a-z][a-z0-9_\-*/]{0,255}|[a-z0-9][a-z0-9_\-*/]{0,240}@[a-z][a-z0-9_\-*/]{0,13})$/;
33871
+ var TRACESTATE_VALUE = /^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/;
33872
+ function trimOws(member) {
33873
+ return member.replace(/^[ \t]+/, "").replace(/[ \t]+$/, "");
33874
+ }
33875
+ var ListTraceState = class _ListTraceState {
33876
+ #entries;
33877
+ constructor(entries) {
33878
+ this.#entries = entries;
33879
+ }
33880
+ static #isValid(key, value) {
33881
+ return TRACESTATE_KEY.test(key) && TRACESTATE_VALUE.test(value);
33882
+ }
33883
+ static parse(raw2) {
33884
+ const seen = /* @__PURE__ */ new Set();
33885
+ const entries = [];
33886
+ for (const member of raw2.split(",")) {
33887
+ const trimmed = trimOws(member);
33888
+ if (trimmed.length === 0) continue;
33889
+ const at = trimmed.indexOf("=");
33890
+ if (at <= 0) continue;
33891
+ const key = trimmed.slice(0, at);
33892
+ const value = trimmed.slice(at + 1);
33893
+ if (seen.has(key)) continue;
33894
+ if (!_ListTraceState.#isValid(key, value)) continue;
33895
+ seen.add(key);
33896
+ entries.push([key, value]);
33897
+ if (entries.length === TRACESTATE_MAX_MEMBERS) break;
33898
+ }
33899
+ return entries.length > 0 ? new _ListTraceState(entries) : void 0;
33900
+ }
33901
+ get(key) {
33902
+ return this.#entries.find(([k]) => k === key)?.[1];
33903
+ }
33904
+ set(key, value) {
33905
+ if (!_ListTraceState.#isValid(key, value)) return this;
33906
+ return new _ListTraceState([
33907
+ [key, value],
33908
+ ...this.#entries.filter(([k]) => k !== key)
33909
+ ].slice(0, TRACESTATE_MAX_MEMBERS));
33910
+ }
33911
+ unset(key) {
33912
+ return new _ListTraceState(this.#entries.filter(([k]) => k !== key));
33913
+ }
33914
+ serialize() {
33915
+ return this.#entries.map(([k, v]) => `${k}=${v}`).join(",");
33916
+ }
33917
+ };
33918
+ function parseTraceParent(traceparent, tracestate) {
33919
+ if (typeof traceparent !== "string") return void 0;
33920
+ if (traceparent.length < TRACEPARENT_PREFIX_LENGTH) return void 0;
33921
+ const match2 = TRACEPARENT.exec(traceparent);
33922
+ if (!match2) return void 0;
33923
+ const [, version2, traceId, spanId, flags] = match2;
33924
+ if (version2 === "ff") return void 0;
33925
+ if (version2 === "00") {
33926
+ if (traceparent.length !== TRACEPARENT_PREFIX_LENGTH) return void 0;
33927
+ } else if (traceparent.length > TRACEPARENT_PREFIX_LENGTH && traceparent[TRACEPARENT_PREFIX_LENGTH] !== "-") {
33928
+ return void 0;
33929
+ }
33930
+ if (traceId === INVALID_TRACE_ID || spanId === INVALID_SPAN_ID) {
33931
+ return void 0;
33932
+ }
33933
+ const traceState = typeof tracestate === "string" ? ListTraceState.parse(tracestate) : void 0;
33934
+ return {
33935
+ traceId,
33936
+ spanId,
33937
+ // Only the sampled bit is defined; the rest of the byte is reserved.
33938
+ traceFlags: parseInt(flags, 16) & TraceFlags.SAMPLED,
33939
+ isRemote: true,
33940
+ ...traceState ? { traceState } : {}
33941
+ };
33942
+ }
33943
+ function parentContext(remote) {
33944
+ const active = context.active();
33945
+ return remote ? trace.setSpanContext(active, remote) : active;
33946
+ }
33035
33947
  function getServerTracer() {
33036
33948
  if (!serverTracer) {
33037
33949
  serverTracer = trace.getTracer("mcp.server", "0.8.0");
33038
33950
  }
33039
33951
  return serverTracer;
33040
33952
  }
33041
- function startToolCallSpan(toolName, attributes) {
33953
+ function startToolCallSpan(toolName, attributes, remoteParent) {
33042
33954
  const tracer = getServerTracer();
33043
- return tracer.startSpan(`mcp.tool.call ${toolName}`, { attributes });
33955
+ return tracer.startSpan(
33956
+ `mcp.tool.call ${toolName}`,
33957
+ { attributes },
33958
+ parentContext(remoteParent)
33959
+ );
33044
33960
  }
33045
33961
  function endToolCallSpan(span, success, durationMs, error2) {
33046
33962
  span.setAttribute("mcp.tool.duration_ms", durationMs);
@@ -34096,7 +35012,7 @@ function isCloudflareWorkers() {
34096
35012
  var USER_AGENT;
34097
35013
  if (typeof navigator === "undefined" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) {
34098
35014
  const NAME = "jose";
34099
- const VERSION2 = "v6.2.8";
35015
+ const VERSION2 = "v6.2.9";
34100
35016
  USER_AGENT = `${NAME}/${VERSION2}`;
34101
35017
  }
34102
35018
  var customFetch = Symbol();
@@ -36564,6 +37480,8 @@ var STATELESS_SUPPORTED_VERSIONS = [
36564
37480
  ];
36565
37481
  var STATELESS_SERVER_INFO_KEY = "io.modelcontextprotocol/serverInfo";
36566
37482
  var STATELESS_LOG_LEVEL_KEY = "io.modelcontextprotocol/logLevel";
37483
+ var TRACEPARENT_KEY = "traceparent";
37484
+ var TRACESTATE_KEY2 = "tracestate";
36567
37485
  var SPEC_2026_07_28 = "2026-07-28";
36568
37486
  var TASKS_EXTENSION_ID = "io.modelcontextprotocol/tasks";
36569
37487
  var STATELESS_FALLBACK_VERSION = "2026-07-28";
@@ -36571,6 +37489,13 @@ var JSONRPC_INVALID_PARAMS = ErrorCode.InvalidParams;
36571
37489
  var MCP_HEADER_MISMATCH = -32020;
36572
37490
  var MCP_MISSING_REQUIRED_CLIENT_CAPABILITY = -32021;
36573
37491
  var MCP_UNSUPPORTED_PROTOCOL_VERSION = -32022;
37492
+ function readTraceContext(meta2) {
37493
+ const traceContext = parseTraceParent(
37494
+ meta2[TRACEPARENT_KEY],
37495
+ meta2[TRACESTATE_KEY2]
37496
+ );
37497
+ return traceContext ? { traceContext } : {};
37498
+ }
36574
37499
  var MCP_LOG_LEVELS = [
36575
37500
  "debug",
36576
37501
  "info",
@@ -36865,15 +37790,63 @@ var McpApp = class {
36865
37790
  async (request) => {
36866
37791
  const toolName = request.params.name;
36867
37792
  const args = request.params.arguments || {};
37793
+ const meta2 = request.params._meta;
37794
+ const clientMeta = isRecord5(meta2) ? {
37795
+ ...readTraceContext(meta2),
37796
+ ...readLogLevel(meta2) !== void 0 ? { logLevel: readLogLevel(meta2) } : {}
37797
+ } : void 0;
36868
37798
  let result;
36869
37799
  try {
36870
- result = await this.executeToolCall(toolName, args);
37800
+ result = await this.executeToolCall(
37801
+ toolName,
37802
+ args,
37803
+ void 0,
37804
+ void 0,
37805
+ void 0,
37806
+ clientMeta
37807
+ );
36871
37808
  } catch (error2) {
36872
37809
  return this.handleToolError(error2, toolName);
36873
37810
  }
36874
37811
  return this.buildToolCallResult(toolName, result);
36875
37812
  }
36876
37813
  );
37814
+ server.fallbackRequestHandler = (request) => {
37815
+ if (request.method !== "server/discover") {
37816
+ throw new McpError(ErrorCode.MethodNotFound, "Method not found");
37817
+ }
37818
+ return Promise.resolve(this.buildDiscoverResult());
37819
+ };
37820
+ }
37821
+ /**
37822
+ * The `server/discover` result (spec 2026-07-28, SEP-2575).
37823
+ *
37824
+ * Single source of truth for both transports. They used to be one inline
37825
+ * object on the HTTP path; a stdio copy would have been the second place to
37826
+ * forget `instructions` or a new capability.
37827
+ *
37828
+ * Always stamped as 2026-07-28 regardless of what the transport negotiated.
37829
+ * That is deliberate but not free: nothing gates the method, so a peer that
37830
+ * negotiated `2025-11-25` over stdio can call it and receive an envelope it
37831
+ * never agreed to. The alternative is worse — stamping the negotiated version
37832
+ * would make the probe answer "2025" to the client asking whether this server
37833
+ * speaks 2026, which is the one question it exists to answer. Treat
37834
+ * `server/discover` as a cross-version exception: its result describes what
37835
+ * the server supports, not what the current transport negotiated.
37836
+ */
37837
+ buildDiscoverResult() {
37838
+ return this.stampResult(
37839
+ this.withCacheHints({
37840
+ supportedVersions: [...STATELESS_SUPPORTED_VERSIONS],
37841
+ capabilities: this.buildServerCapabilities(),
37842
+ serverInfo: {
37843
+ name: this.options.name,
37844
+ version: this.options.version
37845
+ },
37846
+ ...this.options.instructions ? { instructions: this.options.instructions } : {}
37847
+ }, SPEC_2026_07_28),
37848
+ SPEC_2026_07_28
37849
+ );
36877
37850
  }
36878
37851
  /**
36879
37852
  * Register tools with their handlers
@@ -37129,12 +38102,16 @@ var McpApp = class {
37129
38102
  ...mrtr?.inputResponses !== void 0 ? { inputResponses: mrtr.inputResponses } : {},
37130
38103
  ...mrtr?.retryVerified !== void 0 ? { retryVerified: mrtr.retryVerified } : {}
37131
38104
  };
37132
- const span = startToolCallSpan(toolName, {
37133
- "mcp.tool.name": toolName,
37134
- "mcp.server.name": this.options.name,
37135
- "mcp.transport": request ? "http" : "stdio",
37136
- "mcp.session.id": sessionId
37137
- });
38105
+ const span = startToolCallSpan(
38106
+ toolName,
38107
+ {
38108
+ "mcp.tool.name": toolName,
38109
+ "mcp.server.name": this.options.name,
38110
+ "mcp.transport": request ? "http" : "stdio",
38111
+ "mcp.session.id": sessionId
38112
+ },
38113
+ clientMeta?.traceContext
38114
+ );
37138
38115
  const queueMetrics = this.requestQueue.getMetrics();
37139
38116
  this.serverMetrics.setGauges({
37140
38117
  activeRequests: queueMetrics.inFlight,
@@ -37582,14 +38559,14 @@ var McpApp = class {
37582
38559
  return { allowed: true, retryAfterMs: 0 };
37583
38560
  }
37584
38561
  const ip = getClientIpFromHeaders(request.headers);
37585
- const context = {
38562
+ const context2 = {
37586
38563
  ip,
37587
38564
  method: request.method,
37588
38565
  path: new URL(request.url).pathname,
37589
38566
  headers: overrideHeaders ?? request.headers,
37590
38567
  sessionId
37591
38568
  };
37592
- const key = httpRateLimit.keyExtractor?.(context) ?? ip;
38569
+ const key = httpRateLimit.keyExtractor?.(context2) ?? ip;
37593
38570
  const behavior = httpRateLimit.onLimitExceeded ?? "reject";
37594
38571
  if (behavior === "wait") {
37595
38572
  try {
@@ -37787,18 +38764,7 @@ var McpApp = class {
37787
38764
  return c.json({
37788
38765
  jsonrpc: "2.0",
37789
38766
  id,
37790
- result: this.stampResult(
37791
- this.withCacheHints({
37792
- supportedVersions: [...STATELESS_SUPPORTED_VERSIONS],
37793
- capabilities: this.buildServerCapabilities(),
37794
- serverInfo: {
37795
- name: this.options.name,
37796
- version: this.options.version
37797
- },
37798
- ...this.options.instructions ? { instructions: this.options.instructions } : {}
37799
- }, statelessVersion),
37800
- statelessVersion
37801
- )
38767
+ result: this.buildDiscoverResult()
37802
38768
  });
37803
38769
  }
37804
38770
  if (method === "initialize") {
@@ -37836,7 +38802,8 @@ var McpApp = class {
37836
38802
  const statelessClientMeta = isRecord5(params) && isRecord5(params["_meta"]) ? {
37837
38803
  clientInfo: params["_meta"][STATELESS_CLIENT_INFO_KEY],
37838
38804
  clientCapabilities: params["_meta"][STATELESS_CLIENT_CAPABILITIES_KEY],
37839
- logLevel: readLogLevel(params["_meta"])
38805
+ logLevel: readLogLevel(params["_meta"]),
38806
+ ...readTraceContext(params["_meta"])
37840
38807
  } : void 0;
37841
38808
  const mrtrEnabled = true;
37842
38809
  const ingressDigest = mrtrEnabled ? await paramsDigest({ arguments: args, name: toolName }) : "";
@@ -38977,7 +39944,7 @@ var McpApp = class {
38977
39944
  * A violation is the server author's bug, so it surfaces as `-32603` rather
38978
39945
  * than being emitted as an invalid MRTR result for the client to puzzle over.
38979
39946
  */
38980
- async buildInputRequiredResult(signal, context) {
39947
+ async buildInputRequiredResult(signal, context2) {
38981
39948
  const requests = signal.inputRequests;
38982
39949
  if (requests !== void 0 && !isRecord5(requests)) {
38983
39950
  return {
@@ -38998,7 +39965,7 @@ var McpApp = class {
38998
39965
  if (hasRequests) {
38999
39966
  const check = checkInputRequestCapabilities(
39000
39967
  requests,
39001
- context.clientCapabilities
39968
+ context2.clientCapabilities
39002
39969
  );
39003
39970
  if (!check.ok) {
39004
39971
  if (check.kind === "malformed") {
@@ -39044,9 +40011,9 @@ var McpApp = class {
39044
40011
  if (key !== null) {
39045
40012
  const ttl = this.options.mrtr?.defaultTtlSecs ?? 300;
39046
40013
  requestState = await sealRequestState({
39047
- sub: context.principal,
39048
- method: context.method,
39049
- paramsDigest: context.paramsDigest,
40014
+ sub: context2.principal,
40015
+ method: context2.method,
40016
+ paramsDigest: context2.paramsDigest,
39050
40017
  exp: Math.floor(Date.now() / 1e3) + ttl,
39051
40018
  nonce: bytesToHexLocal(crypto.getRandomValues(new Uint8Array(16)))
39052
40019
  }, key);
@@ -48072,8 +49039,8 @@ function getToolByName(name) {
48072
49039
  function linkDisambiguationRequestKey(inputPath) {
48073
49040
  return `link-disambiguation:${inputPath}`;
48074
49041
  }
48075
- function supportsElicitation(context) {
48076
- return context?.clientCapabilities?.elicitation !== void 0;
49042
+ function supportsElicitation(context2) {
49043
+ return context2?.clientCapabilities?.elicitation !== void 0;
48077
49044
  }
48078
49045
  function isRecord6(value) {
48079
49046
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -48107,16 +49074,16 @@ function buildInputRequiredSignal(ambiguity, inputPath) {
48107
49074
  }
48108
49075
  };
48109
49076
  }
48110
- function selectedRecordId(ambiguity, inputPath, context) {
48111
- const hasRetryContext = context?.inputResponses !== void 0 || context?.retryVerified !== void 0;
49077
+ function selectedRecordId(ambiguity, inputPath, context2) {
49078
+ const hasRetryContext = context2?.inputResponses !== void 0 || context2?.retryVerified !== void 0;
48112
49079
  if (!hasRetryContext) return void 0;
48113
- if (context?.retryVerified !== true) {
49080
+ if (context2?.retryVerified !== true) {
48114
49081
  throw new Error(
48115
49082
  "[link-disambiguation] Refusing to use an unverified MRTR response."
48116
49083
  );
48117
49084
  }
48118
49085
  const key = linkDisambiguationRequestKey(inputPath);
48119
- const response = context.inputResponses?.[key];
49086
+ const response = context2.inputResponses?.[key];
48120
49087
  if (!isRecord6(response)) {
48121
49088
  throw new Error(
48122
49089
  `[link-disambiguation] Missing or invalid response for "${key}".`
@@ -48664,6 +49631,43 @@ function loadMrtrConfig() {
48664
49631
  return { signingKey };
48665
49632
  }
48666
49633
 
49634
+ // src/claude-code-stdio-compat.ts
49635
+ var LIST_RESULT_ARRAY_KEYS = ["tools", "resources", "prompts"];
49636
+ function stampMissingResultType(line) {
49637
+ const hasTrailingNewline = line.endsWith("\n");
49638
+ const trimmed = hasTrailingNewline ? line.slice(0, -1) : line;
49639
+ let message2;
49640
+ try {
49641
+ message2 = JSON.parse(trimmed);
49642
+ } catch {
49643
+ return line;
49644
+ }
49645
+ if (!message2 || typeof message2 !== "object" || !("result" in message2)) {
49646
+ return line;
49647
+ }
49648
+ const result = message2.result;
49649
+ if (!result || typeof result !== "object" || Array.isArray(result) || "resultType" in result) {
49650
+ return line;
49651
+ }
49652
+ const record2 = result;
49653
+ const isListResult = LIST_RESULT_ARRAY_KEYS.some(
49654
+ (key) => Array.isArray(record2[key])
49655
+ );
49656
+ if (!isListResult) return line;
49657
+ record2.resultType = "complete";
49658
+ return JSON.stringify(message2) + (hasTrailingNewline ? "\n" : "");
49659
+ }
49660
+ function installClaudeCodeStdioCompat() {
49661
+ const stdout = process.stdout;
49662
+ if (stdout.__claudeCodeStdioCompatInstalled) return;
49663
+ const originalWrite = stdout.write.bind(stdout);
49664
+ stdout.write = (chunk, ...rest) => {
49665
+ const patched = typeof chunk === "string" ? stampMissingResultType(chunk) : chunk;
49666
+ return originalWrite(patched, ...rest);
49667
+ };
49668
+ stdout.__claudeCodeStdioCompatInstalled = true;
49669
+ }
49670
+
48667
49671
  // server.ts
48668
49672
  var DEFAULT_HTTP_PORT = 3012;
48669
49673
  async function main() {
@@ -48788,6 +49792,7 @@ async function main() {
48788
49792
  }
48789
49793
  });
48790
49794
  } else {
49795
+ installClaudeCodeStdioCompat();
48791
49796
  await server.start();
48792
49797
  console.error("[hvgerp-mcp] stdio mode ready");
48793
49798
  }