@frontmcp/sdk 0.2.1 → 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.
Files changed (76) hide show
  1. package/package.json +3 -3
  2. package/src/decorators/front-mcp.decorator.js.map +1 -1
  3. package/src/decorators/hook.decorator.d.ts +12 -0
  4. package/src/decorators/{flow-hooks.decorator.js → hook.decorator.js} +18 -13
  5. package/src/decorators/hook.decorator.js.map +1 -0
  6. package/src/decorators/index.d.ts +1 -1
  7. package/src/decorators/index.js +1 -1
  8. package/src/decorators/index.js.map +1 -1
  9. package/src/decorators/tool.decorator.d.ts +34 -6
  10. package/src/decorators/tool.decorator.js +8 -1
  11. package/src/decorators/tool.decorator.js.map +1 -1
  12. package/src/dynamic/dynamic.plugin.d.ts +1 -0
  13. package/src/dynamic/dynamic.plugin.js +3 -0
  14. package/src/dynamic/dynamic.plugin.js.map +1 -1
  15. package/src/entries/base.entry.d.ts +1 -1
  16. package/src/entries/base.entry.js.map +1 -1
  17. package/src/entries/flow.entry.js.map +1 -1
  18. package/src/entries/hook.entry.d.ts +12 -0
  19. package/src/entries/hook.entry.js +20 -0
  20. package/src/entries/hook.entry.js.map +1 -0
  21. package/src/entries/index.d.ts +1 -0
  22. package/src/entries/index.js +1 -0
  23. package/src/entries/index.js.map +1 -1
  24. package/src/entries/plugin.entry.d.ts +2 -1
  25. package/src/entries/plugin.entry.js.map +1 -1
  26. package/src/entries/scope.entry.d.ts +2 -1
  27. package/src/entries/scope.entry.js.map +1 -1
  28. package/src/entries/tool.entry.d.ts +5 -2
  29. package/src/entries/tool.entry.js.map +1 -1
  30. package/src/interfaces/flow.interface.d.ts +9 -6
  31. package/src/interfaces/flow.interface.js +4 -2
  32. package/src/interfaces/flow.interface.js.map +1 -1
  33. package/src/interfaces/hook.interface.d.ts +3 -0
  34. package/src/{metadata/flow-hooks.metadata.js → interfaces/hook.interface.js} +1 -1
  35. package/src/interfaces/hook.interface.js.map +1 -0
  36. package/src/interfaces/index.d.ts +1 -0
  37. package/src/interfaces/index.js +1 -0
  38. package/src/interfaces/index.js.map +1 -1
  39. package/src/interfaces/internal/registry.interface.d.ts +30 -4
  40. package/src/interfaces/internal/registry.interface.js.map +1 -1
  41. package/src/interfaces/tool.interface.d.ts +11 -4
  42. package/src/interfaces/tool.interface.js +2 -1
  43. package/src/interfaces/tool.interface.js.map +1 -1
  44. package/src/metadata/flow.metadata.d.ts +2 -0
  45. package/src/metadata/flow.metadata.js.map +1 -1
  46. package/src/metadata/hook.metadata.d.ts +19 -0
  47. package/src/metadata/hook.metadata.js +3 -0
  48. package/src/metadata/hook.metadata.js.map +1 -0
  49. package/src/metadata/index.d.ts +1 -1
  50. package/src/metadata/index.js +1 -1
  51. package/src/metadata/index.js.map +1 -1
  52. package/src/metadata/tool.metadata.d.ts +0 -100
  53. package/src/metadata/tool.metadata.js +1 -6
  54. package/src/metadata/tool.metadata.js.map +1 -1
  55. package/src/records/hook.record.d.ts +11 -0
  56. package/src/records/hook.record.js +8 -0
  57. package/src/records/hook.record.js.map +1 -0
  58. package/src/records/index.d.ts +1 -0
  59. package/src/records/index.js +1 -0
  60. package/src/records/index.js.map +1 -1
  61. package/src/records/plugin.record.d.ts +13 -3
  62. package/src/records/plugin.record.js +1 -1
  63. package/src/records/plugin.record.js.map +1 -1
  64. package/src/records/tool.record.d.ts +1 -1
  65. package/src/records/tool.record.js.map +1 -1
  66. package/src/schemas/annotated-class.schema.js +5 -1
  67. package/src/schemas/annotated-class.schema.js.map +1 -1
  68. package/src/tokens/flow-hook.tokens.js +2 -2
  69. package/src/tokens/flow-hook.tokens.js.map +1 -1
  70. package/src/tokens/tool.tokens.d.ts +1 -0
  71. package/src/tokens/tool.tokens.js +2 -1
  72. package/src/tokens/tool.tokens.js.map +1 -1
  73. package/src/decorators/flow-hooks.decorator.d.ts +0 -12
  74. package/src/decorators/flow-hooks.decorator.js.map +0 -1
  75. package/src/metadata/flow-hooks.metadata.d.ts +0 -20
  76. package/src/metadata/flow-hooks.metadata.js.map +0 -1
