@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.js
CHANGED
|
@@ -10,8 +10,11 @@ import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/
|
|
|
10
10
|
import { DEFAULT_REQUEST_TIMEOUT_MSEC } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
11
11
|
import { LoggingMessageNotificationSchema, ListRootsRequestSchema, ListResourcesResultSchema, ReadResourceResultSchema, EmptyResultSchema, ListResourceTemplatesResultSchema, ListPromptsResultSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolListChangedNotificationSchema, ResourceUpdatedNotificationSchema, ResourceListChangedNotificationSchema, ElicitRequestSchema, ProgressNotificationSchema, ListToolsRequestSchema, CallToolRequestSchema, SetLevelRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, McpError, ErrorCode, ListResourceTemplatesRequestSchema, SubscribeRequestSchema, UnsubscribeRequestSchema, ListPromptsRequestSchema, PromptSchema, GetPromptRequestSchema, CallToolResultSchema, JSONRPCMessageSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
12
12
|
import { asyncExitHook, gracefulExit } from 'exit-hook';
|
|
13
|
-
import {
|
|
13
|
+
import { UnauthorizedError } from '@modelcontextprotocol/sdk/client/auth.js';
|
|
14
|
+
export { UnauthorizedError, auth, buildDiscoveryUrls, discoverAuthorizationServerMetadata, discoverOAuthMetadata, discoverOAuthProtectedResourceMetadata, exchangeAuthorization, extractResourceMetadataUrl, parseErrorResponse, refreshAuthorization, registerClient, selectResourceURL, startAuthorization } from '@modelcontextprotocol/sdk/client/auth.js';
|
|
15
|
+
import { createHash, randomUUID, timingSafeEqual } from 'crypto';
|
|
14
16
|
import equal from 'fast-deep-equal';
|
|
17
|
+
import { createServer } from 'http';
|
|
15
18
|
import { MCPServerBase } from '@mastra/core/mcp';
|
|
16
19
|
import { isStandardSchemaWithJSON as isStandardSchemaWithJSON$1, standardSchemaToJSONSchema } from '@mastra/core/schema';
|
|
17
20
|
import { readFileSync } from 'fs';
|
|
@@ -22,7 +25,6 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
|
22
25
|
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
|
|
23
26
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
24
27
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
25
|
-
export { UnauthorizedError, auth, buildDiscoveryUrls, discoverAuthorizationServerMetadata, discoverOAuthMetadata, discoverOAuthProtectedResourceMetadata, exchangeAuthorization, extractResourceMetadataUrl, parseErrorResponse, refreshAuthorization, registerClient, selectResourceURL, startAuthorization } from '@modelcontextprotocol/sdk/client/auth.js';
|
|
26
28
|
|
|
27
29
|
var __defProp = Object.defineProperty;
|
|
28
30
|
var __export = (target, all) => {
|
|
@@ -20119,9 +20121,9 @@ var require_json_schema_traverse = __commonJS({
|
|
|
20119
20121
|
}
|
|
20120
20122
|
});
|
|
20121
20123
|
|
|
20122
|
-
// ../schema-compat/dist/chunk-
|
|
20124
|
+
// ../schema-compat/dist/chunk-FIHBR42C.js
|
|
20123
20125
|
var require_code = __commonJS({
|
|
20124
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
20126
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/codegen/code.js"(exports) {
|
|
20125
20127
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20126
20128
|
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;
|
|
20127
20129
|
var _CodeOrName = class {
|
|
@@ -20272,7 +20274,7 @@ var require_code = __commonJS({
|
|
|
20272
20274
|
}
|
|
20273
20275
|
});
|
|
20274
20276
|
var require_scope = __commonJS({
|
|
20275
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
20277
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/codegen/scope.js"(exports) {
|
|
20276
20278
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20277
20279
|
exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
|
|
20278
20280
|
var code_1 = require_code();
|
|
@@ -20414,7 +20416,7 @@ var require_scope = __commonJS({
|
|
|
20414
20416
|
}
|
|
20415
20417
|
});
|
|
20416
20418
|
var require_codegen = __commonJS({
|
|
20417
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
20419
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/codegen/index.js"(exports) {
|
|
20418
20420
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20419
20421
|
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;
|
|
20420
20422
|
var code_1 = require_code();
|
|
@@ -21131,7 +21133,7 @@ var require_codegen = __commonJS({
|
|
|
21131
21133
|
}
|
|
21132
21134
|
});
|
|
21133
21135
|
var require_util = __commonJS({
|
|
21134
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21136
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/util.js"(exports) {
|
|
21135
21137
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21136
21138
|
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;
|
|
21137
21139
|
var codegen_1 = require_codegen();
|
|
@@ -21295,7 +21297,7 @@ var require_util = __commonJS({
|
|
|
21295
21297
|
}
|
|
21296
21298
|
});
|
|
21297
21299
|
var require_names = __commonJS({
|
|
21298
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21300
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/names.js"(exports) {
|
|
21299
21301
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21300
21302
|
var codegen_1 = require_codegen();
|
|
21301
21303
|
var names = {
|
|
@@ -21331,7 +21333,7 @@ var require_names = __commonJS({
|
|
|
21331
21333
|
}
|
|
21332
21334
|
});
|
|
21333
21335
|
var require_errors = __commonJS({
|
|
21334
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21336
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/errors.js"(exports) {
|
|
21335
21337
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21336
21338
|
exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;
|
|
21337
21339
|
var codegen_1 = require_codegen();
|
|
@@ -21450,7 +21452,7 @@ var require_errors = __commonJS({
|
|
|
21450
21452
|
}
|
|
21451
21453
|
});
|
|
21452
21454
|
var require_boolSchema = __commonJS({
|
|
21453
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21455
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports) {
|
|
21454
21456
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21455
21457
|
exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;
|
|
21456
21458
|
var errors_1 = require_errors();
|
|
@@ -21498,7 +21500,7 @@ var require_boolSchema = __commonJS({
|
|
|
21498
21500
|
}
|
|
21499
21501
|
});
|
|
21500
21502
|
var require_rules = __commonJS({
|
|
21501
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21503
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/rules.js"(exports) {
|
|
21502
21504
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21503
21505
|
exports.getRules = exports.isJSONType = void 0;
|
|
21504
21506
|
var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
|
|
@@ -21526,7 +21528,7 @@ var require_rules = __commonJS({
|
|
|
21526
21528
|
}
|
|
21527
21529
|
});
|
|
21528
21530
|
var require_applicability = __commonJS({
|
|
21529
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21531
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/applicability.js"(exports) {
|
|
21530
21532
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21531
21533
|
exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;
|
|
21532
21534
|
function schemaHasRulesForType({ schema, self }, type) {
|
|
@@ -21546,7 +21548,7 @@ var require_applicability = __commonJS({
|
|
|
21546
21548
|
}
|
|
21547
21549
|
});
|
|
21548
21550
|
var require_dataType = __commonJS({
|
|
21549
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21551
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/dataType.js"(exports) {
|
|
21550
21552
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21551
21553
|
exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;
|
|
21552
21554
|
var rules_1 = require_rules();
|
|
@@ -21727,7 +21729,7 @@ var require_dataType = __commonJS({
|
|
|
21727
21729
|
}
|
|
21728
21730
|
});
|
|
21729
21731
|
var require_defaults = __commonJS({
|
|
21730
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21732
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/defaults.js"(exports) {
|
|
21731
21733
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21732
21734
|
exports.assignDefaults = void 0;
|
|
21733
21735
|
var codegen_1 = require_codegen();
|
|
@@ -21761,7 +21763,7 @@ var require_defaults = __commonJS({
|
|
|
21761
21763
|
}
|
|
21762
21764
|
});
|
|
21763
21765
|
var require_code2 = __commonJS({
|
|
21764
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21766
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/code.js"(exports) {
|
|
21765
21767
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21766
21768
|
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;
|
|
21767
21769
|
var codegen_1 = require_codegen();
|
|
@@ -21891,7 +21893,7 @@ var require_code2 = __commonJS({
|
|
|
21891
21893
|
}
|
|
21892
21894
|
});
|
|
21893
21895
|
var require_keyword = __commonJS({
|
|
21894
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
21896
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/keyword.js"(exports) {
|
|
21895
21897
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21896
21898
|
exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0;
|
|
21897
21899
|
var codegen_1 = require_codegen();
|
|
@@ -22006,7 +22008,7 @@ var require_keyword = __commonJS({
|
|
|
22006
22008
|
}
|
|
22007
22009
|
});
|
|
22008
22010
|
var require_subschema = __commonJS({
|
|
22009
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
22011
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/subschema.js"(exports) {
|
|
22010
22012
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22011
22013
|
exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0;
|
|
22012
22014
|
var codegen_1 = require_codegen();
|
|
@@ -22118,7 +22120,7 @@ var require_fast_deep_equal = __commonJS({
|
|
|
22118
22120
|
}
|
|
22119
22121
|
});
|
|
22120
22122
|
var require_resolve = __commonJS({
|
|
22121
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
22123
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/resolve.js"(exports) {
|
|
22122
22124
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22123
22125
|
exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0;
|
|
22124
22126
|
var util_1 = require_util();
|
|
@@ -22271,7 +22273,7 @@ var require_resolve = __commonJS({
|
|
|
22271
22273
|
}
|
|
22272
22274
|
});
|
|
22273
22275
|
var require_validate = __commonJS({
|
|
22274
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
22276
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/validate/index.js"(exports) {
|
|
22275
22277
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22276
22278
|
exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0;
|
|
22277
22279
|
var boolSchema_1 = require_boolSchema();
|
|
@@ -22775,7 +22777,7 @@ var require_validate = __commonJS({
|
|
|
22775
22777
|
}
|
|
22776
22778
|
});
|
|
22777
22779
|
var require_validation_error = __commonJS({
|
|
22778
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
22780
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/runtime/validation_error.js"(exports) {
|
|
22779
22781
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22780
22782
|
var ValidationError = class extends Error {
|
|
22781
22783
|
constructor(errors) {
|
|
@@ -22788,7 +22790,7 @@ var require_validation_error = __commonJS({
|
|
|
22788
22790
|
}
|
|
22789
22791
|
});
|
|
22790
22792
|
var require_ref_error = __commonJS({
|
|
22791
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
22793
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/ref_error.js"(exports) {
|
|
22792
22794
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22793
22795
|
var resolve_1 = require_resolve();
|
|
22794
22796
|
var MissingRefError = class extends Error {
|
|
@@ -22802,7 +22804,7 @@ var require_ref_error = __commonJS({
|
|
|
22802
22804
|
}
|
|
22803
22805
|
});
|
|
22804
22806
|
var require_compile = __commonJS({
|
|
22805
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
22807
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/compile/index.js"(exports) {
|
|
22806
22808
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22807
22809
|
exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;
|
|
22808
22810
|
var codegen_1 = require_codegen();
|
|
@@ -23023,7 +23025,7 @@ var require_compile = __commonJS({
|
|
|
23023
23025
|
}
|
|
23024
23026
|
});
|
|
23025
23027
|
var require_data = __commonJS({
|
|
23026
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
23028
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/refs/data.json"(exports, module) {
|
|
23027
23029
|
module.exports = {
|
|
23028
23030
|
$id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
|
|
23029
23031
|
description: "Meta-schema for $data reference (JSON AnySchema extension proposal)",
|
|
@@ -23040,7 +23042,7 @@ var require_data = __commonJS({
|
|
|
23040
23042
|
}
|
|
23041
23043
|
});
|
|
23042
23044
|
var require_utils = __commonJS({
|
|
23043
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fast-uri/3.1.
|
|
23045
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fast-uri/3.1.4/7a4a15ca6e52b43729e575308419a557aad60270ad0b69ef14852015b4b55d46/node_modules/fast-uri/lib/utils.js"(exports, module) {
|
|
23044
23046
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
23045
23047
|
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);
|
|
23046
23048
|
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
@@ -23350,7 +23352,7 @@ var require_utils = __commonJS({
|
|
|
23350
23352
|
}
|
|
23351
23353
|
});
|
|
23352
23354
|
var require_schemes = __commonJS({
|
|
23353
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fast-uri/3.1.
|
|
23355
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fast-uri/3.1.4/7a4a15ca6e52b43729e575308419a557aad60270ad0b69ef14852015b4b55d46/node_modules/fast-uri/lib/schemes.js"(exports, module) {
|
|
23354
23356
|
var { isUUID } = require_utils();
|
|
23355
23357
|
var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
|
|
23356
23358
|
var supportedSchemeNames = (
|
|
@@ -23557,7 +23559,7 @@ var require_schemes = __commonJS({
|
|
|
23557
23559
|
}
|
|
23558
23560
|
});
|
|
23559
23561
|
var require_fast_uri = __commonJS({
|
|
23560
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fast-uri/3.1.
|
|
23562
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fast-uri/3.1.4/7a4a15ca6e52b43729e575308419a557aad60270ad0b69ef14852015b4b55d46/node_modules/fast-uri/index.js"(exports, module) {
|
|
23561
23563
|
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
23562
23564
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
23563
23565
|
function normalize(uri, options) {
|
|
@@ -23697,6 +23699,7 @@ var require_fast_uri = __commonJS({
|
|
|
23697
23699
|
return uriTokens.join("");
|
|
23698
23700
|
}
|
|
23699
23701
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
23702
|
+
var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
|
|
23700
23703
|
function getParseError(parsed, matches) {
|
|
23701
23704
|
if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
|
|
23702
23705
|
return 'URI path must start with "/" when authority is present.';
|
|
@@ -23726,6 +23729,11 @@ var require_fast_uri = __commonJS({
|
|
|
23726
23729
|
uri = "//" + uri;
|
|
23727
23730
|
}
|
|
23728
23731
|
}
|
|
23732
|
+
const authorityMatch = uri.match(AUTHORITY_PREFIX);
|
|
23733
|
+
if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
|
|
23734
|
+
parsed.error = "URI authority must not contain a literal backslash.";
|
|
23735
|
+
malformedAuthorityOrPort = true;
|
|
23736
|
+
}
|
|
23729
23737
|
const matches = uri.match(URI_PARSE);
|
|
23730
23738
|
if (matches) {
|
|
23731
23739
|
parsed.scheme = matches[1];
|
|
@@ -23769,7 +23777,7 @@ var require_fast_uri = __commonJS({
|
|
|
23769
23777
|
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
23770
23778
|
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
23771
23779
|
try {
|
|
23772
|
-
parsed.host = URL
|
|
23780
|
+
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
23773
23781
|
} catch (e) {
|
|
23774
23782
|
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
23775
23783
|
}
|
|
@@ -23840,7 +23848,7 @@ var require_fast_uri = __commonJS({
|
|
|
23840
23848
|
}
|
|
23841
23849
|
});
|
|
23842
23850
|
var require_uri = __commonJS({
|
|
23843
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
23851
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/runtime/uri.js"(exports) {
|
|
23844
23852
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23845
23853
|
var uri = require_fast_uri();
|
|
23846
23854
|
uri.code = 'require("ajv/dist/runtime/uri").default';
|
|
@@ -23848,7 +23856,7 @@ var require_uri = __commonJS({
|
|
|
23848
23856
|
}
|
|
23849
23857
|
});
|
|
23850
23858
|
var require_core = __commonJS({
|
|
23851
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
23859
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/core.js"(exports) {
|
|
23852
23860
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23853
23861
|
exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
|
|
23854
23862
|
var validate_1 = require_validate();
|
|
@@ -24456,7 +24464,7 @@ var require_core = __commonJS({
|
|
|
24456
24464
|
}
|
|
24457
24465
|
});
|
|
24458
24466
|
var require_id = __commonJS({
|
|
24459
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24467
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/core/id.js"(exports) {
|
|
24460
24468
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24461
24469
|
var def = {
|
|
24462
24470
|
keyword: "id",
|
|
@@ -24468,7 +24476,7 @@ var require_id = __commonJS({
|
|
|
24468
24476
|
}
|
|
24469
24477
|
});
|
|
24470
24478
|
var require_ref = __commonJS({
|
|
24471
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24479
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/core/ref.js"(exports) {
|
|
24472
24480
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24473
24481
|
exports.callRef = exports.getValidate = void 0;
|
|
24474
24482
|
var ref_error_1 = require_ref_error();
|
|
@@ -24587,7 +24595,7 @@ var require_ref = __commonJS({
|
|
|
24587
24595
|
}
|
|
24588
24596
|
});
|
|
24589
24597
|
var require_core2 = __commonJS({
|
|
24590
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24598
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/core/index.js"(exports) {
|
|
24591
24599
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24592
24600
|
var id_1 = require_id();
|
|
24593
24601
|
var ref_1 = require_ref();
|
|
@@ -24605,7 +24613,7 @@ var require_core2 = __commonJS({
|
|
|
24605
24613
|
}
|
|
24606
24614
|
});
|
|
24607
24615
|
var require_limitNumber = __commonJS({
|
|
24608
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24616
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports) {
|
|
24609
24617
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24610
24618
|
var codegen_1 = require_codegen();
|
|
24611
24619
|
var ops = codegen_1.operators;
|
|
@@ -24634,7 +24642,7 @@ var require_limitNumber = __commonJS({
|
|
|
24634
24642
|
}
|
|
24635
24643
|
});
|
|
24636
24644
|
var require_multipleOf = __commonJS({
|
|
24637
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24645
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports) {
|
|
24638
24646
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24639
24647
|
var codegen_1 = require_codegen();
|
|
24640
24648
|
var error51 = {
|
|
@@ -24659,7 +24667,7 @@ var require_multipleOf = __commonJS({
|
|
|
24659
24667
|
}
|
|
24660
24668
|
});
|
|
24661
24669
|
var require_ucs2length = __commonJS({
|
|
24662
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24670
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/runtime/ucs2length.js"(exports) {
|
|
24663
24671
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24664
24672
|
function ucs2length(str) {
|
|
24665
24673
|
const len = str.length;
|
|
@@ -24682,7 +24690,7 @@ var require_ucs2length = __commonJS({
|
|
|
24682
24690
|
}
|
|
24683
24691
|
});
|
|
24684
24692
|
var require_limitLength = __commonJS({
|
|
24685
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24693
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports) {
|
|
24686
24694
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24687
24695
|
var codegen_1 = require_codegen();
|
|
24688
24696
|
var util_1 = require_util();
|
|
@@ -24711,7 +24719,7 @@ var require_limitLength = __commonJS({
|
|
|
24711
24719
|
}
|
|
24712
24720
|
});
|
|
24713
24721
|
var require_pattern = __commonJS({
|
|
24714
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24722
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports) {
|
|
24715
24723
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24716
24724
|
var code_1 = require_code2();
|
|
24717
24725
|
var util_1 = require_util();
|
|
@@ -24745,7 +24753,7 @@ var require_pattern = __commonJS({
|
|
|
24745
24753
|
}
|
|
24746
24754
|
});
|
|
24747
24755
|
var require_limitProperties = __commonJS({
|
|
24748
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24756
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports) {
|
|
24749
24757
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24750
24758
|
var codegen_1 = require_codegen();
|
|
24751
24759
|
var error51 = {
|
|
@@ -24771,7 +24779,7 @@ var require_limitProperties = __commonJS({
|
|
|
24771
24779
|
}
|
|
24772
24780
|
});
|
|
24773
24781
|
var require_required = __commonJS({
|
|
24774
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24782
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/required.js"(exports) {
|
|
24775
24783
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24776
24784
|
var code_1 = require_code2();
|
|
24777
24785
|
var codegen_1 = require_codegen();
|
|
@@ -24850,7 +24858,7 @@ var require_required = __commonJS({
|
|
|
24850
24858
|
}
|
|
24851
24859
|
});
|
|
24852
24860
|
var require_limitItems = __commonJS({
|
|
24853
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24861
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports) {
|
|
24854
24862
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24855
24863
|
var codegen_1 = require_codegen();
|
|
24856
24864
|
var error51 = {
|
|
@@ -24876,7 +24884,7 @@ var require_limitItems = __commonJS({
|
|
|
24876
24884
|
}
|
|
24877
24885
|
});
|
|
24878
24886
|
var require_equal = __commonJS({
|
|
24879
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24887
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/runtime/equal.js"(exports) {
|
|
24880
24888
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24881
24889
|
var equal2 = require_fast_deep_equal();
|
|
24882
24890
|
equal2.code = 'require("ajv/dist/runtime/equal").default';
|
|
@@ -24884,7 +24892,7 @@ var require_equal = __commonJS({
|
|
|
24884
24892
|
}
|
|
24885
24893
|
});
|
|
24886
24894
|
var require_uniqueItems = __commonJS({
|
|
24887
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24895
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports) {
|
|
24888
24896
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24889
24897
|
var dataType_1 = require_dataType();
|
|
24890
24898
|
var codegen_1 = require_codegen();
|
|
@@ -24948,7 +24956,7 @@ var require_uniqueItems = __commonJS({
|
|
|
24948
24956
|
}
|
|
24949
24957
|
});
|
|
24950
24958
|
var require_const = __commonJS({
|
|
24951
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24959
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/const.js"(exports) {
|
|
24952
24960
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24953
24961
|
var codegen_1 = require_codegen();
|
|
24954
24962
|
var util_1 = require_util();
|
|
@@ -24974,7 +24982,7 @@ var require_const = __commonJS({
|
|
|
24974
24982
|
}
|
|
24975
24983
|
});
|
|
24976
24984
|
var require_enum = __commonJS({
|
|
24977
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
24985
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports) {
|
|
24978
24986
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24979
24987
|
var codegen_1 = require_codegen();
|
|
24980
24988
|
var util_1 = require_util();
|
|
@@ -25020,7 +25028,7 @@ var require_enum = __commonJS({
|
|
|
25020
25028
|
}
|
|
25021
25029
|
});
|
|
25022
25030
|
var require_validation = __commonJS({
|
|
25023
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25031
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/index.js"(exports) {
|
|
25024
25032
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25025
25033
|
var limitNumber_1 = require_limitNumber();
|
|
25026
25034
|
var multipleOf_1 = require_multipleOf();
|
|
@@ -25055,7 +25063,7 @@ var require_validation = __commonJS({
|
|
|
25055
25063
|
}
|
|
25056
25064
|
});
|
|
25057
25065
|
var require_additionalItems = __commonJS({
|
|
25058
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25066
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports) {
|
|
25059
25067
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25060
25068
|
exports.validateAdditionalItems = void 0;
|
|
25061
25069
|
var codegen_1 = require_codegen();
|
|
@@ -25105,7 +25113,7 @@ var require_additionalItems = __commonJS({
|
|
|
25105
25113
|
}
|
|
25106
25114
|
});
|
|
25107
25115
|
var require_items = __commonJS({
|
|
25108
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25116
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports) {
|
|
25109
25117
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25110
25118
|
exports.validateTuple = void 0;
|
|
25111
25119
|
var codegen_1 = require_codegen();
|
|
@@ -25159,7 +25167,7 @@ var require_items = __commonJS({
|
|
|
25159
25167
|
}
|
|
25160
25168
|
});
|
|
25161
25169
|
var require_prefixItems = __commonJS({
|
|
25162
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25170
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports) {
|
|
25163
25171
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25164
25172
|
var items_1 = require_items();
|
|
25165
25173
|
var def = {
|
|
@@ -25173,7 +25181,7 @@ var require_prefixItems = __commonJS({
|
|
|
25173
25181
|
}
|
|
25174
25182
|
});
|
|
25175
25183
|
var require_items2020 = __commonJS({
|
|
25176
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25184
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports) {
|
|
25177
25185
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25178
25186
|
var codegen_1 = require_codegen();
|
|
25179
25187
|
var util_1 = require_util();
|
|
@@ -25205,7 +25213,7 @@ var require_items2020 = __commonJS({
|
|
|
25205
25213
|
}
|
|
25206
25214
|
});
|
|
25207
25215
|
var require_contains = __commonJS({
|
|
25208
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25216
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports) {
|
|
25209
25217
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25210
25218
|
var codegen_1 = require_codegen();
|
|
25211
25219
|
var util_1 = require_util();
|
|
@@ -25296,7 +25304,7 @@ var require_contains = __commonJS({
|
|
|
25296
25304
|
}
|
|
25297
25305
|
});
|
|
25298
25306
|
var require_dependencies = __commonJS({
|
|
25299
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25307
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports) {
|
|
25300
25308
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25301
25309
|
exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
|
|
25302
25310
|
var codegen_1 = require_codegen();
|
|
@@ -25387,7 +25395,7 @@ var require_dependencies = __commonJS({
|
|
|
25387
25395
|
}
|
|
25388
25396
|
});
|
|
25389
25397
|
var require_propertyNames = __commonJS({
|
|
25390
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25398
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports) {
|
|
25391
25399
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25392
25400
|
var codegen_1 = require_codegen();
|
|
25393
25401
|
var util_1 = require_util();
|
|
@@ -25427,7 +25435,7 @@ var require_propertyNames = __commonJS({
|
|
|
25427
25435
|
}
|
|
25428
25436
|
});
|
|
25429
25437
|
var require_additionalProperties = __commonJS({
|
|
25430
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25438
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports) {
|
|
25431
25439
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25432
25440
|
var code_1 = require_code2();
|
|
25433
25441
|
var codegen_1 = require_codegen();
|
|
@@ -25530,7 +25538,7 @@ var require_additionalProperties = __commonJS({
|
|
|
25530
25538
|
}
|
|
25531
25539
|
});
|
|
25532
25540
|
var require_properties = __commonJS({
|
|
25533
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25541
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports) {
|
|
25534
25542
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25535
25543
|
var validate_1 = require_validate();
|
|
25536
25544
|
var code_1 = require_code2();
|
|
@@ -25585,7 +25593,7 @@ var require_properties = __commonJS({
|
|
|
25585
25593
|
}
|
|
25586
25594
|
});
|
|
25587
25595
|
var require_patternProperties = __commonJS({
|
|
25588
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25596
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports) {
|
|
25589
25597
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25590
25598
|
var code_1 = require_code2();
|
|
25591
25599
|
var codegen_1 = require_codegen();
|
|
@@ -25656,7 +25664,7 @@ var require_patternProperties = __commonJS({
|
|
|
25656
25664
|
}
|
|
25657
25665
|
});
|
|
25658
25666
|
var require_not = __commonJS({
|
|
25659
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25667
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports) {
|
|
25660
25668
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25661
25669
|
var util_1 = require_util();
|
|
25662
25670
|
var def = {
|
|
@@ -25684,7 +25692,7 @@ var require_not = __commonJS({
|
|
|
25684
25692
|
}
|
|
25685
25693
|
});
|
|
25686
25694
|
var require_anyOf = __commonJS({
|
|
25687
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25695
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports) {
|
|
25688
25696
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25689
25697
|
var code_1 = require_code2();
|
|
25690
25698
|
var def = {
|
|
@@ -25698,7 +25706,7 @@ var require_anyOf = __commonJS({
|
|
|
25698
25706
|
}
|
|
25699
25707
|
});
|
|
25700
25708
|
var require_oneOf = __commonJS({
|
|
25701
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25709
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports) {
|
|
25702
25710
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25703
25711
|
var codegen_1 = require_codegen();
|
|
25704
25712
|
var util_1 = require_util();
|
|
@@ -25753,7 +25761,7 @@ var require_oneOf = __commonJS({
|
|
|
25753
25761
|
}
|
|
25754
25762
|
});
|
|
25755
25763
|
var require_allOf = __commonJS({
|
|
25756
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25764
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports) {
|
|
25757
25765
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25758
25766
|
var util_1 = require_util();
|
|
25759
25767
|
var def = {
|
|
@@ -25777,7 +25785,7 @@ var require_allOf = __commonJS({
|
|
|
25777
25785
|
}
|
|
25778
25786
|
});
|
|
25779
25787
|
var require_if = __commonJS({
|
|
25780
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25788
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports) {
|
|
25781
25789
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25782
25790
|
var codegen_1 = require_codegen();
|
|
25783
25791
|
var util_1 = require_util();
|
|
@@ -25843,7 +25851,7 @@ var require_if = __commonJS({
|
|
|
25843
25851
|
}
|
|
25844
25852
|
});
|
|
25845
25853
|
var require_thenElse = __commonJS({
|
|
25846
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25854
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports) {
|
|
25847
25855
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25848
25856
|
var util_1 = require_util();
|
|
25849
25857
|
var def = {
|
|
@@ -25858,7 +25866,7 @@ var require_thenElse = __commonJS({
|
|
|
25858
25866
|
}
|
|
25859
25867
|
});
|
|
25860
25868
|
var require_applicator = __commonJS({
|
|
25861
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25869
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports) {
|
|
25862
25870
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25863
25871
|
var additionalItems_1 = require_additionalItems();
|
|
25864
25872
|
var prefixItems_1 = require_prefixItems();
|
|
@@ -25903,7 +25911,7 @@ var require_applicator = __commonJS({
|
|
|
25903
25911
|
}
|
|
25904
25912
|
});
|
|
25905
25913
|
var require_format = __commonJS({
|
|
25906
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
25914
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/format/format.js"(exports) {
|
|
25907
25915
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25908
25916
|
var codegen_1 = require_codegen();
|
|
25909
25917
|
var error51 = {
|
|
@@ -25990,7 +25998,7 @@ var require_format = __commonJS({
|
|
|
25990
25998
|
}
|
|
25991
25999
|
});
|
|
25992
26000
|
var require_format2 = __commonJS({
|
|
25993
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26001
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/format/index.js"(exports) {
|
|
25994
26002
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25995
26003
|
var format_1 = require_format();
|
|
25996
26004
|
var format = [format_1.default];
|
|
@@ -25998,7 +26006,7 @@ var require_format2 = __commonJS({
|
|
|
25998
26006
|
}
|
|
25999
26007
|
});
|
|
26000
26008
|
var require_metadata = __commonJS({
|
|
26001
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26009
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/metadata.js"(exports) {
|
|
26002
26010
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26003
26011
|
exports.contentVocabulary = exports.metadataVocabulary = void 0;
|
|
26004
26012
|
exports.metadataVocabulary = [
|
|
@@ -26018,7 +26026,7 @@ var require_metadata = __commonJS({
|
|
|
26018
26026
|
}
|
|
26019
26027
|
});
|
|
26020
26028
|
var require_draft7 = __commonJS({
|
|
26021
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26029
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/draft7.js"(exports) {
|
|
26022
26030
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26023
26031
|
var core_1 = require_core2();
|
|
26024
26032
|
var validation_1 = require_validation();
|
|
@@ -26037,7 +26045,7 @@ var require_draft7 = __commonJS({
|
|
|
26037
26045
|
}
|
|
26038
26046
|
});
|
|
26039
26047
|
var require_types = __commonJS({
|
|
26040
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26048
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports) {
|
|
26041
26049
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26042
26050
|
exports.DiscrError = void 0;
|
|
26043
26051
|
var DiscrError;
|
|
@@ -26048,7 +26056,7 @@ var require_types = __commonJS({
|
|
|
26048
26056
|
}
|
|
26049
26057
|
});
|
|
26050
26058
|
var require_discriminator = __commonJS({
|
|
26051
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26059
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports) {
|
|
26052
26060
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26053
26061
|
var codegen_1 = require_codegen();
|
|
26054
26062
|
var types_1 = require_types();
|
|
@@ -26150,7 +26158,7 @@ var require_discriminator = __commonJS({
|
|
|
26150
26158
|
}
|
|
26151
26159
|
});
|
|
26152
26160
|
var require_json_schema_draft_07 = __commonJS({
|
|
26153
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26161
|
+
"../../../../../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) {
|
|
26154
26162
|
module.exports = {
|
|
26155
26163
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
26156
26164
|
$id: "http://json-schema.org/draft-07/schema#",
|
|
@@ -26305,7 +26313,7 @@ var require_json_schema_draft_07 = __commonJS({
|
|
|
26305
26313
|
}
|
|
26306
26314
|
});
|
|
26307
26315
|
var require_ajv = __commonJS({
|
|
26308
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26316
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/ajv.js"(exports, module) {
|
|
26309
26317
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26310
26318
|
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;
|
|
26311
26319
|
var core_1 = require_core();
|
|
@@ -26372,7 +26380,7 @@ var require_ajv = __commonJS({
|
|
|
26372
26380
|
}
|
|
26373
26381
|
});
|
|
26374
26382
|
var require_dynamicAnchor = __commonJS({
|
|
26375
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26383
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js"(exports) {
|
|
26376
26384
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26377
26385
|
exports.dynamicAnchor = void 0;
|
|
26378
26386
|
var codegen_1 = require_codegen();
|
|
@@ -26404,7 +26412,7 @@ var require_dynamicAnchor = __commonJS({
|
|
|
26404
26412
|
}
|
|
26405
26413
|
});
|
|
26406
26414
|
var require_dynamicRef = __commonJS({
|
|
26407
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26415
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js"(exports) {
|
|
26408
26416
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26409
26417
|
exports.dynamicRef = void 0;
|
|
26410
26418
|
var codegen_1 = require_codegen();
|
|
@@ -26447,7 +26455,7 @@ var require_dynamicRef = __commonJS({
|
|
|
26447
26455
|
}
|
|
26448
26456
|
});
|
|
26449
26457
|
var require_recursiveAnchor = __commonJS({
|
|
26450
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26458
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js"(exports) {
|
|
26451
26459
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26452
26460
|
var dynamicAnchor_1 = require_dynamicAnchor();
|
|
26453
26461
|
var util_1 = require_util();
|
|
@@ -26465,7 +26473,7 @@ var require_recursiveAnchor = __commonJS({
|
|
|
26465
26473
|
}
|
|
26466
26474
|
});
|
|
26467
26475
|
var require_recursiveRef = __commonJS({
|
|
26468
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26476
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js"(exports) {
|
|
26469
26477
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26470
26478
|
var dynamicRef_1 = require_dynamicRef();
|
|
26471
26479
|
var def = {
|
|
@@ -26477,7 +26485,7 @@ var require_recursiveRef = __commonJS({
|
|
|
26477
26485
|
}
|
|
26478
26486
|
});
|
|
26479
26487
|
var require_dynamic = __commonJS({
|
|
26480
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26488
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/dynamic/index.js"(exports) {
|
|
26481
26489
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26482
26490
|
var dynamicAnchor_1 = require_dynamicAnchor();
|
|
26483
26491
|
var dynamicRef_1 = require_dynamicRef();
|
|
@@ -26488,7 +26496,7 @@ var require_dynamic = __commonJS({
|
|
|
26488
26496
|
}
|
|
26489
26497
|
});
|
|
26490
26498
|
var require_dependentRequired = __commonJS({
|
|
26491
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26499
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js"(exports) {
|
|
26492
26500
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26493
26501
|
var dependencies_1 = require_dependencies();
|
|
26494
26502
|
var def = {
|
|
@@ -26502,7 +26510,7 @@ var require_dependentRequired = __commonJS({
|
|
|
26502
26510
|
}
|
|
26503
26511
|
});
|
|
26504
26512
|
var require_dependentSchemas = __commonJS({
|
|
26505
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26513
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js"(exports) {
|
|
26506
26514
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26507
26515
|
var dependencies_1 = require_dependencies();
|
|
26508
26516
|
var def = {
|
|
@@ -26515,7 +26523,7 @@ var require_dependentSchemas = __commonJS({
|
|
|
26515
26523
|
}
|
|
26516
26524
|
});
|
|
26517
26525
|
var require_limitContains = __commonJS({
|
|
26518
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26526
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/validation/limitContains.js"(exports) {
|
|
26519
26527
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26520
26528
|
var util_1 = require_util();
|
|
26521
26529
|
var def = {
|
|
@@ -26532,7 +26540,7 @@ var require_limitContains = __commonJS({
|
|
|
26532
26540
|
}
|
|
26533
26541
|
});
|
|
26534
26542
|
var require_next = __commonJS({
|
|
26535
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26543
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/next.js"(exports) {
|
|
26536
26544
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26537
26545
|
var dependentRequired_1 = require_dependentRequired();
|
|
26538
26546
|
var dependentSchemas_1 = require_dependentSchemas();
|
|
@@ -26542,7 +26550,7 @@ var require_next = __commonJS({
|
|
|
26542
26550
|
}
|
|
26543
26551
|
});
|
|
26544
26552
|
var require_unevaluatedProperties = __commonJS({
|
|
26545
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26553
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js"(exports) {
|
|
26546
26554
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26547
26555
|
var codegen_1 = require_codegen();
|
|
26548
26556
|
var util_1 = require_util();
|
|
@@ -26605,7 +26613,7 @@ var require_unevaluatedProperties = __commonJS({
|
|
|
26605
26613
|
}
|
|
26606
26614
|
});
|
|
26607
26615
|
var require_unevaluatedItems = __commonJS({
|
|
26608
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26616
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js"(exports) {
|
|
26609
26617
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26610
26618
|
var codegen_1 = require_codegen();
|
|
26611
26619
|
var util_1 = require_util();
|
|
@@ -26646,7 +26654,7 @@ var require_unevaluatedItems = __commonJS({
|
|
|
26646
26654
|
}
|
|
26647
26655
|
});
|
|
26648
26656
|
var require_unevaluated = __commonJS({
|
|
26649
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26657
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/unevaluated/index.js"(exports) {
|
|
26650
26658
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26651
26659
|
var unevaluatedProperties_1 = require_unevaluatedProperties();
|
|
26652
26660
|
var unevaluatedItems_1 = require_unevaluatedItems();
|
|
@@ -26655,7 +26663,7 @@ var require_unevaluated = __commonJS({
|
|
|
26655
26663
|
}
|
|
26656
26664
|
});
|
|
26657
26665
|
var require_draft2020 = __commonJS({
|
|
26658
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26666
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/vocabularies/draft2020.js"(exports) {
|
|
26659
26667
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26660
26668
|
var core_1 = require_core2();
|
|
26661
26669
|
var validation_1 = require_validation();
|
|
@@ -26680,7 +26688,7 @@ var require_draft2020 = __commonJS({
|
|
|
26680
26688
|
}
|
|
26681
26689
|
});
|
|
26682
26690
|
var require_schema = __commonJS({
|
|
26683
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26691
|
+
"../../../../../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) {
|
|
26684
26692
|
module.exports = {
|
|
26685
26693
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26686
26694
|
$id: "https://json-schema.org/draft/2020-12/schema",
|
|
@@ -26738,7 +26746,7 @@ var require_schema = __commonJS({
|
|
|
26738
26746
|
}
|
|
26739
26747
|
});
|
|
26740
26748
|
var require_applicator2 = __commonJS({
|
|
26741
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26749
|
+
"../../../../../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) {
|
|
26742
26750
|
module.exports = {
|
|
26743
26751
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26744
26752
|
$id: "https://json-schema.org/draft/2020-12/meta/applicator",
|
|
@@ -26789,7 +26797,7 @@ var require_applicator2 = __commonJS({
|
|
|
26789
26797
|
}
|
|
26790
26798
|
});
|
|
26791
26799
|
var require_unevaluated2 = __commonJS({
|
|
26792
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26800
|
+
"../../../../../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) {
|
|
26793
26801
|
module.exports = {
|
|
26794
26802
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26795
26803
|
$id: "https://json-schema.org/draft/2020-12/meta/unevaluated",
|
|
@@ -26807,7 +26815,7 @@ var require_unevaluated2 = __commonJS({
|
|
|
26807
26815
|
}
|
|
26808
26816
|
});
|
|
26809
26817
|
var require_content = __commonJS({
|
|
26810
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26818
|
+
"../../../../../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) {
|
|
26811
26819
|
module.exports = {
|
|
26812
26820
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26813
26821
|
$id: "https://json-schema.org/draft/2020-12/meta/content",
|
|
@@ -26826,7 +26834,7 @@ var require_content = __commonJS({
|
|
|
26826
26834
|
}
|
|
26827
26835
|
});
|
|
26828
26836
|
var require_core3 = __commonJS({
|
|
26829
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26837
|
+
"../../../../../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) {
|
|
26830
26838
|
module.exports = {
|
|
26831
26839
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26832
26840
|
$id: "https://json-schema.org/draft/2020-12/meta/core",
|
|
@@ -26880,7 +26888,7 @@ var require_core3 = __commonJS({
|
|
|
26880
26888
|
}
|
|
26881
26889
|
});
|
|
26882
26890
|
var require_format_annotation = __commonJS({
|
|
26883
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26891
|
+
"../../../../../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) {
|
|
26884
26892
|
module.exports = {
|
|
26885
26893
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26886
26894
|
$id: "https://json-schema.org/draft/2020-12/meta/format-annotation",
|
|
@@ -26897,7 +26905,7 @@ var require_format_annotation = __commonJS({
|
|
|
26897
26905
|
}
|
|
26898
26906
|
});
|
|
26899
26907
|
var require_meta_data = __commonJS({
|
|
26900
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26908
|
+
"../../../../../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) {
|
|
26901
26909
|
module.exports = {
|
|
26902
26910
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26903
26911
|
$id: "https://json-schema.org/draft/2020-12/meta/meta-data",
|
|
@@ -26936,7 +26944,7 @@ var require_meta_data = __commonJS({
|
|
|
26936
26944
|
}
|
|
26937
26945
|
});
|
|
26938
26946
|
var require_validation2 = __commonJS({
|
|
26939
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
26947
|
+
"../../../../../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) {
|
|
26940
26948
|
module.exports = {
|
|
26941
26949
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
26942
26950
|
$id: "https://json-schema.org/draft/2020-12/meta/validation",
|
|
@@ -27029,7 +27037,7 @@ var require_validation2 = __commonJS({
|
|
|
27029
27037
|
}
|
|
27030
27038
|
});
|
|
27031
27039
|
var require_json_schema_2020_12 = __commonJS({
|
|
27032
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
27040
|
+
"../../../../../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) {
|
|
27033
27041
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27034
27042
|
var metaSchema = require_schema();
|
|
27035
27043
|
var applicator = require_applicator2();
|
|
@@ -27060,7 +27068,7 @@ var require_json_schema_2020_12 = __commonJS({
|
|
|
27060
27068
|
}
|
|
27061
27069
|
});
|
|
27062
27070
|
var require__ = __commonJS({
|
|
27063
|
-
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/
|
|
27071
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/c6b8e08046f415c29cce032dd0b2d6bb3a5ea0224f64b7de77f78cf4b40ba41e/node_modules/ajv/dist/2020.js"(exports, module) {
|
|
27064
27072
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27065
27073
|
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2020 = void 0;
|
|
27066
27074
|
var core_1 = require_core();
|
|
@@ -27345,7 +27353,7 @@ function toStandardSchema3(zodSchema2) {
|
|
|
27345
27353
|
return wrapper;
|
|
27346
27354
|
}
|
|
27347
27355
|
|
|
27348
|
-
// ../schema-compat/dist/chunk-
|
|
27356
|
+
// ../schema-compat/dist/chunk-C7LTFHL3.js
|
|
27349
27357
|
var SUPPORTED_TARGETS = /* @__PURE__ */ new Set(["draft-07", "draft-04", "draft-2020-12"]);
|
|
27350
27358
|
var ZOD_V4_TARGET_MAP = {
|
|
27351
27359
|
"draft-07": "draft-7",
|
|
@@ -31076,6 +31084,44 @@ function getMastraToolStrictMeta(meta3) {
|
|
|
31076
31084
|
const strict = mastraMeta[STRICT_META_KEY];
|
|
31077
31085
|
return typeof strict === "boolean" ? strict : void 0;
|
|
31078
31086
|
}
|
|
31087
|
+
function escapeHeaderValue(value) {
|
|
31088
|
+
return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
31089
|
+
}
|
|
31090
|
+
function generateWWWAuthenticateHeader(options = {}) {
|
|
31091
|
+
const params = [];
|
|
31092
|
+
if (options.resourceMetadataUrl) {
|
|
31093
|
+
params.push(`resource_metadata="${escapeHeaderValue(options.resourceMetadataUrl)}"`);
|
|
31094
|
+
}
|
|
31095
|
+
if (options.additionalParams) {
|
|
31096
|
+
for (const [key, value] of Object.entries(options.additionalParams)) {
|
|
31097
|
+
params.push(`${key}="${escapeHeaderValue(value)}"`);
|
|
31098
|
+
}
|
|
31099
|
+
}
|
|
31100
|
+
if (params.length === 0) {
|
|
31101
|
+
return "Bearer";
|
|
31102
|
+
}
|
|
31103
|
+
return `Bearer ${params.join(", ")}`;
|
|
31104
|
+
}
|
|
31105
|
+
function generateProtectedResourceMetadata(config2) {
|
|
31106
|
+
return {
|
|
31107
|
+
resource: config2.resource,
|
|
31108
|
+
authorization_servers: config2.authorizationServers,
|
|
31109
|
+
scopes_supported: config2.scopesSupported ?? ["mcp:read", "mcp:write"],
|
|
31110
|
+
bearer_methods_supported: ["header"],
|
|
31111
|
+
...config2.resourceName && { resource_name: config2.resourceName },
|
|
31112
|
+
...config2.resourceDocumentation && {
|
|
31113
|
+
resource_documentation: config2.resourceDocumentation
|
|
31114
|
+
}
|
|
31115
|
+
};
|
|
31116
|
+
}
|
|
31117
|
+
function extractBearerToken(authHeader) {
|
|
31118
|
+
if (!authHeader) return void 0;
|
|
31119
|
+
const prefix = "bearer ";
|
|
31120
|
+
if (authHeader.length <= prefix.length) return void 0;
|
|
31121
|
+
if (authHeader.slice(0, prefix.length).toLowerCase() !== prefix) return void 0;
|
|
31122
|
+
const token = authHeader.slice(prefix.length).trim();
|
|
31123
|
+
return token || void 0;
|
|
31124
|
+
}
|
|
31079
31125
|
|
|
31080
31126
|
// src/client/actions/elicitation.ts
|
|
31081
31127
|
var ElicitationClientActions = class {
|
|
@@ -31532,6 +31578,10 @@ var InternalMastraMCPClient = class extends MastraBase {
|
|
|
31532
31578
|
enableProgressTracking;
|
|
31533
31579
|
serverConfig;
|
|
31534
31580
|
transport;
|
|
31581
|
+
pendingAuthTransport;
|
|
31582
|
+
clientBaseOnClose;
|
|
31583
|
+
clientConnectionOnClose;
|
|
31584
|
+
_authState;
|
|
31535
31585
|
operationContextStore = new AsyncLocalStorage();
|
|
31536
31586
|
exitHookUnsubscribe;
|
|
31537
31587
|
sigTermHandler;
|
|
@@ -31716,14 +31766,14 @@ var InternalMastraMCPClient = class extends MastraBase {
|
|
|
31716
31766
|
this.log("debug", `Attempting to connect to URL: ${url2}`);
|
|
31717
31767
|
let shouldTrySSE = url2.pathname.endsWith(`/sse`);
|
|
31718
31768
|
if (!shouldTrySSE) {
|
|
31769
|
+
const streamableTransport = new StreamableHTTPClientTransport(url2, {
|
|
31770
|
+
requestInit,
|
|
31771
|
+
reconnectionOptions: this.serverConfig.reconnectionOptions,
|
|
31772
|
+
authProvider,
|
|
31773
|
+
fetch: fetch2
|
|
31774
|
+
});
|
|
31719
31775
|
try {
|
|
31720
31776
|
this.log("debug", "Trying Streamable HTTP transport...");
|
|
31721
|
-
const streamableTransport = new StreamableHTTPClientTransport(url2, {
|
|
31722
|
-
requestInit,
|
|
31723
|
-
reconnectionOptions: this.serverConfig.reconnectionOptions,
|
|
31724
|
-
authProvider,
|
|
31725
|
-
fetch: fetch2
|
|
31726
|
-
});
|
|
31727
31777
|
await this.client.connect(streamableTransport, {
|
|
31728
31778
|
timeout: connectTimeout ?? DEFAULT_SERVER_CONNECT_TIMEOUT_MSEC
|
|
31729
31779
|
});
|
|
@@ -31731,6 +31781,10 @@ var InternalMastraMCPClient = class extends MastraBase {
|
|
|
31731
31781
|
this.log("debug", "Successfully connected using Streamable HTTP transport.");
|
|
31732
31782
|
} catch (error51) {
|
|
31733
31783
|
this.log("debug", `Streamable HTTP transport failed: ${error51}`);
|
|
31784
|
+
if (authProvider && error51 instanceof UnauthorizedError) {
|
|
31785
|
+
this.markNeedsAuth(streamableTransport);
|
|
31786
|
+
throw error51;
|
|
31787
|
+
}
|
|
31734
31788
|
const status = error51?.code;
|
|
31735
31789
|
if (status !== void 0 && !SSE_FALLBACK_STATUS_CODES.includes(status)) {
|
|
31736
31790
|
throw error51;
|
|
@@ -31739,19 +31793,24 @@ var InternalMastraMCPClient = class extends MastraBase {
|
|
|
31739
31793
|
}
|
|
31740
31794
|
}
|
|
31741
31795
|
if (shouldTrySSE) {
|
|
31796
|
+
await this.detachStaleClientTransport();
|
|
31742
31797
|
this.log("debug", "Falling back to deprecated HTTP+SSE transport...");
|
|
31798
|
+
const sseEventSourceInit = { ...eventSourceInit, fetch: eventSourceInit?.fetch ?? fetch2 };
|
|
31799
|
+
const sseTransport = new SSEClientTransport(url2, {
|
|
31800
|
+
requestInit,
|
|
31801
|
+
eventSourceInit: sseEventSourceInit,
|
|
31802
|
+
authProvider,
|
|
31803
|
+
fetch: fetch2
|
|
31804
|
+
});
|
|
31743
31805
|
try {
|
|
31744
|
-
const sseEventSourceInit = { ...eventSourceInit, fetch: fetch2 };
|
|
31745
|
-
const sseTransport = new SSEClientTransport(url2, {
|
|
31746
|
-
requestInit,
|
|
31747
|
-
eventSourceInit: sseEventSourceInit,
|
|
31748
|
-
authProvider,
|
|
31749
|
-
fetch: fetch2
|
|
31750
|
-
});
|
|
31751
31806
|
await this.client.connect(sseTransport, { timeout: this.serverConfig.timeout ?? this.timeout });
|
|
31752
31807
|
this.transport = sseTransport;
|
|
31753
31808
|
this.log("debug", "Successfully connected using deprecated HTTP+SSE transport.");
|
|
31754
31809
|
} catch (sseError) {
|
|
31810
|
+
if (authProvider && sseError instanceof UnauthorizedError) {
|
|
31811
|
+
this.markNeedsAuth(sseTransport);
|
|
31812
|
+
throw sseError;
|
|
31813
|
+
}
|
|
31755
31814
|
this.log(
|
|
31756
31815
|
"error",
|
|
31757
31816
|
`Failed to connect with SSE transport after failing to connect to Streamable HTTP transport first. SSE error: ${sseError}`
|
|
@@ -31759,6 +31818,110 @@ var InternalMastraMCPClient = class extends MastraBase {
|
|
|
31759
31818
|
throw new Error("Could not connect to server with any available HTTP transport");
|
|
31760
31819
|
}
|
|
31761
31820
|
}
|
|
31821
|
+
this.closePendingAuthTransport();
|
|
31822
|
+
if (authProvider) {
|
|
31823
|
+
this._authState = "authorized";
|
|
31824
|
+
}
|
|
31825
|
+
}
|
|
31826
|
+
/**
|
|
31827
|
+
* Detaches whatever transport is still attached to the underlying SDK Client.
|
|
31828
|
+
*
|
|
31829
|
+
* The SDK assigns its internal `_transport` before `transport.start()` and never
|
|
31830
|
+
* clears it when `start()` throws, and its cleanup after a failed initialize is a
|
|
31831
|
+
* fire-and-forget `void this.close()`. Either way a stale transport can remain
|
|
31832
|
+
* attached, making every subsequent `client.connect()` throw "Already connected
|
|
31833
|
+
* to a transport" and permanently wedging this client (issue #19862). Mastra's
|
|
31834
|
+
* own `this.transport` is only assigned after a successful connect, so
|
|
31835
|
+
* disconnect/forceReconnect never see the stale one. Calling this before every
|
|
31836
|
+
* connect attempt restores the invariant that a connect starts from a detached
|
|
31837
|
+
* SDK client.
|
|
31838
|
+
*/
|
|
31839
|
+
async detachStaleClientTransport() {
|
|
31840
|
+
const stale = this.client.transport;
|
|
31841
|
+
if (!stale) {
|
|
31842
|
+
return;
|
|
31843
|
+
}
|
|
31844
|
+
if (stale === this.pendingAuthTransport) {
|
|
31845
|
+
this.severClientTransportLink(stale);
|
|
31846
|
+
return;
|
|
31847
|
+
}
|
|
31848
|
+
this.log("debug", "Closing stale SDK client transport before connect attempt");
|
|
31849
|
+
try {
|
|
31850
|
+
await stale.close();
|
|
31851
|
+
} catch (e) {
|
|
31852
|
+
this.log("debug", "Error closing stale SDK client transport (ignored)", {
|
|
31853
|
+
error: e instanceof Error ? e.message : String(e)
|
|
31854
|
+
});
|
|
31855
|
+
}
|
|
31856
|
+
this.severClientTransportLink(stale);
|
|
31857
|
+
}
|
|
31858
|
+
/**
|
|
31859
|
+
* Severs the mutual references between the SDK client and a stale transport
|
|
31860
|
+
* without closing it. Clearing the transport's callbacks ensures a later
|
|
31861
|
+
* close() of the stale transport cannot reach into the SDK client and clear
|
|
31862
|
+
* the state of a newer live connection.
|
|
31863
|
+
*/
|
|
31864
|
+
severClientTransportLink(stale) {
|
|
31865
|
+
stale.onclose = void 0;
|
|
31866
|
+
stale.onerror = void 0;
|
|
31867
|
+
stale.onmessage = void 0;
|
|
31868
|
+
if (this.client.transport === stale) {
|
|
31869
|
+
this.client._transport = void 0;
|
|
31870
|
+
}
|
|
31871
|
+
}
|
|
31872
|
+
/**
|
|
31873
|
+
* Closes and clears any transport retained from an unfinished authorization
|
|
31874
|
+
* flow. Safe to call when nothing is pending. Centralizes the cleanup so
|
|
31875
|
+
* success, disconnect, and forceReconnect all release the same resource.
|
|
31876
|
+
*/
|
|
31877
|
+
closePendingAuthTransport(replacement) {
|
|
31878
|
+
const pending = this.pendingAuthTransport;
|
|
31879
|
+
this.pendingAuthTransport = replacement;
|
|
31880
|
+
if (pending && pending !== replacement) {
|
|
31881
|
+
void pending.close().catch(() => {
|
|
31882
|
+
});
|
|
31883
|
+
}
|
|
31884
|
+
}
|
|
31885
|
+
/**
|
|
31886
|
+
* Records that the server rejected the connection with a 401 and keeps the
|
|
31887
|
+
* transport that started the authorization flow so finishAuth can complete it.
|
|
31888
|
+
*/
|
|
31889
|
+
markNeedsAuth(transport) {
|
|
31890
|
+
this.closePendingAuthTransport(transport);
|
|
31891
|
+
this._authState = "needs-auth";
|
|
31892
|
+
this.log("debug", "Server requires OAuth authorization before connecting.");
|
|
31893
|
+
}
|
|
31894
|
+
/**
|
|
31895
|
+
* OAuth authorization state of this server connection, when it has an authProvider.
|
|
31896
|
+
*
|
|
31897
|
+
* @internal
|
|
31898
|
+
*/
|
|
31899
|
+
get authState() {
|
|
31900
|
+
return this._authState;
|
|
31901
|
+
}
|
|
31902
|
+
/**
|
|
31903
|
+
* Completes a pending OAuth authorization-code flow.
|
|
31904
|
+
*
|
|
31905
|
+
* Exchanges the authorization code captured at the redirect URI on the same
|
|
31906
|
+
* transport that started the flow, then leaves the client ready to connect().
|
|
31907
|
+
*
|
|
31908
|
+
* @param authorizationCode - The authorization code captured at the redirect URI
|
|
31909
|
+
* @throws {Error} If no authorization flow is pending for this server
|
|
31910
|
+
*
|
|
31911
|
+
* @internal
|
|
31912
|
+
*/
|
|
31913
|
+
async finishAuth(authorizationCode) {
|
|
31914
|
+
const pending = this.pendingAuthTransport;
|
|
31915
|
+
if (!pending) {
|
|
31916
|
+
throw new Error("No OAuth authorization is pending for this server. Call connect() first.");
|
|
31917
|
+
}
|
|
31918
|
+
this.pendingAuthTransport = void 0;
|
|
31919
|
+
try {
|
|
31920
|
+
await pending.finishAuth(authorizationCode);
|
|
31921
|
+
} finally {
|
|
31922
|
+
void pending.close().catch(() => {
|
|
31923
|
+
});
|
|
31924
|
+
}
|
|
31762
31925
|
}
|
|
31763
31926
|
isConnected = null;
|
|
31764
31927
|
/**
|
|
@@ -31778,6 +31941,7 @@ var InternalMastraMCPClient = class extends MastraBase {
|
|
|
31778
31941
|
}
|
|
31779
31942
|
this.isConnected = new Promise(async (resolve, reject) => {
|
|
31780
31943
|
try {
|
|
31944
|
+
await this.detachStaleClientTransport();
|
|
31781
31945
|
const { command, url: url2 } = this.serverConfig;
|
|
31782
31946
|
if (command) {
|
|
31783
31947
|
await this.connectStdio(command);
|
|
@@ -31788,21 +31952,30 @@ var InternalMastraMCPClient = class extends MastraBase {
|
|
|
31788
31952
|
}
|
|
31789
31953
|
this.refreshServerInstructions();
|
|
31790
31954
|
resolve(true);
|
|
31791
|
-
const
|
|
31792
|
-
|
|
31793
|
-
|
|
31794
|
-
|
|
31795
|
-
|
|
31796
|
-
|
|
31797
|
-
this.
|
|
31798
|
-
|
|
31799
|
-
|
|
31800
|
-
|
|
31801
|
-
|
|
31802
|
-
|
|
31803
|
-
|
|
31955
|
+
const connectedTransport = this.transport;
|
|
31956
|
+
const connectionPromise = this.isConnected;
|
|
31957
|
+
if (this.client.onclose !== this.clientConnectionOnClose) {
|
|
31958
|
+
this.clientBaseOnClose = this.client.onclose;
|
|
31959
|
+
}
|
|
31960
|
+
const connectionOnClose = () => {
|
|
31961
|
+
if (this.transport === connectedTransport) {
|
|
31962
|
+
this.log("debug", `MCP server connection closed`);
|
|
31963
|
+
const staleTransport = this.transport;
|
|
31964
|
+
this.transport = void 0;
|
|
31965
|
+
if (this.isConnected === connectionPromise) {
|
|
31966
|
+
this.isConnected = null;
|
|
31967
|
+
}
|
|
31968
|
+
this.serverInstructions = void 0;
|
|
31969
|
+
if (staleTransport) {
|
|
31970
|
+
this.severClientTransportLink(staleTransport);
|
|
31971
|
+
void staleTransport.close().catch(() => {
|
|
31972
|
+
});
|
|
31973
|
+
}
|
|
31804
31974
|
}
|
|
31975
|
+
this.clientBaseOnClose?.();
|
|
31805
31976
|
};
|
|
31977
|
+
this.clientConnectionOnClose = connectionOnClose;
|
|
31978
|
+
this.client.onclose = connectionOnClose;
|
|
31806
31979
|
} catch (e) {
|
|
31807
31980
|
this.isConnected = null;
|
|
31808
31981
|
reject(e);
|
|
@@ -31869,13 +32042,16 @@ var InternalMastraMCPClient = class extends MastraBase {
|
|
|
31869
32042
|
this.serverInstructions = this.client.getInstructions();
|
|
31870
32043
|
}
|
|
31871
32044
|
async disconnect() {
|
|
32045
|
+
this.closePendingAuthTransport();
|
|
31872
32046
|
if (!this.transport) {
|
|
32047
|
+
await this.detachStaleClientTransport();
|
|
31873
32048
|
this.log("debug", "Disconnect called but no transport was connected.");
|
|
31874
32049
|
return;
|
|
31875
32050
|
}
|
|
31876
32051
|
this.log("debug", `Disconnecting from MCP server`);
|
|
32052
|
+
const disconnectedTransport = this.transport;
|
|
31877
32053
|
try {
|
|
31878
|
-
await
|
|
32054
|
+
await disconnectedTransport.close();
|
|
31879
32055
|
this.log("debug", "Successfully disconnected from MCP server");
|
|
31880
32056
|
} catch (e) {
|
|
31881
32057
|
this.log("error", "Error during MCP server disconnect", {
|
|
@@ -31883,6 +32059,7 @@ var InternalMastraMCPClient = class extends MastraBase {
|
|
|
31883
32059
|
});
|
|
31884
32060
|
throw e;
|
|
31885
32061
|
} finally {
|
|
32062
|
+
this.severClientTransportLink(disconnectedTransport);
|
|
31886
32063
|
this.transport = void 0;
|
|
31887
32064
|
this.isConnected = null;
|
|
31888
32065
|
this.serverInstructions = void 0;
|
|
@@ -31913,14 +32090,20 @@ var InternalMastraMCPClient = class extends MastraBase {
|
|
|
31913
32090
|
*/
|
|
31914
32091
|
async forceReconnect() {
|
|
31915
32092
|
this.log("debug", "Forcing reconnection to MCP server...");
|
|
32093
|
+
this.closePendingAuthTransport();
|
|
32094
|
+
const disconnectedTransport = this.transport;
|
|
31916
32095
|
try {
|
|
31917
|
-
if (
|
|
31918
|
-
await
|
|
32096
|
+
if (disconnectedTransport) {
|
|
32097
|
+
await disconnectedTransport.close();
|
|
31919
32098
|
}
|
|
31920
32099
|
} catch (e) {
|
|
31921
32100
|
this.log("debug", "Error during force disconnect (ignored)", {
|
|
31922
32101
|
error: e instanceof Error ? e.message : String(e)
|
|
31923
32102
|
});
|
|
32103
|
+
} finally {
|
|
32104
|
+
if (disconnectedTransport) {
|
|
32105
|
+
this.severClientTransportLink(disconnectedTransport);
|
|
32106
|
+
}
|
|
31924
32107
|
}
|
|
31925
32108
|
this.transport = void 0;
|
|
31926
32109
|
this.isConnected = null;
|
|
@@ -32191,6 +32374,399 @@ var InternalMastraMCPClient = class extends MastraBase {
|
|
|
32191
32374
|
};
|
|
32192
32375
|
}
|
|
32193
32376
|
};
|
|
32377
|
+
var CALLBACK_PORT_FALLBACK_RANGE = 10;
|
|
32378
|
+
var DEFAULT_CALLBACK_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
32379
|
+
var SUCCESS_HTML = `<!DOCTYPE html>
|
|
32380
|
+
<html>
|
|
32381
|
+
<head><meta charset="utf-8"><title>Authentication complete</title></head>
|
|
32382
|
+
<body style="font-family: system-ui, sans-serif; text-align: center; padding-top: 4rem;">
|
|
32383
|
+
<h1>Authentication complete</h1>
|
|
32384
|
+
<p>You can close this tab and return to your application.</p>
|
|
32385
|
+
</body>
|
|
32386
|
+
</html>`;
|
|
32387
|
+
var ERROR_HTML = `<!DOCTYPE html>
|
|
32388
|
+
<html>
|
|
32389
|
+
<head><meta charset="utf-8"><title>Authentication failed</title></head>
|
|
32390
|
+
<body style="font-family: system-ui, sans-serif; text-align: center; padding-top: 4rem;">
|
|
32391
|
+
<h1>Authentication failed</h1>
|
|
32392
|
+
<p>You can close this tab and retry from your application.</p>
|
|
32393
|
+
</body>
|
|
32394
|
+
</html>`;
|
|
32395
|
+
function getCallbackUrlCandidates(redirectUrl) {
|
|
32396
|
+
const base = new URL(redirectUrl.toString());
|
|
32397
|
+
const preferredPort = base.port ? Number(base.port) : base.protocol === "https:" ? 443 : 80;
|
|
32398
|
+
const candidates = [];
|
|
32399
|
+
for (let offset = 0; offset <= CALLBACK_PORT_FALLBACK_RANGE; offset++) {
|
|
32400
|
+
const port = preferredPort + offset;
|
|
32401
|
+
if (port > 65535) break;
|
|
32402
|
+
const candidate = new URL(base.toString());
|
|
32403
|
+
candidate.port = String(port);
|
|
32404
|
+
candidates.push(candidate);
|
|
32405
|
+
}
|
|
32406
|
+
return candidates;
|
|
32407
|
+
}
|
|
32408
|
+
function stateMatches(receivedState, expectedState) {
|
|
32409
|
+
const received = Buffer.from(receivedState);
|
|
32410
|
+
const expected = Buffer.from(expectedState);
|
|
32411
|
+
return received.length === expected.length && timingSafeEqual(received, expected);
|
|
32412
|
+
}
|
|
32413
|
+
function listen(server, port, hostname3) {
|
|
32414
|
+
return new Promise((resolve, reject) => {
|
|
32415
|
+
const onError = (error51) => {
|
|
32416
|
+
server.off("listening", onListening);
|
|
32417
|
+
if (error51.code === "EADDRINUSE") {
|
|
32418
|
+
resolve(error51);
|
|
32419
|
+
} else {
|
|
32420
|
+
reject(error51);
|
|
32421
|
+
}
|
|
32422
|
+
};
|
|
32423
|
+
const onListening = () => {
|
|
32424
|
+
server.off("error", onError);
|
|
32425
|
+
resolve(null);
|
|
32426
|
+
};
|
|
32427
|
+
server.once("error", onError);
|
|
32428
|
+
server.once("listening", onListening);
|
|
32429
|
+
server.listen(port, hostname3);
|
|
32430
|
+
});
|
|
32431
|
+
}
|
|
32432
|
+
async function createOAuthCallbackServer(options) {
|
|
32433
|
+
const candidates = getCallbackUrlCandidates(options.redirectUrl);
|
|
32434
|
+
const callbackPath = candidates[0].pathname;
|
|
32435
|
+
let settled = false;
|
|
32436
|
+
let resolveCode;
|
|
32437
|
+
let rejectCode;
|
|
32438
|
+
const codePromise = new Promise((resolve, reject) => {
|
|
32439
|
+
resolveCode = resolve;
|
|
32440
|
+
rejectCode = reject;
|
|
32441
|
+
});
|
|
32442
|
+
codePromise.catch(() => {
|
|
32443
|
+
});
|
|
32444
|
+
const settle = (outcome) => {
|
|
32445
|
+
if (settled) return;
|
|
32446
|
+
settled = true;
|
|
32447
|
+
if ("result" in outcome) {
|
|
32448
|
+
resolveCode(outcome.result);
|
|
32449
|
+
} else {
|
|
32450
|
+
rejectCode(outcome.error);
|
|
32451
|
+
}
|
|
32452
|
+
};
|
|
32453
|
+
const server = createServer((req, res) => {
|
|
32454
|
+
const url2 = new URL(req.url ?? "", "http://localhost");
|
|
32455
|
+
if (url2.pathname !== callbackPath) {
|
|
32456
|
+
res.statusCode = 404;
|
|
32457
|
+
res.end("Not found");
|
|
32458
|
+
return;
|
|
32459
|
+
}
|
|
32460
|
+
if (settled) {
|
|
32461
|
+
res.statusCode = 410;
|
|
32462
|
+
res.end("Callback already handled");
|
|
32463
|
+
return;
|
|
32464
|
+
}
|
|
32465
|
+
const respond = (statusCode, html) => {
|
|
32466
|
+
res.statusCode = statusCode;
|
|
32467
|
+
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
32468
|
+
res.end(html);
|
|
32469
|
+
};
|
|
32470
|
+
const state = url2.searchParams.get("state");
|
|
32471
|
+
if (state === null || !stateMatches(state, options.state)) {
|
|
32472
|
+
respond(400, ERROR_HTML);
|
|
32473
|
+
return;
|
|
32474
|
+
}
|
|
32475
|
+
const error51 = url2.searchParams.get("error");
|
|
32476
|
+
if (error51) {
|
|
32477
|
+
const description = url2.searchParams.get("error_description");
|
|
32478
|
+
respond(400, ERROR_HTML);
|
|
32479
|
+
settle({ error: new Error(`Authorization failed: ${error51}${description ? ` (${description})` : ""}`) });
|
|
32480
|
+
return;
|
|
32481
|
+
}
|
|
32482
|
+
const code = url2.searchParams.get("code");
|
|
32483
|
+
if (!code) {
|
|
32484
|
+
respond(400, ERROR_HTML);
|
|
32485
|
+
settle({ error: new Error("Authorization failed: missing authorization code") });
|
|
32486
|
+
return;
|
|
32487
|
+
}
|
|
32488
|
+
respond(200, SUCCESS_HTML);
|
|
32489
|
+
settle({ result: { code, state } });
|
|
32490
|
+
});
|
|
32491
|
+
const hostname3 = candidates[0].hostname.replace(/^\[|\]$/g, "");
|
|
32492
|
+
let boundUrl;
|
|
32493
|
+
let boundPort;
|
|
32494
|
+
for (const candidate of candidates) {
|
|
32495
|
+
const candidatePort = Number(candidate.port);
|
|
32496
|
+
const error51 = await listen(server, candidatePort, hostname3);
|
|
32497
|
+
if (!error51) {
|
|
32498
|
+
boundUrl = candidate;
|
|
32499
|
+
boundPort = candidatePort;
|
|
32500
|
+
break;
|
|
32501
|
+
}
|
|
32502
|
+
}
|
|
32503
|
+
if (!boundUrl || boundPort === void 0) {
|
|
32504
|
+
const firstPort = Number(candidates[0].port);
|
|
32505
|
+
const lastPort = Number(candidates[candidates.length - 1].port);
|
|
32506
|
+
throw new Error(`Failed to start OAuth callback server: ports ${firstPort}-${lastPort} are all in use`);
|
|
32507
|
+
}
|
|
32508
|
+
server.on("error", (error51) => {
|
|
32509
|
+
settle({ error: error51 instanceof Error ? error51 : new Error(String(error51)) });
|
|
32510
|
+
});
|
|
32511
|
+
return {
|
|
32512
|
+
url: boundUrl,
|
|
32513
|
+
port: boundPort,
|
|
32514
|
+
waitForCode({ timeoutMs = DEFAULT_CALLBACK_TIMEOUT_MS } = {}) {
|
|
32515
|
+
let timer;
|
|
32516
|
+
const timeout = new Promise((_, reject) => {
|
|
32517
|
+
timer = setTimeout(
|
|
32518
|
+
() => reject(new Error(`Timed out waiting for OAuth callback after ${timeoutMs}ms`)),
|
|
32519
|
+
timeoutMs
|
|
32520
|
+
);
|
|
32521
|
+
timer.unref?.();
|
|
32522
|
+
});
|
|
32523
|
+
return Promise.race([codePromise, timeout]).finally(() => clearTimeout(timer));
|
|
32524
|
+
},
|
|
32525
|
+
close() {
|
|
32526
|
+
settle({ error: new Error("OAuth callback server closed before receiving an authorization code") });
|
|
32527
|
+
server.closeIdleConnections();
|
|
32528
|
+
return new Promise((resolve, reject) => {
|
|
32529
|
+
server.close((error51) => {
|
|
32530
|
+
if (error51 && error51.code !== "ERR_SERVER_NOT_RUNNING") {
|
|
32531
|
+
reject(error51);
|
|
32532
|
+
} else {
|
|
32533
|
+
resolve();
|
|
32534
|
+
}
|
|
32535
|
+
});
|
|
32536
|
+
});
|
|
32537
|
+
}
|
|
32538
|
+
};
|
|
32539
|
+
}
|
|
32540
|
+
|
|
32541
|
+
// src/client/oauth-provider.ts
|
|
32542
|
+
var InMemoryOAuthStorage = class {
|
|
32543
|
+
data = /* @__PURE__ */ new Map();
|
|
32544
|
+
set(key, value) {
|
|
32545
|
+
this.data.set(key, value);
|
|
32546
|
+
}
|
|
32547
|
+
get(key) {
|
|
32548
|
+
return this.data.get(key);
|
|
32549
|
+
}
|
|
32550
|
+
delete(key) {
|
|
32551
|
+
this.data.delete(key);
|
|
32552
|
+
}
|
|
32553
|
+
clear() {
|
|
32554
|
+
this.data.clear();
|
|
32555
|
+
}
|
|
32556
|
+
};
|
|
32557
|
+
var MCPOAuthClientProvider = class {
|
|
32558
|
+
_redirectUrl;
|
|
32559
|
+
_clientMetadata;
|
|
32560
|
+
storage;
|
|
32561
|
+
onRedirect;
|
|
32562
|
+
generateState;
|
|
32563
|
+
_clientInfo;
|
|
32564
|
+
_sessionState;
|
|
32565
|
+
_sessionRedirectUrl;
|
|
32566
|
+
constructor(options) {
|
|
32567
|
+
this._redirectUrl = options.redirectUrl;
|
|
32568
|
+
this._clientMetadata = options.clientMetadata;
|
|
32569
|
+
this._clientInfo = options.clientInformation;
|
|
32570
|
+
this.storage = options.storage ?? new InMemoryOAuthStorage();
|
|
32571
|
+
this.onRedirect = options.onRedirectToAuthorization;
|
|
32572
|
+
this.generateState = options.stateGenerator ?? (() => crypto.randomUUID());
|
|
32573
|
+
}
|
|
32574
|
+
/**
|
|
32575
|
+
* The URL to redirect the user agent to after authorization.
|
|
32576
|
+
*/
|
|
32577
|
+
get redirectUrl() {
|
|
32578
|
+
return this._redirectUrl;
|
|
32579
|
+
}
|
|
32580
|
+
/**
|
|
32581
|
+
* Metadata about this OAuth client.
|
|
32582
|
+
*/
|
|
32583
|
+
get clientMetadata() {
|
|
32584
|
+
return this._clientMetadata;
|
|
32585
|
+
}
|
|
32586
|
+
/**
|
|
32587
|
+
* Returns a OAuth2 state parameter.
|
|
32588
|
+
*
|
|
32589
|
+
* While an authorization session is active (see beginAuthorizationSession),
|
|
32590
|
+
* the pinned session state is returned so a callback server can validate
|
|
32591
|
+
* the redirect against a known value.
|
|
32592
|
+
*/
|
|
32593
|
+
async state() {
|
|
32594
|
+
return this._sessionState ?? this.generateState();
|
|
32595
|
+
}
|
|
32596
|
+
/**
|
|
32597
|
+
* Pins the OAuth state parameter for the next authorization request.
|
|
32598
|
+
*
|
|
32599
|
+
* Hosts driving an interactive authorization flow (e.g. MCPClient.authenticate)
|
|
32600
|
+
* call this before triggering the flow so the loopback callback server knows
|
|
32601
|
+
* which state value to expect. Call endAuthorizationSession once the flow settles.
|
|
32602
|
+
*
|
|
32603
|
+
* @returns The pinned state value, generated with the configured stateGenerator
|
|
32604
|
+
*/
|
|
32605
|
+
async beginAuthorizationSession() {
|
|
32606
|
+
this._sessionState = await this.generateState();
|
|
32607
|
+
this._sessionRedirectUrl = this._redirectUrl;
|
|
32608
|
+
return this._sessionState;
|
|
32609
|
+
}
|
|
32610
|
+
/**
|
|
32611
|
+
* Clears the pinned authorization state (see beginAuthorizationSession) and
|
|
32612
|
+
* restores the configured redirect URL if applyResolvedRedirectUrl rebased
|
|
32613
|
+
* it to a fallback port during the session, so the next flow starts from
|
|
32614
|
+
* the preferred port again.
|
|
32615
|
+
*/
|
|
32616
|
+
endAuthorizationSession() {
|
|
32617
|
+
this._sessionState = void 0;
|
|
32618
|
+
if (this._sessionRedirectUrl !== void 0) {
|
|
32619
|
+
this._redirectUrl = this._sessionRedirectUrl;
|
|
32620
|
+
this._sessionRedirectUrl = void 0;
|
|
32621
|
+
}
|
|
32622
|
+
}
|
|
32623
|
+
/**
|
|
32624
|
+
* Points the provider at the callback URL that is actually bound.
|
|
32625
|
+
*
|
|
32626
|
+
* Loopback callback servers may bind a fallback port when the preferred one
|
|
32627
|
+
* is in use. Call this before triggering authorization so the authorization
|
|
32628
|
+
* request's redirect_uri matches the listening server, and so dynamic client
|
|
32629
|
+
* registration registers every candidate callback URL (see
|
|
32630
|
+
* getCallbackUrlCandidates) rather than only the preferred one.
|
|
32631
|
+
*
|
|
32632
|
+
* @param redirectUrl - The callback URL that is actually bound
|
|
32633
|
+
* @param registeredRedirectUris - The redirect URIs to register during dynamic client registration
|
|
32634
|
+
*/
|
|
32635
|
+
applyResolvedRedirectUrl(redirectUrl, registeredRedirectUris) {
|
|
32636
|
+
this._redirectUrl = redirectUrl;
|
|
32637
|
+
this._clientMetadata = {
|
|
32638
|
+
...this._clientMetadata,
|
|
32639
|
+
redirect_uris: registeredRedirectUris.map((uri) => uri.toString())
|
|
32640
|
+
};
|
|
32641
|
+
}
|
|
32642
|
+
/**
|
|
32643
|
+
* Loads information about this OAuth client.
|
|
32644
|
+
*/
|
|
32645
|
+
async clientInformation() {
|
|
32646
|
+
if (this._clientInfo) {
|
|
32647
|
+
return this._clientInfo;
|
|
32648
|
+
}
|
|
32649
|
+
const stored = await this.storage.get("client_info");
|
|
32650
|
+
if (stored) {
|
|
32651
|
+
try {
|
|
32652
|
+
return JSON.parse(stored);
|
|
32653
|
+
} catch {
|
|
32654
|
+
}
|
|
32655
|
+
}
|
|
32656
|
+
return void 0;
|
|
32657
|
+
}
|
|
32658
|
+
/**
|
|
32659
|
+
* Saves dynamically registered client information.
|
|
32660
|
+
*/
|
|
32661
|
+
async saveClientInformation(clientInformation) {
|
|
32662
|
+
this._clientInfo = clientInformation;
|
|
32663
|
+
await this.storage.set("client_info", JSON.stringify(clientInformation));
|
|
32664
|
+
}
|
|
32665
|
+
/**
|
|
32666
|
+
* Loads existing OAuth tokens.
|
|
32667
|
+
*/
|
|
32668
|
+
async tokens() {
|
|
32669
|
+
const stored = await this.storage.get("tokens");
|
|
32670
|
+
if (stored) {
|
|
32671
|
+
try {
|
|
32672
|
+
return JSON.parse(stored);
|
|
32673
|
+
} catch {
|
|
32674
|
+
}
|
|
32675
|
+
}
|
|
32676
|
+
return void 0;
|
|
32677
|
+
}
|
|
32678
|
+
/**
|
|
32679
|
+
* Stores new OAuth tokens after successful authorization.
|
|
32680
|
+
*/
|
|
32681
|
+
async saveTokens(tokens) {
|
|
32682
|
+
await this.storage.set("tokens", JSON.stringify(tokens));
|
|
32683
|
+
}
|
|
32684
|
+
/**
|
|
32685
|
+
* Invoked to redirect the user agent to the authorization URL.
|
|
32686
|
+
*/
|
|
32687
|
+
async redirectToAuthorization(authorizationUrl) {
|
|
32688
|
+
if (this.onRedirect) {
|
|
32689
|
+
await this.onRedirect(authorizationUrl);
|
|
32690
|
+
} else {
|
|
32691
|
+
console.info(`Authorization required. Please visit: ${authorizationUrl.toString()}`);
|
|
32692
|
+
}
|
|
32693
|
+
}
|
|
32694
|
+
/**
|
|
32695
|
+
* Saves a PKCE code verifier before redirecting to authorization.
|
|
32696
|
+
*/
|
|
32697
|
+
async saveCodeVerifier(codeVerifier) {
|
|
32698
|
+
await this.storage.set("code_verifier", codeVerifier);
|
|
32699
|
+
}
|
|
32700
|
+
/**
|
|
32701
|
+
* Loads the PKCE code verifier for validating authorization result.
|
|
32702
|
+
*/
|
|
32703
|
+
async codeVerifier() {
|
|
32704
|
+
const verifier = await this.storage.get("code_verifier");
|
|
32705
|
+
if (!verifier) {
|
|
32706
|
+
throw new Error("No code verifier found. Authorization flow may not have started properly.");
|
|
32707
|
+
}
|
|
32708
|
+
return verifier;
|
|
32709
|
+
}
|
|
32710
|
+
/**
|
|
32711
|
+
* Invalidate credentials when server indicates they're no longer valid.
|
|
32712
|
+
*/
|
|
32713
|
+
async invalidateCredentials(scope) {
|
|
32714
|
+
switch (scope) {
|
|
32715
|
+
case "all":
|
|
32716
|
+
await this.storage.delete("tokens");
|
|
32717
|
+
await this.storage.delete("client_info");
|
|
32718
|
+
await this.storage.delete("code_verifier");
|
|
32719
|
+
this._clientInfo = void 0;
|
|
32720
|
+
break;
|
|
32721
|
+
case "client":
|
|
32722
|
+
await this.storage.delete("client_info");
|
|
32723
|
+
this._clientInfo = void 0;
|
|
32724
|
+
break;
|
|
32725
|
+
case "tokens":
|
|
32726
|
+
await this.storage.delete("tokens");
|
|
32727
|
+
break;
|
|
32728
|
+
case "verifier":
|
|
32729
|
+
await this.storage.delete("code_verifier");
|
|
32730
|
+
break;
|
|
32731
|
+
}
|
|
32732
|
+
}
|
|
32733
|
+
/**
|
|
32734
|
+
* Clear all stored OAuth data.
|
|
32735
|
+
* Useful for logging out or resetting state.
|
|
32736
|
+
*/
|
|
32737
|
+
async clear() {
|
|
32738
|
+
await this.invalidateCredentials("all");
|
|
32739
|
+
}
|
|
32740
|
+
/**
|
|
32741
|
+
* Check if the provider has valid (non-expired) tokens.
|
|
32742
|
+
*/
|
|
32743
|
+
async hasValidTokens() {
|
|
32744
|
+
const currentTokens = await this.tokens();
|
|
32745
|
+
if (!currentTokens) return false;
|
|
32746
|
+
if (!currentTokens.access_token) return false;
|
|
32747
|
+
return true;
|
|
32748
|
+
}
|
|
32749
|
+
};
|
|
32750
|
+
function createSimpleTokenProvider(accessToken, options) {
|
|
32751
|
+
const tokens = {
|
|
32752
|
+
access_token: accessToken,
|
|
32753
|
+
token_type: options.tokenType ?? "Bearer",
|
|
32754
|
+
refresh_token: options.refreshToken,
|
|
32755
|
+
expires_in: options.expiresIn,
|
|
32756
|
+
scope: options.scope
|
|
32757
|
+
};
|
|
32758
|
+
const storage = new InMemoryOAuthStorage();
|
|
32759
|
+
storage.set("tokens", JSON.stringify(tokens));
|
|
32760
|
+
if (options.clientInformation) {
|
|
32761
|
+
storage.set("client_info", JSON.stringify(options.clientInformation));
|
|
32762
|
+
}
|
|
32763
|
+
return new MCPOAuthClientProvider({
|
|
32764
|
+
redirectUrl: options.redirectUrl,
|
|
32765
|
+
clientMetadata: options.clientMetadata,
|
|
32766
|
+
clientInformation: options.clientInformation,
|
|
32767
|
+
storage
|
|
32768
|
+
});
|
|
32769
|
+
}
|
|
32194
32770
|
var MCPClientServerProxy = class extends MCPServerBase {
|
|
32195
32771
|
clientGetter;
|
|
32196
32772
|
cachedClient = null;
|
|
@@ -32330,12 +32906,25 @@ var MCPClientServerProxy = class extends MCPServerBase {
|
|
|
32330
32906
|
// src/client/configuration.ts
|
|
32331
32907
|
var mcpClientInstances = /* @__PURE__ */ new Map();
|
|
32332
32908
|
var TOOL_DISCOVERY_MAX_ATTEMPTS = 2;
|
|
32909
|
+
var LOOPBACK_IPV4 = /^127\.(?:\d{1,3})\.(?:\d{1,3})\.(?:\d{1,3})$/;
|
|
32910
|
+
function isLoopbackHostname(hostname3) {
|
|
32911
|
+
return hostname3 === "localhost" || hostname3 === "[::1]" || hostname3 === "::1" || LOOPBACK_IPV4.test(hostname3);
|
|
32912
|
+
}
|
|
32333
32913
|
var MCPClient = class extends MastraBase {
|
|
32334
32914
|
serverConfigs = {};
|
|
32335
32915
|
id;
|
|
32336
32916
|
defaultTimeout;
|
|
32337
32917
|
mcpClientsById = /* @__PURE__ */ new Map();
|
|
32338
32918
|
disconnectPromise = null;
|
|
32919
|
+
authFlowsByServer = /* @__PURE__ */ new Map();
|
|
32920
|
+
authCallbackServersByServer = /* @__PURE__ */ new Map();
|
|
32921
|
+
/**
|
|
32922
|
+
* Per-server abort controllers for in-flight authorization flows. Created
|
|
32923
|
+
* synchronously at the start of {@link runAuthorizationFlow} — before the
|
|
32924
|
+
* callback server exists — so cancel/disconnect can interrupt the setup phase
|
|
32925
|
+
* (discovery, registration, port binding) and not just the waitForCode wait.
|
|
32926
|
+
*/
|
|
32927
|
+
authAbortControllersByServer = /* @__PURE__ */ new Map();
|
|
32339
32928
|
/**
|
|
32340
32929
|
* Creates a new MCPClient instance for managing MCP server connections.
|
|
32341
32930
|
*
|
|
@@ -32995,6 +33584,15 @@ To fix this you have three different options:
|
|
|
32995
33584
|
this.disconnectPromise = (async () => {
|
|
32996
33585
|
try {
|
|
32997
33586
|
mcpClientInstances.delete(this.id);
|
|
33587
|
+
const pendingFlows = Array.from(this.authFlowsByServer.values());
|
|
33588
|
+
for (const controller of this.authAbortControllersByServer.values()) {
|
|
33589
|
+
controller.abort();
|
|
33590
|
+
}
|
|
33591
|
+
await Promise.allSettled(Array.from(this.authCallbackServersByServer.values()).map((server) => server.close()));
|
|
33592
|
+
await Promise.allSettled(pendingFlows);
|
|
33593
|
+
this.authAbortControllersByServer.clear();
|
|
33594
|
+
this.authCallbackServersByServer.clear();
|
|
33595
|
+
this.authFlowsByServer.clear();
|
|
32998
33596
|
await Promise.allSettled(Array.from(this.mcpClientsById.values()).map((client) => client.disconnect()));
|
|
32999
33597
|
this.mcpClientsById.clear();
|
|
33000
33598
|
} finally {
|
|
@@ -33026,6 +33624,151 @@ To fix this you have three different options:
|
|
|
33026
33624
|
await this.getConnectedClientForServer(serverName);
|
|
33027
33625
|
}
|
|
33028
33626
|
}
|
|
33627
|
+
/**
|
|
33628
|
+
* Runs the interactive OAuth authorization-code flow for a server.
|
|
33629
|
+
*
|
|
33630
|
+
* Requires the server to be configured with an MCPOAuthClientProvider whose
|
|
33631
|
+
* redirect URL points at a loopback address. The flow:
|
|
33632
|
+
*
|
|
33633
|
+
* 1. Starts a loopback callback server on the redirect URL's port (falling
|
|
33634
|
+
* back to the next sequential ports when it is in use)
|
|
33635
|
+
* 2. Attempts a connection so the SDK runs discovery and dynamic client
|
|
33636
|
+
* registration, delivering the authorization URL through the provider's
|
|
33637
|
+
* `onRedirectToAuthorization` callback — the host directs the user there
|
|
33638
|
+
* 3. Waits for the browser to deliver the authorization code, validates the
|
|
33639
|
+
* OAuth state, exchanges the code for tokens, and reconnects
|
|
33640
|
+
*
|
|
33641
|
+
* Concurrent calls for the same server join the pending flow (the joiner's
|
|
33642
|
+
* options are ignored — the pending flow keeps its own timeout); different
|
|
33643
|
+
* servers authenticate independently. Each server needs its own provider
|
|
33644
|
+
* instance: the flow pins session state on the provider, so sharing one
|
|
33645
|
+
* MCPOAuthClientProvider across servers is not supported. Hosts with custom
|
|
33646
|
+
* redirect handling (e.g. a web app with an HTTPS redirect URL) should
|
|
33647
|
+
* drive MCPOAuthClientProvider directly instead.
|
|
33648
|
+
*
|
|
33649
|
+
* @param serverName - The name of the server to authenticate (must match a key in `servers`)
|
|
33650
|
+
* @param options.timeoutMs - How long to wait for the browser callback (default 5 minutes)
|
|
33651
|
+
* @throws {Error} If the server has no MCPOAuthClientProvider or its redirect URL is not loopback
|
|
33652
|
+
*
|
|
33653
|
+
* @example
|
|
33654
|
+
* ```typescript
|
|
33655
|
+
* if (mcp.getServerAuthState('weatherServer') === 'needs-auth') {
|
|
33656
|
+
* await mcp.authenticate('weatherServer');
|
|
33657
|
+
* }
|
|
33658
|
+
* ```
|
|
33659
|
+
*/
|
|
33660
|
+
async authenticate(serverName, options) {
|
|
33661
|
+
if (this.disconnectPromise) {
|
|
33662
|
+
await this.disconnectPromise.catch(() => {
|
|
33663
|
+
});
|
|
33664
|
+
}
|
|
33665
|
+
const pendingFlow = this.authFlowsByServer.get(serverName);
|
|
33666
|
+
if (pendingFlow) {
|
|
33667
|
+
return pendingFlow;
|
|
33668
|
+
}
|
|
33669
|
+
const flow = this.runAuthorizationFlow(serverName, options).finally(() => {
|
|
33670
|
+
this.authFlowsByServer.delete(serverName);
|
|
33671
|
+
});
|
|
33672
|
+
this.authFlowsByServer.set(serverName, flow);
|
|
33673
|
+
return flow;
|
|
33674
|
+
}
|
|
33675
|
+
/**
|
|
33676
|
+
* OAuth authorization state of a configured server.
|
|
33677
|
+
*
|
|
33678
|
+
* Returns `undefined` for servers without an authProvider and for servers
|
|
33679
|
+
* that have not attempted a connection yet.
|
|
33680
|
+
*/
|
|
33681
|
+
getServerAuthState(serverName) {
|
|
33682
|
+
return this.mcpClientsById.get(serverName)?.authState;
|
|
33683
|
+
}
|
|
33684
|
+
async runAuthorizationFlow(serverName, options) {
|
|
33685
|
+
const abortController = new AbortController();
|
|
33686
|
+
this.authAbortControllersByServer.set(serverName, abortController);
|
|
33687
|
+
const throwIfAborted = () => {
|
|
33688
|
+
if (abortController.signal.aborted) {
|
|
33689
|
+
throw new Error(`Authentication for MCP server ${serverName} was cancelled.`);
|
|
33690
|
+
}
|
|
33691
|
+
};
|
|
33692
|
+
let provider;
|
|
33693
|
+
let sessionStarted = false;
|
|
33694
|
+
let callbackServer;
|
|
33695
|
+
try {
|
|
33696
|
+
const config2 = this.getServerConfig(serverName);
|
|
33697
|
+
const candidateProvider = config2.authProvider;
|
|
33698
|
+
if (!(candidateProvider instanceof MCPOAuthClientProvider)) {
|
|
33699
|
+
throw new Error(
|
|
33700
|
+
`Cannot authenticate MCP server ${serverName}: it is not configured with an MCPOAuthClientProvider.`
|
|
33701
|
+
);
|
|
33702
|
+
}
|
|
33703
|
+
provider = candidateProvider;
|
|
33704
|
+
const redirectUrl = new URL(provider.redirectUrl.toString());
|
|
33705
|
+
if (redirectUrl.protocol !== "http:" || !isLoopbackHostname(redirectUrl.hostname)) {
|
|
33706
|
+
throw new Error(
|
|
33707
|
+
`Cannot authenticate MCP server ${serverName}: the provider's redirect URL must be a loopback address, got ${redirectUrl.origin}.`
|
|
33708
|
+
);
|
|
33709
|
+
}
|
|
33710
|
+
const state = await provider.beginAuthorizationSession();
|
|
33711
|
+
sessionStarted = true;
|
|
33712
|
+
throwIfAborted();
|
|
33713
|
+
callbackServer = await createOAuthCallbackServer({ redirectUrl, state });
|
|
33714
|
+
throwIfAborted();
|
|
33715
|
+
this.authCallbackServersByServer.set(serverName, callbackServer);
|
|
33716
|
+
provider.applyResolvedRedirectUrl(callbackServer.url, getCallbackUrlCandidates(redirectUrl));
|
|
33717
|
+
const clientInfo = await provider.clientInformation();
|
|
33718
|
+
if (clientInfo?.redirect_uris && !clientInfo.redirect_uris.includes(callbackServer.url.toString())) {
|
|
33719
|
+
await provider.invalidateCredentials("client");
|
|
33720
|
+
}
|
|
33721
|
+
const client = await this.getClientForServer(serverName);
|
|
33722
|
+
try {
|
|
33723
|
+
await client.connect();
|
|
33724
|
+
return;
|
|
33725
|
+
} catch (error51) {
|
|
33726
|
+
if (!(error51 instanceof UnauthorizedError)) {
|
|
33727
|
+
throw this.handleConnectError(serverName, error51);
|
|
33728
|
+
}
|
|
33729
|
+
}
|
|
33730
|
+
const { code } = await callbackServer.waitForCode(options);
|
|
33731
|
+
await client.finishAuth(code);
|
|
33732
|
+
try {
|
|
33733
|
+
await client.connect();
|
|
33734
|
+
} catch (error51) {
|
|
33735
|
+
throw error51 instanceof UnauthorizedError ? error51 : this.handleConnectError(serverName, error51);
|
|
33736
|
+
}
|
|
33737
|
+
} finally {
|
|
33738
|
+
this.authCallbackServersByServer.delete(serverName);
|
|
33739
|
+
this.authAbortControllersByServer.delete(serverName);
|
|
33740
|
+
if (sessionStarted) {
|
|
33741
|
+
provider?.endAuthorizationSession();
|
|
33742
|
+
}
|
|
33743
|
+
await callbackServer?.close();
|
|
33744
|
+
}
|
|
33745
|
+
}
|
|
33746
|
+
/**
|
|
33747
|
+
* Cancels a pending {@link authenticate} flow for a server.
|
|
33748
|
+
*
|
|
33749
|
+
* Tears down the loopback callback server immediately — the pending
|
|
33750
|
+
* authenticate() call rejects. Useful when the user closed the browser
|
|
33751
|
+
* without completing consent, which the host cannot observe.
|
|
33752
|
+
*
|
|
33753
|
+
* The resulting auth state depends on how far the flow had progressed: a flow
|
|
33754
|
+
* cancelled after the server rejected the connection with a 401 stays in the
|
|
33755
|
+
* `needs-auth` state so it can be retried right away, while a flow cancelled
|
|
33756
|
+
* during the setup phase (before any connection was attempted) leaves the
|
|
33757
|
+
* state unchanged — typically `undefined`.
|
|
33758
|
+
*
|
|
33759
|
+
* @param serverName - The name of the server whose flow to cancel
|
|
33760
|
+
* @returns `true` if a pending flow was cancelled, `false` when no flow was pending
|
|
33761
|
+
*/
|
|
33762
|
+
async cancelAuthentication(serverName) {
|
|
33763
|
+
const pendingFlow = this.authFlowsByServer.get(serverName);
|
|
33764
|
+
if (!pendingFlow) {
|
|
33765
|
+
return false;
|
|
33766
|
+
}
|
|
33767
|
+
this.authAbortControllersByServer.get(serverName)?.abort();
|
|
33768
|
+
await this.authCallbackServersByServer.get(serverName)?.close();
|
|
33769
|
+
await pendingFlow.catch(() => void 0);
|
|
33770
|
+
return true;
|
|
33771
|
+
}
|
|
33029
33772
|
/**
|
|
33030
33773
|
* Returns instructions advertised by connected MCP servers during initialize.
|
|
33031
33774
|
*
|
|
@@ -33311,7 +34054,9 @@ To fix this you have three different options:
|
|
|
33311
34054
|
);
|
|
33312
34055
|
this.logger.trackException(mastraError);
|
|
33313
34056
|
this.logger.error("MCPClient errored connecting to MCP server:", { error: mastraError.toString() });
|
|
33314
|
-
|
|
34057
|
+
if (!(error51 instanceof UnauthorizedError)) {
|
|
34058
|
+
this.mcpClientsById.delete(name);
|
|
34059
|
+
}
|
|
33315
34060
|
return mastraError;
|
|
33316
34061
|
}
|
|
33317
34062
|
async getConnectedClientForServer(serverName) {
|
|
@@ -33342,184 +34087,6 @@ To fix this you have three different options:
|
|
|
33342
34087
|
}
|
|
33343
34088
|
};
|
|
33344
34089
|
|
|
33345
|
-
// src/client/oauth-provider.ts
|
|
33346
|
-
var InMemoryOAuthStorage = class {
|
|
33347
|
-
data = /* @__PURE__ */ new Map();
|
|
33348
|
-
set(key, value) {
|
|
33349
|
-
this.data.set(key, value);
|
|
33350
|
-
}
|
|
33351
|
-
get(key) {
|
|
33352
|
-
return this.data.get(key);
|
|
33353
|
-
}
|
|
33354
|
-
delete(key) {
|
|
33355
|
-
this.data.delete(key);
|
|
33356
|
-
}
|
|
33357
|
-
clear() {
|
|
33358
|
-
this.data.clear();
|
|
33359
|
-
}
|
|
33360
|
-
};
|
|
33361
|
-
var MCPOAuthClientProvider = class {
|
|
33362
|
-
_redirectUrl;
|
|
33363
|
-
_clientMetadata;
|
|
33364
|
-
storage;
|
|
33365
|
-
onRedirect;
|
|
33366
|
-
generateState;
|
|
33367
|
-
_clientInfo;
|
|
33368
|
-
constructor(options) {
|
|
33369
|
-
this._redirectUrl = options.redirectUrl;
|
|
33370
|
-
this._clientMetadata = options.clientMetadata;
|
|
33371
|
-
this._clientInfo = options.clientInformation;
|
|
33372
|
-
this.storage = options.storage ?? new InMemoryOAuthStorage();
|
|
33373
|
-
this.onRedirect = options.onRedirectToAuthorization;
|
|
33374
|
-
this.generateState = options.stateGenerator ?? (() => crypto.randomUUID());
|
|
33375
|
-
}
|
|
33376
|
-
/**
|
|
33377
|
-
* The URL to redirect the user agent to after authorization.
|
|
33378
|
-
*/
|
|
33379
|
-
get redirectUrl() {
|
|
33380
|
-
return this._redirectUrl;
|
|
33381
|
-
}
|
|
33382
|
-
/**
|
|
33383
|
-
* Metadata about this OAuth client.
|
|
33384
|
-
*/
|
|
33385
|
-
get clientMetadata() {
|
|
33386
|
-
return this._clientMetadata;
|
|
33387
|
-
}
|
|
33388
|
-
/**
|
|
33389
|
-
* Returns a OAuth2 state parameter.
|
|
33390
|
-
*/
|
|
33391
|
-
async state() {
|
|
33392
|
-
return this.generateState();
|
|
33393
|
-
}
|
|
33394
|
-
/**
|
|
33395
|
-
* Loads information about this OAuth client.
|
|
33396
|
-
*/
|
|
33397
|
-
async clientInformation() {
|
|
33398
|
-
if (this._clientInfo) {
|
|
33399
|
-
return this._clientInfo;
|
|
33400
|
-
}
|
|
33401
|
-
const stored = await this.storage.get("client_info");
|
|
33402
|
-
if (stored) {
|
|
33403
|
-
try {
|
|
33404
|
-
return JSON.parse(stored);
|
|
33405
|
-
} catch {
|
|
33406
|
-
}
|
|
33407
|
-
}
|
|
33408
|
-
return void 0;
|
|
33409
|
-
}
|
|
33410
|
-
/**
|
|
33411
|
-
* Saves dynamically registered client information.
|
|
33412
|
-
*/
|
|
33413
|
-
async saveClientInformation(clientInformation) {
|
|
33414
|
-
this._clientInfo = clientInformation;
|
|
33415
|
-
await this.storage.set("client_info", JSON.stringify(clientInformation));
|
|
33416
|
-
}
|
|
33417
|
-
/**
|
|
33418
|
-
* Loads existing OAuth tokens.
|
|
33419
|
-
*/
|
|
33420
|
-
async tokens() {
|
|
33421
|
-
const stored = await this.storage.get("tokens");
|
|
33422
|
-
if (stored) {
|
|
33423
|
-
try {
|
|
33424
|
-
return JSON.parse(stored);
|
|
33425
|
-
} catch {
|
|
33426
|
-
}
|
|
33427
|
-
}
|
|
33428
|
-
return void 0;
|
|
33429
|
-
}
|
|
33430
|
-
/**
|
|
33431
|
-
* Stores new OAuth tokens after successful authorization.
|
|
33432
|
-
*/
|
|
33433
|
-
async saveTokens(tokens) {
|
|
33434
|
-
await this.storage.set("tokens", JSON.stringify(tokens));
|
|
33435
|
-
}
|
|
33436
|
-
/**
|
|
33437
|
-
* Invoked to redirect the user agent to the authorization URL.
|
|
33438
|
-
*/
|
|
33439
|
-
async redirectToAuthorization(authorizationUrl) {
|
|
33440
|
-
if (this.onRedirect) {
|
|
33441
|
-
await this.onRedirect(authorizationUrl);
|
|
33442
|
-
} else {
|
|
33443
|
-
console.info(`Authorization required. Please visit: ${authorizationUrl.toString()}`);
|
|
33444
|
-
}
|
|
33445
|
-
}
|
|
33446
|
-
/**
|
|
33447
|
-
* Saves a PKCE code verifier before redirecting to authorization.
|
|
33448
|
-
*/
|
|
33449
|
-
async saveCodeVerifier(codeVerifier) {
|
|
33450
|
-
await this.storage.set("code_verifier", codeVerifier);
|
|
33451
|
-
}
|
|
33452
|
-
/**
|
|
33453
|
-
* Loads the PKCE code verifier for validating authorization result.
|
|
33454
|
-
*/
|
|
33455
|
-
async codeVerifier() {
|
|
33456
|
-
const verifier = await this.storage.get("code_verifier");
|
|
33457
|
-
if (!verifier) {
|
|
33458
|
-
throw new Error("No code verifier found. Authorization flow may not have started properly.");
|
|
33459
|
-
}
|
|
33460
|
-
return verifier;
|
|
33461
|
-
}
|
|
33462
|
-
/**
|
|
33463
|
-
* Invalidate credentials when server indicates they're no longer valid.
|
|
33464
|
-
*/
|
|
33465
|
-
async invalidateCredentials(scope) {
|
|
33466
|
-
switch (scope) {
|
|
33467
|
-
case "all":
|
|
33468
|
-
await this.storage.delete("tokens");
|
|
33469
|
-
await this.storage.delete("client_info");
|
|
33470
|
-
await this.storage.delete("code_verifier");
|
|
33471
|
-
this._clientInfo = void 0;
|
|
33472
|
-
break;
|
|
33473
|
-
case "client":
|
|
33474
|
-
await this.storage.delete("client_info");
|
|
33475
|
-
this._clientInfo = void 0;
|
|
33476
|
-
break;
|
|
33477
|
-
case "tokens":
|
|
33478
|
-
await this.storage.delete("tokens");
|
|
33479
|
-
break;
|
|
33480
|
-
case "verifier":
|
|
33481
|
-
await this.storage.delete("code_verifier");
|
|
33482
|
-
break;
|
|
33483
|
-
}
|
|
33484
|
-
}
|
|
33485
|
-
/**
|
|
33486
|
-
* Clear all stored OAuth data.
|
|
33487
|
-
* Useful for logging out or resetting state.
|
|
33488
|
-
*/
|
|
33489
|
-
async clear() {
|
|
33490
|
-
await this.invalidateCredentials("all");
|
|
33491
|
-
}
|
|
33492
|
-
/**
|
|
33493
|
-
* Check if the provider has valid (non-expired) tokens.
|
|
33494
|
-
*/
|
|
33495
|
-
async hasValidTokens() {
|
|
33496
|
-
const currentTokens = await this.tokens();
|
|
33497
|
-
if (!currentTokens) return false;
|
|
33498
|
-
if (!currentTokens.access_token) return false;
|
|
33499
|
-
return true;
|
|
33500
|
-
}
|
|
33501
|
-
};
|
|
33502
|
-
function createSimpleTokenProvider(accessToken, options) {
|
|
33503
|
-
const tokens = {
|
|
33504
|
-
access_token: accessToken,
|
|
33505
|
-
token_type: options.tokenType ?? "Bearer",
|
|
33506
|
-
refresh_token: options.refreshToken,
|
|
33507
|
-
expires_in: options.expiresIn,
|
|
33508
|
-
scope: options.scope
|
|
33509
|
-
};
|
|
33510
|
-
const storage = new InMemoryOAuthStorage();
|
|
33511
|
-
storage.set("tokens", JSON.stringify(tokens));
|
|
33512
|
-
if (options.clientInformation) {
|
|
33513
|
-
storage.set("client_info", JSON.stringify(options.clientInformation));
|
|
33514
|
-
}
|
|
33515
|
-
return new MCPOAuthClientProvider({
|
|
33516
|
-
redirectUrl: options.redirectUrl,
|
|
33517
|
-
clientMetadata: options.clientMetadata,
|
|
33518
|
-
clientInformation: options.clientInformation,
|
|
33519
|
-
storage
|
|
33520
|
-
});
|
|
33521
|
-
}
|
|
33522
|
-
|
|
33523
34090
|
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono/4.12.30/1b2e4fcdfb5fc9f7f51bffc1540f859608c39e01fb7d73d8ab30d60a680eaffc/node_modules/hono/dist/utils/stream.js
|
|
33524
34091
|
var StreamingApi = class {
|
|
33525
34092
|
writer;
|
|
@@ -36208,44 +36775,6 @@ Provided arguments: ${JSON.stringify(args, null, 2)}`,
|
|
|
36208
36775
|
return { resources };
|
|
36209
36776
|
}
|
|
36210
36777
|
};
|
|
36211
|
-
function escapeHeaderValue(value) {
|
|
36212
|
-
return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
36213
|
-
}
|
|
36214
|
-
function generateWWWAuthenticateHeader(options = {}) {
|
|
36215
|
-
const params = [];
|
|
36216
|
-
if (options.resourceMetadataUrl) {
|
|
36217
|
-
params.push(`resource_metadata="${escapeHeaderValue(options.resourceMetadataUrl)}"`);
|
|
36218
|
-
}
|
|
36219
|
-
if (options.additionalParams) {
|
|
36220
|
-
for (const [key, value] of Object.entries(options.additionalParams)) {
|
|
36221
|
-
params.push(`${key}="${escapeHeaderValue(value)}"`);
|
|
36222
|
-
}
|
|
36223
|
-
}
|
|
36224
|
-
if (params.length === 0) {
|
|
36225
|
-
return "Bearer";
|
|
36226
|
-
}
|
|
36227
|
-
return `Bearer ${params.join(", ")}`;
|
|
36228
|
-
}
|
|
36229
|
-
function generateProtectedResourceMetadata(config2) {
|
|
36230
|
-
return {
|
|
36231
|
-
resource: config2.resource,
|
|
36232
|
-
authorization_servers: config2.authorizationServers,
|
|
36233
|
-
scopes_supported: config2.scopesSupported ?? ["mcp:read", "mcp:write"],
|
|
36234
|
-
bearer_methods_supported: ["header"],
|
|
36235
|
-
...config2.resourceName && { resource_name: config2.resourceName },
|
|
36236
|
-
...config2.resourceDocumentation && {
|
|
36237
|
-
resource_documentation: config2.resourceDocumentation
|
|
36238
|
-
}
|
|
36239
|
-
};
|
|
36240
|
-
}
|
|
36241
|
-
function extractBearerToken(authHeader) {
|
|
36242
|
-
if (!authHeader) return void 0;
|
|
36243
|
-
const prefix = "bearer ";
|
|
36244
|
-
if (authHeader.length <= prefix.length) return void 0;
|
|
36245
|
-
if (authHeader.slice(0, prefix.length).toLowerCase() !== prefix) return void 0;
|
|
36246
|
-
const token = authHeader.slice(prefix.length).trim();
|
|
36247
|
-
return token || void 0;
|
|
36248
|
-
}
|
|
36249
36778
|
|
|
36250
36779
|
// src/server/oauth-middleware.ts
|
|
36251
36780
|
function createOAuthMiddleware(options) {
|
|
@@ -36412,6 +36941,6 @@ function createIntrospectionValidator(introspectionEndpoint, clientCredentials)
|
|
|
36412
36941
|
};
|
|
36413
36942
|
}
|
|
36414
36943
|
|
|
36415
|
-
export { InMemoryOAuthStorage, InternalMastraMCPClient, MCPClient, MCPClientServerProxy, MCPOAuthClientProvider, MCPServer, createIntrospectionValidator, createOAuthMiddleware, createSimpleTokenProvider, createStaticTokenValidator, extractBearerToken, generateProtectedResourceMetadata, generateWWWAuthenticateHeader };
|
|
36944
|
+
export { InMemoryOAuthStorage, InternalMastraMCPClient, MCPClient, MCPClientServerProxy, MCPOAuthClientProvider, MCPServer, createIntrospectionValidator, createOAuthCallbackServer, createOAuthMiddleware, createSimpleTokenProvider, createStaticTokenValidator, extractBearerToken, generateProtectedResourceMetadata, generateWWWAuthenticateHeader, getCallbackUrlCandidates };
|
|
36416
36945
|
//# sourceMappingURL=index.js.map
|
|
36417
36946
|
//# sourceMappingURL=index.js.map
|