@frontmcp/sdk 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/decorators/front-mcp.decorator.js.map +1 -1
- package/src/decorators/hook.decorator.d.ts +12 -0
- package/src/decorators/{flow-hooks.decorator.js → hook.decorator.js} +18 -13
- package/src/decorators/hook.decorator.js.map +1 -0
- package/src/decorators/index.d.ts +1 -1
- package/src/decorators/index.js +1 -1
- package/src/decorators/index.js.map +1 -1
- package/src/decorators/tool.decorator.d.ts +34 -6
- package/src/decorators/tool.decorator.js +8 -1
- package/src/decorators/tool.decorator.js.map +1 -1
- package/src/dynamic/dynamic.plugin.d.ts +1 -0
- package/src/dynamic/dynamic.plugin.js +3 -0
- package/src/dynamic/dynamic.plugin.js.map +1 -1
- package/src/entries/base.entry.d.ts +1 -1
- package/src/entries/base.entry.js.map +1 -1
- package/src/entries/flow.entry.js.map +1 -1
- package/src/entries/hook.entry.d.ts +12 -0
- package/src/entries/hook.entry.js +20 -0
- package/src/entries/hook.entry.js.map +1 -0
- package/src/entries/index.d.ts +1 -0
- package/src/entries/index.js +1 -0
- package/src/entries/index.js.map +1 -1
- package/src/entries/plugin.entry.d.ts +2 -1
- package/src/entries/plugin.entry.js.map +1 -1
- package/src/entries/scope.entry.d.ts +2 -1
- package/src/entries/scope.entry.js.map +1 -1
- package/src/entries/tool.entry.d.ts +6 -2
- package/src/entries/tool.entry.js +1 -0
- package/src/entries/tool.entry.js.map +1 -1
- package/src/interfaces/flow.interface.d.ts +9 -6
- package/src/interfaces/flow.interface.js +4 -2
- package/src/interfaces/flow.interface.js.map +1 -1
- package/src/interfaces/hook.interface.d.ts +3 -0
- package/src/{metadata/flow-hooks.metadata.js → interfaces/hook.interface.js} +1 -1
- package/src/interfaces/hook.interface.js.map +1 -0
- package/src/interfaces/index.d.ts +1 -0
- package/src/interfaces/index.js +1 -0
- package/src/interfaces/index.js.map +1 -1
- package/src/interfaces/internal/registry.interface.d.ts +30 -4
- package/src/interfaces/internal/registry.interface.js.map +1 -1
- package/src/interfaces/tool.interface.d.ts +13 -5
- package/src/interfaces/tool.interface.js +5 -4
- package/src/interfaces/tool.interface.js.map +1 -1
- package/src/metadata/flow.metadata.d.ts +2 -0
- package/src/metadata/flow.metadata.js.map +1 -1
- package/src/metadata/hook.metadata.d.ts +19 -0
- package/src/metadata/hook.metadata.js +3 -0
- package/src/metadata/hook.metadata.js.map +1 -0
- package/src/metadata/index.d.ts +1 -1
- package/src/metadata/index.js +1 -1
- package/src/metadata/index.js.map +1 -1
- package/src/metadata/tool.metadata.d.ts +0 -100
- package/src/metadata/tool.metadata.js +1 -6
- package/src/metadata/tool.metadata.js.map +1 -1
- package/src/records/hook.record.d.ts +11 -0
- package/src/records/hook.record.js +8 -0
- package/src/records/hook.record.js.map +1 -0
- package/src/records/index.d.ts +1 -0
- package/src/records/index.js +1 -0
- package/src/records/index.js.map +1 -1
- package/src/records/plugin.record.d.ts +13 -3
- package/src/records/plugin.record.js +1 -1
- package/src/records/plugin.record.js.map +1 -1
- package/src/records/tool.record.d.ts +1 -1
- package/src/records/tool.record.js.map +1 -1
- package/src/schemas/annotated-class.schema.js +5 -1
- package/src/schemas/annotated-class.schema.js.map +1 -1
- package/src/schemas/http-output.schema.d.ts +93 -93
- package/src/schemas/http-output.schema.js +2 -2
- package/src/schemas/http-output.schema.js.map +1 -1
- package/src/tokens/base.tokens.js.map +1 -1
- package/src/tokens/flow-hook.tokens.js +2 -2
- package/src/tokens/flow-hook.tokens.js.map +1 -1
- package/src/tokens/tool.tokens.d.ts +1 -0
- package/src/tokens/tool.tokens.js +2 -1
- package/src/tokens/tool.tokens.js.map +1 -1
- package/src/types/auth/session.types.d.ts +2 -2
- package/src/types/options/auth.options.d.ts +4 -4
- package/src/utils/decide-request-intent.utils.d.ts +7 -7
- package/src/decorators/flow-hooks.decorator.d.ts +0 -12
- package/src/decorators/flow-hooks.decorator.js.map +0 -1
- package/src/metadata/flow-hooks.metadata.d.ts +0 -20
- package/src/metadata/flow-hooks.metadata.js.map +0 -1
|
@@ -20,7 +20,11 @@ exports.annotatedFrontMcpAuthProvidersSchema = zod_1.z.custom((v) => {
|
|
|
20
20
|
(v['useFactory'] && metadata_1.frontMcpAuthProviderMetadataSchema.passthrough().safeParse(v).success);
|
|
21
21
|
}, { message: 'plugins items must be annotated with @AuthProvider() | @FrontMcpAuthProvider().' });
|
|
22
22
|
exports.annotatedFrontMcpPluginsSchema = zod_1.z.custom((v) => {
|
|
23
|
-
return (typeof v === 'function' && Reflect.hasMetadata(tokens_1.FrontMcpPluginTokens.type, v))
|
|
23
|
+
return (typeof v === 'function' && Reflect.hasMetadata(tokens_1.FrontMcpPluginTokens.type, v))
|
|
24
|
+
||
|
|
25
|
+
(v['useValue'] && Reflect.hasMetadata(tokens_1.FrontMcpPluginTokens.type, v.useValue.constructor))
|
|
26
|
+
||
|
|
27
|
+
(v['useFactory'] && metadata_1.frontMcpPluginMetadataSchema.passthrough().safeParse(v).success);
|
|
24
28
|
}, { message: 'plugins items must be annotated with @Plugin() | @FrontMcpPlugin().' });
|
|
25
29
|
exports.annotatedFrontMcpAdaptersSchema = zod_1.z.custom((v) => {
|
|
26
30
|
return typeof v === 'function' && Reflect.hasMetadata(tokens_1.FrontMcpAdapterTokens.type, v)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotated-class.schema.js","sourceRoot":"","sources":["../../../src/schemas/annotated-class.schema.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AACxB,sCAMmB;AACnB,0CAIqB;AAER,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAChD,CAAC,CAAC,EAAa,EAAE,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,+BAAsB,CAAC,IAAI,EAAE,CAAC,CAAC,EAChG,EAAE,OAAO,EAAE,4DAA4D,EAAE,CAC1E,CAAC;AAEW,QAAA,gCA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,CAChC,OAAO,CAAC,WAAW,CAAC,2BAAkB,CAAC,IAAI,EAAE,CAAC,CAAC;;YAE/C,CAAC,CAAC,2BAAkB,CAAC,IAAI,CAAC,KAAK,SAAS,CACzC,CAAC;AACJ,CAAC,EACD,EAAE,OAAO,EAAE,+DAA+D,EAAE,CAC7E,CAAC;AAEW,QAAA,gCAAgC,GAAG,OAAC,CAAC,MAAM,CACtD,CAAC,CAAC,EAAa,EAAE,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,+BAAsB,CAAC,IAAI,EAAE,CAAC,CAAC,EAChG,EAAE,OAAO,EAAE,2EAA2E,EAAE,CACzF,CAAC;AAEW,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CACpD,CAAC,CAAC,EAAa,EAAE,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,6BAAoB,CAAC,IAAI,EAAE,CAAC,CAAC,EAC9F,EAAE,OAAO,EAAE,qEAAqE,EAAE,CACnF,CAAC;AAEW,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CACnD,CAAC,CAAC,EAAa,EAAE,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,mCAA0B,CAAC,IAAI,EAAE,CAAC,CAAC,EACpG,EAAE,OAAO,EAAE,oEAAoE,EAAE,CAClF,CAAC","sourcesContent":["import { Type } from '../interfaces';\nimport { z } from 'zod';\nimport {\n FrontMcpAdapterTokens, FrontMcpAuthProviderTokens,\n FrontMcpLocalAppTokens, FrontMcpLogTransportTokens,\n FrontMcpPluginTokens, FrontMcpPromptTokens,\n FrontMcpProviderTokens, FrontMcpResourceTokens,\n FrontMcpToolTokens,\n} from '../tokens';\nimport {\n frontMcpAdapterMetadataSchema,\n frontMcpAuthProviderMetadataSchema, frontMcpPluginMetadataSchema,\n frontMcpProviderMetadataSchema,\n} from '../metadata';\n\nexport const annotatedFrontMcpAppSchema = z.custom<Type>(\n (v): v is Type => typeof v === 'function' && Reflect.hasMetadata(FrontMcpLocalAppTokens.type, v),\n { message: 'apps items must be annotated with @App() | @FrontMcpApp().' },\n);\n\nexport const annotatedFrontMcpProvidersSchema = z.custom<Type>(\n (v): v is Type => {\n return typeof v === 'function' && Reflect.hasMetadata(FrontMcpProviderTokens.type, v)\n ||\n (v['useValue'] && Reflect.hasMetadata(FrontMcpProviderTokens.type, v.useValue.constructor))\n ||\n (v['useFactory'] && frontMcpProviderMetadataSchema.passthrough().safeParse(v).success);\n },\n { message: 'plugins items must be annotated with @Provider() | @FrontMcpProvider().' },\n);\n\nexport const annotatedFrontMcpAuthProvidersSchema = z.custom<Type>(\n (v): v is Type => {\n return typeof v === 'function' && Reflect.hasMetadata(FrontMcpAuthProviderTokens.type, v)\n ||\n (v['useValue'] && Reflect.hasMetadata(FrontMcpAuthProviderTokens.type, v.useValue.constructor))\n ||\n (v['useFactory'] && frontMcpAuthProviderMetadataSchema.passthrough().safeParse(v).success);\n },\n { message: 'plugins items must be annotated with @AuthProvider() | @FrontMcpAuthProvider().' },\n);\n\nexport const annotatedFrontMcpPluginsSchema = z.custom<Type>(\n (v): v is Type => {\n return (typeof v === 'function' && Reflect.hasMetadata(FrontMcpPluginTokens.type, v))\n ||\n (v['useValue'] && Reflect.hasMetadata(FrontMcpPluginTokens.type, v.useValue.constructor))\n ||\n (v['useFactory'] && frontMcpPluginMetadataSchema.passthrough().safeParse(v).success);\n },\n { message: 'plugins items must be annotated with @Plugin() | @FrontMcpPlugin().' },\n);\n\nexport const annotatedFrontMcpAdaptersSchema = z.custom<Type>(\n (v): v is Type => {\n return typeof v === 'function' && Reflect.hasMetadata(FrontMcpAdapterTokens.type, v)\n ||\n (v['useValue'] && Reflect.hasMetadata(FrontMcpAdapterTokens.type, v.useValue.constructor))\n ||\n (v['useFactory'] && frontMcpAdapterMetadataSchema.passthrough().safeParse(v).success);\n },\n { message: 'adapters items must be annotated with @Adapter() | @FrontMcpAdapter().' },\n);\n\nexport const annotatedFrontMcpToolsSchema = z.custom<Type>(\n (v): v is Type => {\n return typeof v === 'function' && (\n Reflect.hasMetadata(FrontMcpToolTokens.type, v)\n ||\n v[FrontMcpToolTokens.type] !== undefined\n );\n },\n { message: 'tools items must be annotated with @Tool() | @FrontMcpTool().' },\n);\n\nexport const annotatedFrontMcpResourcesSchema = z.custom<Type>(\n (v): v is Type => typeof v === 'function' && Reflect.hasMetadata(FrontMcpResourceTokens.type, v),\n { message: 'resources items must be annotated with @Resource() | @FrontMcpResource().' },\n);\n\nexport const annotatedFrontMcpPromptsSchema = z.custom<Type>(\n (v): v is Type => typeof v === 'function' && Reflect.hasMetadata(FrontMcpPromptTokens.type, v),\n { message: 'prompts items must be annotated with @Prompt() | @FrontMcpPrompt().' },\n);\n\nexport const annotatedFrontMcpLoggerSchema = z.custom<Type>(\n (v): v is Type => typeof v === 'function' && Reflect.hasMetadata(FrontMcpLogTransportTokens.type, v),\n { message: 'logger items must be annotated with @Logger() | @FrontMcpLogger().' },\n);"]}
|