@@ -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,gCAAgC,GAAG,OAAC,CAAC,MAAM,CACtD,CAAC,CAAC,EAAa,EAAE;IACf,OAAO,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,+BAAsB,CAAC,IAAI,EAAE,CAAC,CAAC;;YAEnF,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,+BAAsB,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;;YAE3F,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,yCAA8B,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC3F,CAAC,EACD,EAAE,OAAO,EAAE,yEAAyE,EAAE,CACvF,CAAC;AAEW,QAAA,oCAAoC,GAAG,OAAC,CAAC,MAAM,CAC1D,CAAC,CAAC,EAAa,EAAE;IACf,OAAO,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,mCAA0B,CAAC,IAAI,EAAE,CAAC,CAAC;;YAEvF,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,mCAA0B,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;;YAE/F,C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AA+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,\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 { 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);"]}
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,gCAAgC,GAAG,OAAC,CAAC,MAAM,CACtD,CAAC,CAAC,EAAa,EAAE;IACf,OAAO,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,+BAAsB,CAAC,IAAI,EAAE,CAAC,CAAC;;YAEnF,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,+BAAsB,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;;YAE3F,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,yCAA8B,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC3F,CAAC,EACD,EAAE,OAAO,EAAE,yEAAyE,EAAE,CACvF,CAAC;AAEW,QAAA,oCAAoC,GAAG,OAAC,CAAC,MAAM,CA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AC","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);"]}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FrontMcpFlowHookTokens = void 0;
4
4
  const base_tokens_1 = require("./base.tokens");
5
5
  exports.FrontMcpFlowHookTokens = {
6
- type: base_tokens_1.tokenFactory.type('flow'),
7
- hooks: base_tokens_1.tokenFactory.meta('hooks'),
6
+ type: base_tokens_1.tokenFactory.type('hooks'),
7
+ hooks: base_tokens_1.tokenFactory.meta('hooks'), // used for aggregate hooks in a target class
8
8
  };
9
9
  //# sourceMappingURL=flow-hook.tokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flow-hook.tokens.js","sourceRoot":"","sources":["../../../src/tokens/flow-hook.tokens.ts"],"names":[],"mappings":";;;AAEA,+CAA6C;AAEhC,QAAA,sBAAsB,GAAG;IACpC,IAAI,EAAE,0BAAY,CAAC,IAAI,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE,0BAAY,CAAC,IAAI,CAAC,OAAO,CAAC;CACoB,CAAC","sourcesContent":["import { RawMetadataShape } from '../types';\nimport { FlowHookMetadata } from '../metadata';\nimport { tokenFactory } from './base.tokens';\n\nexport const FrontMcpFlowHookTokens = {\n type: tokenFactory.type('flow'),\n hooks: tokenFactory.meta('hooks'),\n} as const satisfies RawMetadataShape<FlowHookMetadata>;\n\n"]}
1
+ {"version":3,"file":"flow-hook.tokens.js","sourceRoot":"","sources":["../../../src/tokens/flow-hook.tokens.ts"],"names":[],"mappings":";;;AAEA,+CAA2C;AAE9B,QAAA,sBAAsB,GAAG;IACpC,IAAI,EAAE,0BAAY,CAAC,IAAI,CAAC,OAAO,CAAC;IAChC,KAAK,EAAE,0BAAY,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,6CAA6C;CAC1B,CAAC","sourcesContent":["import {RawMetadataShape} from '../types';\nimport { TokenHookMetadata} from '../metadata';\nimport {tokenFactory} from './base.tokens';\n\nexport const FrontMcpFlowHookTokens = {\n type: tokenFactory.type('hooks'),\n hooks: tokenFactory.meta('hooks'), // used for aggregate hooks in a target class\n} as const satisfies RawMetadataShape<TokenHookMetadata>;\n\n"]}
@@ -11,3 +11,4 @@ export declare const FrontMcpToolTokens: {
11
11
  readonly hideFromDiscovery: symbol;
12
12
  readonly metadata: symbol;
13
13
  };
