@frontmcp/sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/package.json +29 -0
- package/src/constants.d.ts +30 -0
- package/src/constants.js +36 -0
- package/src/constants.js.map +1 -0
- package/src/decorators/adapter.decorator.d.ts +7 -0
- package/src/decorators/adapter.decorator.js +20 -0
- package/src/decorators/adapter.decorator.js.map +1 -0
- package/src/decorators/app.decorator.d.ts +7 -0
- package/src/decorators/app.decorator.js +44 -0
- package/src/decorators/app.decorator.js.map +1 -0
- package/src/decorators/auth-provider.decorator.d.ts +7 -0
- package/src/decorators/auth-provider.decorator.js +20 -0
- package/src/decorators/auth-provider.decorator.js.map +1 -0
- package/src/decorators/flow-hooks.decorator.d.ts +12 -0
- package/src/decorators/flow-hooks.decorator.js +63 -0
- package/src/decorators/flow-hooks.decorator.js.map +1 -0
- package/src/decorators/flow.decorator.d.ts +6 -0
- package/src/decorators/flow.decorator.js +19 -0
- package/src/decorators/flow.decorator.js.map +1 -0
- package/src/decorators/front-mcp.decorator.d.ts +6 -0
- package/src/decorators/front-mcp.decorator.js +40 -0
- package/src/decorators/front-mcp.decorator.js.map +1 -0
- package/src/decorators/index.d.ts +12 -0
- package/src/decorators/index.js +16 -0
- package/src/decorators/index.js.map +1 -0
- package/src/decorators/logger.decorator.d.ts +7 -0
- package/src/decorators/logger.decorator.js +20 -0
- package/src/decorators/logger.decorator.js.map +1 -0
- package/src/decorators/plugin.decorator.d.ts +7 -0
- package/src/decorators/plugin.decorator.js +38 -0
- package/src/decorators/plugin.decorator.js.map +1 -0
- package/src/decorators/prompt.decorator.d.ts +13 -0
- package/src/decorators/prompt.decorator.js +38 -0
- package/src/decorators/prompt.decorator.js.map +1 -0
- package/src/decorators/provider.decorator.d.ts +7 -0
- package/src/decorators/provider.decorator.js +20 -0
- package/src/decorators/provider.decorator.js.map +1 -0
- package/src/decorators/resource.decorator.d.ts +17 -0
- package/src/decorators/resource.decorator.js +52 -0
- package/src/decorators/resource.decorator.js.map +1 -0
- package/src/decorators/tool.decorator.d.ts +14 -0
- package/src/decorators/tool.decorator.js +38 -0
- package/src/decorators/tool.decorator.js.map +1 -0
- package/src/decorators-old/async-with.decorator.d.ts +9 -0
- package/src/decorators-old/async-with.decorator.js +23 -0
- package/src/decorators-old/async-with.decorator.js.map +1 -0
- package/src/decorators-old/auth-hook.decorator.d.ts +14 -0
- package/src/decorators-old/auth-hook.decorator.js +27 -0
- package/src/decorators-old/auth-hook.decorator.js.map +1 -0
- package/src/decorators-old/session-hook.decorator.d.ts +14 -0
- package/src/decorators-old/session-hook.decorator.js +27 -0
- package/src/decorators-old/session-hook.decorator.js.map +1 -0
- package/src/decorators-old/tool-hook.decorator.d.ts +14 -0
- package/src/decorators-old/tool-hook.decorator.js +27 -0
- package/src/decorators-old/tool-hook.decorator.js.map +1 -0
- package/src/dynamic/dynamic.adapter.d.ts +42 -0
- package/src/dynamic/dynamic.adapter.js +28 -0
- package/src/dynamic/dynamic.adapter.js.map +1 -0
- package/src/dynamic/dynamic.plugin.d.ts +52 -0
- package/src/dynamic/dynamic.plugin.js +33 -0
- package/src/dynamic/dynamic.plugin.js.map +1 -0
- package/src/dynamic/dynamic.utils.d.ts +3 -0
- package/src/dynamic/dynamic.utils.js +27 -0
- package/src/dynamic/dynamic.utils.js.map +1 -0
- package/src/dynamic/index.d.ts +2 -0
- package/src/dynamic/index.js +6 -0
- package/src/dynamic/index.js.map +1 -0
- package/src/entries/adapter.entry.d.ts +6 -0
- package/src/entries/adapter.entry.js +8 -0
- package/src/entries/adapter.entry.js.map +1 -0
- package/src/entries/app.entry.d.ts +13 -0
- package/src/entries/app.entry.js +9 -0
- package/src/entries/app.entry.js.map +1 -0
- package/src/entries/auth-provider.entry.d.ts +6 -0
- package/src/entries/auth-provider.entry.js +8 -0
- package/src/entries/auth-provider.entry.js.map +1 -0
- package/src/entries/base.entry.d.ts +20 -0
- package/src/entries/base.entry.js +17 -0
- package/src/entries/base.entry.js.map +1 -0
- package/src/entries/flow.entry.d.ts +15 -0
- package/src/entries/flow.entry.js +21 -0
- package/src/entries/flow.entry.js.map +1 -0
- package/src/entries/index.d.ts +12 -0
- package/src/entries/index.js +16 -0
- package/src/entries/index.js.map +1 -0
- package/src/entries/logger.entry.d.ts +6 -0
- package/src/entries/logger.entry.js +8 -0
- package/src/entries/logger.entry.js.map +1 -0
- package/src/entries/plugin.entry.d.ts +6 -0
- package/src/entries/plugin.entry.js +8 -0
- package/src/entries/plugin.entry.js.map +1 -0
- package/src/entries/prompt.entry.d.ts +6 -0
- package/src/entries/prompt.entry.js +8 -0
- package/src/entries/prompt.entry.js.map +1 -0
- package/src/entries/provider.entry.d.ts +7 -0
- package/src/entries/provider.entry.js +8 -0
- package/src/entries/provider.entry.js.map +1 -0
- package/src/entries/resource.entry.d.ts +7 -0
- package/src/entries/resource.entry.js +11 -0
- package/src/entries/resource.entry.js.map +1 -0
- package/src/entries/scope.entry.d.ts +17 -0
- package/src/entries/scope.entry.js +8 -0
- package/src/entries/scope.entry.js.map +1 -0
- package/src/entries/tool.entry.d.ts +15 -0
- package/src/entries/tool.entry.js +11 -0
- package/src/entries/tool.entry.js.map +1 -0
- package/src/index.d.ts +18 -0
- package/src/index.js +22 -0
- package/src/index.js.map +1 -0
- package/src/interfaces/adapter.interface.d.ts +20 -0
- package/src/interfaces/adapter.interface.js +3 -0
- package/src/interfaces/adapter.interface.js.map +1 -0
- package/src/interfaces/app.interface.d.ts +6 -0
- package/src/interfaces/app.interface.js +3 -0
- package/src/interfaces/app.interface.js.map +1 -0
- package/src/interfaces/auth-hook.interface.d.ts +126 -0
- package/src/interfaces/auth-hook.interface.js +135 -0
- package/src/interfaces/auth-hook.interface.js.map +1 -0
- package/src/interfaces/auth-provider.interface.d.ts +22 -0
- package/src/interfaces/auth-provider.interface.js +18 -0
- package/src/interfaces/auth-provider.interface.js.map +1 -0
- package/src/interfaces/base.interface.d.ts +77 -0
- package/src/interfaces/base.interface.js +3 -0
- package/src/interfaces/base.interface.js.map +1 -0
- package/src/interfaces/flow.interface.d.ts +38 -0
- package/src/interfaces/flow.interface.js +69 -0
- package/src/interfaces/flow.interface.js.map +1 -0
- package/src/interfaces/front-mcp.interface.d.ts +5 -0
- package/src/interfaces/front-mcp.interface.js +3 -0
- package/src/interfaces/front-mcp.interface.js.map +1 -0
- package/src/interfaces/index.d.ts +15 -0
- package/src/interfaces/index.js +19 -0
- package/src/interfaces/index.js.map +1 -0
- package/src/interfaces/internal/flow.utils.d.ts +24 -0
- package/src/interfaces/internal/flow.utils.js +83 -0
- package/src/interfaces/internal/flow.utils.js.map +1 -0
- package/src/interfaces/internal/index.d.ts +2 -0
- package/src/interfaces/internal/index.js +7 -0
- package/src/interfaces/internal/index.js.map +1 -0
- package/src/interfaces/internal/primary-auth-provider.interface.d.ts +24 -0
- package/src/interfaces/internal/primary-auth-provider.interface.js +33 -0
- package/src/interfaces/internal/primary-auth-provider.interface.js.map +1 -0
- package/src/interfaces/internal/registry.interface.d.ts +71 -0
- package/src/interfaces/internal/registry.interface.js +3 -0
- package/src/interfaces/internal/registry.interface.js.map +1 -0
- package/src/interfaces/logger.interface.d.ts +42 -0
- package/src/interfaces/logger.interface.js +10 -0
- package/src/interfaces/logger.interface.js.map +1 -0
- package/src/interfaces/plugin.interface.d.ts +8 -0
- package/src/interfaces/plugin.interface.js +3 -0
- package/src/interfaces/plugin.interface.js.map +1 -0
- package/src/interfaces/prompt.interface.d.ts +5 -0
- package/src/interfaces/prompt.interface.js +3 -0
- package/src/interfaces/prompt.interface.js.map +1 -0
- package/src/interfaces/provider.interface.d.ts +20 -0
- package/src/interfaces/provider.interface.js +18 -0
- package/src/interfaces/provider.interface.js.map +1 -0
- package/src/interfaces/resource.interface.d.ts +21 -0
- package/src/interfaces/resource.interface.js +3 -0
- package/src/interfaces/resource.interface.js.map +1 -0
- package/src/interfaces/scope.interface.d.ts +5 -0
- package/src/interfaces/scope.interface.js +3 -0
- package/src/interfaces/scope.interface.js.map +1 -0
- package/src/interfaces/server.interface.d.ts +46 -0
- package/src/interfaces/server.interface.js +18 -0
- package/src/interfaces/server.interface.js.map +1 -0
- package/src/interfaces/session-hook.interface.d.ts +131 -0
- package/src/interfaces/session-hook.interface.js +140 -0
- package/src/interfaces/session-hook.interface.js.map +1 -0
- package/src/interfaces/tool-hook.interface.d.ts +80 -0
- package/src/interfaces/tool-hook.interface.js +92 -0
- package/src/interfaces/tool-hook.interface.js.map +1 -0
- package/src/interfaces/tool.interface.d.ts +45 -0
- package/src/interfaces/tool.interface.js +89 -0
- package/src/interfaces/tool.interface.js.map +1 -0
- package/src/metadata/adapter.metadata.d.ts +22 -0
- package/src/metadata/adapter.metadata.js +10 -0
- package/src/metadata/adapter.metadata.js.map +1 -0
- package/src/metadata/app.metadata.d.ts +872 -0
- package/src/metadata/app.metadata.js +30 -0
- package/src/metadata/app.metadata.js.map +1 -0
- package/src/metadata/auth-provider.metadata.d.ts +33 -0
- package/src/metadata/auth-provider.metadata.js +19 -0
- package/src/metadata/auth-provider.metadata.js.map +1 -0
- package/src/metadata/flow-hooks.metadata.d.ts +20 -0
- package/src/metadata/flow-hooks.metadata.js +3 -0
- package/src/metadata/flow-hooks.metadata.js.map +1 -0
- package/src/metadata/flow.metadata.d.ts +75 -0
- package/src/metadata/flow.metadata.js +15 -0
- package/src/metadata/flow.metadata.js.map +1 -0
- package/src/metadata/front-mcp.metadata.d.ts +1144 -0
- package/src/metadata/front-mcp.metadata.js +25 -0
- package/src/metadata/front-mcp.metadata.js.map +1 -0
- package/src/metadata/index.d.ts +12 -0
- package/src/metadata/index.js +16 -0
- package/src/metadata/index.js.map +1 -0
- package/src/metadata/logger.metadata.d.ts +39 -0
- package/src/metadata/logger.metadata.js +10 -0
- package/src/metadata/logger.metadata.js.map +1 -0
- package/src/metadata/plugin.metadata.d.ts +93 -0
- package/src/metadata/plugin.metadata.js +18 -0
- package/src/metadata/plugin.metadata.js.map +1 -0
- package/src/metadata/prompt.metadata.d.ts +226 -0
- package/src/metadata/prompt.metadata.js +27 -0
- package/src/metadata/prompt.metadata.js.map +1 -0
- package/src/metadata/provider.metadata.d.ts +34 -0
- package/src/metadata/provider.metadata.js +20 -0
- package/src/metadata/provider.metadata.js.map +1 -0
- package/src/metadata/resource.metadata.d.ts +199 -0
- package/src/metadata/resource.metadata.js +22 -0
- package/src/metadata/resource.metadata.js.map +1 -0
- package/src/metadata/tool.metadata.d.ts +278 -0
- package/src/metadata/tool.metadata.js +28 -0
- package/src/metadata/tool.metadata.js.map +1 -0
- package/src/providers/session.provider.d.ts +13 -0
- package/src/providers/session.provider.js +27 -0
- package/src/providers/session.provider.js.map +1 -0
- package/src/records/adapter.record.d.ts +26 -0
- package/src/records/adapter.record.js +11 -0
- package/src/records/adapter.record.js.map +1 -0
- package/src/records/app.record.d.ts +19 -0
- package/src/records/app.record.js +9 -0
- package/src/records/app.record.js.map +1 -0
- package/src/records/auth-provider.record.d.ts +37 -0
- package/src/records/auth-provider.record.js +12 -0
- package/src/records/auth-provider.record.js.map +1 -0
- package/src/records/flow.record.d.ts +11 -0
- package/src/records/flow.record.js +8 -0
- package/src/records/flow.record.js.map +1 -0
- package/src/records/index.d.ts +11 -0
- package/src/records/index.js +15 -0
- package/src/records/index.js.map +1 -0
- package/src/records/logger.record.d.ts +11 -0
- package/src/records/logger.record.js +8 -0
- package/src/records/logger.record.js.map +1 -0
- package/src/records/plugin.record.d.ts +21 -0
- package/src/records/plugin.record.js +11 -0
- package/src/records/plugin.record.js.map +1 -0
- package/src/records/prompt.record.d.ts +18 -0
- package/src/records/prompt.record.js +9 -0
- package/src/records/prompt.record.js.map +1 -0
- package/src/records/provider.record.d.ts +36 -0
- package/src/records/provider.record.js +14 -0
- package/src/records/provider.record.js.map +1 -0
- package/src/records/resource.record.d.ts +18 -0
- package/src/records/resource.record.js +14 -0
- package/src/records/resource.record.js.map +1 -0
- package/src/records/scope.record.d.ts +18 -0
- package/src/records/scope.record.js +9 -0
- package/src/records/scope.record.js.map +1 -0
- package/src/records/tool.record.d.ts +17 -0
- package/src/records/tool.record.js +9 -0
- package/src/records/tool.record.js.map +1 -0
- package/src/schemas/annotated-class.schema.d.ts +11 -0
- package/src/schemas/annotated-class.schema.js +40 -0
- package/src/schemas/annotated-class.schema.js.map +1 -0
- package/src/schemas/http-input.schema.d.ts +33 -0
- package/src/schemas/http-input.schema.js +13 -0
- package/src/schemas/http-input.schema.js.map +1 -0
- package/src/schemas/http-output.schema.d.ts +2011 -0
- package/src/schemas/http-output.schema.js +283 -0
- package/src/schemas/http-output.schema.js.map +1 -0
- package/src/schemas/index.d.ts +3 -0
- package/src/schemas/index.js +7 -0
- package/src/schemas/index.js.map +1 -0
- package/src/tokens/adapter.tokens.d.ts +3 -0
- package/src/tokens/adapter.tokens.js +11 -0
- package/src/tokens/adapter.tokens.js.map +1 -0
- package/src/tokens/app.tokens.d.ts +4 -0
- package/src/tokens/app.tokens.js +30 -0
- package/src/tokens/app.tokens.js.map +1 -0
- package/src/tokens/auth-provider.tokens.d.ts +3 -0
- package/src/tokens/auth-provider.tokens.js +12 -0
- package/src/tokens/auth-provider.tokens.js.map +1 -0
- package/src/tokens/base.tokens.d.ts +5 -0
- package/src/tokens/base.tokens.js +9 -0
- package/src/tokens/base.tokens.js.map +1 -0
- package/src/tokens/flow-hook.tokens.d.ts +4 -0
- package/src/tokens/flow-hook.tokens.js +9 -0
- package/src/tokens/flow-hook.tokens.js.map +1 -0
- package/src/tokens/flow.tokens.d.ts +11 -0
- package/src/tokens/flow.tokens.js +16 -0
- package/src/tokens/flow.tokens.js.map +1 -0
- package/src/tokens/front-mcp.tokens.d.ts +3 -0
- package/src/tokens/front-mcp.tokens.js +19 -0
- package/src/tokens/front-mcp.tokens.js.map +1 -0
- package/src/tokens/index.d.ts +13 -0
- package/src/tokens/index.js +17 -0
- package/src/tokens/index.js.map +1 -0
- package/src/tokens/logger.tokens.d.ts +3 -0
- package/src/tokens/logger.tokens.js +11 -0
- package/src/tokens/logger.tokens.js.map +1 -0
- package/src/tokens/plugin.tokens.d.ts +13 -0
- package/src/tokens/plugin.tokens.js +18 -0
- package/src/tokens/plugin.tokens.js.map +1 -0
- package/src/tokens/prompt.tokens.d.ts +9 -0
- package/src/tokens/prompt.tokens.js +14 -0
- package/src/tokens/prompt.tokens.js.map +1 -0
- package/src/tokens/provider.tokens.d.ts +3 -0
- package/src/tokens/provider.tokens.js +12 -0
- package/src/tokens/provider.tokens.js.map +1 -0
- package/src/tokens/resource.tokens.d.ts +20 -0
- package/src/tokens/resource.tokens.js +25 -0
- package/src/tokens/resource.tokens.js.map +1 -0
- package/src/tokens/server.tokens.d.ts +6 -0
- package/src/tokens/server.tokens.js +11 -0
- package/src/tokens/server.tokens.js.map +1 -0
- package/src/tokens/tool.tokens.d.ts +13 -0
- package/src/tokens/tool.tokens.js +18 -0
- package/src/tokens/tool.tokens.js.map +1 -0
- package/src/types/auth/index.d.ts +2 -0
- package/src/types/auth/index.js +6 -0
- package/src/types/auth/index.js.map +1 -0
- package/src/types/auth/jwt.types.d.ts +112 -0
- package/src/types/auth/jwt.types.js +36 -0
- package/src/types/auth/jwt.types.js.map +1 -0
- package/src/types/auth/session.types.d.ts +263 -0
- package/src/types/auth/session.types.js +40 -0
- package/src/types/auth/session.types.js.map +1 -0
- package/src/types/common.types.d.ts +11 -0
- package/src/types/common.types.js +3 -0
- package/src/types/common.types.js.map +1 -0
- package/src/types/index.d.ts +3 -0
- package/src/types/index.js +7 -0
- package/src/types/index.js.map +1 -0
- package/src/types/options/auth.options.d.ts +513 -0
- package/src/types/options/auth.options.js +53 -0
- package/src/types/options/auth.options.js.map +1 -0
- package/src/types/options/http.options.d.ts +22 -0
- package/src/types/options/http.options.js +10 -0
- package/src/types/options/http.options.js.map +1 -0
- package/src/types/options/index.d.ts +5 -0
- package/src/types/options/index.js +9 -0
- package/src/types/options/index.js.map +1 -0
- package/src/types/options/logging.options.d.ts +39 -0
- package/src/types/options/logging.options.js +37 -0
- package/src/types/options/logging.options.js.map +1 -0
- package/src/types/options/server-info.options.d.ts +48 -0
- package/src/types/options/server-info.options.js +13 -0
- package/src/types/options/server-info.options.js.map +1 -0
- package/src/types/options/session.options.d.ts +67 -0
- package/src/types/options/session.options.js +9 -0
- package/src/types/options/session.options.js.map +1 -0
- package/src/utils/decide-request-intent.utils.d.ts +79 -0
- package/src/utils/decide-request-intent.utils.js +326 -0
- package/src/utils/decide-request-intent.utils.js.map +1 -0
- package/src/utils/index.d.ts +2 -0
- package/src/utils/index.js +6 -0
- package/src/utils/index.js.map +1 -0
- package/src/utils/path.utils.d.ts +20 -0
- package/src/utils/path.utils.js +66 -0
- package/src/utils/path.utils.js.map +1 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.frontMcpMetadataSchema = exports.frontMcpBaseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
const schemas_1 = require("../schemas");
|
|
7
|
+
exports.frontMcpBaseSchema = zod_1.z.object({
|
|
8
|
+
info: types_1.serverInfoOptionsSchema,
|
|
9
|
+
providers: zod_1.z.array(schemas_1.annotatedFrontMcpProvidersSchema).optional().default([]),
|
|
10
|
+
apps: zod_1.z.array(schemas_1.annotatedFrontMcpAppSchema),
|
|
11
|
+
serve: zod_1.z.boolean().optional().default(true),
|
|
12
|
+
http: types_1.httpOptionsSchema.optional().default({}),
|
|
13
|
+
session: types_1.sessionOptionsSchema.optional().default({}),
|
|
14
|
+
logging: types_1.loggingOptionsSchema.optional().default({}),
|
|
15
|
+
});
|
|
16
|
+
const frontMcpMultiAppSchema = exports.frontMcpBaseSchema.extend({
|
|
17
|
+
splitByApp: zod_1.z.literal(false).default(false).describe('If true, each app gets its own scope & basePath.'),
|
|
18
|
+
auth: types_1.authOptionsSchema.optional().describe('Configures the server\'s default authentication provider.'),
|
|
19
|
+
});
|
|
20
|
+
const frontMcpSplitByAppSchema = exports.frontMcpBaseSchema.extend({
|
|
21
|
+
splitByApp: zod_1.z.literal(true).describe('If false, apps are grouped under the same scope & basePath.'),
|
|
22
|
+
auth: zod_1.z.never().optional(),
|
|
23
|
+
});
|
|
24
|
+
exports.frontMcpMetadataSchema = frontMcpMultiAppSchema.or(frontMcpSplitByAppSchema);
|
|
25
|
+
//# sourceMappingURL=front-mcp.metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"front-mcp.metadata.js","sourceRoot":"","sources":["../../../src/metadata/front-mcp.metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AACtB,oCAYkB;AAClB,wCAGoB;AAqBP,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,+BAAuB;IAC7B,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,0CAAgC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3E,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,oCAA0B,CAAC;IACzC,KAAK,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3C,IAAI,EAAE,yBAAiB,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9C,OAAO,EAAE,4BAAoB,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACpD,OAAO,EAAE,4BAAoB,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CACT,CAAC,CAAC;AAQ/C,MAAM,sBAAsB,GAAG,0BAAkB,CAAC,MAAM,CAAC;IACvD,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,kDAAkD,CAAC;IACxG,IAAI,EAAE,yBAAiB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;CACnC,CAAC,CAAC;AAQzE,MAAM,wBAAwB,GAAG,0BAAkB,CAAC,MAAM,CAAC;IACzD,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,6DAA6D,CAAC;IACnG,IAAI,EAAE,OAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;CAC6C,CAAC,CAAC;AAK9D,QAAA,sBAAsB,GAAG,sBAAsB,CAAC,EAAE,CAAC,wBAAwB,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\nimport {\n AuthOptions,\n authOptionsSchema,\n SessionOptions,\n sessionOptionsSchema,\n ServerInfoOptions,\n serverInfoOptionsSchema,\n HttpOptions,\n httpOptionsSchema,\n LoggingOptions,\n loggingOptionsSchema,\n RawZodShape,\n} from '../types';\nimport {\n annotatedFrontMcpAppSchema,\n annotatedFrontMcpProvidersSchema,\n} from '../schemas';\nimport {AppType, ProviderType} from '../interfaces';\n\n\nexport interface FrontMcpBaseMetadata {\n info: ServerInfoOptions;\n apps: AppType[];\n http?: HttpOptions;\n session?: SessionOptions;\n logging?: LoggingOptions;\n\n serve?: boolean; // default to true\n\n /**\n * Additional providers that are available to all apps.\n */\n providers?: ProviderType[];\n\n\n}\n\nexport const frontMcpBaseSchema = z.object({\n info: serverInfoOptionsSchema,\n providers: z.array(annotatedFrontMcpProvidersSchema).optional().default([]),\n apps: z.array(annotatedFrontMcpAppSchema),\n serve: z.boolean().optional().default(true),\n http: httpOptionsSchema.optional().default({}),\n session: sessionOptionsSchema.optional().default({}),\n logging: loggingOptionsSchema.optional().default({}),\n} satisfies RawZodShape<FrontMcpBaseMetadata>);\n\n\nexport interface FrontMcpMultiAppMetadata extends FrontMcpBaseMetadata {\n splitByApp?: false;\n auth?: AuthOptions;\n}\n\nconst frontMcpMultiAppSchema = frontMcpBaseSchema.extend({\n splitByApp: z.literal(false).default(false).describe('If true, each app gets its own scope & basePath.'),\n auth: authOptionsSchema.optional().describe('Configures the server\\'s default authentication provider.'),\n} satisfies RawZodShape<FrontMcpMultiAppMetadata, FrontMcpBaseMetadata>);\n\n\nexport interface FrontMcpSplitByAppMetadata extends FrontMcpBaseMetadata {\n splitByApp: true;\n auth?: never;\n}\n\nconst frontMcpSplitByAppSchema = frontMcpBaseSchema.extend({\n splitByApp: z.literal(true).describe('If false, apps are grouped under the same scope & basePath.'),\n auth: z.never().optional(),\n} satisfies RawZodShape<FrontMcpSplitByAppMetadata, FrontMcpBaseMetadata>);\n\n\nexport type FrontMcpMetadata = FrontMcpMultiAppMetadata | FrontMcpSplitByAppMetadata;\n\nexport const frontMcpMetadataSchema = frontMcpMultiAppSchema.or(frontMcpSplitByAppSchema);\n\nexport type FrontMcpMultiAppConfig = z.infer<typeof frontMcpMultiAppSchema>;\nexport type FrontMcpSplitByAppConfig = z.infer<typeof frontMcpSplitByAppSchema>;\n\n\nexport type FrontMcpConfigType = z.infer<typeof frontMcpMetadataSchema>;\n\nexport interface AppScopeMetadata extends Omit<FrontMcpSplitByAppMetadata, 'auth' | 'splitByApp'> {\n id: string;\n apps: [AppType];\n auth?: AuthOptions;\n}\n\nexport interface MultiAppScopeMetadata extends FrontMcpMultiAppMetadata {\n id: string;\n apps: AppType[];\n}\n\nexport type ScopeMetadata = AppScopeMetadata | MultiAppScopeMetadata;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './front-mcp.metadata';
|
|
2
|
+
export * from './flow.metadata';
|
|
3
|
+
export * from './flow-hooks.metadata';
|
|
4
|
+
export * from './app.metadata';
|
|
5
|
+
export * from './provider.metadata';
|
|
6
|
+
export * from './auth-provider.metadata';
|
|
7
|
+
export * from './adapter.metadata';
|
|
8
|
+
export * from './plugin.metadata';
|
|
9
|
+
export * from './tool.metadata';
|
|
10
|
+
export * from './resource.metadata';
|
|
11
|
+
export * from './prompt.metadata';
|
|
12
|
+
export * from './logger.metadata';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./front-mcp.metadata"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./flow.metadata"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./flow-hooks.metadata"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./app.metadata"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./provider.metadata"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./auth-provider.metadata"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./adapter.metadata"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./plugin.metadata"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./tool.metadata"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./resource.metadata"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./prompt.metadata"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./logger.metadata"), exports);
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/metadata/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,0DAAgC;AAChC,gEAAsC;AACtC,yDAA+B;AAC/B,8DAAoC;AACpC,mEAAyC;AACzC,6DAAmC;AACnC,4DAAkC;AAClC,0DAAgC;AAChC,8DAAoC;AACpC,4DAAkC;AAClC,4DAAkC","sourcesContent":["export * from './front-mcp.metadata';\nexport * from './flow.metadata';\nexport * from './flow-hooks.metadata';\nexport * from './app.metadata';\nexport * from './provider.metadata';\nexport * from './auth-provider.metadata';\nexport * from './adapter.metadata';\nexport * from './plugin.metadata';\nexport * from './tool.metadata';\nexport * from './resource.metadata';\nexport * from './prompt.metadata';\nexport * from './logger.metadata';\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare global {
|
|
3
|
+
/**
|
|
4
|
+
* Declarative metadata extends to an FrontMcpLogger decorator.
|
|
5
|
+
*/
|
|
6
|
+
export interface ExtendFrontMcpLoggerMetadata {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Declarative metadata describing what a FrontMcpLogger contributes.
|
|
11
|
+
*/
|
|
12
|
+
export interface LogTransportMetadata extends ExtendFrontMcpLoggerMetadata {
|
|
13
|
+
/**
|
|
14
|
+
* Optional unique identifier for the logger.
|
|
15
|
+
* If omitted, a consumer may derive an ID from the class or file name.
|
|
16
|
+
*/
|
|
17
|
+
id?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Human‑readable name of the logger, used in UIs, logs, and discovery.
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* Short summary describing what the logger does and when to use it.
|
|
24
|
+
*/
|
|
25
|
+
description?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const frontMcpLogTransportMetadataSchema: z.ZodObject<{
|
|
28
|
+
id: z.ZodOptional<z.ZodString>;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
description: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
32
|
+
id: z.ZodOptional<z.ZodString>;
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
description: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
36
|
+
id: z.ZodOptional<z.ZodString>;
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
description: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.frontMcpLogTransportMetadataSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.frontMcpLogTransportMetadataSchema = zod_1.z.object({
|
|
6
|
+
id: zod_1.z.string().optional(),
|
|
7
|
+
name: zod_1.z.string().min(1),
|
|
8
|
+
description: zod_1.z.string().optional(),
|
|
9
|
+
}).passthrough();
|
|
10
|
+
//# sourceMappingURL=logger.metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.metadata.js","sourceRoot":"","sources":["../../../src/metadata/logger.metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAiCX,QAAA,kCAAkC,GAAG,OAAC,CAAC,MAAM,CAAC;IACzD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACuC,CAAC,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport { RawZodShape } from '../types';\n\ndeclare global {\n /**\n * Declarative metadata extends to an FrontMcpLogger decorator.\n */\n export interface ExtendFrontMcpLoggerMetadata {\n }\n}\n\n/**\n * Declarative metadata describing what a FrontMcpLogger contributes.\n */\nexport interface LogTransportMetadata extends ExtendFrontMcpLoggerMetadata {\n /**\n * Optional unique identifier for the logger.\n * If omitted, a consumer may derive an ID from the class or file name.\n */\n id?: string;\n\n /**\n * Human‑readable name of the logger, used in UIs, logs, and discovery.\n */\n name: string;\n\n /**\n * Short summary describing what the logger does and when to use it.\n */\n description?: string;\n}\n\n\nexport const frontMcpLogTransportMetadataSchema = z.object({\n id: z.string().optional(),\n name: z.string().min(1),\n description: z.string().optional(),\n} satisfies RawZodShape<LogTransportMetadata, ExtendFrontMcpLoggerMetadata>).passthrough();\n\n"]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ProviderType, PluginType, AdapterType, ToolType, ResourceType, PromptType } from '../interfaces';
|
|
3
|
+
/**
|
|
4
|
+
* Declarative metadata describing what an McpPlugin contributes at app scope.
|
|
5
|
+
*/
|
|
6
|
+
export interface PluginMetadata {
|
|
7
|
+
/**
|
|
8
|
+
* Human-friendly name for this app as shown in UIs, logs, and describe reports.
|
|
9
|
+
* Keep it short, stable, and unique within a gateway (consider prefixes).
|
|
10
|
+
*/
|
|
11
|
+
id?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Human-friendly name for this app as shown in UIs, logs, and describe reports.
|
|
14
|
+
* Keep it short, stable, and unique within a gateway (consider prefixes).
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional longer explanation of what the app does and what it exposes.
|
|
19
|
+
* Used for documentation, describe reports, and UIs. Avoid secrets/PII.
|
|
20
|
+
*/
|
|
21
|
+
description?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Plugin-scoped providers Named singleton (or scoped-singleton) dependencies used by tools/plugins at runtime
|
|
24
|
+
* — e.g., config, database pools, Redis clients, queues, KMS.
|
|
25
|
+
*
|
|
26
|
+
* Resolution is hierarchical (tool → app → gateway). Providers may depend on
|
|
27
|
+
* other providers and are usually initialized lazily on first use.
|
|
28
|
+
*/
|
|
29
|
+
providers?: ProviderType[];
|
|
30
|
+
/**
|
|
31
|
+
* Plugin can export providers to be used in the host app or other plugins,
|
|
32
|
+
* e.g. for AuthPlugin can export AuthSession to be used in other plugins / apps.
|
|
33
|
+
*
|
|
34
|
+
* Resolution is hierarchical (tool → app → gateway). Providers may depend on
|
|
35
|
+
* other providers and are usually initialized lazily on first use.
|
|
36
|
+
*/
|
|
37
|
+
exports?: ProviderType[];
|
|
38
|
+
/**
|
|
39
|
+
* Plugin-scoped plugins that participate in lifecycle events and can contribute
|
|
40
|
+
* additional capabilities (tools, resources, prompts, providers, adapters).
|
|
41
|
+
* Use plugins to enforce policy, auth, PII reduction, tracing, etc.
|
|
42
|
+
*/
|
|
43
|
+
plugins?: PluginType[];
|
|
44
|
+
/**
|
|
45
|
+
* Plugin-scoped Adapters attached to this app that convert external definitions or sources
|
|
46
|
+
* (e.g., OpenAPI, Lambda, Custom) into generated tools/resources/prompts.
|
|
47
|
+
* Common options include include/exclude filters, name prefixes, base URLs,
|
|
48
|
+
* and authentication (often provided by plugins).
|
|
49
|
+
*/
|
|
50
|
+
adapters?: AdapterType[];
|
|
51
|
+
/**
|
|
52
|
+
* Plugin-scoped Inline tools authored by this app (via builder or class). These are active
|
|
53
|
+
* actions with input/output schemas that the model can call. Tools generated
|
|
54
|
+
* by adapters do not need to be listed here.
|
|
55
|
+
*/
|
|
56
|
+
tools?: ToolType[];
|
|
57
|
+
resources?: ResourceType[];
|
|
58
|
+
prompts?: PromptType[];
|
|
59
|
+
}
|
|
60
|
+
export declare const frontMcpPluginMetadataSchema: z.ZodObject<{
|
|
61
|
+
id: z.ZodOptional<z.ZodString>;
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
description: z.ZodOptional<z.ZodString>;
|
|
64
|
+
providers: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
65
|
+
exports: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
66
|
+
plugins: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
67
|
+
adapters: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
68
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
69
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
70
|
+
prompts: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
71
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
72
|
+
id: z.ZodOptional<z.ZodString>;
|
|
73
|
+
name: z.ZodString;
|
|
74
|
+
description: z.ZodOptional<z.ZodString>;
|
|
75
|
+
providers: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
76
|
+
exports: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
77
|
+
plugins: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
78
|
+
adapters: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
79
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
80
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
81
|
+
prompts: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
82
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
83
|
+
id: z.ZodOptional<z.ZodString>;
|
|
84
|
+
name: z.ZodString;
|
|
85
|
+
description: z.ZodOptional<z.ZodString>;
|
|
86
|
+
providers: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
87
|
+
exports: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
88
|
+
plugins: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
89
|
+
adapters: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
90
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
91
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
92
|
+
prompts: z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>;
|
|
93
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.frontMcpPluginMetadataSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../schemas");
|
|
6
|
+
exports.frontMcpPluginMetadataSchema = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.string().optional(),
|
|
8
|
+
name: zod_1.z.string().min(1),
|
|
9
|
+
description: zod_1.z.string().optional(),
|
|
10
|
+
providers: zod_1.z.array(schemas_1.annotatedFrontMcpProvidersSchema).optional(),
|
|
11
|
+
exports: zod_1.z.array(schemas_1.annotatedFrontMcpProvidersSchema).optional(),
|
|
12
|
+
plugins: zod_1.z.array(schemas_1.annotatedFrontMcpPluginsSchema).optional(),
|
|
13
|
+
adapters: zod_1.z.array(schemas_1.annotatedFrontMcpAdaptersSchema).optional(),
|
|
14
|
+
tools: zod_1.z.array(schemas_1.annotatedFrontMcpToolsSchema).optional(),
|
|
15
|
+
resources: zod_1.z.array(schemas_1.annotatedFrontMcpResourcesSchema).optional(),
|
|
16
|
+
prompts: zod_1.z.array(schemas_1.annotatedFrontMcpPromptsSchema).optional(),
|
|
17
|
+
}).passthrough();
|
|
18
|
+
//# sourceMappingURL=plugin.metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.metadata.js","sourceRoot":"","sources":["../../../src/metadata/plugin.metadata.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAOxB,wCAIoB;AAqEP,QAAA,4BAA4B,GAAG,OAAC,CAAC,MAAM,CAAC;IACnD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,0CAAgC,CAAC,CAAC,QAAQ,EAAE;IAC/D,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,0CAAgC,CAAC,CAAC,QAAQ,EAAE;IAC7D,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,wCAA8B,CAAC,CAAC,QAAQ,EAAE;IAC3D,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,yCAA+B,CAAC,CAAC,QAAQ,EAAE;IAC7D,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,sCAA4B,CAAC,CAAC,QAAQ,EAAE;IACvD,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,0CAAgC,CAAC,CAAC,QAAQ,EAAE;IAC/D,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,wCAA8B,CAAC,CAAC,QAAQ,EAAE;CACtB,CAAC,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { RawZodShape } from '../types';\nimport { z } from 'zod';\nimport {\n ProviderType,\n PluginType,\n AdapterType,\n ToolType, ResourceType, PromptType,\n} from '../interfaces';\nimport {\n annotatedFrontMcpAdaptersSchema,\n annotatedFrontMcpPluginsSchema, annotatedFrontMcpPromptsSchema,\n annotatedFrontMcpProvidersSchema, annotatedFrontMcpResourcesSchema, annotatedFrontMcpToolsSchema,\n} from '../schemas';\n\n/**\n * Declarative metadata describing what an McpPlugin contributes at app scope.\n */\nexport interface PluginMetadata {\n /**\n * Human-friendly name for this app as shown in UIs, logs, and describe reports.\n * Keep it short, stable, and unique within a gateway (consider prefixes).\n */\n id?: string;\n /**\n * Human-friendly name for this app as shown in UIs, logs, and describe reports.\n * Keep it short, stable, and unique within a gateway (consider prefixes).\n */\n name: string;\n\n /**\n * Optional longer explanation of what the app does and what it exposes.\n * Used for documentation, describe reports, and UIs. Avoid secrets/PII.\n */\n description?: string;\n\n /**\n * Plugin-scoped providers Named singleton (or scoped-singleton) dependencies used by tools/plugins at runtime\n * — e.g., config, database pools, Redis clients, queues, KMS.\n *\n * Resolution is hierarchical (tool → app → gateway). Providers may depend on\n * other providers and are usually initialized lazily on first use.\n */\n providers?: ProviderType[];\n\n /**\n * Plugin can export providers to be used in the host app or other plugins,\n * e.g. for AuthPlugin can export AuthSession to be used in other plugins / apps.\n *\n * Resolution is hierarchical (tool → app → gateway). Providers may depend on\n * other providers and are usually initialized lazily on first use.\n */\n exports?: ProviderType[];\n\n /**\n * Plugin-scoped plugins that participate in lifecycle events and can contribute\n * additional capabilities (tools, resources, prompts, providers, adapters).\n * Use plugins to enforce policy, auth, PII reduction, tracing, etc.\n */\n plugins?: PluginType[];\n\n /**\n * Plugin-scoped Adapters attached to this app that convert external definitions or sources\n * (e.g., OpenAPI, Lambda, Custom) into generated tools/resources/prompts.\n * Common options include include/exclude filters, name prefixes, base URLs,\n * and authentication (often provided by plugins).\n */\n adapters?: AdapterType[];\n\n /**\n * Plugin-scoped Inline tools authored by this app (via builder or class). These are active\n * actions with input/output schemas that the model can call. Tools generated\n * by adapters do not need to be listed here.\n */\n tools?: ToolType[];\n\n resources?: ResourceType[];\n\n prompts?: PromptType[];\n\n}\n\nexport const frontMcpPluginMetadataSchema = z.object({\n id: z.string().optional(),\n name: z.string().min(1),\n description: z.string().optional(),\n providers: z.array(annotatedFrontMcpProvidersSchema).optional(),\n exports: z.array(annotatedFrontMcpProvidersSchema).optional(),\n plugins: z.array(annotatedFrontMcpPluginsSchema).optional(),\n adapters: z.array(annotatedFrontMcpAdaptersSchema).optional(),\n tools: z.array(annotatedFrontMcpToolsSchema).optional(),\n resources: z.array(annotatedFrontMcpResourcesSchema).optional(),\n prompts: z.array(annotatedFrontMcpPromptsSchema).optional(),\n} satisfies RawZodShape<PluginMetadata>).passthrough();\n"]}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Icon } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
declare global {
|
|
4
|
+
/**
|
|
5
|
+
* Declarative metadata extends to McpPrompt decorator.
|
|
6
|
+
*/
|
|
7
|
+
export interface ExtendFrontMcpPromptMetadata {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
interface PromptArgument {
|
|
11
|
+
/**
|
|
12
|
+
* The name of the argument.
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* A human-readable description of the argument.
|
|
17
|
+
*/
|
|
18
|
+
description?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether this argument must be provided.
|
|
21
|
+
*/
|
|
22
|
+
required?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A known resource that the server is capable of reading.
|
|
26
|
+
*/
|
|
27
|
+
export interface FrontMcpPromptMetadata extends ExtendFrontMcpPromptMetadata {
|
|
28
|
+
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
32
|
+
* even by those unfamiliar with domain-specific terminology.
|
|
33
|
+
*
|
|
34
|
+
* If not provided, the name should be used for display (except for Tool,
|
|
35
|
+
* where `annotations.title` should be given precedence over using `name`,
|
|
36
|
+
* if present).
|
|
37
|
+
*/
|
|
38
|
+
title?: string;
|
|
39
|
+
/**
|
|
40
|
+
* A description of what this resource represents.
|
|
41
|
+
*
|
|
42
|
+
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
|
43
|
+
*/
|
|
44
|
+
description?: string;
|
|
45
|
+
/**
|
|
46
|
+
* A list of arguments to use for templating the prompt.
|
|
47
|
+
*/
|
|
48
|
+
arguments: PromptArgument[];
|
|
49
|
+
/**
|
|
50
|
+
* A list of icons that can be used to represent this resource template.
|
|
51
|
+
*/
|
|
52
|
+
icons?: Icon[];
|
|
53
|
+
}
|
|
54
|
+
export declare const frontMcpPromptMetadataSchema: z.ZodObject<{
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
title: z.ZodOptional<z.ZodString>;
|
|
57
|
+
description: z.ZodOptional<z.ZodString>;
|
|
58
|
+
arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
59
|
+
/**
|
|
60
|
+
* The name of the argument.
|
|
61
|
+
*/
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
/**
|
|
64
|
+
* A human-readable description of the argument.
|
|
65
|
+
*/
|
|
66
|
+
description: z.ZodOptional<z.ZodString>;
|
|
67
|
+
/**
|
|
68
|
+
* Whether this argument must be provided.
|
|
69
|
+
*/
|
|
70
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
72
|
+
/**
|
|
73
|
+
* The name of the argument.
|
|
74
|
+
*/
|
|
75
|
+
name: z.ZodString;
|
|
76
|
+
/**
|
|
77
|
+
* A human-readable description of the argument.
|
|
78
|
+
*/
|
|
79
|
+
description: z.ZodOptional<z.ZodString>;
|
|
80
|
+
/**
|
|
81
|
+
* Whether this argument must be provided.
|
|
82
|
+
*/
|
|
83
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
85
|
+
/**
|
|
86
|
+
* The name of the argument.
|
|
87
|
+
*/
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
/**
|
|
90
|
+
* A human-readable description of the argument.
|
|
91
|
+
*/
|
|
92
|
+
description: z.ZodOptional<z.ZodString>;
|
|
93
|
+
/**
|
|
94
|
+
* Whether this argument must be provided.
|
|
95
|
+
*/
|
|
96
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
98
|
+
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
99
|
+
src: z.ZodString;
|
|
100
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
101
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
102
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
103
|
+
src: z.ZodString;
|
|
104
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
105
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
106
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
107
|
+
src: z.ZodString;
|
|
108
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
109
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
110
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
111
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
112
|
+
name: z.ZodString;
|
|
113
|
+
title: z.ZodOptional<z.ZodString>;
|
|
114
|
+
description: z.ZodOptional<z.ZodString>;
|
|
115
|
+
arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
116
|
+
/**
|
|
117
|
+
* The name of the argument.
|
|
118
|
+
*/
|
|
119
|
+
name: z.ZodString;
|
|
120
|
+
/**
|
|
121
|
+
* A human-readable description of the argument.
|
|
122
|
+
*/
|
|
123
|
+
description: z.ZodOptional<z.ZodString>;
|
|
124
|
+
/**
|
|
125
|
+
* Whether this argument must be provided.
|
|
126
|
+
*/
|
|
127
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
129
|
+
/**
|
|
130
|
+
* The name of the argument.
|
|
131
|
+
*/
|
|
132
|
+
name: z.ZodString;
|
|
133
|
+
/**
|
|
134
|
+
* A human-readable description of the argument.
|
|
135
|
+
*/
|
|
136
|
+
description: z.ZodOptional<z.ZodString>;
|
|
137
|
+
/**
|
|
138
|
+
* Whether this argument must be provided.
|
|
139
|
+
*/
|
|
140
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
141
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
142
|
+
/**
|
|
143
|
+
* The name of the argument.
|
|
144
|
+
*/
|
|
145
|
+
name: z.ZodString;
|
|
146
|
+
/**
|
|
147
|
+
* A human-readable description of the argument.
|
|
148
|
+
*/
|
|
149
|
+
description: z.ZodOptional<z.ZodString>;
|
|
150
|
+
/**
|
|
151
|
+
* Whether this argument must be provided.
|
|
152
|
+
*/
|
|
153
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
155
|
+
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
156
|
+
src: z.ZodString;
|
|
157
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
158
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
159
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
160
|
+
src: z.ZodString;
|
|
161
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
162
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
163
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
164
|
+
src: z.ZodString;
|
|
165
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
166
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
167
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
168
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
169
|
+
name: z.ZodString;
|
|
170
|
+
title: z.ZodOptional<z.ZodString>;
|
|
171
|
+
description: z.ZodOptional<z.ZodString>;
|
|
172
|
+
arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
173
|
+
/**
|
|
174
|
+
* The name of the argument.
|
|
175
|
+
*/
|
|
176
|
+
name: z.ZodString;
|
|
177
|
+
/**
|
|
178
|
+
* A human-readable description of the argument.
|
|
179
|
+
*/
|
|
180
|
+
description: z.ZodOptional<z.ZodString>;
|
|
181
|
+
/**
|
|
182
|
+
* Whether this argument must be provided.
|
|
183
|
+
*/
|
|
184
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
186
|
+
/**
|
|
187
|
+
* The name of the argument.
|
|
188
|
+
*/
|
|
189
|
+
name: z.ZodString;
|
|
190
|
+
/**
|
|
191
|
+
* A human-readable description of the argument.
|
|
192
|
+
*/
|
|
193
|
+
description: z.ZodOptional<z.ZodString>;
|
|
194
|
+
/**
|
|
195
|
+
* Whether this argument must be provided.
|
|
196
|
+
*/
|
|
197
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
198
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
199
|
+
/**
|
|
200
|
+
* The name of the argument.
|
|
201
|
+
*/
|
|
202
|
+
name: z.ZodString;
|
|
203
|
+
/**
|
|
204
|
+
* A human-readable description of the argument.
|
|
205
|
+
*/
|
|
206
|
+
description: z.ZodOptional<z.ZodString>;
|
|
207
|
+
/**
|
|
208
|
+
* Whether this argument must be provided.
|
|
209
|
+
*/
|
|
210
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
211
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
212
|
+
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
213
|
+
src: z.ZodString;
|
|
214
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
215
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
216
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
217
|
+
src: z.ZodString;
|
|
218
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
219
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
220
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
221
|
+
src: z.ZodString;
|
|
222
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
223
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
224
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
225
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
226
|
+
export { FrontMcpPromptMetadata as PromptMetadata, };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.frontMcpPromptMetadataSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
6
|
+
const promptArgumentSchema = zod_1.z.object({
|
|
7
|
+
/**
|
|
8
|
+
* The name of the argument.
|
|
9
|
+
*/
|
|
10
|
+
name: zod_1.z.string(),
|
|
11
|
+
/**
|
|
12
|
+
* A human-readable description of the argument.
|
|
13
|
+
*/
|
|
14
|
+
description: zod_1.z.optional(zod_1.z.string()),
|
|
15
|
+
/**
|
|
16
|
+
* Whether this argument must be provided.
|
|
17
|
+
*/
|
|
18
|
+
required: zod_1.z.optional(zod_1.z.boolean()),
|
|
19
|
+
}).passthrough();
|
|
20
|
+
exports.frontMcpPromptMetadataSchema = zod_1.z.object({
|
|
21
|
+
name: zod_1.z.string().min(1),
|
|
22
|
+
title: zod_1.z.string().optional(),
|
|
23
|
+
description: zod_1.z.string().optional(),
|
|
24
|
+
arguments: zod_1.z.array(promptArgumentSchema).optional(),
|
|
25
|
+
icons: zod_1.z.array(types_js_1.IconSchema).optional(),
|
|
26
|
+
}).passthrough();
|
|
27
|
+
//# sourceMappingURL=prompt.metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.metadata.js","sourceRoot":"","sources":["../../../src/metadata/prompt.metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,iEAAsE;AAyBtE,MAAM,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC;;OAEG;IACH,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB;;OAEG;IACH,WAAW,EAAE,OAAC,CAAC,QAAQ,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IACnC;;OAEG;IACH,QAAQ,EAAE,OAAC,CAAC,QAAQ,CAAC,OAAC,CAAC,OAAO,EAAE,CAAC;CAClC,CAAC,CAAC,WAAW,EAAE,CAAC;AAsCJ,QAAA,4BAA4B,GAAG,OAAC,CAAC,MAAM,CAAC;IACnD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE;IACnD,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,qBAAU,CAAC,CAAC,QAAQ,EAAE;CACsC,CAAC,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport { RawZodShape } from '../types';\nimport { Icon, IconSchema } from '@modelcontextprotocol/sdk/types.js';\n\ndeclare global {\n /**\n * Declarative metadata extends to McpPrompt decorator.\n */\n export interface ExtendFrontMcpPromptMetadata {\n }\n}\n\ninterface PromptArgument {\n /**\n * The name of the argument.\n */\n name: string;\n /**\n * A human-readable description of the argument.\n */\n description?: string;\n /**\n * Whether this argument must be provided.\n */\n required?: boolean;\n}\n\nconst promptArgumentSchema = z.object({\n /**\n * The name of the argument.\n */\n name: z.string(),\n /**\n * A human-readable description of the argument.\n */\n description: z.optional(z.string()),\n /**\n * Whether this argument must be provided.\n */\n required: z.optional(z.boolean()),\n}).passthrough();\n\n\n/**\n * A known resource that the server is capable of reading.\n */\nexport interface FrontMcpPromptMetadata extends ExtendFrontMcpPromptMetadata {\n /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */\n name: string;\n /**\n * Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\n * even by those unfamiliar with domain-specific terminology.\n *\n * If not provided, the name should be used for display (except for Tool,\n * where `annotations.title` should be given precedence over using `name`,\n * if present).\n */\n title?: string;\n\n /**\n * A description of what this resource represents.\n *\n * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.\n */\n description?: string;\n\n /**\n * A list of arguments to use for templating the prompt.\n */\n arguments: PromptArgument[],\n\n /**\n * A list of icons that can be used to represent this resource template.\n */\n icons?: Icon[];\n}\n\n\nexport const frontMcpPromptMetadataSchema = z.object({\n name: z.string().min(1),\n title: z.string().optional(),\n description: z.string().optional(),\n arguments: z.array(promptArgumentSchema).optional(),\n icons: z.array(IconSchema).optional(),\n} satisfies RawZodShape<FrontMcpPromptMetadata, ExtendFrontMcpPromptMetadata>).passthrough();\n\n\nexport {\n FrontMcpPromptMetadata as PromptMetadata,\n};"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Declarative metadata describing what a FrontMcpProvider contributes at app scope.
|
|
4
|
+
*/
|
|
5
|
+
export interface ProviderMetadata {
|
|
6
|
+
id?: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
scope?: ProviderScope;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Provider lifetime scope semantics.
|
|
13
|
+
*/
|
|
14
|
+
export declare enum ProviderScope {
|
|
15
|
+
GLOBAL = "global",
|
|
16
|
+
SESSION = "session",
|
|
17
|
+
REQUEST = "request"
|
|
18
|
+
}
|
|
19
|
+
export declare const frontMcpProviderMetadataSchema: z.ZodObject<{
|
|
20
|
+
id: z.ZodOptional<z.ZodString>;
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
description: z.ZodOptional<z.ZodString>;
|
|
23
|
+
scope: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof ProviderScope>>>;
|
|
24
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
25
|
+
id: z.ZodOptional<z.ZodString>;
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
description: z.ZodOptional<z.ZodString>;
|
|
28
|
+
scope: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof ProviderScope>>>;
|
|
29
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
30
|
+
id: z.ZodOptional<z.ZodString>;
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
description: z.ZodOptional<z.ZodString>;
|
|
33
|
+
scope: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof ProviderScope>>>;
|
|
34
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.frontMcpProviderMetadataSchema = exports.ProviderScope = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Provider lifetime scope semantics.
|
|
7
|
+
*/
|
|
8
|
+
var ProviderScope;
|
|
9
|
+
(function (ProviderScope) {
|
|
10
|
+
ProviderScope["GLOBAL"] = "global";
|
|
11
|
+
ProviderScope["SESSION"] = "session";
|
|
12
|
+
ProviderScope["REQUEST"] = "request";
|
|
13
|
+
})(ProviderScope || (exports.ProviderScope = ProviderScope = {}));
|
|
14
|
+
exports.frontMcpProviderMetadataSchema = zod_1.z.object({
|
|
15
|
+
id: zod_1.z.string().optional(),
|
|
16
|
+
name: zod_1.z.string().min(1),
|
|
17
|
+
description: zod_1.z.string().optional(),
|
|
18
|
+
scope: zod_1.z.nativeEnum(ProviderScope).optional().default(ProviderScope.GLOBAL),
|
|
19
|
+
}).passthrough();
|
|
20
|
+
//# sourceMappingURL=provider.metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.metadata.js","sourceRoot":"","sources":["../../../src/metadata/provider.metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAcxB;;GAEG;AACH,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;AACrB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAEY,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,KAAK,EAAE,OAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC;CACpC,CAAC,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport { RawZodShape } from '../types';\n\n\n/**\n * Declarative metadata describing what a FrontMcpProvider contributes at app scope.\n */\nexport interface ProviderMetadata {\n id?: string;\n name: string;\n description?: string;\n scope?: ProviderScope;\n}\n\n/**\n * Provider lifetime scope semantics.\n */\nexport enum ProviderScope {\n GLOBAL = 'global',\n SESSION = 'session',\n REQUEST = 'request',\n}\n\nexport const frontMcpProviderMetadataSchema = z.object({\n id: z.string().optional(),\n name: z.string().min(1),\n description: z.string().optional(),\n scope: z.nativeEnum(ProviderScope).optional().default(ProviderScope.GLOBAL),\n} satisfies RawZodShape<ProviderMetadata>).passthrough();\n\n"]}
|