@mastra/mcp 1.14.0 → 1.15.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/client/client.d.ts +64 -0
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/configuration.d.ts +71 -1
- package/dist/client/configuration.d.ts.map +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/oauth-callback-server.d.ts +117 -0
- package/dist/client/oauth-callback-server.d.ts.map +1 -0
- package/dist/client/oauth-provider.d.ts +38 -2
- package/dist/client/oauth-provider.d.ts.map +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-mcp-overview.md +1 -1
- package/dist/docs/references/docs-server-auth-fga.md +40 -0
- package/dist/docs/references/reference-tools-mcp-client.md +104 -24
- package/dist/docs/references/reference-tools-mcp-server.md +143 -44
- package/dist/index.cjs +869 -339
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +870 -341
- package/dist/index.js.map +1 -1
- package/package.json +11 -10
package/dist/index.cjs
CHANGED
|
@@ -12,8 +12,10 @@ var streamableHttp_js = require('@modelcontextprotocol/sdk/client/streamableHttp
|
|
|
12
12
|
var protocol_js = require('@modelcontextprotocol/sdk/shared/protocol.js');
|
|
13
13
|
var types_js = require('@modelcontextprotocol/sdk/types.js');
|
|
14
14
|
var exitHook = require('exit-hook');
|
|
15
|
+
var auth_js = require('@modelcontextprotocol/sdk/client/auth.js');
|
|
15
16
|
var crypto$1 = require('crypto');
|
|
16
17
|
var equal = require('fast-deep-equal');
|
|
18
|
+
var http = require('http');
|
|
17
19
|
var mcp = require('@mastra/core/mcp');
|
|
18
20
|
var schema = require('@mastra/core/schema');
|
|
19
21
|
var fs = require('fs');
|
|
@@ -24,7 +26,6 @@ var index_js$1 = require('@modelcontextprotocol/sdk/server/index.js');
|
|
|
24
26
|
var sse_js$1 = require('@modelcontextprotocol/sdk/server/sse.js');
|
|
25
27
|
var stdio_js$1 = require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
26
28
|
var streamableHttp_js$1 = require('@modelcontextprotocol/sdk/server/streamableHttp.js');
|
|
27
|
-
var auth_js = require('@modelcontextprotocol/sdk/client/auth.js');
|
|
28
29
|
|
|
29
30
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
30
31
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -20126,9 +20127,9 @@ var require_json_schema_traverse = __commonJS({
|
|
|
20126
20127
|
}
|
|
20127
20128
|
});
|
|
20128
20129
|
|
|
20129
|
-
// ../schema-compat/dist/chunk-
|
|
20130
|
+
// ../schema-compat/dist/chunk-FIHBR42C.js
|
|
20130
20131
|
var require_code = __commonJS({
|
|
20131
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
20132
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/codegen/code.js"(exports) {
|
|
20132
20133
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20133
20134
|
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
|
|
20134
20135
|
var _CodeOrName = class {
|
|
@@ -20279,7 +20280,7 @@ var require_code = __commonJS({
|
|
|
20279
20280
|
}
|
|
20280
20281
|
});
|
|
20281
20282
|
var require_scope = __commonJS({
|
|
20282
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
20283
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/codegen/scope.js"(exports) {
|
|
20283
20284
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20284
20285
|
exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
|
|
20285
20286
|
var code_1 = require_code();
|
|
@@ -20421,7 +20422,7 @@ var require_scope = __commonJS({
|
|
|
20421
20422
|
}
|
|
20422
20423
|
});
|
|
20423
20424
|
var require_codegen = __commonJS({
|
|
20424
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
20425
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/codegen/index.js"(exports) {
|
|
20425
20426
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20426
20427
|
exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;
|
|
20427
20428
|
var code_1 = require_code();
|
|
@@ -21138,7 +21139,7 @@ var require_codegen = __commonJS({
|
|
|
21138
21139
|
}
|
|
21139
21140
|
});
|
|
21140
21141
|
var require_util = __commonJS({
|
|
21141
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21142
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/util.js"(exports) {
|
|
21142
21143
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21143
21144
|
exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;
|
|
21144
21145
|
var codegen_1 = require_codegen();
|
|
@@ -21302,7 +21303,7 @@ var require_util = __commonJS({
|
|
|
21302
21303
|
}
|
|
21303
21304
|
});
|
|
21304
21305
|
var require_names = __commonJS({
|
|
21305
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21306
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/names.js"(exports) {
|
|
21306
21307
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21307
21308
|
var codegen_1 = require_codegen();
|
|
21308
21309
|
var names = {
|
|
@@ -21338,7 +21339,7 @@ var require_names = __commonJS({
|
|
|
21338
21339
|
}
|
|
21339
21340
|
});
|
|
21340
21341
|
var require_errors = __commonJS({
|
|
21341
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21342
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/errors.js"(exports) {
|
|
21342
21343
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21343
21344
|
exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;
|
|
21344
21345
|
var codegen_1 = require_codegen();
|
|
@@ -21457,7 +21458,7 @@ var require_errors = __commonJS({
|
|
|
21457
21458
|
}
|
|
21458
21459
|
});
|
|
21459
21460
|
var require_boolSchema = __commonJS({
|
|
21460
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21461
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports) {
|
|
21461
21462
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21462
21463
|
exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;
|
|
21463
21464
|
var errors_1 = require_errors();
|
|
@@ -21505,7 +21506,7 @@ var require_boolSchema = __commonJS({
|
|
|
21505
21506
|
}
|
|
21506
21507
|
});
|
|
21507
21508
|
var require_rules = __commonJS({
|
|
21508
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21509
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/rules.js"(exports) {
|
|
21509
21510
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21510
21511
|
exports.getRules = exports.isJSONType = void 0;
|
|
21511
21512
|
var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
|
|
@@ -21533,7 +21534,7 @@ var require_rules = __commonJS({
|
|
|
21533
21534
|
}
|
|
21534
21535
|
});
|
|
21535
21536
|
var require_applicability = __commonJS({
|
|
21536
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21537
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/applicability.js"(exports) {
|
|
21537
21538
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21538
21539
|
exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;
|
|
21539
21540
|
function schemaHasRulesForType({ schema, self }, type) {
|
|
@@ -21553,7 +21554,7 @@ var require_applicability = __commonJS({
|
|
|
21553
21554
|
}
|
|
21554
21555
|
});
|
|
21555
21556
|
var require_dataType = __commonJS({
|
|
21556
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21557
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/dataType.js"(exports) {
|
|
21557
21558
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21558
21559
|
exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;
|
|
21559
21560
|
var rules_1 = require_rules();
|
|
@@ -21734,7 +21735,7 @@ var require_dataType = __commonJS({
|
|
|
21734
21735
|
}
|
|
21735
21736
|
});
|
|
21736
21737
|
var require_defaults = __commonJS({
|
|
21737
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21738
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/defaults.js"(exports) {
|
|
21738
21739
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21739
21740
|
exports.assignDefaults = void 0;
|
|
21740
21741
|
var codegen_1 = require_codegen();
|
|
@@ -21768,7 +21769,7 @@ var require_defaults = __commonJS({
|
|
|
21768
21769
|
}
|
|
21769
21770
|
});
|
|
21770
21771
|
var require_code2 = __commonJS({
|
|
21771
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21772
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/code.js"(exports) {
|
|
21772
21773
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21773
21774
|
exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0;
|
|
21774
21775
|
var codegen_1 = require_codegen();
|
|
@@ -21898,7 +21899,7 @@ var require_code2 = __commonJS({
|
|
|
21898
21899
|
}
|
|
21899
21900
|
});
|
|
21900
21901
|
var require_keyword = __commonJS({
|
|
21901
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21902
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/keyword.js"(exports) {
|
|
21902
21903
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21903
21904
|
exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0;
|
|
21904
21905
|
var codegen_1 = require_codegen();
|
|
@@ -22013,7 +22014,7 @@ var require_keyword = __commonJS({
|
|
|
22013
22014
|
}
|
|
22014
22015
|
});
|
|
22015
22016
|
var require_subschema = __commonJS({
|
|
22016
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
22017
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/subschema.js"(exports) {
|
|
22017
22018
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22018
22019
|
exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0;
|
|
22019
22020
|
var codegen_1 = require_codegen();
|
|
@@ -22125,7 +22126,7 @@ var require_fast_deep_equal = __commonJS({
|
|
|
22125
22126
|
}
|
|
22126
22127
|
});
|
|
22127
22128
|
var require_resolve = __commonJS({
|
|
22128
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
22129
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/resolve.js"(exports) {
|
|
22129
22130
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22130
22131
|
exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0;
|
|
22131
22132
|
var util_1 = require_util();
|
|
@@ -22278,7 +22279,7 @@ var require_resolve = __commonJS({
|
|
|
22278
22279
|
}
|
|
22279
22280
|
});
|
|
22280
22281
|
var require_validate = __commonJS({
|
|
22281
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
22282
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/index.js"(exports) {
|
|
22282
22283
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22283
22284
|
exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0;
|
|
22284
22285
|
var boolSchema_1 = require_boolSchema();
|
|
@@ -22782,7 +22783,7 @@ var require_validate = __commonJS({
|
|
|
22782
22783
|
}
|
|
22783
22784
|
});
|
|
22784
22785
|
var require_validation_error = __commonJS({
|
|
22785
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
22786
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/runtime/validation_error.js"(exports) {
|
|
22786
22787
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22787
22788
|
var ValidationError = class extends Error {
|
|
22788
22789
|
constructor(errors) {
|
|
@@ -22795,7 +22796,7 @@ var require_validation_error = __commonJS({
|
|
|
22795
22796
|
}
|
|
22796
22797
|
});
|
|
22797
22798
|
var require_ref_error = __commonJS({
|
|
22798
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
22799
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/ref_error.js"(exports) {
|
|
22799
22800
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22800
22801
|
var resolve_1 = require_resolve();
|
|
22801
22802
|
var MissingRefError = class extends Error {
|
|
@@ -22809,7 +22810,7 @@ var require_ref_error = __commonJS({
|
|
|
22809
22810
|
}
|
|
22810
22811
|
});
|
|
22811
22812
|
var require_compile = __commonJS({
|
|
22812
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
22813
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/index.js"(exports) {
|
|
22813
22814
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22814
22815
|
exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;
|
|
22815
22816
|
var codegen_1 = require_codegen();
|
|
@@ -23030,7 +23031,7 @@ var require_compile = __commonJS({
|
|
|
23030
23031
|
}
|
|
23031
23032
|
});
|
|
23032
23033
|
var require_data = __commonJS({
|
|
23033
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
23034
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/refs/data.json"(exports, module) {
|
|
23034
23035
|
module.exports = {
|
|
23035
23036
|
$id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
|
|
23036
23037
|
description: "Meta-schema for $data reference (JSON AnySchema extension proposal)",
|
|
@@ -23047,7 +23048,7 @@ var require_data = __commonJS({
|
|
|
23047
23048
|
}
|
|
23048
23049
|
});
|
|
23049
23050
|
var require_utils = __commonJS({
|
|
23050
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fast-uri/3.1.
|
|
23051
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fast-uri/3.1.4/7a4a15ca6e52b43729e575308419a557aad60270ad0b69ef14852015b4b55d46/node_modules/fast-uri/lib/utils.js"(exports, module) {
|
|
23051
23052
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
23052
23053
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
23053
23054
|
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
@@ -23357,7 +23358,7 @@ var require_utils = __commonJS({
|
|
|
23357
23358
|
}
|
|
23358
23359
|
});
|
|
23359
23360
|
var require_schemes = __commonJS({
|
|
23360
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fast-uri/3.1.
|
|
23361
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fast-uri/3.1.4/7a4a15ca6e52b43729e575308419a557aad60270ad0b69ef14852015b4b55d46/node_modules/fast-uri/lib/schemes.js"(exports, module) {
|
|
23361
23362
|
var { isUUID } = require_utils();
|
|
23362
23363
|
var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
|
|
23363
23364
|
var supportedSchemeNames = (
|
|
@@ -23564,7 +23565,7 @@ var require_schemes = __commonJS({
|
|
|
23564
23565
|
}
|
|
23565
23566
|
});
|
|
23566
23567
|
var require_fast_uri = __commonJS({
|
|
23567
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fast-uri/3.1.
|
|
23568
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fast-uri/3.1.4/7a4a15ca6e52b43729e575308419a557aad60270ad0b69ef14852015b4b55d46/node_modules/fast-uri/index.js"(exports, module) {
|
|
23568
23569
|
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
23569
23570
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
23570
23571
|
function normalize(uri, options) {
|
|
@@ -23704,6 +23705,7 @@ var require_fast_uri = __commonJS({
|
|
|
23704
23705
|
return uriTokens.join("");
|
|
23705
23706
|
}
|
|
23706
23707
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
23708
|
+
var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
|
|
23707
23709
|
function getParseError(parsed, matches) {
|
|
23708
23710
|
if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
|
|
23709
23711
|
return 'URI path must start with "/" when authority is present.';
|
|
@@ -23733,6 +23735,11 @@ var require_fast_uri = __commonJS({
|
|
|
23733
23735
|
uri = "//" + uri;
|
|
23734
23736
|
}
|
|
23735
23737
|
}
|
|
23738
|
+
const authorityMatch = uri.match(AUTHORITY_PREFIX);
|
|
23739
|
+
if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
|
|
23740
|
+
parsed.error = "URI authority must not contain a literal backslash.";
|
|
23741
|
+
malformedAuthorityOrPort = true;
|
|
23742
|
+
}
|
|
23736
23743
|
const matches = uri.match(URI_PARSE);
|
|
23737
23744
|
if (matches) {
|
|
23738
23745
|
parsed.scheme = matches[1];
|
|
@@ -23776,7 +23783,7 @@ var require_fast_uri = __commonJS({
|
|
|
23776
23783
|
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
23777
23784
|
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
23778
23785
|
try {
|
|
23779
|
-
parsed.host = URL
|
|
23786
|
+
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
23780
23787
|
} catch (e) {
|
|
23781
23788
|
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
23782
23789
|
}
|
|
@@ -23847,7 +23854,7 @@ var require_fast_uri = __commonJS({
|
|
|
23847
23854
|
}
|
|
23848
23855
|
});
|
|
23849
23856
|
var require_uri = __commonJS({
|
|
23850
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
23857
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/runtime/uri.js"(exports) {
|
|
23851
23858
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23852
23859
|
var uri = require_fast_uri();
|
|
23853
23860
|
uri.code = 'require("ajv/dist/runtime/uri").default';
|
|
@@ -23855,7 +23862,7 @@ var require_uri = __commonJS({
|
|
|
23855
23862
|
}
|
|
23856
23863
|
});
|
|
23857
23864
|
var require_core = __commonJS({
|
|
23858
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
23865
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/core.js"(exports) {
|
|
23859
23866
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23860
23867
|
exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
|
|
23861
23868
|
var validate_1 = require_validate();
|
|
@@ -24463,7 +24470,7 @@ var require_core = __commonJS({
|
|
|
24463
24470
|
}
|
|
24464
24471
|
});
|
|
24465
24472
|
var require_id = __commonJS({
|
|
24466
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24473
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/core/id.js"(exports) {
|
|
24467
24474
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24468
24475
|
var def = {
|
|
24469
24476
|
keyword: "id",
|
|
@@ -24475,7 +24482,7 @@ var require_id = __commonJS({
|
|
|
24475
24482
|
}
|
|
24476
24483
|
});
|
|
24477
24484
|
var require_ref = __commonJS({
|
|
24478
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24485
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/core/ref.js"(exports) {
|
|
24479
24486
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24480
24487
|
exports.callRef = exports.getValidate = void 0;
|
|
24481
24488
|
var ref_error_1 = require_ref_error();
|
|
@@ -24594,7 +24601,7 @@ var require_ref = __commonJS({
|
|
|
24594
24601
|
}
|
|
24595
24602
|
});
|
|
24596
24603
|
var require_core2 = __commonJS({
|
|
24597
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24604
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/core/index.js"(exports) {
|
|
24598
24605
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24599
24606
|
var id_1 = require_id();
|
|
24600
24607
|
var ref_1 = require_ref();
|
|
@@ -24612,7 +24619,7 @@ var require_core2 = __commonJS({
|
|
|
24612
24619
|
}
|
|
24613
24620
|
});
|
|
24614
24621
|
var require_limitNumber = __commonJS({
|
|
24615
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24622
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports) {
|
|
24616
24623
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24617
24624
|
var codegen_1 = require_codegen();
|
|
24618
24625
|
var ops = codegen_1.operators;
|
|
@@ -24641,7 +24648,7 @@ var require_limitNumber = __commonJS({
|
|
|
24641
24648
|
}
|
|
24642
24649
|
});
|
|
24643
24650
|
var require_multipleOf = __commonJS({
|
|
24644
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24651
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports) {
|
|
24645
24652
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24646
24653
|
var codegen_1 = require_codegen();
|
|
24647
24654
|
var error51 = {
|
|
@@ -24666,7 +24673,7 @@ var require_multipleOf = __commonJS({
|
|
|
24666
24673
|
}
|
|
24667
24674
|
});
|
|
24668
24675
|
var require_ucs2length = __commonJS({
|
|
24669
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24676
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/runtime/ucs2length.js"(exports) {
|
|
24670
24677
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24671
24678
|
function ucs2length(str) {
|
|
24672
24679
|
const len = str.length;
|
|
@@ -24689,7 +24696,7 @@ var require_ucs2length = __commonJS({
|
|
|
24689
24696
|
}
|
|
24690
24697
|
});
|
|
24691
24698
|
var require_limitLength = __commonJS({
|
|
24692
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24699
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports) {
|
|
24693
24700
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24694
24701
|
var codegen_1 = require_codegen();
|
|
24695
24702
|
var util_1 = require_util();
|
|
@@ -24718,7 +24725,7 @@ var require_limitLength = __commonJS({
|
|
|
24718
24725
|
}
|
|
24719
24726
|
});
|
|
24720
24727
|
var require_pattern = __commonJS({
|
|
24721
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24728
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports) {
|
|
24722
24729
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24723
24730
|
var code_1 = require_code2();
|
|
24724
24731
|
var util_1 = require_util();
|
|
@@ -24752,7 +24759,7 @@ var require_pattern = __commonJS({
|
|
|
24752
24759
|
}
|
|
24753
24760
|
});
|
|
24754
24761
|
var require_limitProperties = __commonJS({
|
|
24755
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24762
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports) {
|
|
24756
24763
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24757
24764
|
var codegen_1 = require_codegen();
|
|
24758
24765
|
var error51 = {
|
|
@@ -24778,7 +24785,7 @@ var require_limitProperties = __commonJS({
|
|
|
24778
24785
|
}
|
|
24779
24786
|
});
|
|
24780
24787
|
var require_required = __commonJS({
|
|
24781
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24788
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/required.js"(exports) {
|
|
24782
24789
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24783
24790
|
var code_1 = require_code2();
|
|
24784
24791
|
var codegen_1 = require_codegen();
|
|
@@ -24857,7 +24864,7 @@ var require_required = __commonJS({
|
|
|
24857
24864
|
}
|
|
24858
24865
|
});
|
|
24859
24866
|
var require_limitItems = __commonJS({
|
|
24860
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24867
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports) {
|
|
24861
24868
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24862
24869
|
var codegen_1 = require_codegen();
|
|
24863
24870
|
var error51 = {
|
|
@@ -24883,7 +24890,7 @@ var require_limitItems = __commonJS({
|
|
|
24883
24890
|
}
|
|
24884
24891
|
});
|
|
24885
24892
|
var require_equal = __commonJS({
|
|
24886
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24893
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/runtime/equal.js"(exports) {
|
|
24887
24894
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24888
24895
|
var equal2 = require_fast_deep_equal();
|
|
24889
24896
|
equal2.code = 'require("ajv/dist/runtime/equal").default';
|
|
@@ -24891,7 +24898,7 @@ var require_equal = __commonJS({
|
|
|
24891
24898
|
}
|
|
24892
24899
|
});
|
|
24893
24900
|
var require_uniqueItems = __commonJS({
|
|
24894
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24901
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports) {
|
|
24895
24902
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24896
24903
|
var dataType_1 = require_dataType();
|
|
24897
24904
|
var codegen_1 = require_codegen();
|
|
@@ -24955,7 +24962,7 @@ var require_uniqueItems = __commonJS({
|
|
|
24955
24962
|
}
|
|
24956
24963
|
});
|
|
24957
24964
|
var require_const = __commonJS({
|
|
24958
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24965
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/const.js"(exports) {
|
|
24959
24966
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24960
24967
|
var codegen_1 = require_codegen();
|
|
24961
24968
|
var util_1 = require_util();
|
|
@@ -24981,7 +24988,7 @@ var require_const = __commonJS({
|
|
|
24981
24988
|
}
|
|
24982
24989
|
});
|
|
24983
24990
|
var require_enum = __commonJS({
|
|
24984
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24991
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports) {
|
|
24985
24992
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24986
24993
|
var codegen_1 = require_codegen();
|
|
24987
24994
|
var util_1 = require_util();
|
|
@@ -25027,7 +25034,7 @@ var require_enum = __commonJS({
|
|
|
25027
25034
|
}
|
|
25028
25035
|
});
|
|
25029
25036
|
var require_validation = __commonJS({
|
|
25030
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25037
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/index.js"(exports) {
|
|
25031
25038
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25032
25039
|
var limitNumber_1 = require_limitNumber();
|
|
25033
25040
|
var multipleOf_1 = require_multipleOf();
|
|
@@ -25062,7 +25069,7 @@ var require_validation = __commonJS({
|
|
|
25062
25069
|
}
|
|
25063
25070
|
});
|
|
25064
25071
|
var require_additionalItems = __commonJS({
|
|
25065
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25072
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports) {
|
|
25066
25073
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25067
25074
|
exports.validateAdditionalItems = void 0;
|
|
25068
25075
|
var codegen_1 = require_codegen();
|
|
@@ -25112,7 +25119,7 @@ var require_additionalItems = __commonJS({
|
|
|
25112
25119
|
}
|
|
25113
25120
|
});
|
|
25114
25121
|
var require_items = __commonJS({
|
|
25115
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25122
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports) {
|
|
25116
25123
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25117
25124
|
exports.validateTuple = void 0;
|
|
25118
25125
|
var codegen_1 = require_codegen();
|
|
@@ -25166,7 +25173,7 @@ var require_items = __commonJS({
|
|
|
25166
25173
|
}
|
|
25167
25174
|
});
|
|
25168
25175
|
var require_prefixItems = __commonJS({
|
|
25169
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25176
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports) {
|
|
25170
25177
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25171
25178
|
var items_1 = require_items();
|
|
25172
25179
|
var def = {
|
|
@@ -25180,7 +25187,7 @@ var require_prefixItems = __commonJS({
|
|
|
25180
25187
|
}
|
|
25181
25188
|
});
|
|
25182
25189
|
var require_items2020 = __commonJS({
|
|
25183
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25190
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports) {
|
|
25184
25191
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25185
25192
|
var codegen_1 = require_codegen();
|
|
25186
25193
|
var util_1 = require_util();
|
|
@@ -25212,7 +25219,7 @@ var require_items2020 = __commonJS({
|
|
|
25212
25219
|
}
|
|
25213
25220
|
});
|
|
25214
25221
|
var require_contains = __commonJS({
|
|
25215
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25222
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports) {
|
|
25216
25223
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25217
25224
|
var codegen_1 = require_codegen();
|
|
25218
25225
|
var util_1 = require_util();
|
|
@@ -25303,7 +25310,7 @@ var require_contains = __commonJS({
|
|
|
25303
25310
|
}
|
|
25304
25311
|
});
|
|
25305
25312
|
var require_dependencies = __commonJS({
|
|
25306
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25313
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports) {
|
|
25307
25314
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25308
25315
|
exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
|
|
25309
25316
|
var codegen_1 = require_codegen();
|
|
@@ -25394,7 +25401,7 @@ var require_dependencies = __commonJS({
|
|
|
25394
25401
|
}
|
|
25395
25402
|
});
|
|
25396
25403
|
var require_propertyNames = __commonJS({
|
|
25397
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25404
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports) {
|
|
25398
25405
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25399
25406
|
var codegen_1 = require_codegen();
|
|
25400
25407
|
var util_1 = require_util();
|
|
@@ -25434,7 +25441,7 @@ var require_propertyNames = __commonJS({
|
|
|
25434
25441
|
}
|
|
25435
25442
|
});
|
|
25436
25443
|
var require_additionalProperties = __commonJS({
|
|
25437
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25444
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports) {
|
|
25438
25445
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25439
25446
|
var code_1 = require_code2();
|
|
25440
25447
|
var codegen_1 = require_codegen();
|
|
@@ -25537,7 +25544,7 @@ var require_additionalProperties = __commonJS({
|
|
|
25537
25544
|
}
|
|
25538
25545
|
});
|
|
25539
25546
|
var require_properties = __commonJS({
|
|
25540
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25547
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports) {
|
|
25541
25548
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25542
25549
|
var validate_1 = require_validate();
|
|
25543
25550
|
var code_1 = require_code2();
|
|
@@ -25592,7 +25599,7 @@ var require_properties = __commonJS({
|
|
|
25592
25599
|
}
|
|
25593
25600
|
});
|
|
25594
25601
|
var require_patternProperties = __commonJS({
|
|
25595
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25602
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports) {
|
|
25596
25603
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25597
25604
|
var code_1 = require_code2();
|
|
25598
25605
|
var codegen_1 = require_codegen();
|
|
@@ -25663,7 +25670,7 @@ var require_patternProperties = __commonJS({
|
|
|
25663
25670
|
}
|
|
25664
25671
|
});
|
|
25665
25672
|
var require_not = __commonJS({
|
|
25666
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25673
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports) {
|
|
25667
25674
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25668
25675
|
var util_1 = require_util();
|
|
25669
25676
|
var def = {
|
|
@@ -25691,7 +25698,7 @@ var require_not = __commonJS({
|
|
|
25691
25698
|
}
|
|
25692
25699
|
});
|
|
25693
25700
|
var require_anyOf = __commonJS({
|
|
25694
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25701
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports) {
|
|
25695
25702
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25696
25703
|
var code_1 = require_code2();
|
|
25697
25704
|
var def = {
|
|
@@ -25705,7 +25712,7 @@ var require_anyOf = __commonJS({
|
|
|
25705
25712
|
}
|
|
25706
25713
|
});
|
|
25707
25714
|
var require_oneOf = __commonJS({
|
|
25708
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25715
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports) {
|
|
25709
25716
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25710
25717
|
var codegen_1 = require_codegen();
|
|
25711
25718
|
var util_1 = require_util();
|
|
@@ -25760,7 +25767,7 @@ var require_oneOf = __commonJS({
|
|
|
25760
25767
|
}
|
|
25761
25768
|
});
|
|
25762
25769
|
var require_allOf = __commonJS({
|
|
25763
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25770
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports) {
|
|
25764
25771
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25765
25772
|
var util_1 = require_util();
|
|
25766
25773
|
var def = {
|
|
@@ -25784,7 +25791,7 @@ var require_allOf = __commonJS({
|
|
|
25784
25791
|
}
|
|
25785
25792
|
});
|
|
25786
25793
|
var require_if = __commonJS({
|
|
25787
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25794
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports) {
|
|
25788
25795
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25789
25796
|
var codegen_1 = require_codegen();
|
|
25790
25797
|
var util_1 = require_util();
|
|
@@ -25850,7 +25857,7 @@ var require_if = __commonJS({
|
|
|
25850
25857
|
}
|
|
25851
25858
|
});
|
|
25852
25859
|
var require_thenElse = __commonJS({
|
|
25853
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25860
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports) {
|
|
25854
25861
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25855
25862
|
var util_1 = require_util();
|
|
25856
25863
|
var def = {
|
|
@@ -25865,7 +25872,7 @@ var require_thenElse = __commonJS({
|
|
|
25865
25872
|
}
|
|
25866
25873
|
});
|
|
25867
25874
|
var require_applicator = __commonJS({
|
|
25868
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25875
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports) {
|
|
25869
25876
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25870
25877
|
var additionalItems_1 = require_additionalItems();
|
|
25871
25878
|
var prefixItems_1 = require_prefixItems();
|
|
@@ -25910,7 +25917,7 @@ var require_applicator = __commonJS({
|
|
|
25910
25917
|
}
|
|
25911
25918
|
});
|
|
25912
25919
|
var require_format = __commonJS({
|
|
25913
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25920
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/format/format.js"(exports) {
|
|
25914
25921
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25915
25922
|
var codegen_1 = require_codegen();
|
|
25916
25923
|
var error51 = {
|
|
@@ -25997,7 +26004,7 @@ var require_format = __commonJS({
|
|
|
25997
26004
|
}
|
|
25998
26005
|
});
|
|
25999
26006
|
var require_format2 = __commonJS({
|
|
26000
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26007
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/format/index.js"(exports) {
|
|
26001
26008
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26002
26009
|
var format_1 = require_format();
|
|
26003
26010
|
var format = [format_1.default];
|
|
@@ -26005,7 +26012,7 @@ var require_format2 = __commonJS({
|
|
|
26005
26012
|
}
|
|
26006
26013
|
});
|
|
26007
26014
|
var require_metadata = __commonJS({
|
|
26008
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26015
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/metadata.js"(exports) {
|
|
26009
26016
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26010
26017
|
exports.contentVocabulary = exports.metadataVocabulary = void 0;
|
|
26011
26018
|
exports.metadataVocabulary = [
|
|
@@ -26025,7 +26032,7 @@ var require_metadata = __commonJS({
|
|
|
26025
26032
|
}
|
|
26026
26033
|
});
|
|
26027
26034
|
var require_draft7 = __commonJS({
|
|
26028
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26035
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/draft7.js"(exports) {
|
|
26029
26036
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26030
26037
|
var core_1 = require_core2();
|
|
26031
26038
|
var validation_1 = require_validation();
|
|
@@ -26044,7 +26051,7 @@ var require_draft7 = __commonJS({
|
|
|
26044
26051
|
}
|
|
26045
26052
|
});
|
|
26046
26053
|
var require_types = __commonJS({
|
|
26047
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26054
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports) {
|
|
26048
26055
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26049
26056
|
exports.DiscrError = void 0;
|
|
26050
26057
|
var DiscrError;
|
|
@@ -26055,7 +26062,7 @@ var require_types = __commonJS({
|
|
|
26055
26062
|
}
|
|
26056
26063
|
});
|
|
26057
26064
|
var require_discriminator = __commonJS({
|
|
26058
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26065
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports) {
|
|
26059
26066
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26060
26067
|
var codegen_1 = require_codegen();
|
|
26061
26068
|
var types_1 = require_types();
|
|
@@ -26157,7 +26164,7 @@ var require_discriminator = __commonJS({
|
|
|
26157
26164
|
}
|
|
26158
26165
|
});
|
|
26159
26166
|
var require_json_schema_draft_07 = __commonJS({
|
|
26160
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26167
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports, module) {
|
|
26161
26168
|
module.exports = {
|
|
26162
26169
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
26163
26170
|
$id: "http://json-schema.org/draft-07/schema#",
|
|
@@ -26312,7 +26319,7 @@ var require_json_schema_draft_07 = __commonJS({
|
|
|
26312
26319
|
}
|
|
26313
26320
|
});
|
|
26314
26321
|
var require_ajv = __commonJS({
|
|
26315
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26322
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/ajv.js"(exports, module) {
|
|
26316
26323
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26317
26324
|
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;
|
|
26318
26325
|
var core_1 = require_core();
|
|
@@ -26379,7 +26386,7 @@ var require_ajv = __commonJS({
|
|
|
26379
26386
|
}
|
|
26380
26387
|
});
|
|
26381
26388
|
var require_dynamicAnchor = __commonJS({
|
|
26382
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26389
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js"(exports) {
|
|
26383
26390
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26384
26391
|
exports.dynamicAnchor = void 0;
|
|
26385
26392
|
var codegen_1 = require_codegen();
|
|
@@ -26411,7 +26418,7 @@ var require_dynamicAnchor = __commonJS({
|
|
|
26411
26418
|
}
|
|
26412
26419
|
});
|
|
26413
26420
|
var require_dynamicRef = __commonJS({
|
|
26414
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26421
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js"(exports) {
|
|
26415
26422
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26416
26423
|
exports.dynamicRef = void 0;
|
|
26417
26424
|
var codegen_1 = require_codegen();
|
|
@@ -26454,7 +26461,7 @@ var require_dynamicRef = __commonJS({
|
|
|
26454
26461
|
}
|
|
26455
26462
|
});
|
|
26456
26463
|
var require_recursiveAnchor = __commonJS({
|
|
26457
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26464
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js"(exports) {
|
|
26458
26465
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26459
26466
|
var dynamicAnchor_1 = require_dynamicAnchor();
|
|
26460
26467
|
var util_1 = require_util();
|
|
@@ -26472,7 +26479,7 @@ var require_recursiveAnchor = __commonJS({
|
|
|
26472
26479
|
}
|
|
26473
26480
|
});
|
|
26474
26481
|
var require_recursiveRef = __commonJS({
|
|
26475
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26482
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js"(exports) {
|
|
26476
26483
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26477
26484
|
var dynamicRef_1 = require_dynamicRef();
|
|
26478
26485
|
var def = {
|
|
@@ -26484,7 +26491,7 @@ var require_recursiveRef = __commonJS({
|
|
|
26484
26491
|
}
|
|
26485
26492
|
});
|
|
26486
26493
|
var require_dynamic = __commonJS({
|
|
26487
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26494
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/dynamic/index.js"(exports) {
|
|
26488
26495
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26489
26496
|
var dynamicAnchor_1 = require_dynamicAnchor();
|
|
26490
26497
|
var dynamicRef_1 = require_dynamicRef();
|
|
@@ -26495,7 +26502,7 @@ var require_dynamic = __commonJS({
|
|
|
26495
26502
|
}
|
|
26496
26503
|
});
|
|
26497
26504
|
var require_dependentRequired = __commonJS({
|
|
26498
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26505
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js"(exports) {
|
|
26499
26506
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26500
26507
|
var dependencies_1 = require_dependencies();
|
|
26501
26508
|
var def = {
|
|
@@ -26509,7 +26516,7 @@ var require_dependentRequired = __commonJS({
|
|
|
26509
26516
|
}
|
|
26510
26517
|
});
|
|
26511
26518
|
var require_dependentSchemas = __commonJS({
|
|
26512
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26519
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js"(exports) {
|
|
26513
26520
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26514
26521
|
var dependencies_1 = require_dependencies();
|
|
26515
26522
|
var def = {
|
|
@@ -26522,7 +26529,7 @@ var require_dependentSchemas = __commonJS({
|
|
|
26522
26529
|
}
|
|
26523
26530
|
});
|
|
26524
26531
|
var require_limitContains = __commonJS({
|
|
26525
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26532
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/limitContains.js"(exports) {
|
|
26526
26533
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26527
26534
|
var util_1 = require_util();
|
|
26528
26535
|
var def = {
|
|
@@ -26539,7 +26546,7 @@ var require_limitContains = __commonJS({
|
|
|
26539
26546
|
}
|
|
26540
26547
|
});
|
|
26541
26548
|
var require_next = __commonJS({
|
|
26542
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26549
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/next.js"(exports) {
|
|
26543
26550
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26544
26551
|
var dependentRequired_1 = require_dependentRequired();
|
|
26545
26552
|
var dependentSchemas_1 = require_dependentSchemas();
|
|
@@ -26549,7 +26556,7 @@ var require_next = __commonJS({
|
|
|
26549
26556
|
}
|
|
26550
26557
|
});
|
|
26551
26558
|
var require_unevaluatedProperties = __commonJS({
|
|
26552
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26559
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js"(exports) {
|
|
26553
26560
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26554
26561
|
var codegen_1 = require_codegen();
|
|
26555
26562
|
var util_1 = require_util();
|
|
@@ -26612,7 +26619,7 @@ var require_unevaluatedProperties = __commonJS({
|
|
|
26612
26619
|
}
|
|
26613
26620
|
});
|
|
26614
26621
|
var require_unevaluatedItems = __commonJS({
|
|
26615
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26622
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js"(exports) {
|
|
26616
26623
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26617
26624
|
var codegen_1 = require_codegen();
|
|
26618
26625
|
var util_1 = require_util();
|
|
@@ -26653,7 +26660,7 @@ var require_unevaluatedItems = __commonJS({
|
|
|
26653
26660
|
}
|
|
26654
26661
|
});
|
|
26655
26662
|
var require_unevaluated = __commonJS({
|
|
26656
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26663
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/unevaluated/index.js"(exports) {
|
|
26657
26664
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26658
26665
|
var unevaluatedProperties_1 = require_unevaluatedProperties();
|
|
26659
26666
|
var unevaluatedItems_1 = require_unevaluatedItems();
|
|
@@ -26662,7 +26669,7 @@ var require_unevaluated = __commonJS({
|
|
|
26662
26669
|
}
|
|
26663
26670
|
});
|
|
26664
26671
|
var require_draft2020 = __commonJS({
|
|
26665
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26672
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/draft2020.js"(exports) {
|
|
26666
26673
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26667
26674
|
var core_1 = require_core2();
|
|
26668
26675
|
var validation_1 = require_validation();
|
|
@@ -26687,7 +26694,7 @@ var require_draft2020 = __commonJS({
|
|
|
26687
26694
|
}
|
|
26688
26695
|
});
|
|
26689
26696
|
var require_schema = __commonJS({
|
|
26690
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26697
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json"(exports, module) {
|
|
26691
26698
|
module.exports = {
|
|
26692
26699
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26693
26700
|
$id: "https://json-schema.org/draft/2020-12/schema",
|
|
@@ -26745,7 +26752,7 @@ var require_schema = __commonJS({
|
|
|
26745
26752
|
}
|
|
26746
26753
|
});
|
|
26747
26754
|
var require_applicator2 = __commonJS({
|
|
26748
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26755
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json"(exports, module) {
|
|
26749
26756
|
module.exports = {
|
|
26750
26757
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26751
26758
|
$id: "https://json-schema.org/draft/2020-12/meta/applicator",
|
|
@@ -26796,7 +26803,7 @@ var require_applicator2 = __commonJS({
|
|
|
26796
26803
|
}
|
|
26797
26804
|
});
|
|
26798
26805
|
var require_unevaluated2 = __commonJS({
|
|
26799
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26806
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json"(exports, module) {
|
|
26800
26807
|
module.exports = {
|
|
26801
26808
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26802
26809
|
$id: "https://json-schema.org/draft/2020-12/meta/unevaluated",
|
|
@@ -26814,7 +26821,7 @@ var require_unevaluated2 = __commonJS({
|
|
|
26814
26821
|
}
|
|
26815
26822
|
});
|
|
26816
26823
|
var require_content = __commonJS({
|
|
26817
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26824
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json"(exports, module) {
|
|
26818
26825
|
module.exports = {
|
|
26819
26826
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26820
26827
|
$id: "https://json-schema.org/draft/2020-12/meta/content",
|
|
@@ -26833,7 +26840,7 @@ var require_content = __commonJS({
|
|
|
26833
26840
|
}
|
|
26834
26841
|
});
|
|
26835
26842
|
var require_core3 = __commonJS({
|
|
26836
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26843
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json"(exports, module) {
|
|
26837
26844
|
module.exports = {
|
|
26838
26845
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26839
26846
|
$id: "https://json-schema.org/draft/2020-12/meta/core",
|
|
@@ -26887,7 +26894,7 @@ var require_core3 = __commonJS({
|
|
|
26887
26894
|
}
|
|
26888
26895
|
});
|
|
26889
26896
|
var require_format_annotation = __commonJS({
|
|
26890
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26897
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json"(exports, module) {
|
|
26891
26898
|
module.exports = {
|
|
26892
26899
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26893
26900
|
$id: "https://json-schema.org/draft/2020-12/meta/format-annotation",
|
|
@@ -26904,7 +26911,7 @@ var require_format_annotation = __commonJS({
|
|
|
26904
26911
|
}
|
|
26905
26912
|
});
|
|
26906
26913
|
var require_meta_data = __commonJS({
|
|
26907
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26914
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json"(exports, module) {
|
|
26908
26915
|
module.exports = {
|
|
26909
26916
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26910
26917
|
$id: "https://json-schema.org/draft/2020-12/meta/meta-data",
|
|
@@ -26943,7 +26950,7 @@ var require_meta_data = __commonJS({
|
|
|
26943
26950
|
}
|
|
26944
26951
|
});
|
|
26945
26952
|
var require_validation2 = __commonJS({
|
|
26946
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26953
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json"(exports, module) {
|
|
26947
26954
|
module.exports = {
|
|
26948
26955
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26949
26956
|
$id: "https://json-schema.org/draft/2020-12/meta/validation",
|
|
@@ -27036,7 +27043,7 @@ var require_validation2 = __commonJS({
|
|
|
27036
27043
|
}
|
|
27037
27044
|
});
|
|
27038
27045
|
var require_json_schema_2020_12 = __commonJS({
|
|
27039
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
27046
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/refs/json-schema-2020-12/index.js"(exports) {
|
|
27040
27047
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27041
27048
|
var metaSchema = require_schema();
|
|
27042
27049
|
var applicator = require_applicator2();
|
|
@@ -27067,7 +27074,7 @@ var require_json_schema_2020_12 = __commonJS({
|
|
|
27067
27074
|
}
|
|
27068
27075
|
});
|
|
27069
27076
|
var require__ = __commonJS({
|
|
27070
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
27077
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/2020.js"(exports, module) {
|
|
27071
27078
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27072
27079
|
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2020 = void 0;
|
|
27073
27080
|
var core_1 = require_core();
|
|
@@ -27352,7 +27359,7 @@ function toStandardSchema3(zodSchema2) {
|
|
|
27352
27359
|
return wrapper;
|
|
27353
27360
|
}
|
|
27354
27361
|
|
|
27355
|
-
// ../schema-compat/dist/chunk-
|
|
27362
|
+
// ../schema-compat/dist/chunk-C7LTFHL3.js
|
|
27356
27363
|
var SUPPORTED_TARGETS = /* @__PURE__ */ new Set(["draft-07", "draft-04", "draft-2020-12"]);
|
|
27357
27364
|
var ZOD_V4_TARGET_MAP = {
|
|
27358
27365
|
"draft-07": "draft-7",
|
|
@@ -31083,6 +31090,44 @@ function getMastraToolStrictMeta(meta3) {
|
|
|
31083
31090
|
const strict = mastraMeta[STRICT_META_KEY];
|
|
31084
31091
|
return typeof strict === "boolean" ? strict : void 0;
|
|
31085
31092
|
}
|
|
31093
|
+
function escapeHeaderValue(value) {
|
|
31094
|
+
return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
31095
|
+
}
|
|
31096
|
+
function generateWWWAuthenticateHeader(options = {}) {
|
|
31097
|
+
const params = [];
|
|
31098
|
+
if (options.resourceMetadataUrl) {
|
|
31099
|
+
params.push(`resource_metadata="${escapeHeaderValue(options.resourceMetadataUrl)}"`);
|
|
31100
|
+
}
|
|
31101
|
+
if (options.additionalParams) {
|
|
31102
|
+
for (const [key, value] of Object.entries(options.additionalParams)) {
|
|
31103
|
+
params.push(`${key}="${escapeHeaderValue(value)}"`);
|
|
31104
|
+
}
|
|
31105
|
+
}
|
|
31106
|
+
if (params.length === 0) {
|
|
31107
|
+
return "Bearer";
|
|
31108
|
+
}
|
|
31109
|
+
return `Bearer ${params.join(", ")}`;
|
|
31110
|
+
}
|
|
31111
|
+
function generateProtectedResourceMetadata(config2) {
|
|
31112
|
+
return {
|
|
31113
|
+
resource: config2.resource,
|
|
31114
|
+
authorization_servers: config2.authorizationServers,
|
|
31115
|
+
scopes_supported: config2.scopesSupported ?? ["mcp:read", "mcp:write"],
|
|
31116
|
+
bearer_methods_supported: ["header"],
|
|
31117
|
+
...config2.resourceName && { resource_name: config2.resourceName },
|
|
31118
|
+
...config2.resourceDocumentation && {
|
|
31119
|
+
resource_documentation: config2.resourceDocumentation
|
|
31120
|
+
}
|
|
31121
|
+
};
|
|
31122
|
+
}
|
|
31123
|
+
function extractBearerToken(authHeader) {
|
|
31124
|
+
if (!authHeader) return void 0;
|
|
31125
|
+
const prefix = "bearer ";
|
|
31126
|
+
if (authHeader.length <= prefix.length) return void 0;
|
|
31127
|
+
if (authHeader.slice(0, prefix.length).toLowerCase() !== prefix) return void 0;
|
|
31128
|
+
const token = authHeader.slice(prefix.length).trim();
|
|
31129
|
+
return token || void 0;
|
|
31130
|
+
}
|
|
31086
31131
|
|
|
31087
31132
|
// src/client/actions/elicitation.ts
|
|
31088
31133
|
var ElicitationClientActions = class {
|
|
@@ -31539,6 +31584,10 @@ var InternalMastraMCPClient = class extends base.MastraBase {
|
|
|
31539
31584
|
enableProgressTracking;
|
|
31540
31585
|
serverConfig;
|
|
31541
31586
|
transport;
|
|
31587
|
+
pendingAuthTransport;
|
|
31588
|
+
clientBaseOnClose;
|
|
31589
|
+
clientConnectionOnClose;
|
|
31590
|
+
_authState;
|
|
31542
31591
|
operationContextStore = new async_hooks.AsyncLocalStorage();
|
|
31543
31592
|
exitHookUnsubscribe;
|
|
31544
31593
|
sigTermHandler;
|
|
@@ -31723,14 +31772,14 @@ var InternalMastraMCPClient = class extends base.MastraBase {
|
|
|
31723
31772
|
this.log("debug", `Attempting to connect to URL: ${url2}`);
|
|
31724
31773
|
let shouldTrySSE = url2.pathname.endsWith(`/sse`);
|
|
31725
31774
|
if (!shouldTrySSE) {
|
|
31775
|
+
const streamableTransport = new streamableHttp_js.StreamableHTTPClientTransport(url2, {
|
|
31776
|
+
requestInit,
|
|
31777
|
+
reconnectionOptions: this.serverConfig.reconnectionOptions,
|
|
31778
|
+
authProvider,
|
|
31779
|
+
fetch: fetch2
|
|
31780
|
+
});
|
|
31726
31781
|
try {
|
|
31727
31782
|
this.log("debug", "Trying Streamable HTTP transport...");
|
|
31728
|
-
const streamableTransport = new streamableHttp_js.StreamableHTTPClientTransport(url2, {
|
|
31729
|
-
requestInit,
|
|
31730
|
-
reconnectionOptions: this.serverConfig.reconnectionOptions,
|
|
31731
|
-
authProvider,
|
|
31732
|
-
fetch: fetch2
|
|
31733
|
-
});
|
|
31734
31783
|
await this.client.connect(streamableTransport, {
|
|
31735
31784
|
timeout: connectTimeout ?? DEFAULT_SERVER_CONNECT_TIMEOUT_MSEC
|
|
31736
31785
|
});
|
|
@@ -31738,6 +31787,10 @@ var InternalMastraMCPClient = class extends base.MastraBase {
|
|
|
31738
31787
|
this.log("debug", "Successfully connected using Streamable HTTP transport.");
|
|
31739
31788
|
} catch (error51) {
|
|
31740
31789
|
this.log("debug", `Streamable HTTP transport failed: ${error51}`);
|
|
31790
|
+
if (authProvider && error51 instanceof auth_js.UnauthorizedError) {
|
|
31791
|
+
this.markNeedsAuth(streamableTransport);
|
|
31792
|
+
throw error51;
|
|
31793
|
+
}
|
|
31741
31794
|
const status = error51?.code;
|
|
31742
31795
|
if (status !== void 0 && !SSE_FALLBACK_STATUS_CODES.includes(status)) {
|
|
31743
31796
|
throw error51;
|
|
@@ -31746,19 +31799,24 @@ var InternalMastraMCPClient = class extends base.MastraBase {
|
|
|
31746
31799
|
}
|
|
31747
31800
|
}
|
|
31748
31801
|
if (shouldTrySSE) {
|
|
31802
|
+
await this.detachStaleClientTransport();
|
|
31749
31803
|
this.log("debug", "Falling back to deprecated HTTP+SSE transport...");
|
|
31804
|
+
const sseEventSourceInit = { ...eventSourceInit, fetch: eventSourceInit?.fetch ?? fetch2 };
|
|
31805
|
+
const sseTransport = new sse_js.SSEClientTransport(url2, {
|
|
31806
|
+
requestInit,
|
|
31807
|
+
eventSourceInit: sseEventSourceInit,
|
|
31808
|
+
authProvider,
|
|
31809
|
+
fetch: fetch2
|
|
31810
|
+
});
|
|
31750
31811
|
try {
|
|
31751
|
-
const sseEventSourceInit = { ...eventSourceInit, fetch: fetch2 };
|
|
31752
|
-
const sseTransport = new sse_js.SSEClientTransport(url2, {
|
|
31753
|
-
requestInit,
|
|
31754
|
-
eventSourceInit: sseEventSourceInit,
|
|
31755
|
-
authProvider,
|
|
31756
|
-
fetch: fetch2
|
|
31757
|
-
});
|
|
31758
31812
|
await this.client.connect(sseTransport, { timeout: this.serverConfig.timeout ?? this.timeout });
|
|
31759
31813
|
this.transport = sseTransport;
|
|
31760
31814
|
this.log("debug", "Successfully connected using deprecated HTTP+SSE transport.");
|
|
31761
31815
|
} catch (sseError) {
|
|
31816
|
+
if (authProvider && sseError instanceof auth_js.UnauthorizedError) {
|
|
31817
|
+
this.markNeedsAuth(sseTransport);
|
|
31818
|
+
throw sseError;
|
|
31819
|
+
}
|
|
31762
31820
|
this.log(
|
|
31763
31821
|
"error",
|
|
31764
31822
|
`Failed to connect with SSE transport after failing to connect to Streamable HTTP transport first. SSE error: ${sseError}`
|
|
@@ -31766,6 +31824,110 @@ var InternalMastraMCPClient = class extends base.MastraBase {
|
|
|
31766
31824
|
throw new Error("Could not connect to server with any available HTTP transport");
|
|
31767
31825
|
}
|
|
31768
31826
|
}
|
|
31827
|
+
this.closePendingAuthTransport();
|
|
31828
|
+
if (authProvider) {
|
|
31829
|
+
this._authState = "authorized";
|
|
31830
|
+
}
|
|
31831
|
+
}
|
|
31832
|
+
/**
|
|
31833
|
+
* Detaches whatever transport is still attached to the underlying SDK Client.
|
|
31834
|
+
*
|
|
31835
|
+
* The SDK assigns its internal `_transport` before `transport.start()` and never
|
|
31836
|
+
* clears it when `start()` throws, and its cleanup after a failed initialize is a
|
|
31837
|
+
* fire-and-forget `void this.close()`. Either way a stale transport can remain
|
|
31838
|
+
* attached, making every subsequent `client.connect()` throw "Already connected
|
|
31839
|
+
* to a transport" and permanently wedging this client (issue #19862). Mastra's
|
|
31840
|
+
* own `this.transport` is only assigned after a successful connect, so
|
|
31841
|
+
* disconnect/forceReconnect never see the stale one. Calling this before every
|
|
31842
|
+
* connect attempt restores the invariant that a connect starts from a detached
|
|
31843
|
+
* SDK client.
|
|
31844
|
+
*/
|
|
31845
|
+
async detachStaleClientTransport() {
|
|
31846
|
+
const stale = this.client.transport;
|
|
31847
|
+
if (!stale) {
|
|
31848
|
+
return;
|
|
31849
|
+
}
|
|
31850
|
+
if (stale === this.pendingAuthTransport) {
|
|
31851
|
+
this.severClientTransportLink(stale);
|
|
31852
|
+
return;
|
|
31853
|
+
}
|
|
31854
|
+
this.log("debug", "Closing stale SDK client transport before connect attempt");
|
|
31855
|
+
try {
|
|
31856
|
+
await stale.close();
|
|
31857
|
+
} catch (e) {
|
|
31858
|
+
this.log("debug", "Error closing stale SDK client transport (ignored)", {
|
|
31859
|
+
error: e instanceof Error ? e.message : String(e)
|
|
31860
|
+
});
|
|
31861
|
+
}
|
|
31862
|
+
this.severClientTransportLink(stale);
|
|
31863
|
+
}
|
|
31864
|
+
/**
|
|
31865
|
+
* Severs the mutual references between the SDK client and a stale transport
|
|
31866
|
+
* without closing it. Clearing the transport's callbacks ensures a later
|
|
31867
|
+
* close() of the stale transport cannot reach into the SDK client and clear
|
|
31868
|
+
* the state of a newer live connection.
|
|
31869
|
+
*/
|
|
31870
|
+
severClientTransportLink(stale) {
|
|
31871
|
+
stale.onclose = void 0;
|
|
31872
|
+
stale.onerror = void 0;
|
|
31873
|
+
stale.onmessage = void 0;
|
|
31874
|
+
if (this.client.transport === stale) {
|
|
31875
|
+
this.client._transport = void 0;
|
|
31876
|
+
}
|
|
31877
|
+
}
|
|
31878
|
+
/**
|
|
31879
|
+
* Closes and clears any transport retained from an unfinished authorization
|
|
31880
|
+
* flow. Safe to call when nothing is pending. Centralizes the cleanup so
|
|
31881
|
+
* success, disconnect, and forceReconnect all release the same resource.
|
|
31882
|
+
*/
|
|
31883
|
+
closePendingAuthTransport(replacement) {
|
|
31884
|
+
const pending = this.pendingAuthTransport;
|
|
31885
|
+
this.pendingAuthTransport = replacement;
|
|
31886
|
+
if (pending && pending !== replacement) {
|
|
31887
|
+
void pending.close().catch(() => {
|
|
31888
|
+
});
|
|
31889
|
+
}
|
|
31890
|
+
}
|
|
31891
|
+
/**
|
|
31892
|
+
* Records that the server rejected the connection with a 401 and keeps the
|
|
31893
|
+
* transport that started the authorization flow so finishAuth can complete it.
|
|
31894
|
+
*/
|
|
31895
|
+
markNeedsAuth(transport) {
|
|
31896
|
+
this.closePendingAuthTransport(transport);
|
|
31897
|
+
this._authState = "needs-auth";
|
|
31898
|
+
this.log("debug", "Server requires OAuth authorization before connecting.");
|
|
31899
|
+
}
|
|
31900
|
+
/**
|
|
31901
|
+
* OAuth authorization state of this server connection, when it has an authProvider.
|
|
31902
|
+
*
|
|
31903
|
+
* @internal
|
|
31904
|
+
*/
|
|
31905
|
+
get authState() {
|
|
31906
|
+
return this._authState;
|
|
31907
|
+
}
|
|
31908
|
+
/**
|
|
31909
|
+
* Completes a pending OAuth authorization-code flow.
|
|
31910
|
+
*
|
|
31911
|
+
* Exchanges the authorization code captured at the redirect URI on the same
|
|
31912
|
+
* transport that started the flow, then leaves the client ready to connect().
|
|
31913
|
+
*
|
|
31914
|
+
* @param authorizationCode - The authorization code captured at the redirect URI
|
|
31915
|
+
* @throws {Error} If no authorization flow is pending for this server
|
|
31916
|
+
*
|
|
31917
|
+
* @internal
|
|
31918
|
+
*/
|
|
31919
|
+
async finishAuth(authorizationCode) {
|
|
31920
|
+
const pending = this.pendingAuthTransport;
|
|
31921
|
+
if (!pending) {
|
|
31922
|
+
throw new Error("No OAuth authorization is pending for this server. Call connect() first.");
|
|
31923
|
+
}
|
|
31924
|
+
this.pendingAuthTransport = void 0;
|
|
31925
|
+
try {
|
|
31926
|
+
await pending.finishAuth(authorizationCode);
|
|
31927
|
+
} finally {
|
|
31928
|
+
void pending.close().catch(() => {
|
|
31929
|
+
});
|
|
31930
|
+
}
|
|
31769
31931
|
}
|
|
31770
31932
|
isConnected = null;
|
|
31771
31933
|
/**
|
|
@@ -31785,6 +31947,7 @@ var InternalMastraMCPClient = class extends base.MastraBase {
|
|
|
31785
31947
|
}
|
|
31786
31948
|
this.isConnected = new Promise(async (resolve, reject) => {
|
|
31787
31949
|
try {
|
|
31950
|
+
await this.detachStaleClientTransport();
|
|
31788
31951
|
const { command, url: url2 } = this.serverConfig;
|
|
31789
31952
|
if (command) {
|
|
31790
31953
|
await this.connectStdio(command);
|
|
@@ -31795,21 +31958,30 @@ var InternalMastraMCPClient = class extends base.MastraBase {
|
|
|
31795
31958
|
}
|
|
31796
31959
|
this.refreshServerInstructions();
|
|
31797
31960
|
resolve(true);
|
|
31798
|
-
const
|
|
31799
|
-
|
|
31800
|
-
|
|
31801
|
-
|
|
31802
|
-
|
|
31803
|
-
|
|
31804
|
-
this.
|
|
31805
|
-
|
|
31806
|
-
|
|
31807
|
-
|
|
31808
|
-
|
|
31809
|
-
|
|
31810
|
-
|
|
31961
|
+
const connectedTransport = this.transport;
|
|
31962
|
+
const connectionPromise = this.isConnected;
|
|
31963
|
+
if (this.client.onclose !== this.clientConnectionOnClose) {
|
|
31964
|
+
this.clientBaseOnClose = this.client.onclose;
|
|
31965
|
+
}
|
|
31966
|
+
const connectionOnClose = () => {
|
|
31967
|
+
if (this.transport === connectedTransport) {
|
|
31968
|
+
this.log("debug", `MCP server connection closed`);
|
|
31969
|
+
const staleTransport = this.transport;
|
|
31970
|
+
this.transport = void 0;
|
|
31971
|
+
if (this.isConnected === connectionPromise) {
|
|
31972
|
+
this.isConnected = null;
|
|
31973
|
+
}
|
|
31974
|
+
this.serverInstructions = void 0;
|
|
31975
|
+
if (staleTransport) {
|
|
31976
|
+
this.severClientTransportLink(staleTransport);
|
|
31977
|
+
void staleTransport.close().catch(() => {
|
|
31978
|
+
});
|
|
31979
|
+
}
|
|
31811
31980
|
}
|
|
31981
|
+
this.clientBaseOnClose?.();
|
|
31812
31982
|
};
|
|
31983
|
+
this.clientConnectionOnClose = connectionOnClose;
|
|
31984
|
+
this.client.onclose = connectionOnClose;
|
|
31813
31985
|
} catch (e) {
|
|
31814
31986
|
this.isConnected = null;
|
|
31815
31987
|
reject(e);
|
|
@@ -31876,13 +32048,16 @@ var InternalMastraMCPClient = class extends base.MastraBase {
|
|
|
31876
32048
|
this.serverInstructions = this.client.getInstructions();
|
|
31877
32049
|
}
|
|
31878
32050
|
async disconnect() {
|
|
32051
|
+
this.closePendingAuthTransport();
|
|
31879
32052
|
if (!this.transport) {
|
|
32053
|
+
await this.detachStaleClientTransport();
|
|
31880
32054
|
this.log("debug", "Disconnect called but no transport was connected.");
|
|
31881
32055
|
return;
|
|
31882
32056
|
}
|
|
31883
32057
|
this.log("debug", `Disconnecting from MCP server`);
|
|
32058
|
+
const disconnectedTransport = this.transport;
|
|
31884
32059
|
try {
|
|
31885
|
-
await
|
|
32060
|
+
await disconnectedTransport.close();
|
|
31886
32061
|
this.log("debug", "Successfully disconnected from MCP server");
|
|
31887
32062
|
} catch (e) {
|
|
31888
32063
|
this.log("error", "Error during MCP server disconnect", {
|
|
@@ -31890,6 +32065,7 @@ var InternalMastraMCPClient = class extends base.MastraBase {
|
|
|
31890
32065
|
});
|
|
31891
32066
|
throw e;
|
|
31892
32067
|
} finally {
|
|
32068
|
+
this.severClientTransportLink(disconnectedTransport);
|
|
31893
32069
|
this.transport = void 0;
|
|
31894
32070
|
this.isConnected = null;
|
|
31895
32071
|
this.serverInstructions = void 0;
|
|
@@ -31920,14 +32096,20 @@ var InternalMastraMCPClient = class extends base.MastraBase {
|
|
|
31920
32096
|
*/
|
|
31921
32097
|
async forceReconnect() {
|
|
31922
32098
|
this.log("debug", "Forcing reconnection to MCP server...");
|
|
32099
|
+
this.closePendingAuthTransport();
|
|
32100
|
+
const disconnectedTransport = this.transport;
|
|
31923
32101
|
try {
|
|
31924
|
-
if (
|
|
31925
|
-
await
|
|
32102
|
+
if (disconnectedTransport) {
|
|
32103
|
+
await disconnectedTransport.close();
|
|
31926
32104
|
}
|
|
31927
32105
|
} catch (e) {
|
|
31928
32106
|
this.log("debug", "Error during force disconnect (ignored)", {
|
|
31929
32107
|
error: e instanceof Error ? e.message : String(e)
|
|
31930
32108
|
});
|
|
32109
|
+
} finally {
|
|
32110
|
+
if (disconnectedTransport) {
|
|
32111
|
+
this.severClientTransportLink(disconnectedTransport);
|
|
32112
|
+
}
|
|
31931
32113
|
}
|
|
31932
32114
|
this.transport = void 0;
|
|
31933
32115
|
this.isConnected = null;
|
|
@@ -32198,6 +32380,399 @@ var InternalMastraMCPClient = class extends base.MastraBase {
|
|
|
32198
32380
|
};
|
|
32199
32381
|
}
|
|
32200
32382
|
};
|
|
32383
|
+
var CALLBACK_PORT_FALLBACK_RANGE = 10;
|
|
32384
|
+
var DEFAULT_CALLBACK_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
32385
|
+
var SUCCESS_HTML = `<!DOCTYPE html>
|
|
32386
|
+
<html>
|
|
32387
|
+
<head><meta charset="utf-8"><title>Authentication complete</title></head>
|
|
32388
|
+
<body style="font-family: system-ui, sans-serif; text-align: center; padding-top: 4rem;">
|
|
32389
|
+
<h1>Authentication complete</h1>
|
|
32390
|
+
<p>You can close this tab and return to your application.</p>
|
|
32391
|
+
</body>
|
|
32392
|
+
</html>`;
|
|
32393
|
+
var ERROR_HTML = `<!DOCTYPE html>
|
|
32394
|
+
<html>
|
|
32395
|
+
<head><meta charset="utf-8"><title>Authentication failed</title></head>
|
|
32396
|
+
<body style="font-family: system-ui, sans-serif; text-align: center; padding-top: 4rem;">
|
|
32397
|
+
<h1>Authentication failed</h1>
|
|
32398
|
+
<p>You can close this tab and retry from your application.</p>
|
|
32399
|
+
</body>
|
|
32400
|
+
</html>`;
|
|
32401
|
+
function getCallbackUrlCandidates(redirectUrl) {
|
|
32402
|
+
const base = new URL(redirectUrl.toString());
|
|
32403
|
+
const preferredPort = base.port ? Number(base.port) : base.protocol === "https:" ? 443 : 80;
|
|
32404
|
+
const candidates = [];
|
|
32405
|
+
for (let offset = 0; offset <= CALLBACK_PORT_FALLBACK_RANGE; offset++) {
|
|
32406
|
+
const port = preferredPort + offset;
|
|
32407
|
+
if (port > 65535) break;
|
|
32408
|
+
const candidate = new URL(base.toString());
|
|
32409
|
+
candidate.port = String(port);
|
|
32410
|
+
candidates.push(candidate);
|
|
32411
|
+
}
|
|
32412
|
+
return candidates;
|
|
32413
|
+
}
|
|
32414
|
+
function stateMatches(receivedState, expectedState) {
|
|
32415
|
+
const received = Buffer.from(receivedState);
|
|
32416
|
+
const expected = Buffer.from(expectedState);
|
|
32417
|
+
return received.length === expected.length && crypto$1.timingSafeEqual(received, expected);
|
|
32418
|
+
}
|
|
32419
|
+
function listen(server, port, hostname3) {
|
|
32420
|
+
return new Promise((resolve, reject) => {
|
|
32421
|
+
const onError = (error51) => {
|
|
32422
|
+
server.off("listening", onListening);
|
|
32423
|
+
if (error51.code === "EADDRINUSE") {
|
|
32424
|
+
resolve(error51);
|
|
32425
|
+
} else {
|
|
32426
|
+
reject(error51);
|
|
32427
|
+
}
|
|
32428
|
+
};
|
|
32429
|
+
const onListening = () => {
|
|
32430
|
+
server.off("error", onError);
|
|
32431
|
+
resolve(null);
|
|
32432
|
+
};
|
|
32433
|
+
server.once("error", onError);
|
|
32434
|
+
server.once("listening", onListening);
|
|
32435
|
+
server.listen(port, hostname3);
|
|
32436
|
+
});
|
|
32437
|
+
}
|
|
32438
|
+
async function createOAuthCallbackServer(options) {
|
|
32439
|
+
const candidates = getCallbackUrlCandidates(options.redirectUrl);
|
|
32440
|
+
const callbackPath = candidates[0].pathname;
|
|
32441
|
+
let settled = false;
|
|
32442
|
+
let resolveCode;
|
|
32443
|
+
let rejectCode;
|
|
32444
|
+
const codePromise = new Promise((resolve, reject) => {
|
|
32445
|
+
resolveCode = resolve;
|
|
32446
|
+
rejectCode = reject;
|
|
32447
|
+
});
|
|
32448
|
+
codePromise.catch(() => {
|
|
32449
|
+
});
|
|
32450
|
+
const settle = (outcome) => {
|
|
32451
|
+
if (settled) return;
|
|
32452
|
+
settled = true;
|
|
32453
|
+
if ("result" in outcome) {
|
|
32454
|
+
resolveCode(outcome.result);
|
|
32455
|
+
} else {
|
|
32456
|
+
rejectCode(outcome.error);
|
|
32457
|
+
}
|
|
32458
|
+
};
|
|
32459
|
+
const server = http.createServer((req, res) => {
|
|
32460
|
+
const url2 = new URL(req.url ?? "", "http://localhost");
|
|
32461
|
+
if (url2.pathname !== callbackPath) {
|
|
32462
|
+
res.statusCode = 404;
|
|
32463
|
+
res.end("Not found");
|
|
32464
|
+
return;
|
|
32465
|
+
}
|
|
32466
|
+
if (settled) {
|
|
32467
|
+
res.statusCode = 410;
|
|
32468
|
+
res.end("Callback already handled");
|
|
32469
|
+
return;
|
|
32470
|
+
}
|
|
32471
|
+
const respond = (statusCode, html) => {
|
|
32472
|
+
res.statusCode = statusCode;
|
|
32473
|
+
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
32474
|
+
res.end(html);
|
|
32475
|
+
};
|
|
32476
|
+
const state = url2.searchParams.get("state");
|
|
32477
|
+
if (state === null || !stateMatches(state, options.state)) {
|
|
32478
|
+
respond(400, ERROR_HTML);
|
|
32479
|
+
return;
|
|
32480
|
+
}
|
|
32481
|
+
const error51 = url2.searchParams.get("error");
|
|
32482
|
+
if (error51) {
|
|
32483
|
+
const description = url2.searchParams.get("error_description");
|
|
32484
|
+
respond(400, ERROR_HTML);
|
|
32485
|
+
settle({ error: new Error(`Authorization failed: ${error51}${description ? ` (${description})` : ""}`) });
|
|
32486
|
+
return;
|
|
32487
|
+
}
|
|
32488
|
+
const code = url2.searchParams.get("code");
|
|
32489
|
+
if (!code) {
|
|
32490
|
+
respond(400, ERROR_HTML);
|
|
32491
|
+
settle({ error: new Error("Authorization failed: missing authorization code") });
|
|
32492
|
+
return;
|
|
32493
|
+
}
|
|
32494
|
+
respond(200, SUCCESS_HTML);
|
|
32495
|
+
settle({ result: { code, state } });
|
|
32496
|
+
});
|
|
32497
|
+
const hostname3 = candidates[0].hostname.replace(/^\[|\]$/g, "");
|
|
32498
|
+
let boundUrl;
|
|
32499
|
+
let boundPort;
|
|
32500
|
+
for (const candidate of candidates) {
|
|
32501
|
+
const candidatePort = Number(candidate.port);
|
|
32502
|
+
const error51 = await listen(server, candidatePort, hostname3);
|
|
32503
|
+
if (!error51) {
|
|
32504
|
+
boundUrl = candidate;
|
|
32505
|
+
boundPort = candidatePort;
|
|
32506
|
+
break;
|
|
32507
|
+
}
|
|
32508
|
+
}
|
|
32509
|
+
if (!boundUrl || boundPort === void 0) {
|
|
32510
|
+
const firstPort = Number(candidates[0].port);
|
|
32511
|
+
const lastPort = Number(candidates[candidates.length - 1].port);
|
|
32512
|
+
throw new Error(`Failed to start OAuth callback server: ports ${firstPort}-${lastPort} are all in use`);
|
|
32513
|
+
}
|
|
32514
|
+
server.on("error", (error51) => {
|
|
32515
|
+
settle({ error: error51 instanceof Error ? error51 : new Error(String(error51)) });
|
|
32516
|
+
});
|
|
32517
|
+
return {
|
|
32518
|
+
url: boundUrl,
|
|
32519
|
+
port: boundPort,
|
|
32520
|
+
waitForCode({ timeoutMs = DEFAULT_CALLBACK_TIMEOUT_MS } = {}) {
|
|
32521
|
+
let timer;
|
|
32522
|
+
const timeout = new Promise((_, reject) => {
|
|
32523
|
+
timer = setTimeout(
|
|
32524
|
+
() => reject(new Error(`Timed out waiting for OAuth callback after ${timeoutMs}ms`)),
|
|
32525
|
+
timeoutMs
|
|
32526
|
+
);
|
|
32527
|
+
timer.unref?.();
|
|
32528
|
+
});
|
|
32529
|
+
return Promise.race([codePromise, timeout]).finally(() => clearTimeout(timer));
|
|
32530
|
+
},
|
|
32531
|
+
close() {
|
|
32532
|
+
settle({ error: new Error("OAuth callback server closed before receiving an authorization code") });
|
|
32533
|
+
server.closeIdleConnections();
|
|
32534
|
+
return new Promise((resolve, reject) => {
|
|
32535
|
+
server.close((error51) => {
|
|
32536
|
+
if (error51 && error51.code !== "ERR_SERVER_NOT_RUNNING") {
|
|
32537
|
+
reject(error51);
|
|
32538
|
+
} else {
|
|
32539
|
+
resolve();
|
|
32540
|
+
}
|
|
32541
|
+
});
|
|
32542
|
+
});
|
|
32543
|
+
}
|
|
32544
|
+
};
|
|
32545
|
+
}
|
|
32546
|
+
|
|
32547
|
+
// src/client/oauth-provider.ts
|
|
32548
|
+
var InMemoryOAuthStorage = class {
|
|
32549
|
+
data = /* @__PURE__ */ new Map();
|
|
32550
|
+
set(key, value) {
|
|
32551
|
+
this.data.set(key, value);
|
|
32552
|
+
}
|
|
32553
|
+
get(key) {
|
|
32554
|
+
return this.data.get(key);
|
|
32555
|
+
}
|
|
32556
|
+
delete(key) {
|
|
32557
|
+
this.data.delete(key);
|
|
32558
|
+
}
|
|
32559
|
+
clear() {
|
|
32560
|
+
this.data.clear();
|
|
32561
|
+
}
|
|
32562
|
+
};
|
|
32563
|
+
var MCPOAuthClientProvider = class {
|
|
32564
|
+
_redirectUrl;
|
|
32565
|
+
_clientMetadata;
|
|
32566
|
+
storage;
|
|
32567
|
+
onRedirect;
|
|
32568
|
+
generateState;
|
|
32569
|
+
_clientInfo;
|
|
32570
|
+
_sessionState;
|
|
32571
|
+
_sessionRedirectUrl;
|
|
32572
|
+
constructor(options) {
|
|
32573
|
+
this._redirectUrl = options.redirectUrl;
|
|
32574
|
+
this._clientMetadata = options.clientMetadata;
|
|
32575
|
+
this._clientInfo = options.clientInformation;
|
|
32576
|
+
this.storage = options.storage ?? new InMemoryOAuthStorage();
|
|
32577
|
+
this.onRedirect = options.onRedirectToAuthorization;
|
|
32578
|
+
this.generateState = options.stateGenerator ?? (() => crypto.randomUUID());
|
|
32579
|
+
}
|
|
32580
|
+
/**
|
|
32581
|
+
* The URL to redirect the user agent to after authorization.
|
|
32582
|
+
*/
|
|
32583
|
+
get redirectUrl() {
|
|
32584
|
+
return this._redirectUrl;
|
|
32585
|
+
}
|
|
32586
|
+
/**
|
|
32587
|
+
* Metadata about this OAuth client.
|
|
32588
|
+
*/
|
|
32589
|
+
get clientMetadata() {
|
|
32590
|
+
return this._clientMetadata;
|
|
32591
|
+
}
|
|
32592
|
+
/**
|
|
32593
|
+
* Returns a OAuth2 state parameter.
|
|
32594
|
+
*
|
|
32595
|
+
* While an authorization session is active (see beginAuthorizationSession),
|
|
32596
|
+
* the pinned session state is returned so a callback server can validate
|
|
32597
|
+
* the redirect against a known value.
|
|
32598
|
+
*/
|
|
32599
|
+
async state() {
|
|
32600
|
+
return this._sessionState ?? this.generateState();
|
|
32601
|
+
}
|
|
32602
|
+
/**
|
|
32603
|
+
* Pins the OAuth state parameter for the next authorization request.
|
|
32604
|
+
*
|
|
32605
|
+
* Hosts driving an interactive authorization flow (e.g. MCPClient.authenticate)
|
|
32606
|
+
* call this before triggering the flow so the loopback callback server knows
|
|
32607
|
+
* which state value to expect. Call endAuthorizationSession once the flow settles.
|
|
32608
|
+
*
|
|
32609
|
+
* @returns The pinned state value, generated with the configured stateGenerator
|
|
32610
|
+
*/
|
|
32611
|
+
async beginAuthorizationSession() {
|
|
32612
|
+
this._sessionState = await this.generateState();
|
|
32613
|
+
this._sessionRedirectUrl = this._redirectUrl;
|
|
32614
|
+
return this._sessionState;
|
|
32615
|
+
}
|
|
32616
|
+
/**
|
|
32617
|
+
* Clears the pinned authorization state (see beginAuthorizationSession) and
|
|
32618
|
+
* restores the configured redirect URL if applyResolvedRedirectUrl rebased
|
|
32619
|
+
* it to a fallback port during the session, so the next flow starts from
|
|
32620
|
+
* the preferred port again.
|
|
32621
|
+
*/
|
|
32622
|
+
endAuthorizationSession() {
|
|
32623
|
+
this._sessionState = void 0;
|
|
32624
|
+
if (this._sessionRedirectUrl !== void 0) {
|
|
32625
|
+
this._redirectUrl = this._sessionRedirectUrl;
|
|
32626
|
+
this._sessionRedirectUrl = void 0;
|
|
32627
|
+
}
|
|
32628
|
+
}
|
|
32629
|
+
/**
|
|
32630
|
+
* Points the provider at the callback URL that is actually bound.
|
|
32631
|
+
*
|
|
32632
|
+
* Loopback callback servers may bind a fallback port when the preferred one
|
|
32633
|
+
* is in use. Call this before triggering authorization so the authorization
|
|
32634
|
+
* request's redirect_uri matches the listening server, and so dynamic client
|
|
32635
|
+
* registration registers every candidate callback URL (see
|
|
32636
|
+
* getCallbackUrlCandidates) rather than only the preferred one.
|
|
32637
|
+
*
|
|
32638
|
+
* @param redirectUrl - The callback URL that is actually bound
|
|
32639
|
+
* @param registeredRedirectUris - The redirect URIs to register during dynamic client registration
|
|
32640
|
+
*/
|
|
32641
|
+
applyResolvedRedirectUrl(redirectUrl, registeredRedirectUris) {
|
|
32642
|
+
this._redirectUrl = redirectUrl;
|
|
32643
|
+
this._clientMetadata = {
|
|
32644
|
+
...this._clientMetadata,
|
|
32645
|
+
redirect_uris: registeredRedirectUris.map((uri) => uri.toString())
|
|
32646
|
+
};
|
|
32647
|
+
}
|
|
32648
|
+
/**
|
|
32649
|
+
* Loads information about this OAuth client.
|
|
32650
|
+
*/
|
|
32651
|
+
async clientInformation() {
|
|
32652
|
+
if (this._clientInfo) {
|
|
32653
|
+
return this._clientInfo;
|
|
32654
|
+
}
|
|
32655
|
+
const stored = await this.storage.get("client_info");
|
|
32656
|
+
if (stored) {
|
|
32657
|
+
try {
|
|
32658
|
+
return JSON.parse(stored);
|
|
32659
|
+
} catch {
|
|
32660
|
+
}
|
|
32661
|
+
}
|
|
32662
|
+
return void 0;
|
|
32663
|
+
}
|
|
32664
|
+
/**
|
|
32665
|
+
* Saves dynamically registered client information.
|
|
32666
|
+
*/
|
|
32667
|
+
async saveClientInformation(clientInformation) {
|
|
32668
|
+
this._clientInfo = clientInformation;
|
|
32669
|
+
await this.storage.set("client_info", JSON.stringify(clientInformation));
|
|
32670
|
+
}
|
|
32671
|
+
/**
|
|
32672
|
+
* Loads existing OAuth tokens.
|
|
32673
|
+
*/
|
|
32674
|
+
async tokens() {
|
|
32675
|
+
const stored = await this.storage.get("tokens");
|
|
32676
|
+
if (stored) {
|
|
32677
|
+
try {
|
|
32678
|
+
return JSON.parse(stored);
|
|
32679
|
+
} catch {
|
|
32680
|
+
}
|
|
32681
|
+
}
|
|
32682
|
+
return void 0;
|
|
32683
|
+
}
|
|
32684
|
+
/**
|
|
32685
|
+
* Stores new OAuth tokens after successful authorization.
|
|
32686
|
+
*/
|
|
32687
|
+
async saveTokens(tokens) {
|
|
32688
|
+
await this.storage.set("tokens", JSON.stringify(tokens));
|
|
32689
|
+
}
|
|
32690
|
+
/**
|
|
32691
|
+
* Invoked to redirect the user agent to the authorization URL.
|
|
32692
|
+
*/
|
|
32693
|
+
async redirectToAuthorization(authorizationUrl) {
|
|
32694
|
+
if (this.onRedirect) {
|
|
32695
|
+
await this.onRedirect(authorizationUrl);
|
|
32696
|
+
} else {
|
|
32697
|
+
console.info(`Authorization required. Please visit: ${authorizationUrl.toString()}`);
|
|
32698
|
+
}
|
|
32699
|
+
}
|
|
32700
|
+
/**
|
|
32701
|
+
* Saves a PKCE code verifier before redirecting to authorization.
|
|
32702
|
+
*/
|
|
32703
|
+
async saveCodeVerifier(codeVerifier) {
|
|
32704
|
+
await this.storage.set("code_verifier", codeVerifier);
|
|
32705
|
+
}
|
|
32706
|
+
/**
|
|
32707
|
+
* Loads the PKCE code verifier for validating authorization result.
|
|
32708
|
+
*/
|
|
32709
|
+
async codeVerifier() {
|
|
32710
|
+
const verifier = await this.storage.get("code_verifier");
|
|
32711
|
+
if (!verifier) {
|
|
32712
|
+
throw new Error("No code verifier found. Authorization flow may not have started properly.");
|
|
32713
|
+
}
|
|
32714
|
+
return verifier;
|
|
32715
|
+
}
|
|
32716
|
+
/**
|
|
32717
|
+
* Invalidate credentials when server indicates they're no longer valid.
|
|
32718
|
+
*/
|
|
32719
|
+
async invalidateCredentials(scope) {
|
|
32720
|
+
switch (scope) {
|
|
32721
|
+
case "all":
|
|
32722
|
+
await this.storage.delete("tokens");
|
|
32723
|
+
await this.storage.delete("client_info");
|
|
32724
|
+
await this.storage.delete("code_verifier");
|
|
32725
|
+
this._clientInfo = void 0;
|
|
32726
|
+
break;
|
|
32727
|
+
case "client":
|
|
32728
|
+
await this.storage.delete("client_info");
|
|
32729
|
+
this._clientInfo = void 0;
|
|
32730
|
+
break;
|
|
32731
|
+
case "tokens":
|
|
32732
|
+
await this.storage.delete("tokens");
|
|
32733
|
+
break;
|
|
32734
|
+
case "verifier":
|
|
32735
|
+
await this.storage.delete("code_verifier");
|
|
32736
|
+
break;
|
|
32737
|
+
}
|
|
32738
|
+
}
|
|
32739
|
+
/**
|
|
32740
|
+
* Clear all stored OAuth data.
|
|
32741
|
+
* Useful for logging out or resetting state.
|
|
32742
|
+
*/
|
|
32743
|
+
async clear() {
|
|
32744
|
+
await this.invalidateCredentials("all");
|
|
32745
|
+
}
|
|
32746
|
+
/**
|
|
32747
|
+
* Check if the provider has valid (non-expired) tokens.
|
|
32748
|
+
*/
|
|
32749
|
+
async hasValidTokens() {
|
|
32750
|
+
const currentTokens = await this.tokens();
|
|
32751
|
+
if (!currentTokens) return false;
|
|
32752
|
+
if (!currentTokens.access_token) return false;
|
|
32753
|
+
return true;
|
|
32754
|
+
}
|
|
32755
|
+
};
|
|
32756
|
+
function createSimpleTokenProvider(accessToken, options) {
|
|
32757
|
+
const tokens = {
|
|
32758
|
+
access_token: accessToken,
|
|
32759
|
+
token_type: options.tokenType ?? "Bearer",
|
|
32760
|
+
refresh_token: options.refreshToken,
|
|
32761
|
+
expires_in: options.expiresIn,
|
|
32762
|
+
scope: options.scope
|
|
32763
|
+
};
|
|
32764
|
+
const storage = new InMemoryOAuthStorage();
|
|
32765
|
+
storage.set("tokens", JSON.stringify(tokens));
|
|
32766
|
+
if (options.clientInformation) {
|
|
32767
|
+
storage.set("client_info", JSON.stringify(options.clientInformation));
|
|
32768
|
+
}
|
|
32769
|
+
return new MCPOAuthClientProvider({
|
|
32770
|
+
redirectUrl: options.redirectUrl,
|
|
32771
|
+
clientMetadata: options.clientMetadata,
|
|
32772
|
+
clientInformation: options.clientInformation,
|
|
32773
|
+
storage
|
|
32774
|
+
});
|
|
32775
|
+
}
|
|
32201
32776
|
var MCPClientServerProxy = class extends mcp.MCPServerBase {
|
|
32202
32777
|
clientGetter;
|
|
32203
32778
|
cachedClient = null;
|
|
@@ -32337,12 +32912,25 @@ var MCPClientServerProxy = class extends mcp.MCPServerBase {
|
|
|
32337
32912
|
// src/client/configuration.ts
|
|
32338
32913
|
var mcpClientInstances = /* @__PURE__ */ new Map();
|
|
32339
32914
|
var TOOL_DISCOVERY_MAX_ATTEMPTS = 2;
|
|
32915
|
+
var LOOPBACK_IPV4 = /^127\.(?:\d{1,3})\.(?:\d{1,3})\.(?:\d{1,3})$/;
|
|
32916
|
+
function isLoopbackHostname(hostname3) {
|
|
32917
|
+
return hostname3 === "localhost" || hostname3 === "[::1]" || hostname3 === "::1" || LOOPBACK_IPV4.test(hostname3);
|
|
32918
|
+
}
|
|
32340
32919
|
var MCPClient = class extends base.MastraBase {
|
|
32341
32920
|
serverConfigs = {};
|
|
32342
32921
|
id;
|
|
32343
32922
|
defaultTimeout;
|
|
32344
32923
|
mcpClientsById = /* @__PURE__ */ new Map();
|
|
32345
32924
|
disconnectPromise = null;
|
|
32925
|
+
authFlowsByServer = /* @__PURE__ */ new Map();
|
|
32926
|
+
authCallbackServersByServer = /* @__PURE__ */ new Map();
|
|
32927
|
+
/**
|
|
32928
|
+
* Per-server abort controllers for in-flight authorization flows. Created
|
|
32929
|
+
* synchronously at the start of {@link runAuthorizationFlow} — before the
|
|
32930
|
+
* callback server exists — so cancel/disconnect can interrupt the setup phase
|
|
32931
|
+
* (discovery, registration, port binding) and not just the waitForCode wait.
|
|
32932
|
+
*/
|
|
32933
|
+
authAbortControllersByServer = /* @__PURE__ */ new Map();
|
|
32346
32934
|
/**
|
|
32347
32935
|
* Creates a new MCPClient instance for managing MCP server connections.
|
|
32348
32936
|
*
|
|
@@ -33002,6 +33590,15 @@ To fix this you have three different options:
|
|
|
33002
33590
|
this.disconnectPromise = (async () => {
|
|
33003
33591
|
try {
|
|
33004
33592
|
mcpClientInstances.delete(this.id);
|
|
33593
|
+
const pendingFlows = Array.from(this.authFlowsByServer.values());
|
|
33594
|
+
for (const controller of this.authAbortControllersByServer.values()) {
|
|
33595
|
+
controller.abort();
|
|
33596
|
+
}
|
|
33597
|
+
await Promise.allSettled(Array.from(this.authCallbackServersByServer.values()).map((server) => server.close()));
|
|
33598
|
+
await Promise.allSettled(pendingFlows);
|
|
33599
|
+
this.authAbortControllersByServer.clear();
|
|
33600
|
+
this.authCallbackServersByServer.clear();
|
|
33601
|
+
this.authFlowsByServer.clear();
|
|
33005
33602
|
await Promise.allSettled(Array.from(this.mcpClientsById.values()).map((client) => client.disconnect()));
|
|
33006
33603
|
this.mcpClientsById.clear();
|
|
33007
33604
|
} finally {
|
|
@@ -33033,6 +33630,151 @@ To fix this you have three different options:
|
|
|
33033
33630
|
await this.getConnectedClientForServer(serverName);
|
|
33034
33631
|
}
|
|
33035
33632
|
}
|
|
33633
|
+
/**
|
|
33634
|
+
* Runs the interactive OAuth authorization-code flow for a server.
|
|
33635
|
+
*
|
|
33636
|
+
* Requires the server to be configured with an MCPOAuthClientProvider whose
|
|
33637
|
+
* redirect URL points at a loopback address. The flow:
|
|
33638
|
+
*
|
|
33639
|
+
* 1. Starts a loopback callback server on the redirect URL's port (falling
|
|
33640
|
+
* back to the next sequential ports when it is in use)
|
|
33641
|
+
* 2. Attempts a connection so the SDK runs discovery and dynamic client
|
|
33642
|
+
* registration, delivering the authorization URL through the provider's
|
|
33643
|
+
* `onRedirectToAuthorization` callback — the host directs the user there
|
|
33644
|
+
* 3. Waits for the browser to deliver the authorization code, validates the
|
|
33645
|
+
* OAuth state, exchanges the code for tokens, and reconnects
|
|
33646
|
+
*
|
|
33647
|
+
* Concurrent calls for the same server join the pending flow (the joiner's
|
|
33648
|
+
* options are ignored — the pending flow keeps its own timeout); different
|
|
33649
|
+
* servers authenticate independently. Each server needs its own provider
|
|
33650
|
+
* instance: the flow pins session state on the provider, so sharing one
|
|
33651
|
+
* MCPOAuthClientProvider across servers is not supported. Hosts with custom
|
|
33652
|
+
* redirect handling (e.g. a web app with an HTTPS redirect URL) should
|
|
33653
|
+
* drive MCPOAuthClientProvider directly instead.
|
|
33654
|
+
*
|
|
33655
|
+
* @param serverName - The name of the server to authenticate (must match a key in `servers`)
|
|
33656
|
+
* @param options.timeoutMs - How long to wait for the browser callback (default 5 minutes)
|
|
33657
|
+
* @throws {Error} If the server has no MCPOAuthClientProvider or its redirect URL is not loopback
|
|
33658
|
+
*
|
|
33659
|
+
* @example
|
|
33660
|
+
* ```typescript
|
|
33661
|
+
* if (mcp.getServerAuthState('weatherServer') === 'needs-auth') {
|
|
33662
|
+
* await mcp.authenticate('weatherServer');
|
|
33663
|
+
* }
|
|
33664
|
+
* ```
|
|
33665
|
+
*/
|
|
33666
|
+
async authenticate(serverName, options) {
|
|
33667
|
+
if (this.disconnectPromise) {
|
|
33668
|
+
await this.disconnectPromise.catch(() => {
|
|
33669
|
+
});
|
|
33670
|
+
}
|
|
33671
|
+
const pendingFlow = this.authFlowsByServer.get(serverName);
|
|
33672
|
+
if (pendingFlow) {
|
|
33673
|
+
return pendingFlow;
|
|
33674
|
+
}
|
|
33675
|
+
const flow = this.runAuthorizationFlow(serverName, options).finally(() => {
|
|
33676
|
+
this.authFlowsByServer.delete(serverName);
|
|
33677
|
+
});
|
|
33678
|
+
this.authFlowsByServer.set(serverName, flow);
|
|
33679
|
+
return flow;
|
|
33680
|
+
}
|
|
33681
|
+
/**
|
|
33682
|
+
* OAuth authorization state of a configured server.
|
|
33683
|
+
*
|
|
33684
|
+
* Returns `undefined` for servers without an authProvider and for servers
|
|
33685
|
+
* that have not attempted a connection yet.
|
|
33686
|
+
*/
|
|
33687
|
+
getServerAuthState(serverName) {
|
|
33688
|
+
return this.mcpClientsById.get(serverName)?.authState;
|
|
33689
|
+
}
|
|
33690
|
+
async runAuthorizationFlow(serverName, options) {
|
|
33691
|
+
const abortController = new AbortController();
|
|
33692
|
+
this.authAbortControllersByServer.set(serverName, abortController);
|
|
33693
|
+
const throwIfAborted = () => {
|
|
33694
|
+
if (abortController.signal.aborted) {
|
|
33695
|
+
throw new Error(`Authentication for MCP server ${serverName} was cancelled.`);
|
|
33696
|
+
}
|
|
33697
|
+
};
|
|
33698
|
+
let provider;
|
|
33699
|
+
let sessionStarted = false;
|
|
33700
|
+
let callbackServer;
|
|
33701
|
+
try {
|
|
33702
|
+
const config2 = this.getServerConfig(serverName);
|
|
33703
|
+
const candidateProvider = config2.authProvider;
|
|
33704
|
+
if (!(candidateProvider instanceof MCPOAuthClientProvider)) {
|
|
33705
|
+
throw new Error(
|
|
33706
|
+
`Cannot authenticate MCP server ${serverName}: it is not configured with an MCPOAuthClientProvider.`
|
|
33707
|
+
);
|
|
33708
|
+
}
|
|
33709
|
+
provider = candidateProvider;
|
|
33710
|
+
const redirectUrl = new URL(provider.redirectUrl.toString());
|
|
33711
|
+
if (redirectUrl.protocol !== "http:" || !isLoopbackHostname(redirectUrl.hostname)) {
|
|
33712
|
+
throw new Error(
|
|
33713
|
+
`Cannot authenticate MCP server ${serverName}: the provider's redirect URL must be a loopback address, got ${redirectUrl.origin}.`
|
|
33714
|
+
);
|
|
33715
|
+
}
|
|
33716
|
+
const state = await provider.beginAuthorizationSession();
|
|
33717
|
+
sessionStarted = true;
|
|
33718
|
+
throwIfAborted();
|
|
33719
|
+
callbackServer = await createOAuthCallbackServer({ redirectUrl, state });
|
|
33720
|
+
throwIfAborted();
|
|
33721
|
+
this.authCallbackServersByServer.set(serverName, callbackServer);
|
|
33722
|
+
provider.applyResolvedRedirectUrl(callbackServer.url, getCallbackUrlCandidates(redirectUrl));
|
|
33723
|
+
const clientInfo = await provider.clientInformation();
|
|
33724
|
+
if (clientInfo?.redirect_uris && !clientInfo.redirect_uris.includes(callbackServer.url.toString())) {
|
|
33725
|
+
await provider.invalidateCredentials("client");
|
|
33726
|
+
}
|
|
33727
|
+
const client = await this.getClientForServer(serverName);
|
|
33728
|
+
try {
|
|
33729
|
+
await client.connect();
|
|
33730
|
+
return;
|
|
33731
|
+
} catch (error51) {
|
|
33732
|
+
if (!(error51 instanceof auth_js.UnauthorizedError)) {
|
|
33733
|
+
throw this.handleConnectError(serverName, error51);
|
|
33734
|
+
}
|
|
33735
|
+
}
|
|
33736
|
+
const { code } = await callbackServer.waitForCode(options);
|
|
33737
|
+
await client.finishAuth(code);
|
|
33738
|
+
try {
|
|
33739
|
+
await client.connect();
|
|
33740
|
+
} catch (error51) {
|
|
33741
|
+
throw error51 instanceof auth_js.UnauthorizedError ? error51 : this.handleConnectError(serverName, error51);
|
|
33742
|
+
}
|
|
33743
|
+
} finally {
|
|
33744
|
+
this.authCallbackServersByServer.delete(serverName);
|
|
33745
|
+
this.authAbortControllersByServer.delete(serverName);
|
|
33746
|
+
if (sessionStarted) {
|
|
33747
|
+
provider?.endAuthorizationSession();
|
|
33748
|
+
}
|
|
33749
|
+
await callbackServer?.close();
|
|
33750
|
+
}
|
|
33751
|
+
}
|
|
33752
|
+
/**
|
|
33753
|
+
* Cancels a pending {@link authenticate} flow for a server.
|
|
33754
|
+
*
|
|
33755
|
+
* Tears down the loopback callback server immediately — the pending
|
|
33756
|
+
* authenticate() call rejects. Useful when the user closed the browser
|
|
33757
|
+
* without completing consent, which the host cannot observe.
|
|
33758
|
+
*
|
|
33759
|
+
* The resulting auth state depends on how far the flow had progressed: a flow
|
|
33760
|
+
* cancelled after the server rejected the connection with a 401 stays in the
|
|
33761
|
+
* `needs-auth` state so it can be retried right away, while a flow cancelled
|
|
33762
|
+
* during the setup phase (before any connection was attempted) leaves the
|
|
33763
|
+
* state unchanged — typically `undefined`.
|
|
33764
|
+
*
|
|
33765
|
+
* @param serverName - The name of the server whose flow to cancel
|
|
33766
|
+
* @returns `true` if a pending flow was cancelled, `false` when no flow was pending
|
|
33767
|
+
*/
|
|
33768
|
+
async cancelAuthentication(serverName) {
|
|
33769
|
+
const pendingFlow = this.authFlowsByServer.get(serverName);
|
|
33770
|
+
if (!pendingFlow) {
|
|
33771
|
+
return false;
|
|
33772
|
+
}
|
|
33773
|
+
this.authAbortControllersByServer.get(serverName)?.abort();
|
|
33774
|
+
await this.authCallbackServersByServer.get(serverName)?.close();
|
|
33775
|
+
await pendingFlow.catch(() => void 0);
|
|
33776
|
+
return true;
|
|
33777
|
+
}
|
|
33036
33778
|
/**
|
|
33037
33779
|
* Returns instructions advertised by connected MCP servers during initialize.
|
|
33038
33780
|
*
|
|
@@ -33318,7 +34060,9 @@ To fix this you have three different options:
|
|
|
33318
34060
|
);
|
|
33319
34061
|
this.logger.trackException(mastraError);
|
|
33320
34062
|
this.logger.error("MCPClient errored connecting to MCP server:", { error: mastraError.toString() });
|
|
33321
|
-
|
|
34063
|
+
if (!(error51 instanceof auth_js.UnauthorizedError)) {
|
|
34064
|
+
this.mcpClientsById.delete(name);
|
|
34065
|
+
}
|
|
33322
34066
|
return mastraError;
|
|
33323
34067
|
}
|
|
33324
34068
|
async getConnectedClientForServer(serverName) {
|
|
@@ -33349,184 +34093,6 @@ To fix this you have three different options:
|
|
|
33349
34093
|
}
|
|
33350
34094
|
};
|
|
33351
34095
|
|
|
33352
|
-
// src/client/oauth-provider.ts
|
|
33353
|
-
var InMemoryOAuthStorage = class {
|
|
33354
|
-
data = /* @__PURE__ */ new Map();
|
|
33355
|
-
set(key, value) {
|
|
33356
|
-
this.data.set(key, value);
|
|
33357
|
-
}
|
|
33358
|
-
get(key) {
|
|
33359
|
-
return this.data.get(key);
|
|
33360
|
-
}
|
|
33361
|
-
delete(key) {
|
|
33362
|
-
this.data.delete(key);
|
|
33363
|
-
}
|
|
33364
|
-
clear() {
|
|
33365
|
-
this.data.clear();
|
|
33366
|
-
}
|
|
33367
|
-
};
|
|
33368
|
-
var MCPOAuthClientProvider = class {
|
|
33369
|
-
_redirectUrl;
|
|
33370
|
-
_clientMetadata;
|
|
33371
|
-
storage;
|
|
33372
|
-
onRedirect;
|
|
33373
|
-
generateState;
|
|
33374
|
-
_clientInfo;
|
|
33375
|
-
constructor(options) {
|
|
33376
|
-
this._redirectUrl = options.redirectUrl;
|
|
33377
|
-
this._clientMetadata = options.clientMetadata;
|
|
33378
|
-
this._clientInfo = options.clientInformation;
|
|
33379
|
-
this.storage = options.storage ?? new InMemoryOAuthStorage();
|
|
33380
|
-
this.onRedirect = options.onRedirectToAuthorization;
|
|
33381
|
-
this.generateState = options.stateGenerator ?? (() => crypto.randomUUID());
|
|
33382
|
-
}
|
|
33383
|
-
/**
|
|
33384
|
-
* The URL to redirect the user agent to after authorization.
|
|
33385
|
-
*/
|
|
33386
|
-
get redirectUrl() {
|
|
33387
|
-
return this._redirectUrl;
|
|
33388
|
-
}
|
|
33389
|
-
/**
|
|
33390
|
-
* Metadata about this OAuth client.
|
|
33391
|
-
*/
|
|
33392
|
-
get clientMetadata() {
|
|
33393
|
-
return this._clientMetadata;
|
|
33394
|
-
}
|
|
33395
|
-
/**
|
|
33396
|
-
* Returns a OAuth2 state parameter.
|
|
33397
|
-
*/
|
|
33398
|
-
async state() {
|
|
33399
|
-
return this.generateState();
|
|
33400
|
-
}
|
|
33401
|
-
/**
|
|
33402
|
-
* Loads information about this OAuth client.
|
|
33403
|
-
*/
|
|
33404
|
-
async clientInformation() {
|
|
33405
|
-
if (this._clientInfo) {
|
|
33406
|
-
return this._clientInfo;
|
|
33407
|
-
}
|
|
33408
|
-
const stored = await this.storage.get("client_info");
|
|
33409
|
-
if (stored) {
|
|
33410
|
-
try {
|
|
33411
|
-
return JSON.parse(stored);
|
|
33412
|
-
} catch {
|
|
33413
|
-
}
|
|
33414
|
-
}
|
|
33415
|
-
return void 0;
|
|
33416
|
-
}
|
|
33417
|
-
/**
|
|
33418
|
-
* Saves dynamically registered client information.
|
|
33419
|
-
*/
|
|
33420
|
-
async saveClientInformation(clientInformation) {
|
|
33421
|
-
this._clientInfo = clientInformation;
|
|
33422
|
-
await this.storage.set("client_info", JSON.stringify(clientInformation));
|
|
33423
|
-
}
|
|
33424
|
-
/**
|
|
33425
|
-
* Loads existing OAuth tokens.
|
|
33426
|
-
*/
|
|
33427
|
-
async tokens() {
|
|
33428
|
-
const stored = await this.storage.get("tokens");
|
|
33429
|
-
if (stored) {
|
|
33430
|
-
try {
|
|
33431
|
-
return JSON.parse(stored);
|
|
33432
|
-
} catch {
|
|
33433
|
-
}
|
|
33434
|
-
}
|
|
33435
|
-
return void 0;
|
|
33436
|
-
}
|
|
33437
|
-
/**
|
|
33438
|
-
* Stores new OAuth tokens after successful authorization.
|
|
33439
|
-
*/
|
|
33440
|
-
async saveTokens(tokens) {
|
|
33441
|
-
await this.storage.set("tokens", JSON.stringify(tokens));
|
|
33442
|
-
}
|
|
33443
|
-
/**
|
|
33444
|
-
* Invoked to redirect the user agent to the authorization URL.
|
|
33445
|
-
*/
|
|
33446
|
-
async redirectToAuthorization(authorizationUrl) {
|
|
33447
|
-
if (this.onRedirect) {
|
|
33448
|
-
await this.onRedirect(authorizationUrl);
|
|
33449
|
-
} else {
|
|
33450
|
-
console.info(`Authorization required. Please visit: ${authorizationUrl.toString()}`);
|
|
33451
|
-
}
|
|
33452
|
-
}
|
|
33453
|
-
/**
|
|
33454
|
-
* Saves a PKCE code verifier before redirecting to authorization.
|
|
33455
|
-
*/
|
|
33456
|
-
async saveCodeVerifier(codeVerifier) {
|
|
33457
|
-
await this.storage.set("code_verifier", codeVerifier);
|
|
33458
|
-
}
|
|
33459
|
-
/**
|
|
33460
|
-
* Loads the PKCE code verifier for validating authorization result.
|
|
33461
|
-
*/
|
|
33462
|
-
async codeVerifier() {
|
|
33463
|
-
const verifier = await this.storage.get("code_verifier");
|
|
33464
|
-
if (!verifier) {
|
|
33465
|
-
throw new Error("No code verifier found. Authorization flow may not have started properly.");
|
|
33466
|
-
}
|
|
33467
|
-
return verifier;
|
|
33468
|
-
}
|
|
33469
|
-
/**
|
|
33470
|
-
* Invalidate credentials when server indicates they're no longer valid.
|
|
33471
|
-
*/
|
|
33472
|
-
async invalidateCredentials(scope) {
|
|
33473
|
-
switch (scope) {
|
|
33474
|
-
case "all":
|
|
33475
|
-
await this.storage.delete("tokens");
|
|
33476
|
-
await this.storage.delete("client_info");
|
|
33477
|
-
await this.storage.delete("code_verifier");
|
|
33478
|
-
this._clientInfo = void 0;
|
|
33479
|
-
break;
|
|
33480
|
-
case "client":
|
|
33481
|
-
await this.storage.delete("client_info");
|
|
33482
|
-
this._clientInfo = void 0;
|
|
33483
|
-
break;
|
|
33484
|
-
case "tokens":
|
|
33485
|
-
await this.storage.delete("tokens");
|
|
33486
|
-
break;
|
|
33487
|
-
case "verifier":
|
|
33488
|
-
await this.storage.delete("code_verifier");
|
|
33489
|
-
break;
|
|
33490
|
-
}
|
|
33491
|
-
}
|
|
33492
|
-
/**
|
|
33493
|
-
* Clear all stored OAuth data.
|
|
33494
|
-
* Useful for logging out or resetting state.
|
|
33495
|
-
*/
|
|
33496
|
-
async clear() {
|
|
33497
|
-
await this.invalidateCredentials("all");
|
|
33498
|
-
}
|
|
33499
|
-
/**
|
|
33500
|
-
* Check if the provider has valid (non-expired) tokens.
|
|
33501
|
-
*/
|
|
33502
|
-
async hasValidTokens() {
|
|
33503
|
-
const currentTokens = await this.tokens();
|
|
33504
|
-
if (!currentTokens) return false;
|
|
33505
|
-
if (!currentTokens.access_token) return false;
|
|
33506
|
-
return true;
|
|
33507
|
-
}
|
|
33508
|
-
};
|
|
33509
|
-
function createSimpleTokenProvider(accessToken, options) {
|
|
33510
|
-
const tokens = {
|
|
33511
|
-
access_token: accessToken,
|
|
33512
|
-
token_type: options.tokenType ?? "Bearer",
|
|
33513
|
-
refresh_token: options.refreshToken,
|
|
33514
|
-
expires_in: options.expiresIn,
|
|
33515
|
-
scope: options.scope
|
|
33516
|
-
};
|
|
33517
|
-
const storage = new InMemoryOAuthStorage();
|
|
33518
|
-
storage.set("tokens", JSON.stringify(tokens));
|
|
33519
|
-
if (options.clientInformation) {
|
|
33520
|
-
storage.set("client_info", JSON.stringify(options.clientInformation));
|
|
33521
|
-
}
|
|
33522
|
-
return new MCPOAuthClientProvider({
|
|
33523
|
-
redirectUrl: options.redirectUrl,
|
|
33524
|
-
clientMetadata: options.clientMetadata,
|
|
33525
|
-
clientInformation: options.clientInformation,
|
|
33526
|
-
storage
|
|
33527
|
-
});
|
|
33528
|
-
}
|
|
33529
|
-
|
|
33530
34096
|
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono/4.12.30/1b2e4fcdfb5fc9f7f51bffc1540f859608c39e01fb7d73d8ab30d60a680eaffc/node_modules/hono/dist/utils/stream.js
|
|
33531
34097
|
var StreamingApi = class {
|
|
33532
34098
|
writer;
|
|
@@ -36215,44 +36781,6 @@ Provided arguments: ${JSON.stringify(args, null, 2)}`,
|
|
|
36215
36781
|
return { resources };
|
|
36216
36782
|
}
|
|
36217
36783
|
};
|
|
36218
|
-
function escapeHeaderValue(value) {
|
|
36219
|
-
return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
36220
|
-
}
|
|
36221
|
-
function generateWWWAuthenticateHeader(options = {}) {
|
|
36222
|
-
const params = [];
|
|
36223
|
-
if (options.resourceMetadataUrl) {
|
|
36224
|
-
params.push(`resource_metadata="${escapeHeaderValue(options.resourceMetadataUrl)}"`);
|
|
36225
|
-
}
|
|
36226
|
-
if (options.additionalParams) {
|
|
36227
|
-
for (const [key, value] of Object.entries(options.additionalParams)) {
|
|
36228
|
-
params.push(`${key}="${escapeHeaderValue(value)}"`);
|
|
36229
|
-
}
|
|
36230
|
-
}
|
|
36231
|
-
if (params.length === 0) {
|
|
36232
|
-
return "Bearer";
|
|
36233
|
-
}
|
|
36234
|
-
return `Bearer ${params.join(", ")}`;
|
|
36235
|
-
}
|
|
36236
|
-
function generateProtectedResourceMetadata(config2) {
|
|
36237
|
-
return {
|
|
36238
|
-
resource: config2.resource,
|
|
36239
|
-
authorization_servers: config2.authorizationServers,
|
|
36240
|
-
scopes_supported: config2.scopesSupported ?? ["mcp:read", "mcp:write"],
|
|
36241
|
-
bearer_methods_supported: ["header"],
|
|
36242
|
-
...config2.resourceName && { resource_name: config2.resourceName },
|
|
36243
|
-
...config2.resourceDocumentation && {
|
|
36244
|
-
resource_documentation: config2.resourceDocumentation
|
|
36245
|
-
}
|
|
36246
|
-
};
|
|
36247
|
-
}
|
|
36248
|
-
function extractBearerToken(authHeader) {
|
|
36249
|
-
if (!authHeader) return void 0;
|
|
36250
|
-
const prefix = "bearer ";
|
|
36251
|
-
if (authHeader.length <= prefix.length) return void 0;
|
|
36252
|
-
if (authHeader.slice(0, prefix.length).toLowerCase() !== prefix) return void 0;
|
|
36253
|
-
const token = authHeader.slice(prefix.length).trim();
|
|
36254
|
-
return token || void 0;
|
|
36255
|
-
}
|
|
36256
36784
|
|
|
36257
36785
|
// src/server/oauth-middleware.ts
|
|
36258
36786
|
function createOAuthMiddleware(options) {
|
|
@@ -36478,11 +37006,13 @@ exports.MCPClientServerProxy = MCPClientServerProxy;
|
|
|
36478
37006
|
exports.MCPOAuthClientProvider = MCPOAuthClientProvider;
|
|
36479
37007
|
exports.MCPServer = MCPServer;
|
|
36480
37008
|
exports.createIntrospectionValidator = createIntrospectionValidator;
|
|
37009
|
+
exports.createOAuthCallbackServer = createOAuthCallbackServer;
|
|
36481
37010
|
exports.createOAuthMiddleware = createOAuthMiddleware;
|
|
36482
37011
|
exports.createSimpleTokenProvider = createSimpleTokenProvider;
|
|
36483
37012
|
exports.createStaticTokenValidator = createStaticTokenValidator;
|
|
36484
37013
|
exports.extractBearerToken = extractBearerToken;
|
|
36485
37014
|
exports.generateProtectedResourceMetadata = generateProtectedResourceMetadata;
|
|
36486
37015
|
exports.generateWWWAuthenticateHeader = generateWWWAuthenticateHeader;
|
|
37016
|
+
exports.getCallbackUrlCandidates = getCallbackUrlCandidates;
|
|
36487
37017
|
//# sourceMappingURL=index.cjs.map
|
|
36488
37018
|
//# sourceMappingURL=index.cjs.map
|