@prefecthq/fastmcp-ts 1.0.0-rc.0 → 1.0.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.
@@ -1172,8 +1172,8 @@ var init_version = __esm({
1172
1172
  async run({ args }) {
1173
1173
  if (args.json) setJsonMode(true);
1174
1174
  const data = {
1175
- fastmcp: "1.0.0-rc.0",
1176
- "mcp-sdk": "2.0.0-beta.5",
1175
+ fastmcp: "1.0.0",
1176
+ "mcp-sdk": "^2.0.0",
1177
1177
  node: process.version,
1178
1178
  platform: `${process.platform} ${process.arch}`
1179
1179
  };
@@ -1291,6 +1291,29 @@ var init_chunk_Br0eD_fh = __esm({
1291
1291
  }
1292
1292
  });
1293
1293
 
1294
+ // node_modules/@modelcontextprotocol/client/dist/dialects-BOhdv1Fc.mjs
1295
+ function declares2019Dialect($schema) {
1296
+ return typeof $schema === "string" && DRAFT_2019_09_URIS.has($schema.replace(/#$/, ""));
1297
+ }
1298
+ function declaredDialect(schema, remedy) {
1299
+ if (!("$schema" in schema) || typeof schema.$schema !== "string") return "2020-12";
1300
+ const declared = schema.$schema.replace(/#$/, "");
1301
+ if (DRAFT_2020_12_URIS.has(declared)) return "2020-12";
1302
+ if (DRAFT_2019_09_URIS.has(declared)) return "2019-09";
1303
+ if (DRAFT_07_URIS.has(declared) || DRAFT_06_URIS.has(declared)) return "draft-7";
1304
+ throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${schema.$schema.slice(0, 200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${remedy}`);
1305
+ }
1306
+ var DRAFT_2020_12_URIS, DRAFT_2019_09_URIS, DRAFT_07_URIS, DRAFT_06_URIS;
1307
+ var init_dialects_BOhdv1Fc = __esm({
1308
+ "node_modules/@modelcontextprotocol/client/dist/dialects-BOhdv1Fc.mjs"() {
1309
+ "use strict";
1310
+ DRAFT_2020_12_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft/2020-12/schema", "http://json-schema.org/draft/2020-12/schema"]);
1311
+ DRAFT_2019_09_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft/2019-09/schema", "http://json-schema.org/draft/2019-09/schema"]);
1312
+ DRAFT_07_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft-07/schema", "http://json-schema.org/draft-07/schema"]);
1313
+ DRAFT_06_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft-06/schema", "http://json-schema.org/draft-06/schema"]);
1314
+ }
1315
+ });
1316
+
1294
1317
  // node_modules/zod/v4/core/core.js
1295
1318
  // @__NO_SIDE_EFFECTS__
1296
1319
  function $constructor(name, initializer3, params) {
@@ -9887,7 +9910,7 @@ var init_internal = __esm({
9887
9910
  }
9888
9911
  });
9889
9912
 
9890
- // node_modules/@modelcontextprotocol/client/dist/src-CgOncMok.mjs
9913
+ // node_modules/@modelcontextprotocol/client/dist/src-D_zzAWoS.mjs
9891
9914
  function stampErrorBrands(instance, ctor) {
9892
9915
  const brands = /* @__PURE__ */ new Set();
9893
9916
  let current = ctor;
@@ -10836,24 +10859,32 @@ function buildSchemas2025() {
10836
10859
  function isNonObjectJsonSchemaRoot(json2) {
10837
10860
  return json2["type"] !== "object";
10838
10861
  }
10862
+ function establishesNewBase(id) {
10863
+ return id !== void 0 && !(typeof id === "string" && id.startsWith("#"));
10864
+ }
10839
10865
  function wrapOutputSchemaForLegacy(natural) {
10840
10866
  const $schema = typeof natural["$schema"] === "string" ? natural["$schema"] : void 0;
10841
- if (natural["$id"] !== void 0) return {
10867
+ if (establishesNewBase(natural["$id"])) return {
10842
10868
  ...$schema !== void 0 && { $schema },
10843
10869
  type: "object",
10844
10870
  properties: { result: natural },
10845
10871
  required: ["result"]
10846
10872
  };
10873
+ const convertRecursiveRefs = declares2019Dialect(natural["$schema"]) && natural["$recursiveAnchor"] !== true;
10847
10874
  const rewriteRefs = (node, parentIsNameMap) => {
10848
10875
  if (Array.isArray(node)) return node.map((item) => rewriteRefs(item, false));
10849
10876
  if (node === null || typeof node !== "object") return node;
10850
- if (!parentIsNameMap && node["$id"] !== void 0) return node;
10877
+ if (!parentIsNameMap && establishesNewBase(node["$id"])) return node;
10851
10878
  const out = {};
10879
+ let convertedRecursion = false;
10852
10880
  for (const [k, v] of Object.entries(node)) if (parentIsNameMap) out[k] = rewriteRefs(v, false);
10853
10881
  else if ((k === "$ref" || k === "$dynamicRef") && typeof v === "string") out[k] = v === "#" ? "#/properties/result" : v.startsWith("#/") ? `#/properties/result${v.slice(1)}` : v;
10882
+ else if (k === "$recursiveRef" && v === "#" && convertRecursiveRefs) convertedRecursion = true;
10854
10883
  else if (REF_REWRITE_DATA_POSITION_KEYS.has(k)) out[k] = v;
10855
10884
  else if (REF_REWRITE_NAME_MAP_KEYS.has(k)) out[k] = rewriteRefs(v, true);
10856
10885
  else out[k] = rewriteRefs(v, false);
10886
+ if (convertedRecursion) if ("$ref" in out) out["allOf"] = [...Array.isArray(out["allOf"]) ? out["allOf"] : [], { $ref: "#/properties/result" }];
10887
+ else out["$ref"] = "#/properties/result";
10857
10888
  return out;
10858
10889
  };
10859
10890
  return {
@@ -12649,10 +12680,11 @@ function createFetchWithInit(baseFetch = fetch, baseInit) {
12649
12680
  };
12650
12681
  }
12651
12682
  var BRANDS, OAuthErrorCode, OAuthError, SdkErrorCode, SdkError, SdkHttpError, FIRST_MODERN_PROTOCOL_VERSION, SUPPORTED_MODERN_PROTOCOL_VERSIONS, TOOL_RESULT_FOREIGN_FAMILY_KEYS, memo$1, REF_REWRITE_DATA_POSITION_KEYS, REF_REWRITE_NAME_MAP_KEYS, requestMethodKeys$1, notificationMethodKeys$1, resultMethodKeys, maps$1, rev2025RequestMethods, rev2025NotificationMethods, NOT_IN_ERA$1, rev2025Codec, memo, CACHEABLE_RESULT_METHODS, RESULT_CACHE_HINT_FALLBACK, ProtocolErrorCode, ProtocolError, ResourceNotFoundError, UrlElicitationRequiredError, UnsupportedProtocolVersionError, MissingRequiredClientCapabilityError, DEFAULT_CACHE_TTL_MS, DEFAULT_CACHE_SCOPE, EXTENDED_RESULT_TYPE_METHODS, INPUT_REQUEST_METHODS_2026, maps, requestMethodKeys, notificationMethodKeys, rev2026RequestMethods, rev2026NotificationMethods, NOT_IN_ERA, REQUIRED_ENVELOPE_KEYS, rev2026Codec, wireResultSchemasMemo, MODERN_WIRE_REVISION, ALL_CODECS, schemas_exports3, isJSONRPCRequest, isJSONRPCNotification, isJSONRPCResultResponse, isJSONRPCErrorResponse, isInputRequiredResult, isInitializeRequest, isInitializedNotification, MCP_PARAM_HEADER_PREFIX, X_MCP_HEADER_KEY, RFC9110_TOKEN, PERMITTED_X_MCP_HEADER_TYPES, NON_REACHABLE_SUBSCHEMA_KEYWORDS, OBJECT_VALUED_SUBSCHEMA_KEYWORDS, BASE64_SENTINEL_PREFIX, BASE64_SENTINEL_SUFFIX, HEADER_MISMATCH_ERROR_CODE, INBOUND_VALIDATION_LADDER, LADDER_ERROR_HTTP_STATUS, warnedZodFallback, JSON_SCHEMA_CONVERSION_TARGET, DATETIME_FRACTION_DIGITS, ANNOTATION_ONLY_JSON_SCHEMA_KEYWORDS, ROOT_KEYS, PROPERTY_KEYS_BY_TYPE, SUPPORTED_STRING_FORMATS, inputRequired, DEFAULT_INPUT_REQUIRED_AUTO_FULFILL, DEFAULT_INPUT_REQUIRED_MAX_ROUNDS, REQUEST_STATE_ONLY_LEG_PACING_MS, SPEC_SCHEMA_KEYS, authSchemas, _specTypeSchemas, _isSpecType, specTypeSchemas, isSpecType, DEFAULT_REQUEST_TIMEOUT_MSEC, RESERVED_ENVELOPE_META_KEYS, RETRY_PARAMS_KEYS, NO_REQUEST_STATE, writeNegotiatedProtocolVersion, Protocol, require_content_type, import_content_type, STDIO_DEFAULT_MAX_BUFFER_SIZE, ReadBuffer, InMemoryTransport;
12652
- var init_src_CgOncMok = __esm({
12653
- "node_modules/@modelcontextprotocol/client/dist/src-CgOncMok.mjs"() {
12683
+ var init_src_D_zzAWoS = __esm({
12684
+ "node_modules/@modelcontextprotocol/client/dist/src-D_zzAWoS.mjs"() {
12654
12685
  "use strict";
12655
12686
  init_chunk_Br0eD_fh();
12687
+ init_dialects_BOhdv1Fc();
12656
12688
  init_internal();
12657
12689
  init_v4();
12658
12690
  BRANDS = /* @__PURE__ */ Symbol.for("mcp.sdk.errorBrands");
@@ -12805,7 +12837,8 @@ var init_src_CgOncMok = __esm({
12805
12837
  "patternProperties",
12806
12838
  "$defs",
12807
12839
  "definitions",
12808
- "dependentSchemas"
12840
+ "dependentSchemas",
12841
+ "dependencies"
12809
12842
  ]);
12810
12843
  requestMethodKeys$1 = {
12811
12844
  ping: null,
@@ -14614,9 +14647,9 @@ var init_src_CgOncMok = __esm({
14614
14647
  }
14615
14648
  });
14616
14649
 
14617
- // node_modules/@modelcontextprotocol/client/dist/ajvProvider-Asx17_Co.mjs
14618
- function createDefaultAjvInstance() {
14619
- const ajv = new import__2020.Ajv2020({
14650
+ // node_modules/@modelcontextprotocol/client/dist/ajvProvider-97rDpkRx.mjs
14651
+ function createDefaultAjvInstance(engineClass) {
14652
+ const ajv = new engineClass({
14620
14653
  strict: false,
14621
14654
  validateFormats: true,
14622
14655
  validateSchema: false,
@@ -14625,11 +14658,12 @@ function createDefaultAjvInstance() {
14625
14658
  addFormats(ajv);
14626
14659
  return ajv;
14627
14660
  }
14628
- var require_code$1, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core$2, require_id, require_ref, require_core$1, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation$1, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator$1, require_format$1, require_format, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_dynamicAnchor, require_dynamicRef, require_recursiveAnchor, require_recursiveRef, require_dynamic, require_dependentRequired, require_dependentSchemas, require_limitContains, require_next, require_unevaluatedProperties, require_unevaluatedItems, require_unevaluated$1, require_draft2020, require_schema, require_applicator, require_unevaluated, require_content, require_core, require_format_annotation, require_meta_data, require_validation, require_json_schema_2020_12, require__2020, require_formats, require_limit, require_dist, import_ajv, import__2020, import_dist, DRAFT_2020_12_URIS, addFormats, AjvJsonSchemaValidator, Ajv;
14629
- var init_ajvProvider_Asx17_Co = __esm({
14630
- "node_modules/@modelcontextprotocol/client/dist/ajvProvider-Asx17_Co.mjs"() {
14661
+ var require_code$1, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core$3, require_id, require_ref, require_core$2, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation$2, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator$2, require_format$2, require_format$1, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_dynamicAnchor, require_dynamicRef, require_recursiveAnchor, require_recursiveRef, require_dynamic, require_dependentRequired, require_dependentSchemas, require_limitContains, require_next, require_unevaluatedProperties, require_unevaluatedItems, require_unevaluated$1, require_schema$1, require_applicator$1, require_content$1, require_core$1, require_format, require_meta_data$1, require_validation$1, require_json_schema_2019_09, require__2019, require_draft2020, require_schema, require_applicator, require_unevaluated, require_content, require_core, require_format_annotation, require_meta_data, require_validation, require_json_schema_2020_12, require__2020, require_formats, require_limit, require_dist, import_ajv, import__2019, import__2020, import_dist, addFormats, AjvJsonSchemaValidator, Ajv;
14662
+ var init_ajvProvider_97rDpkRx = __esm({
14663
+ "node_modules/@modelcontextprotocol/client/dist/ajvProvider-97rDpkRx.mjs"() {
14631
14664
  "use strict";
14632
14665
  init_chunk_Br0eD_fh();
14666
+ init_dialects_BOhdv1Fc();
14633
14667
  require_code$1 = /* @__PURE__ */ __commonJSMin(((exports2) => {
14634
14668
  Object.defineProperty(exports2, "__esModule", { value: true });
14635
14669
  exports2.regexpCode = exports2.getEsmExportName = exports2.getProperty = exports2.safeStringify = exports2.stringify = exports2.strConcat = exports2.addCodeArg = exports2.str = exports2._ = exports2.nil = exports2._Code = exports2.Name = exports2.IDENTIFIER = exports2._CodeOrName = void 0;
@@ -17868,7 +17902,7 @@ var init_ajvProvider_Asx17_Co = __esm({
17868
17902
  uri.code = 'require("ajv/dist/runtime/uri").default';
17869
17903
  exports2.default = uri;
17870
17904
  }));
17871
- require_core$2 = /* @__PURE__ */ __commonJSMin(((exports2) => {
17905
+ require_core$3 = /* @__PURE__ */ __commonJSMin(((exports2) => {
17872
17906
  Object.defineProperty(exports2, "__esModule", { value: true });
17873
17907
  exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = void 0;
17874
17908
  var validate_1 = require_validate();
@@ -18549,7 +18583,7 @@ var init_ajvProvider_Asx17_Co = __esm({
18549
18583
  exports2.callRef = callRef;
18550
18584
  exports2.default = def;
18551
18585
  }));
18552
- require_core$1 = /* @__PURE__ */ __commonJSMin(((exports2) => {
18586
+ require_core$2 = /* @__PURE__ */ __commonJSMin(((exports2) => {
18553
18587
  Object.defineProperty(exports2, "__esModule", { value: true });
18554
18588
  const id_1 = require_id();
18555
18589
  const ref_1 = require_ref();
@@ -18946,7 +18980,7 @@ var init_ajvProvider_Asx17_Co = __esm({
18946
18980
  };
18947
18981
  exports2.default = def;
18948
18982
  }));
18949
- require_validation$1 = /* @__PURE__ */ __commonJSMin(((exports2) => {
18983
+ require_validation$2 = /* @__PURE__ */ __commonJSMin(((exports2) => {
18950
18984
  Object.defineProperty(exports2, "__esModule", { value: true });
18951
18985
  const limitNumber_1 = require_limitNumber();
18952
18986
  const multipleOf_1 = require_multipleOf();
@@ -19672,7 +19706,7 @@ var init_ajvProvider_Asx17_Co = __esm({
19672
19706
  };
19673
19707
  exports2.default = def;
19674
19708
  }));
19675
- require_applicator$1 = /* @__PURE__ */ __commonJSMin(((exports2) => {
19709
+ require_applicator$2 = /* @__PURE__ */ __commonJSMin(((exports2) => {
19676
19710
  Object.defineProperty(exports2, "__esModule", { value: true });
19677
19711
  const additionalItems_1 = require_additionalItems();
19678
19712
  const prefixItems_1 = require_prefixItems();
@@ -19711,7 +19745,7 @@ var init_ajvProvider_Asx17_Co = __esm({
19711
19745
  }
19712
19746
  exports2.default = getApplicator;
19713
19747
  }));
19714
- require_format$1 = /* @__PURE__ */ __commonJSMin(((exports2) => {
19748
+ require_format$2 = /* @__PURE__ */ __commonJSMin(((exports2) => {
19715
19749
  Object.defineProperty(exports2, "__esModule", { value: true });
19716
19750
  const codegen_1 = require_codegen();
19717
19751
  const def = {
@@ -19798,9 +19832,9 @@ var init_ajvProvider_Asx17_Co = __esm({
19798
19832
  };
19799
19833
  exports2.default = def;
19800
19834
  }));
19801
- require_format = /* @__PURE__ */ __commonJSMin(((exports2) => {
19835
+ require_format$1 = /* @__PURE__ */ __commonJSMin(((exports2) => {
19802
19836
  Object.defineProperty(exports2, "__esModule", { value: true });
19803
- const format2 = [require_format$1().default];
19837
+ const format2 = [require_format$2().default];
19804
19838
  exports2.default = format2;
19805
19839
  }));
19806
19840
  require_metadata = /* @__PURE__ */ __commonJSMin(((exports2) => {
@@ -19823,10 +19857,10 @@ var init_ajvProvider_Asx17_Co = __esm({
19823
19857
  }));
19824
19858
  require_draft7 = /* @__PURE__ */ __commonJSMin(((exports2) => {
19825
19859
  Object.defineProperty(exports2, "__esModule", { value: true });
19826
- const core_1 = require_core$1();
19827
- const validation_1 = require_validation$1();
19828
- const applicator_1 = require_applicator$1();
19829
- const format_1 = require_format();
19860
+ const core_1 = require_core$2();
19861
+ const validation_1 = require_validation$2();
19862
+ const applicator_1 = require_applicator$2();
19863
+ const format_1 = require_format$1();
19830
19864
  const metadata_1 = require_metadata();
19831
19865
  const draft7Vocabularies = [
19832
19866
  core_1.default,
@@ -20078,7 +20112,7 @@ var init_ajvProvider_Asx17_Co = __esm({
20078
20112
  require_ajv = /* @__PURE__ */ __commonJSMin(((exports2, module2) => {
20079
20113
  Object.defineProperty(exports2, "__esModule", { value: true });
20080
20114
  exports2.MissingRefError = exports2.ValidationError = exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = exports2.Ajv = void 0;
20081
- const core_1 = require_core$2();
20115
+ const core_1 = require_core$3();
20082
20116
  const draft7_1 = require_draft7();
20083
20117
  const discriminator_1 = require_discriminator();
20084
20118
  const draft7MetaSchema = require_json_schema_draft_07();
@@ -20423,15 +20457,418 @@ var init_ajvProvider_Asx17_Co = __esm({
20423
20457
  const unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];
20424
20458
  exports2.default = unevaluated;
20425
20459
  }));
20460
+ require_schema$1 = /* @__PURE__ */ __commonJSMin(((exports2, module2) => {
20461
+ module2.exports = {
20462
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
20463
+ "$id": "https://json-schema.org/draft/2019-09/schema",
20464
+ "$vocabulary": {
20465
+ "https://json-schema.org/draft/2019-09/vocab/core": true,
20466
+ "https://json-schema.org/draft/2019-09/vocab/applicator": true,
20467
+ "https://json-schema.org/draft/2019-09/vocab/validation": true,
20468
+ "https://json-schema.org/draft/2019-09/vocab/meta-data": true,
20469
+ "https://json-schema.org/draft/2019-09/vocab/format": false,
20470
+ "https://json-schema.org/draft/2019-09/vocab/content": true
20471
+ },
20472
+ "$recursiveAnchor": true,
20473
+ "title": "Core and Validation specifications meta-schema",
20474
+ "allOf": [
20475
+ { "$ref": "meta/core" },
20476
+ { "$ref": "meta/applicator" },
20477
+ { "$ref": "meta/validation" },
20478
+ { "$ref": "meta/meta-data" },
20479
+ { "$ref": "meta/format" },
20480
+ { "$ref": "meta/content" }
20481
+ ],
20482
+ "type": ["object", "boolean"],
20483
+ "properties": {
20484
+ "definitions": {
20485
+ "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",
20486
+ "type": "object",
20487
+ "additionalProperties": { "$recursiveRef": "#" },
20488
+ "default": {}
20489
+ },
20490
+ "dependencies": {
20491
+ "$comment": '"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',
20492
+ "type": "object",
20493
+ "additionalProperties": { "anyOf": [{ "$recursiveRef": "#" }, { "$ref": "meta/validation#/$defs/stringArray" }] }
20494
+ }
20495
+ }
20496
+ };
20497
+ }));
20498
+ require_applicator$1 = /* @__PURE__ */ __commonJSMin(((exports2, module2) => {
20499
+ module2.exports = {
20500
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
20501
+ "$id": "https://json-schema.org/draft/2019-09/meta/applicator",
20502
+ "$vocabulary": { "https://json-schema.org/draft/2019-09/vocab/applicator": true },
20503
+ "$recursiveAnchor": true,
20504
+ "title": "Applicator vocabulary meta-schema",
20505
+ "type": ["object", "boolean"],
20506
+ "properties": {
20507
+ "additionalItems": { "$recursiveRef": "#" },
20508
+ "unevaluatedItems": { "$recursiveRef": "#" },
20509
+ "items": { "anyOf": [{ "$recursiveRef": "#" }, { "$ref": "#/$defs/schemaArray" }] },
20510
+ "contains": { "$recursiveRef": "#" },
20511
+ "additionalProperties": { "$recursiveRef": "#" },
20512
+ "unevaluatedProperties": { "$recursiveRef": "#" },
20513
+ "properties": {
20514
+ "type": "object",
20515
+ "additionalProperties": { "$recursiveRef": "#" },
20516
+ "default": {}
20517
+ },
20518
+ "patternProperties": {
20519
+ "type": "object",
20520
+ "additionalProperties": { "$recursiveRef": "#" },
20521
+ "propertyNames": { "format": "regex" },
20522
+ "default": {}
20523
+ },
20524
+ "dependentSchemas": {
20525
+ "type": "object",
20526
+ "additionalProperties": { "$recursiveRef": "#" }
20527
+ },
20528
+ "propertyNames": { "$recursiveRef": "#" },
20529
+ "if": { "$recursiveRef": "#" },
20530
+ "then": { "$recursiveRef": "#" },
20531
+ "else": { "$recursiveRef": "#" },
20532
+ "allOf": { "$ref": "#/$defs/schemaArray" },
20533
+ "anyOf": { "$ref": "#/$defs/schemaArray" },
20534
+ "oneOf": { "$ref": "#/$defs/schemaArray" },
20535
+ "not": { "$recursiveRef": "#" }
20536
+ },
20537
+ "$defs": { "schemaArray": {
20538
+ "type": "array",
20539
+ "minItems": 1,
20540
+ "items": { "$recursiveRef": "#" }
20541
+ } }
20542
+ };
20543
+ }));
20544
+ require_content$1 = /* @__PURE__ */ __commonJSMin(((exports2, module2) => {
20545
+ module2.exports = {
20546
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
20547
+ "$id": "https://json-schema.org/draft/2019-09/meta/content",
20548
+ "$vocabulary": { "https://json-schema.org/draft/2019-09/vocab/content": true },
20549
+ "$recursiveAnchor": true,
20550
+ "title": "Content vocabulary meta-schema",
20551
+ "type": ["object", "boolean"],
20552
+ "properties": {
20553
+ "contentMediaType": { "type": "string" },
20554
+ "contentEncoding": { "type": "string" },
20555
+ "contentSchema": { "$recursiveRef": "#" }
20556
+ }
20557
+ };
20558
+ }));
20559
+ require_core$1 = /* @__PURE__ */ __commonJSMin(((exports2, module2) => {
20560
+ module2.exports = {
20561
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
20562
+ "$id": "https://json-schema.org/draft/2019-09/meta/core",
20563
+ "$vocabulary": { "https://json-schema.org/draft/2019-09/vocab/core": true },
20564
+ "$recursiveAnchor": true,
20565
+ "title": "Core vocabulary meta-schema",
20566
+ "type": ["object", "boolean"],
20567
+ "properties": {
20568
+ "$id": {
20569
+ "type": "string",
20570
+ "format": "uri-reference",
20571
+ "$comment": "Non-empty fragments not allowed.",
20572
+ "pattern": "^[^#]*#?$"
20573
+ },
20574
+ "$schema": {
20575
+ "type": "string",
20576
+ "format": "uri"
20577
+ },
20578
+ "$anchor": {
20579
+ "type": "string",
20580
+ "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$"
20581
+ },
20582
+ "$ref": {
20583
+ "type": "string",
20584
+ "format": "uri-reference"
20585
+ },
20586
+ "$recursiveRef": {
20587
+ "type": "string",
20588
+ "format": "uri-reference"
20589
+ },
20590
+ "$recursiveAnchor": {
20591
+ "type": "boolean",
20592
+ "default": false
20593
+ },
20594
+ "$vocabulary": {
20595
+ "type": "object",
20596
+ "propertyNames": {
20597
+ "type": "string",
20598
+ "format": "uri"
20599
+ },
20600
+ "additionalProperties": { "type": "boolean" }
20601
+ },
20602
+ "$comment": { "type": "string" },
20603
+ "$defs": {
20604
+ "type": "object",
20605
+ "additionalProperties": { "$recursiveRef": "#" },
20606
+ "default": {}
20607
+ }
20608
+ }
20609
+ };
20610
+ }));
20611
+ require_format = /* @__PURE__ */ __commonJSMin(((exports2, module2) => {
20612
+ module2.exports = {
20613
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
20614
+ "$id": "https://json-schema.org/draft/2019-09/meta/format",
20615
+ "$vocabulary": { "https://json-schema.org/draft/2019-09/vocab/format": true },
20616
+ "$recursiveAnchor": true,
20617
+ "title": "Format vocabulary meta-schema",
20618
+ "type": ["object", "boolean"],
20619
+ "properties": { "format": { "type": "string" } }
20620
+ };
20621
+ }));
20622
+ require_meta_data$1 = /* @__PURE__ */ __commonJSMin(((exports2, module2) => {
20623
+ module2.exports = {
20624
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
20625
+ "$id": "https://json-schema.org/draft/2019-09/meta/meta-data",
20626
+ "$vocabulary": { "https://json-schema.org/draft/2019-09/vocab/meta-data": true },
20627
+ "$recursiveAnchor": true,
20628
+ "title": "Meta-data vocabulary meta-schema",
20629
+ "type": ["object", "boolean"],
20630
+ "properties": {
20631
+ "title": { "type": "string" },
20632
+ "description": { "type": "string" },
20633
+ "default": true,
20634
+ "deprecated": {
20635
+ "type": "boolean",
20636
+ "default": false
20637
+ },
20638
+ "readOnly": {
20639
+ "type": "boolean",
20640
+ "default": false
20641
+ },
20642
+ "writeOnly": {
20643
+ "type": "boolean",
20644
+ "default": false
20645
+ },
20646
+ "examples": {
20647
+ "type": "array",
20648
+ "items": true
20649
+ }
20650
+ }
20651
+ };
20652
+ }));
20653
+ require_validation$1 = /* @__PURE__ */ __commonJSMin(((exports2, module2) => {
20654
+ module2.exports = {
20655
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
20656
+ "$id": "https://json-schema.org/draft/2019-09/meta/validation",
20657
+ "$vocabulary": { "https://json-schema.org/draft/2019-09/vocab/validation": true },
20658
+ "$recursiveAnchor": true,
20659
+ "title": "Validation vocabulary meta-schema",
20660
+ "type": ["object", "boolean"],
20661
+ "properties": {
20662
+ "multipleOf": {
20663
+ "type": "number",
20664
+ "exclusiveMinimum": 0
20665
+ },
20666
+ "maximum": { "type": "number" },
20667
+ "exclusiveMaximum": { "type": "number" },
20668
+ "minimum": { "type": "number" },
20669
+ "exclusiveMinimum": { "type": "number" },
20670
+ "maxLength": { "$ref": "#/$defs/nonNegativeInteger" },
20671
+ "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
20672
+ "pattern": {
20673
+ "type": "string",
20674
+ "format": "regex"
20675
+ },
20676
+ "maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
20677
+ "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
20678
+ "uniqueItems": {
20679
+ "type": "boolean",
20680
+ "default": false
20681
+ },
20682
+ "maxContains": { "$ref": "#/$defs/nonNegativeInteger" },
20683
+ "minContains": {
20684
+ "$ref": "#/$defs/nonNegativeInteger",
20685
+ "default": 1
20686
+ },
20687
+ "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },
20688
+ "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
20689
+ "required": { "$ref": "#/$defs/stringArray" },
20690
+ "dependentRequired": {
20691
+ "type": "object",
20692
+ "additionalProperties": { "$ref": "#/$defs/stringArray" }
20693
+ },
20694
+ "const": true,
20695
+ "enum": {
20696
+ "type": "array",
20697
+ "items": true
20698
+ },
20699
+ "type": { "anyOf": [{ "$ref": "#/$defs/simpleTypes" }, {
20700
+ "type": "array",
20701
+ "items": { "$ref": "#/$defs/simpleTypes" },
20702
+ "minItems": 1,
20703
+ "uniqueItems": true
20704
+ }] }
20705
+ },
20706
+ "$defs": {
20707
+ "nonNegativeInteger": {
20708
+ "type": "integer",
20709
+ "minimum": 0
20710
+ },
20711
+ "nonNegativeIntegerDefault0": {
20712
+ "$ref": "#/$defs/nonNegativeInteger",
20713
+ "default": 0
20714
+ },
20715
+ "simpleTypes": { "enum": [
20716
+ "array",
20717
+ "boolean",
20718
+ "integer",
20719
+ "null",
20720
+ "number",
20721
+ "object",
20722
+ "string"
20723
+ ] },
20724
+ "stringArray": {
20725
+ "type": "array",
20726
+ "items": { "type": "string" },
20727
+ "uniqueItems": true,
20728
+ "default": []
20729
+ }
20730
+ }
20731
+ };
20732
+ }));
20733
+ require_json_schema_2019_09 = /* @__PURE__ */ __commonJSMin(((exports2) => {
20734
+ Object.defineProperty(exports2, "__esModule", { value: true });
20735
+ const metaSchema = require_schema$1();
20736
+ const applicator = require_applicator$1();
20737
+ const content = require_content$1();
20738
+ const core = require_core$1();
20739
+ const format2 = require_format();
20740
+ const metadata = require_meta_data$1();
20741
+ const validation = require_validation$1();
20742
+ const META_SUPPORT_DATA = ["/properties"];
20743
+ function addMetaSchema2019($data) {
20744
+ [
20745
+ metaSchema,
20746
+ applicator,
20747
+ content,
20748
+ core,
20749
+ with$data(this, format2),
20750
+ metadata,
20751
+ with$data(this, validation)
20752
+ ].forEach((sch) => this.addMetaSchema(sch, void 0, false));
20753
+ return this;
20754
+ function with$data(ajv, sch) {
20755
+ return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;
20756
+ }
20757
+ }
20758
+ exports2.default = addMetaSchema2019;
20759
+ }));
20760
+ require__2019 = /* @__PURE__ */ __commonJSMin(((exports2, module2) => {
20761
+ Object.defineProperty(exports2, "__esModule", { value: true });
20762
+ exports2.MissingRefError = exports2.ValidationError = exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = exports2.Ajv2019 = void 0;
20763
+ const core_1 = require_core$3();
20764
+ const draft7_1 = require_draft7();
20765
+ const dynamic_1 = require_dynamic();
20766
+ const next_1 = require_next();
20767
+ const unevaluated_1 = require_unevaluated$1();
20768
+ const discriminator_1 = require_discriminator();
20769
+ const json_schema_2019_09_1 = require_json_schema_2019_09();
20770
+ const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema";
20771
+ var Ajv2019 = class extends core_1.default {
20772
+ constructor(opts = {}) {
20773
+ super({
20774
+ ...opts,
20775
+ dynamicRef: true,
20776
+ next: true,
20777
+ unevaluated: true
20778
+ });
20779
+ }
20780
+ _addVocabularies() {
20781
+ super._addVocabularies();
20782
+ this.addVocabulary(dynamic_1.default);
20783
+ draft7_1.default.forEach((v) => this.addVocabulary(v));
20784
+ this.addVocabulary(next_1.default);
20785
+ this.addVocabulary(unevaluated_1.default);
20786
+ if (this.opts.discriminator) this.addKeyword(discriminator_1.default);
20787
+ }
20788
+ _addDefaultMetaSchema() {
20789
+ super._addDefaultMetaSchema();
20790
+ const { $data, meta: meta3 } = this.opts;
20791
+ if (!meta3) return;
20792
+ json_schema_2019_09_1.default.call(this, $data);
20793
+ this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
20794
+ }
20795
+ defaultMeta() {
20796
+ return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
20797
+ }
20798
+ };
20799
+ exports2.Ajv2019 = Ajv2019;
20800
+ module2.exports = exports2 = Ajv2019;
20801
+ module2.exports.Ajv2019 = Ajv2019;
20802
+ Object.defineProperty(exports2, "__esModule", { value: true });
20803
+ exports2.default = Ajv2019;
20804
+ var validate_1 = require_validate();
20805
+ Object.defineProperty(exports2, "KeywordCxt", {
20806
+ enumerable: true,
20807
+ get: function() {
20808
+ return validate_1.KeywordCxt;
20809
+ }
20810
+ });
20811
+ var codegen_1 = require_codegen();
20812
+ Object.defineProperty(exports2, "_", {
20813
+ enumerable: true,
20814
+ get: function() {
20815
+ return codegen_1._;
20816
+ }
20817
+ });
20818
+ Object.defineProperty(exports2, "str", {
20819
+ enumerable: true,
20820
+ get: function() {
20821
+ return codegen_1.str;
20822
+ }
20823
+ });
20824
+ Object.defineProperty(exports2, "stringify", {
20825
+ enumerable: true,
20826
+ get: function() {
20827
+ return codegen_1.stringify;
20828
+ }
20829
+ });
20830
+ Object.defineProperty(exports2, "nil", {
20831
+ enumerable: true,
20832
+ get: function() {
20833
+ return codegen_1.nil;
20834
+ }
20835
+ });
20836
+ Object.defineProperty(exports2, "Name", {
20837
+ enumerable: true,
20838
+ get: function() {
20839
+ return codegen_1.Name;
20840
+ }
20841
+ });
20842
+ Object.defineProperty(exports2, "CodeGen", {
20843
+ enumerable: true,
20844
+ get: function() {
20845
+ return codegen_1.CodeGen;
20846
+ }
20847
+ });
20848
+ var validation_error_1 = require_validation_error();
20849
+ Object.defineProperty(exports2, "ValidationError", {
20850
+ enumerable: true,
20851
+ get: function() {
20852
+ return validation_error_1.default;
20853
+ }
20854
+ });
20855
+ var ref_error_1 = require_ref_error();
20856
+ Object.defineProperty(exports2, "MissingRefError", {
20857
+ enumerable: true,
20858
+ get: function() {
20859
+ return ref_error_1.default;
20860
+ }
20861
+ });
20862
+ }));
20426
20863
  require_draft2020 = /* @__PURE__ */ __commonJSMin(((exports2) => {
20427
20864
  Object.defineProperty(exports2, "__esModule", { value: true });
20428
- const core_1 = require_core$1();
20429
- const validation_1 = require_validation$1();
20430
- const applicator_1 = require_applicator$1();
20865
+ const core_1 = require_core$2();
20866
+ const validation_1 = require_validation$2();
20867
+ const applicator_1 = require_applicator$2();
20431
20868
  const dynamic_1 = require_dynamic();
20432
20869
  const next_1 = require_next();
20433
20870
  const unevaluated_1 = require_unevaluated$1();
20434
- const format_1 = require_format();
20871
+ const format_1 = require_format$1();
20435
20872
  const metadata_1 = require_metadata();
20436
20873
  const draft2020Vocabularies = [
20437
20874
  dynamic_1.default,
@@ -20774,7 +21211,7 @@ var init_ajvProvider_Asx17_Co = __esm({
20774
21211
  require__2020 = /* @__PURE__ */ __commonJSMin(((exports2, module2) => {
20775
21212
  Object.defineProperty(exports2, "__esModule", { value: true });
20776
21213
  exports2.MissingRefError = exports2.ValidationError = exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = exports2.Ajv2020 = void 0;
20777
- const core_1 = require_core$2();
21214
+ const core_1 = require_core$3();
20778
21215
  const draft2020_1 = require_draft2020();
20779
21216
  const discriminator_1 = require_discriminator();
20780
21217
  const json_schema_2020_12_1 = require_json_schema_2020_12();
@@ -21164,20 +21601,25 @@ var init_ajvProvider_Asx17_Co = __esm({
21164
21601
  exports2.default = formatsPlugin;
21165
21602
  }));
21166
21603
  import_ajv = require_ajv();
21604
+ import__2019 = require__2019();
21167
21605
  import__2020 = require__2020();
21168
21606
  import_dist = /* @__PURE__ */ __toESM2(require_dist(), 1);
21169
- DRAFT_2020_12_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft/2020-12/schema", "http://json-schema.org/draft/2020-12/schema"]);
21170
21607
  addFormats = import_dist.default;
21171
21608
  AjvJsonSchemaValidator = class {
21172
21609
  _ajv;
21173
- /** True iff the constructor received a caller-supplied engine; the `$schema` check is skipped. */
21610
+ /** Lazy classic (draft-07) engine, built on the first draft-07/draft-06-declared schema. */
21611
+ _ajvDraft7;
21612
+ /** Lazy 2019-09 engine, built on the first 2019-09-declared schema. */
21613
+ _ajv2019;
21614
+ /** True iff the constructor received a caller-supplied engine; the `$schema` dispatch is skipped. */
21174
21615
  _userAjv;
21175
21616
  /**
21176
21617
  * @param ajv - Optional pre-configured AJV-compatible instance. When supplied, this instance is
21177
21618
  * used for **every** schema regardless of its declared `$schema` (the caller owns dialect
21178
- * choice). When omitted, the provider constructs a single `Ajv2020` instance with
21619
+ * choice). When omitted, the provider constructs per-dialect engines (`Ajv2020`, `Ajv2019`,
21620
+ * and the classic draft-07 `Ajv` for draft-07/06-declared schemas) with
21179
21621
  * `strict: false`, `validateFormats: true`, `validateSchema: false`, `allErrors: true`, and
21180
- * `ajv-formats` registered — **lazily, on the first {@linkcode getValidator} call**, so
21622
+ * `ajv-formats` registered — **lazily, on the first {@linkcode getValidator} call needing each**, so
21181
21623
  * constructing the provider (e.g. as the default validator of a `Client`/`Server` that never
21182
21624
  * validates a JSON Schema) does not pay the ajv + ajv-formats instantiation cost. The parameter
21183
21625
  * is typed structurally so consumers who don't pass an instance need not have `ajv` installed.
@@ -21186,16 +21628,25 @@ var init_ajvProvider_Asx17_Co = __esm({
21186
21628
  this._userAjv = ajv !== void 0;
21187
21629
  this._ajv = ajv;
21188
21630
  }
21189
- /** The underlying engine — the default instance is created on first use. */
21631
+ /** The underlying 2020-12 engine — the default instance is created on first use. */
21190
21632
  get ajv() {
21191
- return this._ajv ??= createDefaultAjvInstance();
21633
+ return this._ajv ??= createDefaultAjvInstance(import__2020.Ajv2020);
21634
+ }
21635
+ /**
21636
+ * Pick the engine for a schema's declared dialect. A caller-supplied engine is used for
21637
+ * every schema — do not second-guess by `$schema` (bring-your-own-validator means
21638
+ * bring-your-own-dialect). Otherwise: no `$schema` or 2020-12 → `Ajv2020`; 2019-09 →
21639
+ * `Ajv2019`; draft-07 or draft-06 → classic `Ajv`; anything else → `Error`.
21640
+ */
21641
+ _engineFor(schema) {
21642
+ if (this._userAjv) return this.ajv;
21643
+ const dialect = declaredDialect(schema, "pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");
21644
+ if (dialect === "2020-12") return this.ajv;
21645
+ if (dialect === "2019-09") return this._ajv2019 ??= createDefaultAjvInstance(import__2019.Ajv2019);
21646
+ return this._ajvDraft7 ??= createDefaultAjvInstance(import_ajv.Ajv);
21192
21647
  }
21193
21648
  getValidator(schema) {
21194
- if (!this._userAjv && "$schema" in schema && typeof schema.$schema === "string" && !DRAFT_2020_12_URIS.has(schema.$schema.replace(/#$/, ""))) {
21195
- const declared = schema.$schema.slice(0, 200);
21196
- throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${declared}"). The default validator supports JSON Schema 2020-12 only; pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.`);
21197
- }
21198
- const engine = this.ajv;
21649
+ const engine = this._engineFor(schema);
21199
21650
  const ajvValidator = "$id" in schema && typeof schema.$id === "string" ? engine.getSchema(schema.$id) ?? engine.compile(schema) : engine.compile(schema);
21200
21651
  return (input) => {
21201
21652
  return ajvValidator(input) ? {
@@ -21219,7 +21670,7 @@ var CORS_IS_POSSIBLE;
21219
21670
  var init_shimsNode = __esm({
21220
21671
  "node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs"() {
21221
21672
  "use strict";
21222
- init_ajvProvider_Asx17_Co();
21673
+ init_ajvProvider_97rDpkRx();
21223
21674
  CORS_IS_POSSIBLE = false;
21224
21675
  }
21225
21676
  });
@@ -22423,6 +22874,19 @@ function encodeCacheValue(value) {
22423
22874
  if (typeof json2 !== "string") throw new TypeError("cache value is not JSON-serializable: it has no JSON representation");
22424
22875
  return json2;
22425
22876
  }
22877
+ function markAuthSeamEscape(error2) {
22878
+ if (typeof error2 === "object" && error2 !== null || typeof error2 === "function") try {
22879
+ Object.defineProperty(error2, AUTH_SEAM, {
22880
+ value: true,
22881
+ configurable: true
22882
+ });
22883
+ } catch {
22884
+ }
22885
+ return error2;
22886
+ }
22887
+ function isAuthSeamEscape(error2) {
22888
+ return (typeof error2 === "object" && error2 !== null || typeof error2 === "function") && error2[AUTH_SEAM] === true;
22889
+ }
22426
22890
  function classifyProbeOutcome(outcome, context) {
22427
22891
  switch (outcome.kind) {
22428
22892
  case "result":
@@ -22497,6 +22961,25 @@ function classifyRpcError(outcome, context) {
22497
22961
  return { kind: "legacy" };
22498
22962
  }
22499
22963
  function classifyHttpError(outcome, context) {
22964
+ if (outcome.status === 401 || outcome.status === 403) {
22965
+ const isDenial = outcome.status === 403;
22966
+ return {
22967
+ kind: "error",
22968
+ error: new SdkHttpError(isDenial ? SdkErrorCode.ClientHttpForbidden : SdkErrorCode.ClientHttpAuthentication, `Version negotiation failed: ${isDenial ? "the server denied access (HTTP 403)" : "the server requires authorization (HTTP 401)"}`, {
22969
+ status: outcome.status,
22970
+ statusText: outcome.statusText,
22971
+ text: outcome.body
22972
+ })
22973
+ };
22974
+ }
22975
+ if (outcome.status >= 500) return {
22976
+ kind: "error",
22977
+ error: new SdkHttpError(SdkErrorCode.EraNegotiationFailed, `Version negotiation failed: the server answered the probe with HTTP ${outcome.status}`, {
22978
+ status: outcome.status,
22979
+ statusText: outcome.statusText,
22980
+ text: outcome.body
22981
+ })
22982
+ };
22500
22983
  const rpcError = parseJsonRpcErrorBody(outcome.body);
22501
22984
  if (rpcError !== void 0) return classifyRpcError(rpcError, context);
22502
22985
  return { kind: "legacy" };
@@ -22600,18 +23083,19 @@ function normalizeReply(reply, timeoutMs) {
22600
23083
  };
22601
23084
  case "send-error": {
22602
23085
  const error2 = reply.error;
23086
+ if (isAuthSeamEscape(error2) || error2 instanceof UnauthorizedError || error2 instanceof Error && error2.name === "UnauthorizedError") return {
23087
+ kind: "auth-required",
23088
+ error: error2
23089
+ };
22603
23090
  if (error2 instanceof SdkHttpError) {
22604
23091
  const text = error2.data?.text;
22605
23092
  return {
22606
23093
  kind: "http-error",
22607
23094
  status: error2.data.status,
22608
- body: typeof text === "string" ? text : void 0
23095
+ body: typeof text === "string" ? text : void 0,
23096
+ statusText: error2.data.statusText
22609
23097
  };
22610
23098
  }
22611
- if (error2 instanceof UnauthorizedError || error2 instanceof Error && error2.name === "UnauthorizedError") return {
22612
- kind: "auth-required",
22613
- error: error2
22614
- };
22615
23099
  return {
22616
23100
  kind: "network-error",
22617
23101
  error: error2
@@ -22797,11 +23281,11 @@ function anySignal(a, b) {
22797
23281
  b.addEventListener("abort", onB, { once: true });
22798
23282
  return controller.signal;
22799
23283
  }
22800
- var OAuthClientFlowError, IssuerMismatchError, RegistrationRejectedError, InsecureTokenEndpointError, AuthorizationServerMismatchError, InsufficientScopeError, UnauthorizedError, AUTHORIZATION_CODE_RESPONSE_TYPE, AUTHORIZATION_CODE_CHALLENGE_METHOD, CAP_EXEMPT_METHODS, InMemoryResponseCacheStore, MAX_CACHE_TTL_MS, ClientResponseCache, UNSUPPORTED_PROTOCOL_VERSION, NOT_PROBE_RECOGNIZED, DEFAULT_VERSION_NEGOTIATION_MODE, ProbeWindow, pendingSpentCloseGuards, LIST_CHANGED_EVICTIONS, DEFAULT_LIST_MAX_PAGES, Client, SseError, SSEClientTransport, DEFAULT_MAX_STEP_UP_RETRIES, DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS, RESERVED_REQUEST_HEADER_NAMES, StreamableHTTPClientTransport;
23284
+ var OAuthClientFlowError, IssuerMismatchError, RegistrationRejectedError, InsecureTokenEndpointError, AuthorizationServerMismatchError, InsufficientScopeError, UnauthorizedError, AUTHORIZATION_CODE_RESPONSE_TYPE, AUTHORIZATION_CODE_CHALLENGE_METHOD, CAP_EXEMPT_METHODS, InMemoryResponseCacheStore, MAX_CACHE_TTL_MS, ClientResponseCache, AUTH_SEAM, UNSUPPORTED_PROTOCOL_VERSION, NOT_PROBE_RECOGNIZED, DEFAULT_VERSION_NEGOTIATION_MODE, ProbeWindow, pendingSpentCloseGuards, LIST_CHANGED_EVICTIONS, DEFAULT_LIST_MAX_PAGES, Client, SseError, SSEClientTransport, DEFAULT_MAX_STEP_UP_RETRIES, DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS, RESERVED_REQUEST_HEADER_NAMES, StreamableHTTPClientTransport;
22801
23285
  var init_dist4 = __esm({
22802
23286
  "node_modules/@modelcontextprotocol/client/dist/index.mjs"() {
22803
23287
  "use strict";
22804
- init_src_CgOncMok();
23288
+ init_src_D_zzAWoS();
22805
23289
  init_shimsNode();
22806
23290
  init_index_node();
22807
23291
  init_dist3();
@@ -23379,6 +23863,7 @@ var init_dist4 = __esm({
23379
23863
  }
23380
23864
  }
23381
23865
  };
23866
+ AUTH_SEAM = /* @__PURE__ */ Symbol.for("mcp.authSeamEscape");
23382
23867
  UNSUPPORTED_PROTOCOL_VERSION = -32022;
23383
23868
  NOT_PROBE_RECOGNIZED = /* @__PURE__ */ new Set([
23384
23869
  -32001,
@@ -24919,7 +25404,12 @@ var init_dist4 = __esm({
24919
25404
  _last401Response;
24920
25405
  async _commonHeaders() {
24921
25406
  const headers = {};
24922
- const token = await this._authProvider?.token();
25407
+ let token;
25408
+ try {
25409
+ token = await this._authProvider?.token();
25410
+ } catch (error2) {
25411
+ throw markAuthSeamEscape(error2);
25412
+ }
24923
25413
  if (token) headers["Authorization"] = `Bearer ${token}`;
24924
25414
  if (this._protocolVersion) headers["mcp-protocol-version"] = this._protocolVersion;
24925
25415
  const extraHeaders = normalizeHeaders(this._requestInit?.headers);
@@ -24963,12 +25453,13 @@ var init_dist4 = __esm({
24963
25453
  serverUrl: this._url,
24964
25454
  fetchFn: this._fetchWithInit
24965
25455
  }).then(() => this._startOrAuth().then(resolve5, reject), (error$2) => {
25456
+ markAuthSeamEscape(error$2);
24966
25457
  this.onerror?.(error$2);
24967
25458
  reject(error$2);
24968
25459
  });
24969
25460
  return;
24970
25461
  }
24971
- const error$1 = new UnauthorizedError();
25462
+ const error$1 = markAuthSeamEscape(new UnauthorizedError());
24972
25463
  reject(error$1);
24973
25464
  this.onerror?.(error$1);
24974
25465
  return;
@@ -25054,22 +25545,26 @@ var init_dist4 = __esm({
25054
25545
  this._scope = scope;
25055
25546
  }
25056
25547
  if (this._authProvider.onUnauthorized && !isAuthRetry) {
25057
- await this._authProvider.onUnauthorized({
25058
- response,
25059
- serverUrl: this._url,
25060
- fetchFn: this._fetchWithInit
25061
- });
25548
+ try {
25549
+ await this._authProvider.onUnauthorized({
25550
+ response,
25551
+ serverUrl: this._url,
25552
+ fetchFn: this._fetchWithInit
25553
+ });
25554
+ } catch (error2) {
25555
+ throw markAuthSeamEscape(error2);
25556
+ }
25062
25557
  await response.text?.().catch(() => {
25063
25558
  });
25064
25559
  return this._send(message, true);
25065
25560
  }
25066
25561
  await response.text?.().catch(() => {
25067
25562
  });
25068
- if (isAuthRetry) throw new SdkHttpError(SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", {
25563
+ if (isAuthRetry) throw markAuthSeamEscape(new SdkHttpError(SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", {
25069
25564
  status: 401,
25070
25565
  statusText: response.statusText
25071
- });
25072
- throw new UnauthorizedError();
25566
+ }));
25567
+ throw markAuthSeamEscape(new UnauthorizedError());
25073
25568
  }
25074
25569
  const text = await response.text?.().catch(() => null);
25075
25570
  throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`);
@@ -25156,6 +25651,13 @@ var init_dist4 = __esm({
25156
25651
  * the same superset-gated refresh bypass, and the same retry cap.
25157
25652
  */
25158
25653
  async _stepUpAuthorize(challenge, stepUpRetries) {
25654
+ try {
25655
+ return await this._stepUpAuthorizeInner(challenge, stepUpRetries);
25656
+ } catch (error2) {
25657
+ throw markAuthSeamEscape(error2);
25658
+ }
25659
+ }
25660
+ async _stepUpAuthorizeInner(challenge, stepUpRetries) {
25159
25661
  if (this._onInsufficientScope === "throw") throw new InsufficientScopeError({
25160
25662
  requiredScope: challenge.scope,
25161
25663
  resourceMetadataUrl: challenge.resourceMetadataUrl,
@@ -25187,7 +25689,12 @@ var init_dist4 = __esm({
25187
25689
  }
25188
25690
  async _commonHeaders() {
25189
25691
  const headers = {};
25190
- const token = await this._authProvider?.token();
25692
+ let token;
25693
+ try {
25694
+ token = await this._authProvider?.token();
25695
+ } catch (error2) {
25696
+ throw markAuthSeamEscape(error2);
25697
+ }
25191
25698
  if (token) headers["Authorization"] = `Bearer ${token}`;
25192
25699
  if (this._sessionId) headers["mcp-session-id"] = this._sessionId;
25193
25700
  if (this._protocolVersion) headers["mcp-protocol-version"] = this._protocolVersion;
@@ -25250,22 +25757,26 @@ var init_dist4 = __esm({
25250
25757
  this._scope = computeScopeUnion(this._scope, scope);
25251
25758
  }
25252
25759
  if (this._authProvider.onUnauthorized && !isAuthRetry) {
25253
- await this._authProvider.onUnauthorized({
25254
- response,
25255
- serverUrl: this._url,
25256
- fetchFn: this._fetchWithInit
25257
- });
25760
+ try {
25761
+ await this._authProvider.onUnauthorized({
25762
+ response,
25763
+ serverUrl: this._url,
25764
+ fetchFn: this._fetchWithInit
25765
+ });
25766
+ } catch (error2) {
25767
+ throw markAuthSeamEscape(error2);
25768
+ }
25258
25769
  await response.text?.().catch(() => {
25259
25770
  });
25260
25771
  return this._startOrAuthSse(options, true, stepUpRetries);
25261
25772
  }
25262
25773
  await response.text?.().catch(() => {
25263
25774
  });
25264
- if (isAuthRetry) throw new SdkHttpError(SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", {
25775
+ if (isAuthRetry) throw markAuthSeamEscape(new SdkHttpError(SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", {
25265
25776
  status: 401,
25266
25777
  statusText: response.statusText
25267
- });
25268
- throw new UnauthorizedError();
25778
+ }));
25779
+ throw markAuthSeamEscape(new UnauthorizedError());
25269
25780
  }
25270
25781
  if (response.status === 403) {
25271
25782
  const { resourceMetadataUrl, scope, error: error2, errorDescription } = extractWWWAuthenticateParams(response);
@@ -25277,7 +25788,7 @@ var init_dist4 = __esm({
25277
25788
  errorDescription,
25278
25789
  statusText: response.statusText,
25279
25790
  text
25280
- }, stepUpRetries) !== "AUTHORIZED") throw new UnauthorizedError();
25791
+ }, stepUpRetries) !== "AUTHORIZED") throw markAuthSeamEscape(new UnauthorizedError());
25281
25792
  return this._startOrAuthSse(options, isAuthRetry, stepUpRetries + 1);
25282
25793
  }
25283
25794
  }
@@ -25486,22 +25997,26 @@ var init_dist4 = __esm({
25486
25997
  this._scope = computeScopeUnion(this._scope, scope);
25487
25998
  }
25488
25999
  if (this._authProvider.onUnauthorized && !isAuthRetry) {
25489
- await this._authProvider.onUnauthorized({
25490
- response,
25491
- serverUrl: this._url,
25492
- fetchFn: this._fetchWithInit
25493
- });
26000
+ try {
26001
+ await this._authProvider.onUnauthorized({
26002
+ response,
26003
+ serverUrl: this._url,
26004
+ fetchFn: this._fetchWithInit
26005
+ });
26006
+ } catch (error2) {
26007
+ throw markAuthSeamEscape(error2);
26008
+ }
25494
26009
  await response.text?.().catch(() => {
25495
26010
  });
25496
26011
  return this._send(message, options, true, stepUpRetries);
25497
26012
  }
25498
26013
  await response.text?.().catch(() => {
25499
26014
  });
25500
- if (isAuthRetry) throw new SdkHttpError(SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", {
26015
+ if (isAuthRetry) throw markAuthSeamEscape(new SdkHttpError(SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", {
25501
26016
  status: 401,
25502
26017
  statusText: response.statusText
25503
- });
25504
- throw new UnauthorizedError();
26018
+ }));
26019
+ throw markAuthSeamEscape(new UnauthorizedError());
25505
26020
  }
25506
26021
  const text = await response.text?.().catch(() => null);
25507
26022
  if (response.status === 403) {
@@ -25513,7 +26028,7 @@ var init_dist4 = __esm({
25513
26028
  errorDescription,
25514
26029
  statusText: response.statusText,
25515
26030
  text
25516
- }, stepUpRetries) !== "AUTHORIZED") throw new UnauthorizedError();
26031
+ }, stepUpRetries) !== "AUTHORIZED") throw markAuthSeamEscape(new UnauthorizedError());
25517
26032
  return this._send(message, options, isAuthRetry, stepUpRetries + 1);
25518
26033
  }
25519
26034
  }
@@ -28384,7 +28899,7 @@ var import_node_process2, import_node_stream2, import_cross_spawn, DEFAULT_INHER
28384
28899
  var init_stdio = __esm({
28385
28900
  "node_modules/@modelcontextprotocol/client/dist/stdio.mjs"() {
28386
28901
  "use strict";
28387
- init_src_CgOncMok();
28902
+ init_src_D_zzAWoS();
28388
28903
  import_node_process2 = __toESM(require("process"), 1);
28389
28904
  import_node_stream2 = require("stream");
28390
28905
  import_cross_spawn = __toESM(require_cross_spawn(), 1);
@@ -46213,7 +46728,7 @@ init_format();
46213
46728
  var main = defineCommand({
46214
46729
  meta: {
46215
46730
  name: "fastmcp",
46216
- version: "1.0.0-rc.0",
46731
+ version: "1.0.0",
46217
46732
  description: "FastMCP CLI \u2014 build, run, and manage MCP servers"
46218
46733
  },
46219
46734
  args: {
@@ -46238,7 +46753,7 @@ var main = defineCommand({
46238
46753
  runMain(main);
46239
46754
  /*! Bundled license information:
46240
46755
 
46241
- @modelcontextprotocol/client/dist/src-CgOncMok.mjs:
46756
+ @modelcontextprotocol/client/dist/src-D_zzAWoS.mjs:
46242
46757
  (*!
46243
46758
  * content-type
46244
46759
  * Copyright(c) 2015 Douglas Christopher Wilson