@frontmcp/sdk 0.3.0 → 0.4.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/LICENSE +201 -0
- package/README.md +192 -164
- package/package.json +7 -4
- package/src/__test-utils__/fixtures/hook.fixtures.d.ts +46 -0
- package/src/__test-utils__/fixtures/hook.fixtures.js +114 -0
- package/src/__test-utils__/fixtures/hook.fixtures.js.map +1 -0
- package/src/__test-utils__/fixtures/index.d.ts +7 -0
- package/src/__test-utils__/fixtures/index.js +11 -0
- package/src/__test-utils__/fixtures/index.js.map +1 -0
- package/src/__test-utils__/fixtures/plugin.fixtures.d.ts +46 -0
- package/src/__test-utils__/fixtures/plugin.fixtures.js +127 -0
- package/src/__test-utils__/fixtures/plugin.fixtures.js.map +1 -0
- package/src/__test-utils__/fixtures/provider.fixtures.d.ts +69 -0
- package/src/__test-utils__/fixtures/provider.fixtures.js +131 -0
- package/src/__test-utils__/fixtures/provider.fixtures.js.map +1 -0
- package/src/__test-utils__/fixtures/scope.fixtures.d.ts +14 -0
- package/src/__test-utils__/fixtures/scope.fixtures.js +59 -0
- package/src/__test-utils__/fixtures/scope.fixtures.js.map +1 -0
- package/src/__test-utils__/fixtures/tool.fixtures.d.ts +36 -0
- package/src/__test-utils__/fixtures/tool.fixtures.js +91 -0
- package/src/__test-utils__/fixtures/tool.fixtures.js.map +1 -0
- package/src/__test-utils__/helpers/assertion.helpers.d.ts +45 -0
- package/src/__test-utils__/helpers/assertion.helpers.js +153 -0
- package/src/__test-utils__/helpers/assertion.helpers.js.map +1 -0
- package/src/__test-utils__/helpers/async.helpers.d.ts +48 -0
- package/src/__test-utils__/helpers/async.helpers.js +112 -0
- package/src/__test-utils__/helpers/async.helpers.js.map +1 -0
- package/src/__test-utils__/helpers/index.d.ts +6 -0
- package/src/__test-utils__/helpers/index.js +10 -0
- package/src/__test-utils__/helpers/index.js.map +1 -0
- package/src/__test-utils__/helpers/setup.helpers.d.ts +54 -0
- package/src/__test-utils__/helpers/setup.helpers.js +106 -0
- package/src/__test-utils__/helpers/setup.helpers.js.map +1 -0
- package/src/__test-utils__/index.d.ts +9 -0
- package/src/__test-utils__/index.js +14 -0
- package/src/__test-utils__/index.js.map +1 -0
- package/src/__test-utils__/mocks/flow-instance.mock.d.ts +50 -0
- package/src/__test-utils__/mocks/flow-instance.mock.js +72 -0
- package/src/__test-utils__/mocks/flow-instance.mock.js.map +1 -0
- package/src/__test-utils__/mocks/hook-registry.mock.d.ts +25 -0
- package/src/__test-utils__/mocks/hook-registry.mock.js +65 -0
- package/src/__test-utils__/mocks/hook-registry.mock.js.map +1 -0
- package/src/__test-utils__/mocks/index.d.ts +8 -0
- package/src/__test-utils__/mocks/index.js +12 -0
- package/src/__test-utils__/mocks/index.js.map +1 -0
- package/src/__test-utils__/mocks/plugin-registry.mock.d.ts +43 -0
- package/src/__test-utils__/mocks/plugin-registry.mock.js +70 -0
- package/src/__test-utils__/mocks/plugin-registry.mock.js.map +1 -0
- package/src/__test-utils__/mocks/provider-registry.mock.d.ts +39 -0
- package/src/__test-utils__/mocks/provider-registry.mock.js +72 -0
- package/src/__test-utils__/mocks/provider-registry.mock.js.map +1 -0
- package/src/__test-utils__/mocks/tool-registry.mock.d.ts +43 -0
- package/src/__test-utils__/mocks/tool-registry.mock.js +79 -0
- package/src/__test-utils__/mocks/tool-registry.mock.js.map +1 -0
- package/src/app/app.utils.js.map +1 -1
- package/src/app/instances/app.local.instance.js +8 -11
- package/src/app/instances/app.local.instance.js.map +1 -1
- package/src/auth/auth.registry.d.ts +2 -2
- package/src/auth/auth.registry.js +3 -3
- package/src/auth/auth.registry.js.map +1 -1
- package/src/auth/flows/oauth.authorize.flow.d.ts +8 -8
- package/src/auth/flows/oauth.register.flow.d.ts +4 -4
- package/src/auth/flows/oauth.token.flow.d.ts +4 -4
- package/src/auth/flows/well-known.jwks.flow.d.ts +12 -12
- package/src/auth/flows/well-known.oauth-authorization-server.flow.d.ts +8 -8
- package/src/auth/flows/well-known.prm.flow.d.ts +4 -4
- package/src/auth/instances/instance.local-primary-auth.d.ts +3 -2
- package/src/auth/instances/instance.local-primary-auth.js +4 -2
- package/src/auth/instances/instance.local-primary-auth.js.map +1 -1
- package/src/auth/instances/instance.remote-primary-auth.d.ts +3 -2
- package/src/auth/instances/instance.remote-primary-auth.js +3 -1
- package/src/auth/instances/instance.remote-primary-auth.js.map +1 -1
- package/src/auth/jwks/jwks.service.js +0 -1
- package/src/auth/jwks/jwks.service.js.map +1 -1
- package/src/common/decorators/tool.decorator.d.ts +97 -36
- package/src/common/decorators/tool.decorator.js +0 -1
- package/src/common/decorators/tool.decorator.js.map +1 -1
- package/src/common/entries/scope.entry.d.ts +1 -0
- package/src/common/entries/scope.entry.js +6 -0
- package/src/common/entries/scope.entry.js.map +1 -1
- package/src/common/entries/tool.entry.d.ts +54 -11
- package/src/common/entries/tool.entry.js +19 -0
- package/src/common/entries/tool.entry.js.map +1 -1
- package/src/common/interfaces/internal/registry.interface.d.ts +10 -2
- package/src/common/interfaces/internal/registry.interface.js.map +1 -1
- package/src/common/interfaces/plugin.interface.d.ts +1 -1
- package/src/common/interfaces/plugin.interface.js.map +1 -1
- package/src/common/interfaces/tool.interface.d.ts +12 -7
- package/src/common/interfaces/tool.interface.js +1 -1
- package/src/common/interfaces/tool.interface.js.map +1 -1
- package/src/common/metadata/front-mcp.metadata.d.ts +145 -145
- package/src/common/metadata/hook.metadata.d.ts +4 -2
- package/src/common/metadata/hook.metadata.js.map +1 -1
- package/src/common/metadata/prompt.metadata.d.ts +28 -28
- package/src/common/metadata/prompt.metadata.js.map +1 -1
- package/src/common/metadata/resource.metadata.d.ts +54 -54
- package/src/common/metadata/tool.metadata.d.ts +190 -7
- package/src/common/metadata/tool.metadata.js +41 -6
- package/src/common/metadata/tool.metadata.js.map +1 -1
- package/src/common/records/scope.record.d.ts +2 -2
- package/src/common/records/scope.record.js.map +1 -1
- package/src/common/schemas/http-output.schema.d.ts +106 -106
- package/src/common/tokens/tool.tokens.js.map +1 -1
- package/src/common/types/options/logging.options.d.ts +1 -2
- package/src/common/types/options/logging.options.js +1 -9
- package/src/common/types/options/logging.options.js.map +1 -1
- package/src/common/types/options/server-info.options.d.ts +19 -19
- package/src/errors/error-handler.d.ts +65 -0
- package/src/errors/error-handler.js +107 -0
- package/src/errors/error-handler.js.map +1 -0
- package/src/errors/index.d.ts +2 -0
- package/src/errors/index.js +26 -0
- package/src/errors/index.js.map +1 -0
- package/src/errors/mcp.error.d.ts +156 -0
- package/src/errors/mcp.error.js +243 -0
- package/src/errors/mcp.error.js.map +1 -0
- package/src/flows/flow.instance.js +7 -6
- package/src/flows/flow.instance.js.map +1 -1
- package/src/flows/flow.registry.js +1 -1
- package/src/flows/flow.registry.js.map +1 -1
- package/src/front-mcp/front-mcp.providers.d.ts +20 -20
- package/src/hooks/hook.registry.d.ts +5 -3
- package/src/hooks/hook.registry.js +13 -1
- package/src/hooks/hook.registry.js.map +1 -1
- package/src/plugin/plugin.registry.d.ts +7 -2
- package/src/plugin/plugin.registry.js +23 -11
- package/src/plugin/plugin.registry.js.map +1 -1
- package/src/prompt/prompt.registry.js +1 -0
- package/src/prompt/prompt.registry.js.map +1 -1
- package/src/resource/resource.registry.js +1 -0
- package/src/resource/resource.registry.js.map +1 -1
- package/src/scope/scope.instance.js +8 -2
- package/src/scope/scope.instance.js.map +1 -1
- package/src/scope/scope.registry.js +3 -2
- package/src/scope/scope.registry.js.map +1 -1
- package/src/scope/scope.utils.js +6 -4
- package/src/scope/scope.utils.js.map +1 -1
- package/src/store/adapters/store.memory.adapter.js +3 -1
- package/src/store/adapters/store.memory.adapter.js.map +1 -1
- package/src/tool/flows/call-tool.flow.d.ts +1012 -676
- package/src/tool/flows/call-tool.flow.js +94 -61
- package/src/tool/flows/call-tool.flow.js.map +1 -1
- package/src/tool/flows/tools-list.flow.d.ts +347 -590
- package/src/tool/flows/tools-list.flow.js +76 -49
- package/src/tool/flows/tools-list.flow.js.map +1 -1
- package/src/tool/tool.instance.d.ts +27 -8
- package/src/tool/tool.instance.js +40 -5
- package/src/tool/tool.instance.js.map +1 -1
- package/src/tool/tool.registry.js +19 -21
- package/src/tool/tool.registry.js.map +1 -1
- package/src/tool/tool.utils.d.ts +3 -2
- package/src/tool/tool.utils.js +377 -14
- package/src/tool/tool.utils.js.map +1 -1
- package/src/transport/adapters/transport.sse.adapter.js +2 -1
- package/src/transport/adapters/transport.sse.adapter.js.map +1 -1
- package/src/transport/adapters/transport.streamable-http.adapter.js.map +1 -1
- package/src/transport/flows/handle.sse.flow.js +6 -13
- package/src/transport/flows/handle.sse.flow.js.map +1 -1
- package/src/transport/flows/handle.streamable-http.flow.js +1 -0
- package/src/transport/flows/handle.streamable-http.flow.js.map +1 -1
- package/src/transport/mcp-handlers/call-tool-request.handler.d.ts +1 -1
- package/src/transport/mcp-handlers/call-tool-request.handler.js +10 -5
- package/src/transport/mcp-handlers/call-tool-request.handler.js.map +1 -1
- package/src/transport/mcp-handlers/index.d.ts +151 -268
- package/src/transport/mcp-handlers/list-tools-request.handler.d.ts +124 -216
- package/src/transport/transport.local.js +1 -0
- package/src/transport/transport.local.js.map +1 -1
- package/src/utils/string.utils.js +1 -1
- package/src/utils/string.utils.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.interface.js","sourceRoot":"","sources":["../../../../../src/common/interfaces/internal/registry.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {\n ScopeEntry,\n FlowEntry,\n AuthProviderEntry,\n AppEntry,\n ProviderEntry,\n PluginEntry,\n AdapterEntry,\n PromptEntry,\n ResourceEntry,\n ToolEntry,\n LoggerEntry,\n EntryOwnerRef,\n HookEntry
|
|
1
|
+
{"version":3,"file":"registry.interface.js","sourceRoot":"","sources":["../../../../../src/common/interfaces/internal/registry.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {\n ScopeEntry,\n FlowEntry,\n AuthProviderEntry,\n AppEntry,\n ProviderEntry,\n PluginEntry,\n AdapterEntry,\n PromptEntry,\n ResourceEntry,\n ToolEntry,\n LoggerEntry,\n EntryOwnerRef,\n HookEntry,\n} from '../../entries';\nimport { Token } from '../base.interface';\nimport { FrontMcpAuth } from './primary-auth-provider.interface';\nimport { FlowName } from '../../metadata';\nimport { FlowCtxOf, FlowInputOf, FlowStagesOf } from '../flow.interface';\nimport { HookRecord } from '../../records';\n\nexport interface ScopeRegistryInterface {\n getScopes(): ScopeEntry[];\n}\n\nexport interface FlowRegistryInterface {\n getFlows(): FlowEntry<FlowName>[];\n}\n\nexport interface HookRegistryInterface {\n /**\n * used to pull hooks registered by a class and related to that class only,\n * like registering hooks on specific tool execution\n * @param token\n */\n getClsHooks(token: Token): HookEntry[];\n\n /**\n * Used to pull all hooks registered to specific flow by name,\n * this is used to construct the flow graph and execute hooks in order\n * @param flow\n */\n getFlowHooks<Name extends FlowName>(\n flow: Name,\n ): HookEntry<FlowInputOf<Name>, Name, FlowStagesOf<Name>, FlowCtxOf<Name>>[];\n\n /**\n * Used to pull all hooks registered to specific flow and stage by name,\n * this is used to construct the flow graph and execute hooks in order\n * @param flow\n * @param stage\n */\n getFlowStageHooks<Name extends FlowName>(\n flow: Name,\n stage: FlowStagesOf<Name> | string,\n ): HookEntry<FlowInputOf<Name>, Name, FlowStagesOf<Name>, FlowCtxOf<Name>>[];\n\n /**\n * Used to pull hooks for a specific flow, optionally filtered by owner ID.\n * Returns all hooks if no ownerId is provided, or only hooks belonging to\n * the specified owner or global hooks (no owner) if ownerId is provided.\n * @param flow\n * @param ownerId\n */\n getFlowHooksForOwner<Name extends FlowName>(\n flow: Name,\n ownerId?: string,\n ): HookEntry<FlowInputOf<Name>, Name, FlowStagesOf<Name>, FlowCtxOf<Name>>[];\n\n registerHooks(embedded: boolean, ...records: HookRecord[]): Promise<void[]>;\n}\n\nexport interface ProviderViews {\n /** App-wide singletons, created at boot. Immutable from invokes POV. */\n global: ReadonlyMap<Token, unknown>;\n /** Session-scoped cache for this sessionId. Mutable. */\n session: Map<Token, unknown>;\n /** Request-scoped providers for this single invocation. Mutable. */\n request: Map<Token, unknown>;\n}\n\nexport interface ProviderRegistryInterface {\n get<T>(token: Token<T>): T;\n\n getProviders(): ProviderEntry[];\n\n getRegistries<T extends RegistryKind>(type: T): RegistryType[T][];\n\n // TODO: fix session type\n buildViews(session: any): Promise<ProviderViews>;\n}\n\nexport interface AuthRegistryInterface {\n getPrimary(): FrontMcpAuth;\n\n getAuthProviders(): AuthProviderEntry[];\n}\n\nexport interface AppRegistryInterface {\n getApps(): AppEntry[];\n}\n\nexport interface PluginRegistryInterface {\n getPlugins(): PluginEntry[];\n}\n\nexport interface AdapterRegistryInterface {\n getAdapters(): AdapterEntry[];\n}\n\nexport interface ToolRegistryInterface {\n owner: EntryOwnerRef;\n\n // inline tools plus discovered by nested tool registries\n getTools(includeHidden?: boolean): ToolEntry[];\n\n // inline tools only\n getInlineTools(): ToolEntry<any, any>[];\n}\n\nexport interface ResourceRegistryInterface {\n // inline resources plus discovered by nested tool registries\n getResources(): ResourceEntry<any, any>[];\n\n // inline resources only\n getInlineResources(): ResourceEntry<any, any>[];\n}\n\nexport interface PromptRegistryInterface {\n // inline prompts plus discovered by nested tool registries\n getPrompts(): PromptEntry[];\n\n // inline prompts only\n getInlinePrompts(): PromptEntry[];\n}\n\nexport interface LoggerRegistryInterface {\n getLoggers(): LoggerEntry[];\n}\n\nexport type GlobalRegistryKind = 'LoggerRegistry' | 'ScopeRegistry';\n\nexport type ScopedRegistryKind = 'AppRegistry' | 'AuthRegistry' | 'FlowRegistry' | 'HookRegistry';\n\nexport type AppRegistryKind =\n | 'ProviderRegistry'\n | 'PluginRegistry'\n | 'AdapterRegistry'\n | 'ToolRegistry'\n | 'PromptRegistry'\n | 'ResourceRegistry';\n\nexport type RegistryKind = GlobalRegistryKind | ScopedRegistryKind | AppRegistryKind;\n\nexport type RegistryType = {\n LoggerRegistry: LoggerRegistryInterface;\n ScopeRegistry: ScopeRegistryInterface;\n FlowRegistry: FlowRegistryInterface;\n HookRegistry: HookRegistryInterface;\n AppRegistry: AppRegistryInterface;\n AuthRegistry: AuthRegistryInterface;\n ProviderRegistry: ProviderRegistryInterface;\n PluginRegistry: PluginRegistryInterface;\n AdapterRegistry: AdapterRegistryInterface;\n ToolRegistry: ToolRegistryInterface;\n ResourceRegistry: ResourceRegistryInterface;\n PromptRegistry: PromptRegistryInterface;\n};\n"]}
|
|
@@ -5,4 +5,4 @@ export interface PluginInterface {
|
|
|
5
5
|
export type PluginClassType<Provide> = ClassType<Provide> & PluginMetadata;
|
|
6
6
|
export type PluginValueType<Provide> = ValueType<Provide> & PluginMetadata;
|
|
7
7
|
export type PluginFactoryType<Provide, Tokens extends readonly Token[]> = FactoryType<Provide, Tokens> & PluginMetadata;
|
|
8
|
-
export type PluginType<Provide extends PluginInterface = PluginInterface> = Type<Provide> | PluginClassType<Provide> | PluginValueType<Provide> | PluginFactoryType<Provide, any[]>;
|
|
8
|
+
export type PluginType<Provide extends PluginInterface = PluginInterface> = Type<Provide> | PluginClassType<Provide> | PluginValueType<Provide> | PluginFactoryType<Provide, readonly any[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/plugin.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { Type, Token, ValueType, ClassType, FactoryType } from './base.interface';\nimport { PluginMetadata } from '../metadata';\n\nexport interface PluginInterface {\n\n}\n\n\nexport type PluginClassType<Provide> = ClassType<Provide> & PluginMetadata;\nexport type PluginValueType<Provide> = ValueType<Provide> & PluginMetadata;\nexport type PluginFactoryType<Provide, Tokens extends readonly Token[]> = FactoryType<Provide, Tokens> & PluginMetadata;\n\n\nexport type PluginType<Provide extends PluginInterface = PluginInterface> =\n | Type<Provide>\n | PluginClassType<Provide>\n | PluginValueType<Provide>\n | PluginFactoryType<Provide, any[]>\n\n"]}
|
|
1
|
+
{"version":3,"file":"plugin.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/plugin.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { Type, Token, ValueType, ClassType, FactoryType } from './base.interface';\nimport { PluginMetadata } from '../metadata';\n\nexport interface PluginInterface {\n\n}\n\n\nexport type PluginClassType<Provide> = ClassType<Provide> & PluginMetadata;\nexport type PluginValueType<Provide> = ValueType<Provide> & PluginMetadata;\nexport type PluginFactoryType<Provide, Tokens extends readonly Token[]> = FactoryType<Provide, Tokens> & PluginMetadata;\n\n\nexport type PluginType<Provide extends PluginInterface = PluginInterface> =\n | Type<Provide>\n | PluginClassType<Provide>\n | PluginValueType<Provide>\n | PluginFactoryType<Provide, readonly any[]>\n\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { FuncType, Token, Type } from
|
|
2
|
-
import { ProviderRegistryInterface } from
|
|
3
|
-
import { ToolMetadata } from
|
|
4
|
-
import { FrontMcpLogger } from
|
|
5
|
-
import { URL } from
|
|
6
|
-
import { AuthInfo } from
|
|
1
|
+
import { FuncType, Token, Type } from './base.interface';
|
|
2
|
+
import { ProviderRegistryInterface } from './internal';
|
|
3
|
+
import { ToolInputType, ToolMetadata, ToolOutputType } from '../metadata';
|
|
4
|
+
import { FrontMcpLogger } from './logger.interface';
|
|
5
|
+
import { URL } from 'url';
|
|
6
|
+
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
|
|
7
|
+
import { ToolInputOf, ToolOutputOf } from '../decorators';
|
|
7
8
|
export type ToolType<T = any> = Type<T> | FuncType<T>;
|
|
8
9
|
type HistoryEntry<T> = {
|
|
9
10
|
at: number;
|
|
@@ -18,7 +19,11 @@ export type ToolCtorArgs<In> = {
|
|
|
18
19
|
logger: FrontMcpLogger;
|
|
19
20
|
authInfo: AuthInfo;
|
|
20
21
|
};
|
|
21
|
-
export declare abstract class ToolContext<
|
|
22
|
+
export declare abstract class ToolContext<InSchema extends ToolInputType = ToolInputType, OutSchema extends ToolOutputType = ToolOutputType, In = ToolInputOf<{
|
|
23
|
+
inputSchema: InSchema;
|
|
24
|
+
}>, Out = ToolOutputOf<{
|
|
25
|
+
outputSchema: OutSchema;
|
|
26
|
+
}>> {
|
|
22
27
|
private providers;
|
|
23
28
|
readonly authInfo: AuthInfo;
|
|
24
29
|
protected readonly runId: string;
|
|
@@ -64,7 +64,7 @@ class ToolContext {
|
|
|
64
64
|
}
|
|
65
65
|
set output(v) {
|
|
66
66
|
this._output = v;
|
|
67
|
-
this._outputHistory.push({ at: Date.now(), stage: this.activeStage, value: v
|
|
67
|
+
this._outputHistory.push({ at: Date.now(), stage: this.activeStage, value: v });
|
|
68
68
|
}
|
|
69
69
|
get outputHistory() {
|
|
70
70
|
return this._outputHistory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/tool.interface.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"tool.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/tool.interface.ts"],"names":[],"mappings":"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","sourcesContent":["import { randomUUID } from 'crypto';\nimport { FuncType, Token, Type } from './base.interface';\nimport { ProviderRegistryInterface } from './internal';\nimport { ToolInputType, ToolMetadata, ToolOutputType } from '../metadata';\nimport { FrontMcpLogger } from './logger.interface';\nimport { FlowControl } from './flow.interface';\nimport { URL } from 'url';\nimport { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';\nimport { ToolInputOf, ToolOutputOf } from '../decorators';\n\nexport type ToolType<T = any> = Type<T> | FuncType<T>;\n\ntype HistoryEntry<T> = {\n at: number;\n stage?: string;\n value: T | undefined;\n note?: string;\n};\n\nexport type ToolCtorArgs<In> = {\n metadata: ToolMetadata;\n input: In;\n providers: ProviderRegistryInterface;\n logger: FrontMcpLogger;\n authInfo: AuthInfo;\n};\n\nexport abstract class ToolContext<\n InSchema extends ToolInputType = ToolInputType,\n OutSchema extends ToolOutputType = ToolOutputType,\n In = ToolInputOf<{ inputSchema: InSchema }>,\n Out = ToolOutputOf<{ outputSchema: OutSchema }>,\n> {\n private providers: ProviderRegistryInterface;\n readonly authInfo: AuthInfo;\n\n protected readonly runId: string;\n protected readonly toolId: string;\n protected readonly toolName: string;\n readonly metadata: ToolMetadata;\n protected readonly logger: FrontMcpLogger;\n\n protected activeStage: string;\n\n // ---- INPUT storages (backing fields)\n private _rawInput?: Partial<In> | any;\n private _input?: In;\n\n // ---- OUTPUT storages (backing fields)\n private _outputDraft?: Partial<Out> | any;\n private _output?: Out;\n\n private _error?: Error;\n\n // ---- histories\n private readonly _inputHistory: HistoryEntry<In>[] = [];\n private readonly _outputHistory: HistoryEntry<Out>[] = [];\n\n constructor(args: ToolCtorArgs<In>) {\n const { metadata, input, providers, logger, authInfo } = args;\n this.runId = randomUUID();\n this.toolName = metadata.name;\n this.toolId = metadata.id ?? metadata.name;\n this.metadata = metadata;\n this._input = input;\n this.providers = providers;\n this.logger = logger.child(`tool:${this.toolId}`);\n this.authInfo = authInfo;\n }\n\n abstract execute(input: In): Promise<Out>;\n\n get<T>(token: Token<T>): T {\n return this.providers.get(token);\n }\n\n tryGet<T>(token: Token<T>): T | undefined {\n try {\n return this.providers.get(token);\n } catch (e) {\n this.logger.warn(\"Requesting provider that doesn't exist: \", token);\n return undefined;\n }\n }\n\n public get input(): In {\n return this._input as In;\n }\n\n public set input(v: In | undefined) {\n this._input = v;\n this._inputHistory.push({\n at: Date.now(),\n stage: this.activeStage,\n value: v,\n });\n }\n\n public get inputHistory(): ReadonlyArray<HistoryEntry<In>> {\n return this._inputHistory;\n }\n\n public get output(): Out | undefined {\n return this._output;\n }\n\n public set output(v: Out | undefined) {\n this._output = v;\n this._outputHistory.push({ at: Date.now(), stage: this.activeStage, value: v });\n }\n\n public get outputHistory(): ReadonlyArray<HistoryEntry<Out>> {\n return this._outputHistory;\n }\n\n respond(value: Out): never {\n // record validated output and surface the value via control flow\n this.output = value;\n FlowControl.respond<Out>(value);\n }\n\n /** Fail the run (invoker will run error/finalize). */\n protected fail(err: Error): never {\n this._error = err;\n FlowControl.fail(err);\n }\n\n mark(stage: string): void {\n this.activeStage = stage;\n }\n\n fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response> {\n return fetch(input, init);\n }\n}\n"]}
|
|
@@ -23,34 +23,34 @@ export declare const frontMcpBaseSchema: z.ZodObject<{
|
|
|
23
23
|
src: z.ZodString;
|
|
24
24
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
25
25
|
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26
|
-
}, "
|
|
27
|
-
src:
|
|
28
|
-
mimeType
|
|
29
|
-
sizes
|
|
30
|
-
},
|
|
31
|
-
src:
|
|
32
|
-
mimeType
|
|
33
|
-
sizes
|
|
34
|
-
}
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
src: string;
|
|
28
|
+
mimeType?: string | undefined;
|
|
29
|
+
sizes?: string[] | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
src: string;
|
|
32
|
+
mimeType?: string | undefined;
|
|
33
|
+
sizes?: string[] | undefined;
|
|
34
|
+
}>, "many">>;
|
|
35
35
|
}, "strip", z.ZodTypeAny, {
|
|
36
36
|
name: string;
|
|
37
37
|
version: string;
|
|
38
38
|
title?: string | undefined;
|
|
39
|
-
icons?:
|
|
40
|
-
src:
|
|
41
|
-
mimeType
|
|
42
|
-
sizes
|
|
43
|
-
}
|
|
39
|
+
icons?: {
|
|
40
|
+
src: string;
|
|
41
|
+
mimeType?: string | undefined;
|
|
42
|
+
sizes?: string[] | undefined;
|
|
43
|
+
}[] | undefined;
|
|
44
44
|
websiteUrl?: string | undefined;
|
|
45
45
|
}, {
|
|
46
46
|
name: string;
|
|
47
47
|
version: string;
|
|
48
48
|
title?: string | undefined;
|
|
49
|
-
icons?:
|
|
50
|
-
src:
|
|
51
|
-
mimeType
|
|
52
|
-
sizes
|
|
53
|
-
}
|
|
49
|
+
icons?: {
|
|
50
|
+
src: string;
|
|
51
|
+
mimeType?: string | undefined;
|
|
52
|
+
sizes?: string[] | undefined;
|
|
53
|
+
}[] | undefined;
|
|
54
54
|
websiteUrl?: string | undefined;
|
|
55
55
|
}>;
|
|
56
56
|
providers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>>;
|
|
@@ -101,11 +101,11 @@ export declare const frontMcpBaseSchema: z.ZodObject<{
|
|
|
101
101
|
name: string;
|
|
102
102
|
version: string;
|
|
103
103
|
title?: string | undefined;
|
|
104
|
-
icons?:
|
|
105
|
-
src:
|
|
106
|
-
mimeType
|
|
107
|
-
sizes
|
|
108
|
-
}
|
|
104
|
+
icons?: {
|
|
105
|
+
src: string;
|
|
106
|
+
mimeType?: string | undefined;
|
|
107
|
+
sizes?: string[] | undefined;
|
|
108
|
+
}[] | undefined;
|
|
109
109
|
websiteUrl?: string | undefined;
|
|
110
110
|
};
|
|
111
111
|
apps: import("../interfaces").Type<unknown>[];
|
|
@@ -130,11 +130,11 @@ export declare const frontMcpBaseSchema: z.ZodObject<{
|
|
|
130
130
|
name: string;
|
|
131
131
|
version: string;
|
|
132
132
|
title?: string | undefined;
|
|
133
|
-
icons?:
|
|
134
|
-
src:
|
|
135
|
-
mimeType
|
|
136
|
-
sizes
|
|
137
|
-
}
|
|
133
|
+
icons?: {
|
|
134
|
+
src: string;
|
|
135
|
+
mimeType?: string | undefined;
|
|
136
|
+
sizes?: string[] | undefined;
|
|
137
|
+
}[] | undefined;
|
|
138
138
|
websiteUrl?: string | undefined;
|
|
139
139
|
};
|
|
140
140
|
apps: import("../interfaces").Type<unknown>[];
|
|
@@ -170,34 +170,34 @@ declare const frontMcpMultiAppSchema: z.ZodObject<{
|
|
|
170
170
|
src: z.ZodString;
|
|
171
171
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
172
172
|
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
173
|
-
}, "
|
|
174
|
-
src:
|
|
175
|
-
mimeType
|
|
176
|
-
sizes
|
|
177
|
-
},
|
|
178
|
-
src:
|
|
179
|
-
mimeType
|
|
180
|
-
sizes
|
|
181
|
-
}
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
src: string;
|
|
175
|
+
mimeType?: string | undefined;
|
|
176
|
+
sizes?: string[] | undefined;
|
|
177
|
+
}, {
|
|
178
|
+
src: string;
|
|
179
|
+
mimeType?: string | undefined;
|
|
180
|
+
sizes?: string[] | undefined;
|
|
181
|
+
}>, "many">>;
|
|
182
182
|
}, "strip", z.ZodTypeAny, {
|
|
183
183
|
name: string;
|
|
184
184
|
version: string;
|
|
185
185
|
title?: string | undefined;
|
|
186
|
-
icons?:
|
|
187
|
-
src:
|
|
188
|
-
mimeType
|
|
189
|
-
sizes
|
|
190
|
-
}
|
|
186
|
+
icons?: {
|
|
187
|
+
src: string;
|
|
188
|
+
mimeType?: string | undefined;
|
|
189
|
+
sizes?: string[] | undefined;
|
|
190
|
+
}[] | undefined;
|
|
191
191
|
websiteUrl?: string | undefined;
|
|
192
192
|
}, {
|
|
193
193
|
name: string;
|
|
194
194
|
version: string;
|
|
195
195
|
title?: string | undefined;
|
|
196
|
-
icons?:
|
|
197
|
-
src:
|
|
198
|
-
mimeType
|
|
199
|
-
sizes
|
|
200
|
-
}
|
|
196
|
+
icons?: {
|
|
197
|
+
src: string;
|
|
198
|
+
mimeType?: string | undefined;
|
|
199
|
+
sizes?: string[] | undefined;
|
|
200
|
+
}[] | undefined;
|
|
201
201
|
websiteUrl?: string | undefined;
|
|
202
202
|
}>;
|
|
203
203
|
providers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>>;
|
|
@@ -365,11 +365,11 @@ declare const frontMcpMultiAppSchema: z.ZodObject<{
|
|
|
365
365
|
name: string;
|
|
366
366
|
version: string;
|
|
367
367
|
title?: string | undefined;
|
|
368
|
-
icons?:
|
|
369
|
-
src:
|
|
370
|
-
mimeType
|
|
371
|
-
sizes
|
|
372
|
-
}
|
|
368
|
+
icons?: {
|
|
369
|
+
src: string;
|
|
370
|
+
mimeType?: string | undefined;
|
|
371
|
+
sizes?: string[] | undefined;
|
|
372
|
+
}[] | undefined;
|
|
373
373
|
websiteUrl?: string | undefined;
|
|
374
374
|
};
|
|
375
375
|
apps: import("../interfaces").Type<unknown>[];
|
|
@@ -430,11 +430,11 @@ declare const frontMcpMultiAppSchema: z.ZodObject<{
|
|
|
430
430
|
name: string;
|
|
431
431
|
version: string;
|
|
432
432
|
title?: string | undefined;
|
|
433
|
-
icons?:
|
|
434
|
-
src:
|
|
435
|
-
mimeType
|
|
436
|
-
sizes
|
|
437
|
-
}
|
|
433
|
+
icons?: {
|
|
434
|
+
src: string;
|
|
435
|
+
mimeType?: string | undefined;
|
|
436
|
+
sizes?: string[] | undefined;
|
|
437
|
+
}[] | undefined;
|
|
438
438
|
websiteUrl?: string | undefined;
|
|
439
439
|
};
|
|
440
440
|
apps: import("../interfaces").Type<unknown>[];
|
|
@@ -506,34 +506,34 @@ declare const frontMcpSplitByAppSchema: z.ZodObject<{
|
|
|
506
506
|
src: z.ZodString;
|
|
507
507
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
508
508
|
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
509
|
-
}, "
|
|
510
|
-
src:
|
|
511
|
-
mimeType
|
|
512
|
-
sizes
|
|
513
|
-
},
|
|
514
|
-
src:
|
|
515
|
-
mimeType
|
|
516
|
-
sizes
|
|
517
|
-
}
|
|
509
|
+
}, "strip", z.ZodTypeAny, {
|
|
510
|
+
src: string;
|
|
511
|
+
mimeType?: string | undefined;
|
|
512
|
+
sizes?: string[] | undefined;
|
|
513
|
+
}, {
|
|
514
|
+
src: string;
|
|
515
|
+
mimeType?: string | undefined;
|
|
516
|
+
sizes?: string[] | undefined;
|
|
517
|
+
}>, "many">>;
|
|
518
518
|
}, "strip", z.ZodTypeAny, {
|
|
519
519
|
name: string;
|
|
520
520
|
version: string;
|
|
521
521
|
title?: string | undefined;
|
|
522
|
-
icons?:
|
|
523
|
-
src:
|
|
524
|
-
mimeType
|
|
525
|
-
sizes
|
|
526
|
-
}
|
|
522
|
+
icons?: {
|
|
523
|
+
src: string;
|
|
524
|
+
mimeType?: string | undefined;
|
|
525
|
+
sizes?: string[] | undefined;
|
|
526
|
+
}[] | undefined;
|
|
527
527
|
websiteUrl?: string | undefined;
|
|
528
528
|
}, {
|
|
529
529
|
name: string;
|
|
530
530
|
version: string;
|
|
531
531
|
title?: string | undefined;
|
|
532
|
-
icons?:
|
|
533
|
-
src:
|
|
534
|
-
mimeType
|
|
535
|
-
sizes
|
|
536
|
-
}
|
|
532
|
+
icons?: {
|
|
533
|
+
src: string;
|
|
534
|
+
mimeType?: string | undefined;
|
|
535
|
+
sizes?: string[] | undefined;
|
|
536
|
+
}[] | undefined;
|
|
537
537
|
websiteUrl?: string | undefined;
|
|
538
538
|
}>;
|
|
539
539
|
providers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>>;
|
|
@@ -587,11 +587,11 @@ declare const frontMcpSplitByAppSchema: z.ZodObject<{
|
|
|
587
587
|
name: string;
|
|
588
588
|
version: string;
|
|
589
589
|
title?: string | undefined;
|
|
590
|
-
icons?:
|
|
591
|
-
src:
|
|
592
|
-
mimeType
|
|
593
|
-
sizes
|
|
594
|
-
}
|
|
590
|
+
icons?: {
|
|
591
|
+
src: string;
|
|
592
|
+
mimeType?: string | undefined;
|
|
593
|
+
sizes?: string[] | undefined;
|
|
594
|
+
}[] | undefined;
|
|
595
595
|
websiteUrl?: string | undefined;
|
|
596
596
|
};
|
|
597
597
|
apps: import("../interfaces").Type<unknown>[];
|
|
@@ -618,11 +618,11 @@ declare const frontMcpSplitByAppSchema: z.ZodObject<{
|
|
|
618
618
|
name: string;
|
|
619
619
|
version: string;
|
|
620
620
|
title?: string | undefined;
|
|
621
|
-
icons?:
|
|
622
|
-
src:
|
|
623
|
-
mimeType
|
|
624
|
-
sizes
|
|
625
|
-
}
|
|
621
|
+
icons?: {
|
|
622
|
+
src: string;
|
|
623
|
+
mimeType?: string | undefined;
|
|
624
|
+
sizes?: string[] | undefined;
|
|
625
|
+
}[] | undefined;
|
|
626
626
|
websiteUrl?: string | undefined;
|
|
627
627
|
};
|
|
628
628
|
apps: import("../interfaces").Type<unknown>[];
|
|
@@ -657,34 +657,34 @@ export declare const frontMcpMetadataSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
657
657
|
src: z.ZodString;
|
|
658
658
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
659
659
|
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
660
|
-
}, "
|
|
661
|
-
src:
|
|
662
|
-
mimeType
|
|
663
|
-
sizes
|
|
664
|
-
},
|
|
665
|
-
src:
|
|
666
|
-
mimeType
|
|
667
|
-
sizes
|
|
668
|
-
}
|
|
660
|
+
}, "strip", z.ZodTypeAny, {
|
|
661
|
+
src: string;
|
|
662
|
+
mimeType?: string | undefined;
|
|
663
|
+
sizes?: string[] | undefined;
|
|
664
|
+
}, {
|
|
665
|
+
src: string;
|
|
666
|
+
mimeType?: string | undefined;
|
|
667
|
+
sizes?: string[] | undefined;
|
|
668
|
+
}>, "many">>;
|
|
669
669
|
}, "strip", z.ZodTypeAny, {
|
|
670
670
|
name: string;
|
|
671
671
|
version: string;
|
|
672
672
|
title?: string | undefined;
|
|
673
|
-
icons?:
|
|
674
|
-
src:
|
|
675
|
-
mimeType
|
|
676
|
-
sizes
|
|
677
|
-
}
|
|
673
|
+
icons?: {
|
|
674
|
+
src: string;
|
|
675
|
+
mimeType?: string | undefined;
|
|
676
|
+
sizes?: string[] | undefined;
|
|
677
|
+
}[] | undefined;
|
|
678
678
|
websiteUrl?: string | undefined;
|
|
679
679
|
}, {
|
|
680
680
|
name: string;
|
|
681
681
|
version: string;
|
|
682
682
|
title?: string | undefined;
|
|
683
|
-
icons?:
|
|
684
|
-
src:
|
|
685
|
-
mimeType
|
|
686
|
-
sizes
|
|
687
|
-
}
|
|
683
|
+
icons?: {
|
|
684
|
+
src: string;
|
|
685
|
+
mimeType?: string | undefined;
|
|
686
|
+
sizes?: string[] | undefined;
|
|
687
|
+
}[] | undefined;
|
|
688
688
|
websiteUrl?: string | undefined;
|
|
689
689
|
}>;
|
|
690
690
|
providers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>>;
|
|
@@ -852,11 +852,11 @@ export declare const frontMcpMetadataSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
852
852
|
name: string;
|
|
853
853
|
version: string;
|
|
854
854
|
title?: string | undefined;
|
|
855
|
-
icons?:
|
|
856
|
-
src:
|
|
857
|
-
mimeType
|
|
858
|
-
sizes
|
|
859
|
-
}
|
|
855
|
+
icons?: {
|
|
856
|
+
src: string;
|
|
857
|
+
mimeType?: string | undefined;
|
|
858
|
+
sizes?: string[] | undefined;
|
|
859
|
+
}[] | undefined;
|
|
860
860
|
websiteUrl?: string | undefined;
|
|
861
861
|
};
|
|
862
862
|
apps: import("../interfaces").Type<unknown>[];
|
|
@@ -917,11 +917,11 @@ export declare const frontMcpMetadataSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
917
917
|
name: string;
|
|
918
918
|
version: string;
|
|
919
919
|
title?: string | undefined;
|
|
920
|
-
icons?:
|
|
921
|
-
src:
|
|
922
|
-
mimeType
|
|
923
|
-
sizes
|
|
924
|
-
}
|
|
920
|
+
icons?: {
|
|
921
|
+
src: string;
|
|
922
|
+
mimeType?: string | undefined;
|
|
923
|
+
sizes?: string[] | undefined;
|
|
924
|
+
}[] | undefined;
|
|
925
925
|
websiteUrl?: string | undefined;
|
|
926
926
|
};
|
|
927
927
|
apps: import("../interfaces").Type<unknown>[];
|
|
@@ -988,34 +988,34 @@ export declare const frontMcpMetadataSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
988
988
|
src: z.ZodString;
|
|
989
989
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
990
990
|
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
991
|
-
}, "
|
|
992
|
-
src:
|
|
993
|
-
mimeType
|
|
994
|
-
sizes
|
|
995
|
-
},
|
|
996
|
-
src:
|
|
997
|
-
mimeType
|
|
998
|
-
sizes
|
|
999
|
-
}
|
|
991
|
+
}, "strip", z.ZodTypeAny, {
|
|
992
|
+
src: string;
|
|
993
|
+
mimeType?: string | undefined;
|
|
994
|
+
sizes?: string[] | undefined;
|
|
995
|
+
}, {
|
|
996
|
+
src: string;
|
|
997
|
+
mimeType?: string | undefined;
|
|
998
|
+
sizes?: string[] | undefined;
|
|
999
|
+
}>, "many">>;
|
|
1000
1000
|
}, "strip", z.ZodTypeAny, {
|
|
1001
1001
|
name: string;
|
|
1002
1002
|
version: string;
|
|
1003
1003
|
title?: string | undefined;
|
|
1004
|
-
icons?:
|
|
1005
|
-
src:
|
|
1006
|
-
mimeType
|
|
1007
|
-
sizes
|
|
1008
|
-
}
|
|
1004
|
+
icons?: {
|
|
1005
|
+
src: string;
|
|
1006
|
+
mimeType?: string | undefined;
|
|
1007
|
+
sizes?: string[] | undefined;
|
|
1008
|
+
}[] | undefined;
|
|
1009
1009
|
websiteUrl?: string | undefined;
|
|
1010
1010
|
}, {
|
|
1011
1011
|
name: string;
|
|
1012
1012
|
version: string;
|
|
1013
1013
|
title?: string | undefined;
|
|
1014
|
-
icons?:
|
|
1015
|
-
src:
|
|
1016
|
-
mimeType
|
|
1017
|
-
sizes
|
|
1018
|
-
}
|
|
1014
|
+
icons?: {
|
|
1015
|
+
src: string;
|
|
1016
|
+
mimeType?: string | undefined;
|
|
1017
|
+
sizes?: string[] | undefined;
|
|
1018
|
+
}[] | undefined;
|
|
1019
1019
|
websiteUrl?: string | undefined;
|
|
1020
1020
|
}>;
|
|
1021
1021
|
providers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodType<import("../interfaces").Type<unknown>, z.ZodTypeDef, import("../interfaces").Type<unknown>>, "many">>>;
|
|
@@ -1069,11 +1069,11 @@ export declare const frontMcpMetadataSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1069
1069
|
name: string;
|
|
1070
1070
|
version: string;
|
|
1071
1071
|
title?: string | undefined;
|
|
1072
|
-
icons?:
|
|
1073
|
-
src:
|
|
1074
|
-
mimeType
|
|
1075
|
-
sizes
|
|
1076
|
-
}
|
|
1072
|
+
icons?: {
|
|
1073
|
+
src: string;
|
|
1074
|
+
mimeType?: string | undefined;
|
|
1075
|
+
sizes?: string[] | undefined;
|
|
1076
|
+
}[] | undefined;
|
|
1077
1077
|
websiteUrl?: string | undefined;
|
|
1078
1078
|
};
|
|
1079
1079
|
apps: import("../interfaces").Type<unknown>[];
|
|
@@ -1100,11 +1100,11 @@ export declare const frontMcpMetadataSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1100
1100
|
name: string;
|
|
1101
1101
|
version: string;
|
|
1102
1102
|
title?: string | undefined;
|
|
1103
|
-
icons?:
|
|
1104
|
-
src:
|
|
1105
|
-
mimeType
|
|
1106
|
-
sizes
|
|
1107
|
-
}
|
|
1103
|
+
icons?: {
|
|
1104
|
+
src: string;
|
|
1105
|
+
mimeType?: string | undefined;
|
|
1106
|
+
sizes?: string[] | undefined;
|
|
1107
|
+
}[] | undefined;
|
|
1108
1108
|
websiteUrl?: string | undefined;
|
|
1109
1109
|
};
|
|
1110
1110
|
apps: import("../interfaces").Type<unknown>[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Token } from
|
|
2
|
-
import { FlowName } from
|
|
1
|
+
import { Token } from '../interfaces';
|
|
2
|
+
import { FlowName } from './flow.metadata';
|
|
3
|
+
import { EntryOwnerRef } from '../entries/base.entry';
|
|
3
4
|
export type HookStageType = 'stage' | 'will' | 'did' | 'around';
|
|
4
5
|
export type HookPriority = number;
|
|
5
6
|
export interface HookOptions<Ctx> {
|
|
@@ -16,4 +17,5 @@ export interface HookMetadata<Name extends FlowName = FlowName, Stage = string,
|
|
|
16
17
|
target: Token;
|
|
17
18
|
method: string;
|
|
18
19
|
static?: boolean;
|
|
20
|
+
owner?: EntryOwnerRef;
|
|
19
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.metadata.js","sourceRoot":"","sources":["../../../../src/common/metadata/hook.metadata.ts"],"names":[],"mappings":"","sourcesContent":["import {Token} from
|
|
1
|
+
{"version":3,"file":"hook.metadata.js","sourceRoot":"","sources":["../../../../src/common/metadata/hook.metadata.ts"],"names":[],"mappings":"","sourcesContent":["import { Token } from '../interfaces';\nimport { FlowName } from './flow.metadata';\nimport { EntryOwnerRef } from '../entries/base.entry';\n\nexport type HookStageType = 'stage' | 'will' | 'did' | 'around';\nexport type HookPriority = number;\n\nexport interface HookOptions<Ctx> {\n priority?: HookPriority;\n filter?: (ctx: Ctx) => boolean | Promise<boolean>;\n}\n\nexport interface TokenHookMetadata {\n hooks: HookMetadata[];\n}\n\nexport interface HookMetadata<Name extends FlowName = FlowName, Stage = string, Ctx = any> extends HookOptions<Ctx> {\n type: HookStageType;\n flow: Name;\n stage: Stage;\n target: Token;\n method: string;\n static?: boolean;\n owner?: EntryOwnerRef;\n}\n"]}
|