14
+ export declare const extendedToolMetadata: symbol;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FrontMcpToolTokens = void 0;
3
+ exports.extendedToolMetadata = exports.FrontMcpToolTokens = void 0;
4
4
  const base_tokens_1 = require("./base.tokens");
5
5
  exports.FrontMcpToolTokens = {
6
6
  type: base_tokens_1.tokenFactory.type('tool'),
@@ -15,4 +15,5 @@ exports.FrontMcpToolTokens = {
15
15
  hideFromDiscovery: base_tokens_1.tokenFactory.meta('hideFromDiscovery'),
16
16
  metadata: base_tokens_1.tokenFactory.meta('metadata'), // used in tool({}) construction
17
17
  };
18
+ exports.extendedToolMetadata = base_tokens_1.tokenFactory.meta('extendedToolMetadata');
18
19
  //# sourceMappingURL=tool.tokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool.tokens.js","sourceRoot":"","sources":["../../../src/tokens/tool.tokens.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAIhC,QAAA,kBAAkB,GAAG;IAChC,IAAI,EAAE,0BAAY,CAAC,IAAI,CAAC,MAAM,CAAC;IAC/B,EAAE,EAAE,0BAAY,CAAC,IAAI,CAAC,IAAI,CAAC;IAC3B,IAAI,EAAE,0BAAY,CAAC,IAAI,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE,0BAAY,CAAC,IAAI,CAAC,aAAa,CAAC;IAC7C,WAAW,EAAE,0BAAY,CAAC,IAAI,CAAC,aAAa,CAAC;IAC7C,cAAc,EAAE,0BAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC;IACnD,YAAY,EAAE,0BAAY,CAAC,IAAI,CAAC,cAAc,CAAC;IAC/C,IAAI,EAAE,0BAAY,CAAC,IAAI,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE,0BAAY,CAAC,IAAI,CAAC,aAAa,CAAC;IAC7C,iBAAiB,EAAE,0BAAY,CAAC,IAAI,CAAC,mBAAmB,CAAC;IACzD,QAAQ,EAAE,0BAAY,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,gCAAgC;CACI,CAAC","sourcesContent":["import { tokenFactory } from './base.tokens';\nimport { RawMetadataShape } from '../types';\nimport { ToolMetadata } from '../metadata';\n\nexport const FrontMcpToolTokens = {\n type: tokenFactory.type('tool'),\n id: tokenFactory.meta('id'),\n name: tokenFactory.meta('name'),\n description: tokenFactory.meta('description'),\n inputSchema: tokenFactory.meta('inputSchema'),\n rawInputSchema: tokenFactory.meta('rawInputSchema'),\n outputSchema: tokenFactory.meta('outputSchema'),\n tags: tokenFactory.meta('tags'),\n annotations: tokenFactory.meta('annotations'),\n hideFromDiscovery: tokenFactory.meta('hideFromDiscovery'),\n metadata: tokenFactory.meta('metadata'), // used in tool({}) construction\n} as const satisfies RawMetadataShape<ToolMetadata, ExtendFrontMcpToolMetadata>;\n"]}
1
+ {"version":3,"file":"tool.tokens.js","sourceRoot":"","sources":["../../../src/tokens/tool.tokens.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAIhC,QAAA,kBAAkB,GAAG;IAChC,IAAI,EAAE,0BAAY,CAAC,IAAI,CAAC,MAAM,CAAC;IAC/B,EAAE,EAAE,0BAAY,CAAC,IAAI,CAAC,IAAI,CAAC;IAC3B,IAAI,EAAE,0BAAY,CAAC,IAAI,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE,0BAAY,CAAC,IAAI,CAAC,aAAa,CAAC;IAC7C,WAAW,EAAE,0BAAY,CAAC,IAAI,CAAC,aAAa,CAAC;IAC7C,cAAc,EAAE,0BAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC;IACnD,YAAY,EAAE,0BAAY,CAAC,IAAI,CAAC,cAAc,CAAC;IAC/C,IAAI,EAAE,0BAAY,CAAC,IAAI,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE,0BAAY,CAAC,IAAI,CAAC,aAAa,CAAC;IAC7C,iBAAiB,EAAE,0BAAY,CAAC,IAAI,CAAC,mBAAmB,CAAC;IACzD,QAAQ,EAAE,0BAAY,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,gCAAgC;CACI,CAAC;AAEnE,QAAA,oBAAoB,GAAG,0BAAY,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["import { tokenFactory } from './base.tokens';\nimport { RawMetadataShape } from '../types';\nimport { ToolMetadata } from '../metadata';\n\nexport const FrontMcpToolTokens = {\n type: tokenFactory.type('tool'),\n id: tokenFactory.meta('id'),\n name: tokenFactory.meta('name'),\n description: tokenFactory.meta('description'),\n inputSchema: tokenFactory.meta('inputSchema'),\n rawInputSchema: tokenFactory.meta('rawInputSchema'),\n outputSchema: tokenFactory.meta('outputSchema'),\n tags: tokenFactory.meta('tags'),\n annotations: tokenFactory.meta('annotations'),\n hideFromDiscovery: tokenFactory.meta('hideFromDiscovery'),\n metadata: tokenFactory.meta('metadata'), // used in tool({}) construction\n} as const satisfies RawMetadataShape<ToolMetadata, ExtendFrontMcpToolMetadata>;\n\nexport const extendedToolMetadata = tokenFactory.meta('extendedToolMetadata');"]}
@@ -1,12 +0,0 @@
1
- import { FlowHookOptions, FlowName } from '../metadata';
2
- /** NEW: typed variants */
3
- export declare function StageHookOf<Name extends FlowName>(name: Name): (stage: ExtendFlows[Name]["stage"], opts?: FlowHookOptions<ExtendFlows[Name]["ctx"]>) => MethodDecorator;
4
- export declare function WillHookOf<Name extends FlowName>(name: Name): (stage: ExtendFlows[Name]["stage"], opts?: FlowHookOptions<ExtendFlows[Name]["ctx"]>) => MethodDecorator;
5
- export declare function DidHookOf<Name extends FlowName>(name: Name): (stage: ExtendFlows[Name]["stage"], opts?: FlowHookOptions<ExtendFlows[Name]["ctx"]>) => MethodDecorator;
6
- export declare function AroundHookOf<Name extends FlowName>(name: Name): (stage: ExtendFlows[Name]["stage"], opts?: FlowHookOptions<ExtendFlows[Name]["ctx"]>) => MethodDecorator;
7
- export declare function FlowHooksOf<Name extends FlowName>(name: Name): {
8
- Stage: (stage: ExtendFlows[Name]["stage"], opts?: FlowHookOptions<ExtendFlows[Name]["ctx"]>) => MethodDecorator;
9
- Will: (stage: ExtendFlows[Name]["stage"], opts?: FlowHookOptions<ExtendFlows[Name]["ctx"]>) => MethodDecorator;
10
- Did: (stage: ExtendFlows[Name]["stage"], opts?: FlowHookOptions<ExtendFlows[Name]["ctx"]>) => MethodDecorator;
11
- Around: (stage: ExtendFlows[Name]["stage"], opts?: FlowHookOptions<ExtendFlows[Name]["ctx"]>) => MethodDecorator;
12
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"flow-hooks.decorator.js","sourceRoot":"","sources":["../../../src/decorators/flow-hooks.decorator.ts"],"names":[],"mappings":";;AA4BA,kCAOC;AAED,gCAOC;AAED,8BAOC;AAED,oCAOC;AAED,kCAOC;AAtED,sCAAmD;AAGnD,SAAS,gBAAgB,CAAC,MAAW,EAAE,IAAkB;IACvD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;IAChC,MAAM,GAAG,GAAmB,OAAO,CAAC,WAAW,CAAC,+BAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAC1F,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,OAAO,CAAC,cAAc,CAAC,+BAAsB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAED,mCAAmC;AACnC,SAAS,IAAI,CAAC,IAAkB;IAC9B,OAAO,UAAoD,KAAQ,EAAE,OAA6B,EAAE;QAClG,OAAO,CAAC,MAAW,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;YACjC,gBAAgB,CAAC,MAAM,EAAE;gBACvB,IAAI;gBACJ,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;gBACpB,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC;gBACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,CAAC;gBAC5B,MAAM,EAAE,IAAI,CAAC,MAAa;gBAC1B,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;aACzC,CAAC,CAAC;Q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McpFlowHookTokens } from '../tokens';\n\n\nfunction registerFlowHook(target: any, meta: FlowHookMeta) {\n const ctor = target.constructor;\n const arr: FlowHookMeta[] = Reflect.getMetadata(FrontMcpFlowHookTokens.hooks, ctor) ?? [];\n arr.push(meta);\n Reflect.defineMetadata(FrontMcpFlowHookTokens.hooks, arr, ctor);\n}\n\n/** Base factory (kept internal) */\nfunction make(kind: FlowHookKind) {\n return function <Ctx = unknown, T extends string = string>(stage: T, opts: FlowHookOptions<Ctx> = {}): MethodDecorator {\n return (target: any, key, _desc) => {\n registerFlowHook(target, {\n kind,\n stage: String(stage),\n method: String(key),\n priority: opts.priority ?? 0,\n filter: opts.filter as any,\n static: Boolean(target.constructor[key]),\n });\n };\n };\n}\n\n/** NEW: typed variants */\nexport function StageHookOf<Name extends FlowName>(name: Name) {\n type T = ExtendFlows[Name]['stage']\n type Ctx = ExtendFlows[Name]['ctx']\n const base = make('stage');\n return function(stage: T, opts: FlowHookOptions<Ctx> = {}) {\n return base<Ctx, T>(stage, opts);\n };\n}\n\nexport function WillHookOf<Name extends FlowName>(name: Name) {\n type T = ExtendFlows[Name]['stage']\n type Ctx = ExtendFlows[Name]['ctx']\n const base = make('will');\n return function(stage: T, opts: FlowHookOptions<Ctx> = {}) {\n return base<Ctx, T>(stage, opts);\n };\n}\n\nexport function DidHookOf<Name extends FlowName>(name: Name) {\n type T = ExtendFlows[Name]['stage']\n type Ctx = ExtendFlows[Name]['ctx']\n const base = make('did');\n return function(stage: T, opts: FlowHookOptions<Ctx> = {}) {\n return base<Ctx, T>(stage, opts);\n };\n}\n\nexport function AroundHookOf<Name extends FlowName>(name: Name) {\n type T = ExtendFlows[Name]['stage']\n type Ctx = ExtendFlows[Name]['ctx']\n const base = make('around');\n return function(stage: T, opts: FlowHookOptions<Ctx> = {}) {\n return base<Ctx, T>(stage, opts);\n };\n}\n\nexport function FlowHooksOf<Name extends FlowName>(name: Name) {\n return {\n Stage: StageHookOf(name),\n Will: WillHookOf(name),\n Did: DidHookOf(name),\n Around: AroundHookOf(name),\n };\n}\n\n"]}
@@ -1,20 +0,0 @@
1
- export type FlowHookKind = 'stage' | 'will' | 'did' | 'around';
2
- export type FlowHookMetadata<Ctx = any> = {
3
- type: 'flow';
4
- hooks: FlowHookMeta<Ctx>[];
5
- };
6
- export type FlowHookMeta<Ctx = any> = {
7
- kind: FlowHookKind;
8
- stage: string;
9
- method: string;
10
- priority?: number;
11
- filter?: (ctx: Ctx) => boolean | Promise<boolean>;
12
- static?: boolean;
13
- };
14
- export type HookKind = 'stage' | 'will' | 'did' | 'around';
15
- export type Priority = number;
16
- export interface FlowHookOptions<Ctx> {
17
- priority?: Priority;
18
- filter?: (ctx: Ctx) => boolean | Promise<boolean>;
19
- name?: string;
20
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"flow-hooks.metadata.js","sourceRoot":"","sources":["../../../src/metadata/flow-hooks.metadata.ts"],"names":[],"mappings":"","sourcesContent":["export type FlowHookKind = 'stage' | 'will' | 'did' | 'around';\n\nexport type FlowHookMetadata<Ctx = any> = {\n type: 'flow';\n hooks: FlowHookMeta<Ctx>[];\n};\n\nexport type FlowHookMeta<Ctx = any> = {\n kind: FlowHookKind;\n stage: string;\n method: string;\n priority?: number;\n filter?: (ctx: Ctx) => boolean | Promise<boolean>;\n static?: boolean;\n};\n\n\nexport type HookKind = 'stage' | 'will' | 'did' | 'around';\nexport type Priority = number;\n\nexport interface FlowHookOptions<Ctx> {\n priority?: Priority;\n filter?: (ctx: Ctx) => boolean | Promise<boolean>;\n name?: string;\n}"]}