@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,199 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Icon } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
declare global {
|
|
4
|
+
/**
|
|
5
|
+
* Declarative metadata extends to McpResource decorator.
|
|
6
|
+
*/
|
|
7
|
+
export interface ExtendFrontMcpResourceMetadata {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Declarative metadata extends to McpResourceTemplate decorator.
|
|
11
|
+
*/
|
|
12
|
+
export interface ExtendFrontMcpResourceTemplateMetadata {
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A known resource that the server is capable of reading.
|
|
17
|
+
*/
|
|
18
|
+
interface ResourceMetadata extends ExtendFrontMcpResourceMetadata {
|
|
19
|
+
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
20
|
+
name: string;
|
|
21
|
+
/**
|
|
22
|
+
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
23
|
+
* even by those unfamiliar with domain-specific terminology.
|
|
24
|
+
*
|
|
25
|
+
* If not provided, the name should be used for display (except for Tool,
|
|
26
|
+
* where `annotations.title` should be given precedence over using `name`,
|
|
27
|
+
* if present).
|
|
28
|
+
*/
|
|
29
|
+
title?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The URI of this resource.
|
|
32
|
+
*/
|
|
33
|
+
uri: string;
|
|
34
|
+
/**
|
|
35
|
+
* A description of what this resource represents.
|
|
36
|
+
*
|
|
37
|
+
* 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.
|
|
38
|
+
*/
|
|
39
|
+
description?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The MIME type of this resource, if known.
|
|
42
|
+
*/
|
|
43
|
+
mimeType?: string;
|
|
44
|
+
/**
|
|
45
|
+
* A list of icons that can be used to represent this resource template.
|
|
46
|
+
*/
|
|
47
|
+
icons?: Icon[];
|
|
48
|
+
}
|
|
49
|
+
export declare const frontMcpResourceMetadataSchema: z.ZodObject<{
|
|
50
|
+
name: z.ZodString;
|
|
51
|
+
title: z.ZodOptional<z.ZodString>;
|
|
52
|
+
uri: z.ZodString;
|
|
53
|
+
description: z.ZodOptional<z.ZodString>;
|
|
54
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
55
|
+
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
56
|
+
src: z.ZodString;
|
|
57
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
58
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
59
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
60
|
+
src: z.ZodString;
|
|
61
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
62
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
63
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
64
|
+
src: z.ZodString;
|
|
65
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
66
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
67
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
68
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
69
|
+
name: z.ZodString;
|
|
70
|
+
title: z.ZodOptional<z.ZodString>;
|
|
71
|
+
uri: z.ZodString;
|
|
72
|
+
description: z.ZodOptional<z.ZodString>;
|
|
73
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
74
|
+
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
75
|
+
src: z.ZodString;
|
|
76
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
77
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
78
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
79
|
+
src: z.ZodString;
|
|
80
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
81
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
82
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
83
|
+
src: z.ZodString;
|
|
84
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
85
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
86
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
87
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
title: z.ZodOptional<z.ZodString>;
|
|
90
|
+
uri: z.ZodString;
|
|
91
|
+
description: z.ZodOptional<z.ZodString>;
|
|
92
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
93
|
+
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
94
|
+
src: z.ZodString;
|
|
95
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
96
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
97
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
98
|
+
src: z.ZodString;
|
|
99
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
100
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
101
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
102
|
+
src: z.ZodString;
|
|
103
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
104
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
105
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
106
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
107
|
+
/**
|
|
108
|
+
* A template description for resources available on the server.
|
|
109
|
+
*/
|
|
110
|
+
interface ResourceTemplateMetadata extends ExtendFrontMcpResourceTemplateMetadata {
|
|
111
|
+
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
112
|
+
name: string;
|
|
113
|
+
/**
|
|
114
|
+
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
115
|
+
* even by those unfamiliar with domain-specific terminology.
|
|
116
|
+
*
|
|
117
|
+
* If not provided, the name should be used for display (except for Tool,
|
|
118
|
+
* where `annotations.title` should be given precedence over using `name`,
|
|
119
|
+
* if present).
|
|
120
|
+
*/
|
|
121
|
+
title?: string;
|
|
122
|
+
/**
|
|
123
|
+
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
|
|
124
|
+
*/
|
|
125
|
+
uriTemplate: string;
|
|
126
|
+
/**
|
|
127
|
+
* A description of what this template is for.
|
|
128
|
+
*
|
|
129
|
+
* 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.
|
|
130
|
+
*/
|
|
131
|
+
description?: string;
|
|
132
|
+
/**
|
|
133
|
+
* The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
|
|
134
|
+
*/
|
|
135
|
+
mimeType?: string;
|
|
136
|
+
/**
|
|
137
|
+
* A list of icons that can be used to represent this resource template.
|
|
138
|
+
*/
|
|
139
|
+
icons?: Icon[];
|
|
140
|
+
}
|
|
141
|
+
export declare const frontMcpResourceTemplateMetadataSchema: z.ZodObject<{
|
|
142
|
+
name: z.ZodString;
|
|
143
|
+
title: z.ZodOptional<z.ZodString>;
|
|
144
|
+
uriTemplate: z.ZodString;
|
|
145
|
+
description: z.ZodOptional<z.ZodString>;
|
|
146
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
147
|
+
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
148
|
+
src: z.ZodString;
|
|
149
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
150
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
151
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
152
|
+
src: z.ZodString;
|
|
153
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
154
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
155
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
156
|
+
src: z.ZodString;
|
|
157
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
158
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
159
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
160
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
161
|
+
name: z.ZodString;
|
|
162
|
+
title: z.ZodOptional<z.ZodString>;
|
|
163
|
+
uriTemplate: z.ZodString;
|
|
164
|
+
description: z.ZodOptional<z.ZodString>;
|
|
165
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
166
|
+
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
167
|
+
src: z.ZodString;
|
|
168
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
169
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
170
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
171
|
+
src: z.ZodString;
|
|
172
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
173
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
174
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
175
|
+
src: z.ZodString;
|
|
176
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
177
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
178
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
179
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
180
|
+
name: z.ZodString;
|
|
181
|
+
title: z.ZodOptional<z.ZodString>;
|
|
182
|
+
uriTemplate: z.ZodString;
|
|
183
|
+
description: z.ZodOptional<z.ZodString>;
|
|
184
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
185
|
+
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
186
|
+
src: z.ZodString;
|
|
187
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
188
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
189
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
190
|
+
src: z.ZodString;
|
|
191
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
192
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
193
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
194
|
+
src: z.ZodString;
|
|
195
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
196
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
197
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
198
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
199
|
+
export { ResourceMetadata, ResourceMetadata as FrontMcpResourceMetadata, ResourceTemplateMetadata, ResourceTemplateMetadata as FrontMcpResourceTemplateMetadata, };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.frontMcpResourceTemplateMetadataSchema = exports.frontMcpResourceMetadataSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
6
|
+
exports.frontMcpResourceMetadataSchema = zod_1.z.object({
|
|
7
|
+
name: zod_1.z.string().min(1),
|
|
8
|
+
title: zod_1.z.string().optional(),
|
|
9
|
+
uri: zod_1.z.string().min(1),
|
|
10
|
+
description: zod_1.z.string().optional(),
|
|
11
|
+
mimeType: zod_1.z.string().optional(),
|
|
12
|
+
icons: zod_1.z.array(types_js_1.IconSchema).optional(),
|
|
13
|
+
}).passthrough();
|
|
14
|
+
exports.frontMcpResourceTemplateMetadataSchema = zod_1.z.object({
|
|
15
|
+
name: zod_1.z.string().min(1),
|
|
16
|
+
title: zod_1.z.string().optional(),
|
|
17
|
+
uriTemplate: zod_1.z.string().min(1),
|
|
18
|
+
description: zod_1.z.string().optional(),
|
|
19
|
+
mimeType: zod_1.z.string().optional(),
|
|
20
|
+
icons: zod_1.z.array(types_js_1.IconSchema).optional(),
|
|
21
|
+
}).passthrough();
|
|
22
|
+
//# sourceMappingURL=resource.metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.metadata.js","sourceRoot":"","sources":["../../../src/metadata/resource.metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,iEAAsE;AAwDzD,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,qBAAU,CAAC,CAAC,QAAQ,EAAE;CACkC,CAAC,CAAC,WAAW,EAAE,CAAC;AA2C5E,QAAA,sCAAsC,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7D,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,GAAG,CAAC,CAAC,CAAC;IAC9B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,qBAAU,CAAC,CAAC,QAAQ,EAAE;CACkD,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 McpResource decorator.\n */\n export interface ExtendFrontMcpResourceMetadata {\n }\n\n /**\n * Declarative metadata extends to McpResourceTemplate decorator.\n */\n export interface ExtendFrontMcpResourceTemplateMetadata {\n }\n}\n\n/**\n * A known resource that the server is capable of reading.\n */\ninterface ResourceMetadata extends ExtendFrontMcpResourceMetadata {\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 * The URI of this resource.\n */\n uri: 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 * The MIME type of this resource, if known.\n */\n mimeType?: string;\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 frontMcpResourceMetadataSchema = z.object({\n name: z.string().min(1),\n title: z.string().optional(),\n uri: z.string().min(1),\n description: z.string().optional(),\n mimeType: z.string().optional(),\n icons: z.array(IconSchema).optional(),\n} satisfies RawZodShape<ResourceMetadata, ExtendFrontMcpResourceMetadata>).passthrough();\n\n\n/**\n * A template description for resources available on the server.\n */\ninterface ResourceTemplateMetadata extends ExtendFrontMcpResourceTemplateMetadata {\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 URI template (according to RFC 6570) that can be used to construct resource URIs.\n */\n uriTemplate: string;\n\n /**\n * A description of what this template is for.\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 * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.\n */\n mimeType?: string;\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 frontMcpResourceTemplateMetadataSchema = z.object({\n name: z.string().min(1),\n title: z.string().optional(),\n uriTemplate: z.string().min(1),\n description: z.string().optional(),\n mimeType: z.string().optional(),\n icons: z.array(IconSchema).optional(),\n} satisfies RawZodShape<ResourceTemplateMetadata, ExtendFrontMcpResourceTemplateMetadata>).passthrough();\n\n\nexport {\n ResourceMetadata,\n ResourceMetadata as FrontMcpResourceMetadata,\n ResourceTemplateMetadata,\n ResourceTemplateMetadata as FrontMcpResourceTemplateMetadata,\n};"]}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolContext } from '../interfaces';
|
|
3
|
+
import { ToolHookStage } from '../interfaces/tool-hook.interface';
|
|
4
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
5
|
+
declare global {
|
|
6
|
+
/**
|
|
7
|
+
* Declarative metadata extends to the an McpTool decorator.
|
|
8
|
+
*/
|
|
9
|
+
export interface ExtendFrontMcpToolMetadata {
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export interface ToolAnnotations {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
/**
|
|
15
|
+
* A human-readable title for the tool.
|
|
16
|
+
*/
|
|
17
|
+
title?: string;
|
|
18
|
+
/**
|
|
19
|
+
* If true, the tool does not modify its environment.
|
|
20
|
+
*
|
|
21
|
+
* Default: false
|
|
22
|
+
*/
|
|
23
|
+
readOnlyHint?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* If true, the tool may perform destructive updates to its environment.
|
|
26
|
+
* If false, the tool performs only additive updates.
|
|
27
|
+
*
|
|
28
|
+
* (This property is meaningful only when `readOnlyHint == false`)
|
|
29
|
+
*
|
|
30
|
+
* Default: true
|
|
31
|
+
*/
|
|
32
|
+
destructiveHint?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* If true, calling the tool repeatedly with the same arguments
|
|
35
|
+
* will have no additional effect on the its environment.
|
|
36
|
+
*
|
|
37
|
+
* (This property is meaningful only when `readOnlyHint == false`)
|
|
38
|
+
*
|
|
39
|
+
* Default: false
|
|
40
|
+
*/
|
|
41
|
+
idempotentHint?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* If true, this tool may interact with an "open world" of external
|
|
44
|
+
* entities. If false, the tool's domain of interaction is closed.
|
|
45
|
+
* For example, the world of a web search tool is open, whereas that
|
|
46
|
+
* of a memory tool is not.
|
|
47
|
+
*
|
|
48
|
+
* Default: true
|
|
49
|
+
*/
|
|
50
|
+
openWorldHint?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Declarative metadata describing what an McpTool contributes.
|
|
54
|
+
*/
|
|
55
|
+
export interface ToolMetadata<In = z.ZodRawShape, Out = z.ZodRawShape> extends ExtendFrontMcpToolMetadata {
|
|
56
|
+
/**
|
|
57
|
+
* Optional unique identifier for the tool.
|
|
58
|
+
* If omitted, a consumer may derive an ID from the class or file name.
|
|
59
|
+
*/
|
|
60
|
+
id?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Human‑readable name of the tool, used in UIs, logs, and discovery.
|
|
63
|
+
*/
|
|
64
|
+
name: string;
|
|
65
|
+
/**
|
|
66
|
+
* Short summary describing what the tool does and when to use it.
|
|
67
|
+
*/
|
|
68
|
+
description?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Zod schema describing the expected input payload for the tool.
|
|
71
|
+
* Used for validation and for generating automatic docs/UX.
|
|
72
|
+
*/
|
|
73
|
+
inputSchema: In;
|
|
74
|
+
/**
|
|
75
|
+
* Zod schema describing the expected input payload for the tool.
|
|
76
|
+
* Used for validation and for generating automatic docs/UX.
|
|
77
|
+
*/
|
|
78
|
+
rawInputSchema?: JSONSchema7;
|
|
79
|
+
/**
|
|
80
|
+
* Zod schema describing the structure of the tool's successful output.
|
|
81
|
+
*/
|
|
82
|
+
outputSchema?: Out;
|
|
83
|
+
/**
|
|
84
|
+
* Optional list of tags/labels that categorize the tool for discovery and filtering.
|
|
85
|
+
*/
|
|
86
|
+
tags?: string[];
|
|
87
|
+
annotations?: ToolAnnotations;
|
|
88
|
+
/**
|
|
89
|
+
* If true, the tool will not be shown in the tool/list action results.
|
|
90
|
+
* this method can still be called directly with tool/call even if hidden.
|
|
91
|
+
* use case: tools that are intended to be private or internal. (usually for testing / private apis)
|
|
92
|
+
* Default: false
|
|
93
|
+
*/
|
|
94
|
+
hideFromDiscovery?: boolean;
|
|
95
|
+
}
|
|
96
|
+
export declare const frontMcpToolMetadataSchema: z.ZodObject<{
|
|
97
|
+
id: z.ZodOptional<z.ZodString>;
|
|
98
|
+
name: z.ZodString;
|
|
99
|
+
description: z.ZodOptional<z.ZodString>;
|
|
100
|
+
inputSchema: z.ZodType<Object, z.ZodTypeDef, Object>;
|
|
101
|
+
rawInputSchema: z.ZodOptional<z.ZodAny>;
|
|
102
|
+
outputSchema: z.ZodOptional<z.ZodType<Object, z.ZodTypeDef, Object>>;
|
|
103
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
104
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
title: z.ZodOptional<z.ZodString>;
|
|
106
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
111
|
+
title: z.ZodOptional<z.ZodString>;
|
|
112
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
113
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
115
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
117
|
+
title: z.ZodOptional<z.ZodString>;
|
|
118
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
121
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
123
|
+
hideFromDiscovery: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
124
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
125
|
+
id: z.ZodOptional<z.ZodString>;
|
|
126
|
+
name: z.ZodString;
|
|
127
|
+
description: z.ZodOptional<z.ZodString>;
|
|
128
|
+
inputSchema: z.ZodType<Object, z.ZodTypeDef, Object>;
|
|
129
|
+
rawInputSchema: z.ZodOptional<z.ZodAny>;
|
|
130
|
+
outputSchema: z.ZodOptional<z.ZodType<Object, z.ZodTypeDef, Object>>;
|
|
131
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
132
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
title: z.ZodOptional<z.ZodString>;
|
|
134
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
139
|
+
title: z.ZodOptional<z.ZodString>;
|
|
140
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
141
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
144
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
145
|
+
title: z.ZodOptional<z.ZodString>;
|
|
146
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
149
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
151
|
+
hideFromDiscovery: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
152
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
153
|
+
id: z.ZodOptional<z.ZodString>;
|
|
154
|
+
name: z.ZodString;
|
|
155
|
+
description: z.ZodOptional<z.ZodString>;
|
|
156
|
+
inputSchema: z.ZodType<Object, z.ZodTypeDef, Object>;
|
|
157
|
+
rawInputSchema: z.ZodOptional<z.ZodAny>;
|
|
158
|
+
outputSchema: z.ZodOptional<z.ZodType<Object, z.ZodTypeDef, Object>>;
|
|
159
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
160
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
161
|
+
title: z.ZodOptional<z.ZodString>;
|
|
162
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
163
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
164
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
165
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
166
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
167
|
+
title: z.ZodOptional<z.ZodString>;
|
|
168
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
173
|
+
title: z.ZodOptional<z.ZodString>;
|
|
174
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
178
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
179
|
+
hideFromDiscovery: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
180
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
181
|
+
export interface ToolInlineMetadata<In = any, Out = any> extends ToolMetadata<In, Out> {
|
|
182
|
+
execute(input: In, ctx: ToolContext<In, Out>): Promise<Out> | Out;
|
|
183
|
+
hooks?: [ToolHookStage, ((ctx: ToolContext<In, Out>) => Promise<void> | void)][];
|
|
184
|
+
}
|
|
185
|
+
export declare const frontMcpToolInlineMetadataSchema: z.ZodObject<{
|
|
186
|
+
id: z.ZodOptional<z.ZodString>;
|
|
187
|
+
name: z.ZodString;
|
|
188
|
+
description: z.ZodOptional<z.ZodString>;
|
|
189
|
+
inputSchema: z.ZodType<Object, z.ZodTypeDef, Object>;
|
|
190
|
+
rawInputSchema: z.ZodOptional<z.ZodAny>;
|
|
191
|
+
outputSchema: z.ZodOptional<z.ZodType<Object, z.ZodTypeDef, Object>>;
|
|
192
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
193
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
title: z.ZodOptional<z.ZodString>;
|
|
195
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
196
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
197
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
198
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
199
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
200
|
+
title: z.ZodOptional<z.ZodString>;
|
|
201
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
202
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
203
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
204
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
205
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
206
|
+
title: z.ZodOptional<z.ZodString>;
|
|
207
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
208
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
209
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
210
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
211
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
212
|
+
hideFromDiscovery: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
213
|
+
} & {
|
|
214
|
+
execute: z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodAny], z.ZodUnknown>, z.ZodUnion<[z.ZodPromise<z.ZodAny>, z.ZodAny]>>;
|
|
215
|
+
hooks: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNativeEnum<typeof ToolHookStage>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodPromise<z.ZodVoid>, z.ZodVoid]>>], null>, "many">>;
|
|
216
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
217
|
+
id: z.ZodOptional<z.ZodString>;
|
|
218
|
+
name: z.ZodString;
|
|
219
|
+
description: z.ZodOptional<z.ZodString>;
|
|
220
|
+
inputSchema: z.ZodType<Object, z.ZodTypeDef, Object>;
|
|
221
|
+
rawInputSchema: z.ZodOptional<z.ZodAny>;
|
|
222
|
+
outputSchema: z.ZodOptional<z.ZodType<Object, z.ZodTypeDef, Object>>;
|
|
223
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
224
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
225
|
+
title: z.ZodOptional<z.ZodString>;
|
|
226
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
227
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
228
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
229
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
230
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
231
|
+
title: z.ZodOptional<z.ZodString>;
|
|
232
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
233
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
235
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
236
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
237
|
+
title: z.ZodOptional<z.ZodString>;
|
|
238
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
239
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
240
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
241
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
242
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
243
|
+
hideFromDiscovery: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
244
|
+
} & {
|
|
245
|
+
execute: z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodAny], z.ZodUnknown>, z.ZodUnion<[z.ZodPromise<z.ZodAny>, z.ZodAny]>>;
|
|
246
|
+
hooks: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNativeEnum<typeof ToolHookStage>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodPromise<z.ZodVoid>, z.ZodVoid]>>], null>, "many">>;
|
|
247
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
248
|
+
id: z.ZodOptional<z.ZodString>;
|
|
249
|
+
name: z.ZodString;
|
|
250
|
+
description: z.ZodOptional<z.ZodString>;
|
|
251
|
+
inputSchema: z.ZodType<Object, z.ZodTypeDef, Object>;
|
|
252
|
+
rawInputSchema: z.ZodOptional<z.ZodAny>;
|
|
253
|
+
outputSchema: z.ZodOptional<z.ZodType<Object, z.ZodTypeDef, Object>>;
|
|
254
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
255
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
256
|
+
title: z.ZodOptional<z.ZodString>;
|
|
257
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
258
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
259
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
260
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
261
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
262
|
+
title: z.ZodOptional<z.ZodString>;
|
|
263
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
264
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
265
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
266
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
267
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
268
|
+
title: z.ZodOptional<z.ZodString>;
|
|
269
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
270
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
271
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
272
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
273
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
274
|
+
hideFromDiscovery: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
275
|
+
} & {
|
|
276
|
+
execute: z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodAny], z.ZodUnknown>, z.ZodUnion<[z.ZodPromise<z.ZodAny>, z.ZodAny]>>;
|
|
277
|
+
hooks: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNativeEnum<typeof ToolHookStage>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodPromise<z.ZodVoid>, z.ZodVoid]>>], null>, "many">>;
|
|
278
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.frontMcpToolInlineMetadataSchema = exports.frontMcpToolMetadataSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const tool_hook_interface_1 = require("../interfaces/tool-hook.interface");
|
|
6
|
+
const mcpToolAnnotationsSchema = zod_1.z.object({
|
|
7
|
+
title: zod_1.z.string().optional(),
|
|
8
|
+
readOnlyHint: zod_1.z.boolean().optional(),
|
|
9
|
+
destructiveHint: zod_1.z.boolean().optional(),
|
|
10
|
+
idempotentHint: zod_1.z.boolean().optional(),
|
|
11
|
+
openWorldHint: zod_1.z.boolean().optional(),
|
|
12
|
+
}).passthrough();
|
|
13
|
+
exports.frontMcpToolMetadataSchema = zod_1.z.object({
|
|
14
|
+
id: zod_1.z.string().optional(),
|
|
15
|
+
name: zod_1.z.string().min(1),
|
|
16
|
+
description: zod_1.z.string().optional(),
|
|
17
|
+
inputSchema: zod_1.z.instanceof(Object),
|
|
18
|
+
rawInputSchema: zod_1.z.any().optional(),
|
|
19
|
+
outputSchema: zod_1.z.instanceof(Object).optional(),
|
|
20
|
+
tags: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
21
|
+
annotations: mcpToolAnnotationsSchema.optional(),
|
|
22
|
+
hideFromDiscovery: zod_1.z.boolean().optional().default(false),
|
|
23
|
+
}).passthrough();
|
|
24
|
+
exports.frontMcpToolInlineMetadataSchema = exports.frontMcpToolMetadataSchema.extend({
|
|
25
|
+
execute: zod_1.z.function().args(zod_1.z.any(), zod_1.z.any()).returns(zod_1.z.promise(zod_1.z.any()).or(zod_1.z.any())),
|
|
26
|
+
hooks: zod_1.z.array(zod_1.z.tuple([zod_1.z.nativeEnum(tool_hook_interface_1.ToolHookStage), zod_1.z.function().returns(zod_1.z.promise(zod_1.z.void()).or(zod_1.z.void()))])).optional(),
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=tool.metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.metadata.js","sourceRoot":"","sources":["../../../src/metadata/tool.metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAGxB,2EAAkE;AAsDlE,MAAM,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,YAAY,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,eAAe,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,cAAc,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACtC,aAAa,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACC,CAAC,CAAC,WAAW,EAAE,CAAC;AAwD3C,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,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,WAAW,EAAE,OAAC,CAAC,UAAU,CAAC,MAAM,CAAC;IACjC,cAAc,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAClC,YAAY,EAAE,OAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;IAC7C,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC3C,WAAW,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IAChD,iBAAiB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACO,CAAC,CAAC,WAAW,EAAE,CAAC;AAUpE,QAAA,gCAAgC,GAAG,kCAA0B,CAAC,MAAM,CAAC;IAChF,OAAO,EAAE,OAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,OAAC,CAAC,GAAG,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,OAAC,CAAC,OAAO,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACpF,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,UAAU,CAAC,mCAAa,CAAC,EAAE,OAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,OAAC,CAAC,OAAO,CAAC,OAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,OAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC1H,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { RawZodShape } from '../types';\nimport { ToolContext } from '../interfaces';\nimport { ToolHookStage } from '../interfaces/tool-hook.interface';\nimport type { JSONSchema7 } from 'json-schema';\n\ndeclare global {\n /**\n * Declarative metadata extends to the an McpTool decorator.\n */\n export interface ExtendFrontMcpToolMetadata {\n }\n}\n\n\nexport interface ToolAnnotations {\n [x: string]: unknown;\n /**\n * A human-readable title for the tool.\n */\n title?: string;\n /**\n * If true, the tool does not modify its environment.\n *\n * Default: false\n */\n readOnlyHint?: boolean;\n /**\n * If true, the tool may perform destructive updates to its environment.\n * If false, the tool performs only additive updates.\n *\n * (This property is meaningful only when `readOnlyHint == false`)\n *\n * Default: true\n */\n destructiveHint?: boolean;\n /**\n * If true, calling the tool repeatedly with the same arguments\n * will have no additional effect on the its environment.\n *\n * (This property is meaningful only when `readOnlyHint == false`)\n *\n * Default: false\n */\n idempotentHint?: boolean;\n /**\n * If true, this tool may interact with an \"open world\" of external\n * entities. If false, the tool's domain of interaction is closed.\n * For example, the world of a web search tool is open, whereas that\n * of a memory tool is not.\n *\n * Default: true\n */\n openWorldHint?: boolean;\n}\n\n\nconst mcpToolAnnotationsSchema = z.object({\n title: z.string().optional(),\n readOnlyHint: z.boolean().optional(),\n destructiveHint: z.boolean().optional(),\n idempotentHint: z.boolean().optional(),\n openWorldHint: z.boolean().optional(),\n} satisfies RawZodShape<ToolAnnotations>).passthrough();\n\n\n/**\n * Declarative metadata describing what an McpTool contributes.\n */\nexport interface ToolMetadata<In = z.ZodRawShape, Out = z.ZodRawShape> extends ExtendFrontMcpToolMetadata {\n /**\n * Optional unique identifier for the tool.\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 tool, used in UIs, logs, and discovery.\n */\n name: string;\n\n /**\n * Short summary describing what the tool does and when to use it.\n */\n description?: string;\n\n /**\n * Zod schema describing the expected input payload for the tool.\n * Used for validation and for generating automatic docs/UX.\n */\n inputSchema: In;\n /**\n * Zod schema describing the expected input payload for the tool.\n * Used for validation and for generating automatic docs/UX.\n */\n rawInputSchema?: JSONSchema7;\n\n /**\n * Zod schema describing the structure of the tool's successful output.\n */\n outputSchema?: Out;\n\n /**\n * Optional list of tags/labels that categorize the tool for discovery and filtering.\n */\n tags?: string[];\n\n annotations?: ToolAnnotations;\n\n /**\n * If true, the tool will not be shown in the tool/list action results.\n * this method can still be called directly with tool/call even if hidden.\n * use case: tools that are intended to be private or internal. (usually for testing / private apis)\n * Default: false\n */\n hideFromDiscovery?: boolean;\n}\n\n\nexport const frontMcpToolMetadataSchema = z.object({\n id: z.string().optional(),\n name: z.string().min(1),\n description: z.string().optional(),\n inputSchema: z.instanceof(Object),\n rawInputSchema: z.any().optional(),\n outputSchema: z.instanceof(Object).optional(),\n tags: z.array(z.string().min(1)).optional(),\n annotations: mcpToolAnnotationsSchema.optional(),\n hideFromDiscovery: z.boolean().optional().default(false),\n} satisfies RawZodShape<ToolMetadata, ExtendFrontMcpToolMetadata>).passthrough();\n\n\nexport interface ToolInlineMetadata<In = any, Out = any> extends ToolMetadata<In, Out> {\n execute(input: In, ctx: ToolContext<In, Out>): Promise<Out> | Out;\n\n hooks?: [ToolHookStage, ((ctx: ToolContext<In, Out>) => Promise<void> | void)][];\n}\n\n\nexport const frontMcpToolInlineMetadataSchema = frontMcpToolMetadataSchema.extend({\n execute: z.function().args(z.any(), z.any()).returns(z.promise(z.any()).or(z.any())),\n hooks: z.array(z.tuple([z.nativeEnum(ToolHookStage), z.function().returns(z.promise(z.void()).or(z.void()))])).optional(),\n});\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SessionIdPayload, UserClaim } from '../types';
|
|
2
|
+
export declare class SessionProvider {
|
|
3
|
+
token: string;
|
|
4
|
+
user: UserClaim;
|
|
5
|
+
session?: {
|
|
6
|
+
id: string;
|
|
7
|
+
payload: SessionIdPayload;
|
|
8
|
+
} | undefined;
|
|
9
|
+
sessionId: string;
|
|
10
|
+
sessionIdPayload: SessionIdPayload;
|
|
11
|
+
requestId: string | number;
|
|
12
|
+
setRequestId(requestId: string | number): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SessionProvider = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const decorators_1 = require("../decorators");
|
|
6
|
+
const metadata_1 = require("../metadata");
|
|
7
|
+
// TODO: REFACTOR/PROVIDERS - move to core and keep SessionInterface and SessionToken for DI
|
|
8
|
+
let SessionProvider = class SessionProvider {
|
|
9
|
+
token;
|
|
10
|
+
user;
|
|
11
|
+
session;
|
|
12
|
+
sessionId;
|
|
13
|
+
sessionIdPayload;
|
|
14
|
+
requestId;
|
|
15
|
+
setRequestId(requestId) {
|
|
16
|
+
this.requestId = requestId;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.SessionProvider = SessionProvider;
|
|
20
|
+
exports.SessionProvider = SessionProvider = tslib_1.__decorate([
|
|
21
|
+
(0, decorators_1.Provider)({
|
|
22
|
+
name: 'SessionProvider',
|
|
23
|
+
description: 'Used to store session information',
|
|
24
|
+
scope: metadata_1.ProviderScope.SESSION,
|
|
25
|
+
})
|
|
26
|
+
], SessionProvider);
|
|
27
|
+
//# sourceMappingURL=session.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.provider.js","sourceRoot":"","sources":["../../../src/providers/session.provider.ts"],"names":[],"mappings":";;;;AACA,8CAAyC;AACzC,0CAA4C;AAE5C,4FAA4F;AAOrF,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,KAAK,CAAS;IACd,IAAI,CAAY;IAChB,OAAO,CAA0D;IACjE,SAAS,CAAS;IAClB,gBAAgB,CAAmB;IAEnC,SAAS,CAAkB;IAE3B,YAAY,CAAC,SAA0B;QACrC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF,CAAA;AAZY,0CAAe;0BAAf,eAAe;IAL3B,IAAA,qBAAQ,EAAC;QACR,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,mCAAmC;QAChD,KAAK,EAAE,wBAAa,CAAC,OAAO;KAC7B,CAAC;GACW,eAAe,CAY3B","sourcesContent":["import { SessionIdPayload, UserClaim } from '../types';\nimport { Provider } from '../decorators';\nimport { ProviderScope } from '../metadata';\n\n// TODO: REFACTOR/PROVIDERS - move to core and keep SessionInterface and SessionToken for DI\n\n@Provider({\n name: 'SessionProvider',\n description: 'Used to store session information',\n scope: ProviderScope.SESSION,\n})\nexport class SessionProvider {\n token: string;\n user: UserClaim;\n session?: { id: string; payload: SessionIdPayload; } | undefined;\n sessionId: string;\n sessionIdPayload: SessionIdPayload;\n\n requestId: string | number;\n\n setRequestId(requestId: string | number) {\n this.requestId = requestId;\n }\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AdapterMetadata } from '../metadata';
|
|
2
|
+
import { ClassType, FactoryType, Type, ValueType } from '../interfaces';
|
|
3
|
+
export declare enum AdapterKind {
|
|
4
|
+
CLASS_TOKEN = "CLASS_TOKEN",
|
|
5
|
+
CLASS = "CLASS",
|
|
6
|
+
VALUE = "VALUE",
|
|
7
|
+
FACTORY = "FACTORY"
|
|
8
|
+
}
|
|
9
|
+
export interface AdapterClassTokenRecord {
|
|
10
|
+
kind: AdapterKind.CLASS_TOKEN;
|
|
11
|
+
provide: Type;
|
|
12
|
+
metadata: AdapterMetadata;
|
|
13
|
+
}
|
|
14
|
+
export interface AdapterClassRecord extends ClassType<any> {
|
|
15
|
+
kind: AdapterKind.CLASS;
|
|
16
|
+
metadata: AdapterMetadata;
|
|
17
|
+
}
|
|
18
|
+
export interface AdapterValueRecord extends ValueType<any> {
|
|
19
|
+
kind: AdapterKind.VALUE;
|
|
20
|
+
metadata: AdapterMetadata;
|
|
21
|
+
}
|
|
22
|
+
export interface AdapterFactoryRecord extends FactoryType<any, any> {
|
|
23
|
+
kind: AdapterKind.FACTORY;
|
|
24
|
+
metadata: AdapterMetadata;
|
|
25
|
+
}
|
|
26
|
+
export type AdapterRecord = AdapterClassTokenRecord | AdapterClassRecord | AdapterValueRecord | AdapterFactoryRecord;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdapterKind = void 0;
|
|
4
|
+
var AdapterKind;
|
|
5
|
+
(function (AdapterKind) {
|
|
6
|
+
AdapterKind["CLASS_TOKEN"] = "CLASS_TOKEN";
|
|
7
|
+
AdapterKind["CLASS"] = "CLASS";
|
|
8
|
+
AdapterKind["VALUE"] = "VALUE";
|
|
9
|
+
AdapterKind["FACTORY"] = "FACTORY";
|
|
10
|
+
})(AdapterKind || (exports.AdapterKind = AdapterKind = {}));
|
|
11
|
+
//# sourceMappingURL=adapter.record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.record.js","sourceRoot":"","sources":["../../../src/records/adapter.record.ts"],"names":[],"mappings":";;;AAGA,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,kCAAmB,CAAA;AACrB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB","sourcesContent":["import { AdapterMetadata } from '../metadata';\nimport { ClassType, FactoryType, Type, ValueType } from '../interfaces';\n\nexport enum AdapterKind {\n CLASS_TOKEN = 'CLASS_TOKEN',\n CLASS = 'CLASS',\n VALUE = 'VALUE',\n FACTORY = 'FACTORY',\n}\n\nexport interface AdapterClassTokenRecord {\n kind: AdapterKind.CLASS_TOKEN;\n provide: Type,\n metadata: AdapterMetadata;\n}\n\nexport interface AdapterClassRecord extends ClassType<any> {\n kind: AdapterKind.CLASS;\n metadata: AdapterMetadata;\n}\n\nexport interface AdapterValueRecord extends ValueType<any> {\n kind: AdapterKind.VALUE;\n metadata: AdapterMetadata;\n}\n\nexport interface AdapterFactoryRecord extends FactoryType<any, any> {\n kind: AdapterKind.FACTORY;\n metadata: AdapterMetadata;\n}\n\nexport type AdapterRecord =\n | AdapterClassTokenRecord\n | AdapterClassRecord\n | AdapterValueRecord\n | AdapterFactoryRecord\n\n"]}
|