@frontmcp/sdk 0.4.1 → 0.5.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 +30 -18
- package/package.json +20 -5
- package/src/app/app.registry.d.ts +3 -2
- package/src/app/app.registry.js +3 -1
- package/src/app/app.registry.js.map +1 -1
- package/src/app/instances/app.local.instance.js +2 -2
- package/src/app/instances/app.local.instance.js.map +1 -1
- package/src/auth/auth.registry.d.ts +34 -2
- package/src/auth/auth.registry.js +162 -24
- package/src/auth/auth.registry.js.map +1 -1
- package/src/auth/auth.utils.js +8 -9
- package/src/auth/auth.utils.js.map +1 -1
- package/src/auth/authorization/authorization.class.d.ts +125 -0
- package/src/auth/authorization/authorization.class.js +224 -0
- package/src/auth/authorization/authorization.class.js.map +1 -0
- package/src/auth/authorization/authorization.types.d.ts +300 -0
- package/src/auth/authorization/authorization.types.js +79 -0
- package/src/auth/authorization/authorization.types.js.map +1 -0
- package/src/auth/authorization/index.d.ts +5 -0
- package/src/auth/authorization/index.js +19 -0
- package/src/auth/authorization/index.js.map +1 -0
- package/src/auth/authorization/orchestrated.authorization.d.ts +242 -0
- package/src/auth/authorization/orchestrated.authorization.js +306 -0
- package/src/auth/authorization/orchestrated.authorization.js.map +1 -0
- package/src/auth/authorization/public.authorization.d.ts +91 -0
- package/src/auth/authorization/public.authorization.js +132 -0
- package/src/auth/authorization/public.authorization.js.map +1 -0
- package/src/auth/authorization/transparent.authorization.d.ts +130 -0
- package/src/auth/authorization/transparent.authorization.js +147 -0
- package/src/auth/authorization/transparent.authorization.js.map +1 -0
- package/src/auth/consent/consent.types.d.ts +111 -0
- package/src/auth/consent/consent.types.js +119 -0
- package/src/auth/consent/consent.types.js.map +1 -0
- package/src/auth/consent/index.d.ts +1 -0
- package/src/auth/consent/index.js +13 -0
- package/src/auth/consent/index.js.map +1 -0
- package/src/auth/detection/auth-provider-detection.d.ts +84 -0
- package/src/auth/detection/auth-provider-detection.js +230 -0
- package/src/auth/detection/auth-provider-detection.js.map +1 -0
- package/src/auth/detection/index.d.ts +1 -0
- package/src/auth/detection/index.js +15 -0
- package/src/auth/detection/index.js.map +1 -0
- package/src/auth/flows/auth.verify.flow.d.ts +110 -0
- package/src/auth/flows/auth.verify.flow.js +379 -0
- package/src/auth/flows/auth.verify.flow.js.map +1 -0
- package/src/auth/flows/oauth.authorize.flow.d.ts +118 -164
- package/src/auth/flows/oauth.authorize.flow.js +701 -33
- package/src/auth/flows/oauth.authorize.flow.js.map +1 -1
- package/src/auth/flows/oauth.callback.flow.d.ts +117 -0
- package/src/auth/flows/oauth.callback.flow.js +357 -0
- package/src/auth/flows/oauth.callback.flow.js.map +1 -0
- package/src/auth/flows/oauth.register.flow.d.ts +32 -125
- package/src/auth/flows/oauth.token.flow.d.ts +52 -154
- package/src/auth/flows/oauth.token.flow.js +193 -55
- package/src/auth/flows/oauth.token.flow.js.map +1 -1
- package/src/auth/flows/session.verify.flow.d.ts +66 -321
- package/src/auth/flows/session.verify.flow.js +107 -18
- package/src/auth/flows/session.verify.flow.js.map +1 -1
- package/src/auth/flows/well-known.jwks.flow.d.ts +34 -205
- package/src/auth/flows/well-known.jwks.flow.js +15 -8
- package/src/auth/flows/well-known.jwks.flow.js.map +1 -1
- package/src/auth/flows/well-known.oauth-authorization-server.flow.d.ts +48 -223
- package/src/auth/flows/well-known.oauth-authorization-server.flow.js +2 -3
- package/src/auth/flows/well-known.oauth-authorization-server.flow.js.map +1 -1
- package/src/auth/flows/well-known.prm.flow.d.ts +19 -120
- package/src/auth/flows/well-known.prm.flow.js +3 -4
- package/src/auth/flows/well-known.prm.flow.js.map +1 -1
- package/src/auth/instances/instance.local-primary-auth.d.ts +91 -4
- package/src/auth/instances/instance.local-primary-auth.js +236 -6
- package/src/auth/instances/instance.local-primary-auth.js.map +1 -1
- package/src/auth/instances/instance.remote-primary-auth.d.ts +4 -3
- package/src/auth/instances/instance.remote-primary-auth.js +2 -2
- package/src/auth/instances/instance.remote-primary-auth.js.map +1 -1
- package/src/auth/session/authorization-vault.d.ts +611 -0
- package/src/auth/session/authorization-vault.js +817 -0
- package/src/auth/session/authorization-vault.js.map +1 -0
- package/src/auth/session/authorization.store.d.ts +301 -0
- package/src/auth/session/authorization.store.js +323 -0
- package/src/auth/session/authorization.store.js.map +1 -0
- package/src/auth/session/encrypted-authorization-vault.d.ts +181 -0
- package/src/auth/session/encrypted-authorization-vault.js +493 -0
- package/src/auth/session/encrypted-authorization-vault.js.map +1 -0
- package/src/auth/session/index.d.ts +4 -4
- package/src/auth/session/index.js +11 -7
- package/src/auth/session/index.js.map +1 -1
- package/src/auth/session/session.schema.d.ts +1 -1
- package/src/auth/session/session.service.d.ts +1 -1
- package/src/auth/session/transport-session.manager.d.ts +101 -0
- package/src/auth/session/transport-session.manager.js +300 -0
- package/src/auth/session/transport-session.manager.js.map +1 -0
- package/src/auth/session/transport-session.types.d.ts +457 -0
- package/src/auth/session/transport-session.types.js +110 -0
- package/src/auth/session/transport-session.types.js.map +1 -0
- package/src/auth/session/utils/session-id.utils.d.ts +14 -2
- package/src/auth/session/utils/session-id.utils.js +68 -19
- package/src/auth/session/utils/session-id.utils.js.map +1 -1
- package/src/auth/session/vault-encryption.d.ts +189 -0
- package/src/auth/session/vault-encryption.js +263 -0
- package/src/auth/session/vault-encryption.js.map +1 -0
- package/src/auth/ui/base-layout.d.ts +188 -0
- package/src/auth/ui/base-layout.js +292 -0
- package/src/auth/ui/base-layout.js.map +1 -0
- package/src/auth/ui/htmx-templates.d.ts +135 -0
- package/src/auth/ui/htmx-templates.js +433 -0
- package/src/auth/ui/htmx-templates.js.map +1 -0
- package/src/auth/ui/index.d.ts +11 -0
- package/src/auth/ui/index.js +35 -0
- package/src/auth/ui/index.js.map +1 -0
- package/src/auth/utils/audience.validator.d.ts +129 -0
- package/src/auth/utils/audience.validator.js +196 -0
- package/src/auth/utils/audience.validator.js.map +1 -0
- package/src/auth/utils/index.d.ts +2 -0
- package/src/auth/utils/index.js +7 -0
- package/src/auth/utils/index.js.map +1 -0
- package/src/auth/utils/www-authenticate.utils.d.ts +97 -0
- package/src/auth/utils/www-authenticate.utils.js +183 -0
- package/src/auth/utils/www-authenticate.utils.js.map +1 -0
- package/src/common/common.schema.d.ts +2 -16
- package/src/common/constants.d.ts +3 -0
- package/src/common/constants.js +6 -1
- package/src/common/constants.js.map +1 -1
- package/src/common/decorators/decorator-utils.d.ts +131 -0
- package/src/common/decorators/decorator-utils.js +195 -0
- package/src/common/decorators/decorator-utils.js.map +1 -0
- package/src/common/decorators/front-mcp.decorator.js +3 -2
- package/src/common/decorators/front-mcp.decorator.js.map +1 -1
- package/src/common/decorators/hook.decorator.d.ts +58 -2
- package/src/common/decorators/hook.decorator.js +127 -17
- package/src/common/decorators/hook.decorator.js.map +1 -1
- package/src/common/decorators/plugin.decorator.d.ts +1 -1
- package/src/common/decorators/plugin.decorator.js +11 -10
- package/src/common/decorators/plugin.decorator.js.map +1 -1
- package/src/common/decorators/resource.decorator.d.ts +32 -3
- package/src/common/decorators/resource.decorator.js +46 -4
- package/src/common/decorators/resource.decorator.js.map +1 -1
- package/src/common/decorators/tool.decorator.d.ts +54 -5
- package/src/common/decorators/tool.decorator.js.map +1 -1
- package/src/common/dynamic/dynamic.plugin.d.ts +22 -11
- package/src/common/dynamic/dynamic.plugin.js +7 -1
- package/src/common/dynamic/dynamic.plugin.js.map +1 -1
- package/src/common/entries/prompt.entry.d.ts +46 -2
- package/src/common/entries/prompt.entry.js +10 -0
- package/src/common/entries/prompt.entry.js.map +1 -1
- package/src/common/entries/resource.entry.d.ts +69 -6
- package/src/common/entries/resource.entry.js +27 -3
- package/src/common/entries/resource.entry.js.map +1 -1
- package/src/common/entries/scope.entry.d.ts +5 -1
- package/src/common/entries/scope.entry.js +3 -3
- package/src/common/entries/scope.entry.js.map +1 -1
- package/src/common/flow/flow.utils.d.ts +56 -0
- package/src/common/flow/flow.utils.js +96 -0
- package/src/common/flow/flow.utils.js.map +1 -0
- package/src/common/index.d.ts +2 -2
- package/src/common/index.js +2 -2
- package/src/common/index.js.map +1 -1
- package/src/common/interfaces/execution-context.interface.d.ts +59 -0
- package/src/common/interfaces/execution-context.interface.js +81 -0
- package/src/common/interfaces/execution-context.interface.js.map +1 -0
- package/src/common/interfaces/flow.interface.d.ts +1 -1
- package/src/common/interfaces/flow.interface.js.map +1 -1
- package/src/common/interfaces/index.d.ts +1 -0
- package/src/common/interfaces/index.js +1 -0
- package/src/common/interfaces/index.js.map +1 -1
- package/src/common/interfaces/internal/primary-auth-provider.interface.d.ts +17 -2
- package/src/common/interfaces/internal/primary-auth-provider.interface.js +52 -4
- package/src/common/interfaces/internal/primary-auth-provider.interface.js.map +1 -1
- package/src/common/interfaces/internal/registry.interface.d.ts +16 -2
- package/src/common/interfaces/internal/registry.interface.js.map +1 -1
- package/src/common/interfaces/plugin.interface.js.map +1 -1
- package/src/common/interfaces/prompt.interface.d.ts +53 -4
- package/src/common/interfaces/prompt.interface.js +78 -0
- package/src/common/interfaces/prompt.interface.js.map +1 -1
- package/src/common/interfaces/resource.interface.d.ts +47 -17
- package/src/common/interfaces/resource.interface.js +53 -0
- package/src/common/interfaces/resource.interface.js.map +1 -1
- package/src/common/interfaces/tool.interface.d.ts +39 -22
- package/src/common/interfaces/tool.interface.js +61 -34
- package/src/common/interfaces/tool.interface.js.map +1 -1
- package/src/common/metadata/adapter.metadata.d.ts +1 -9
- package/src/common/metadata/app.metadata.d.ts +425 -730
- package/src/common/metadata/auth-provider.metadata.d.ts +2 -12
- package/src/common/metadata/flow.metadata.d.ts +10 -25
- package/src/common/metadata/front-mcp.metadata.d.ts +602 -1023
- package/src/common/metadata/front-mcp.metadata.js +6 -4
- package/src/common/metadata/front-mcp.metadata.js.map +1 -1
- package/src/common/metadata/hook.metadata.d.ts +1 -1
- package/src/common/metadata/hook.metadata.js.map +1 -1
- package/src/common/metadata/index.d.ts +1 -0
- package/src/common/metadata/index.js +1 -0
- package/src/common/metadata/index.js.map +1 -1
- package/src/common/metadata/logger.metadata.d.ts +1 -9
- package/src/common/metadata/plugin.metadata.d.ts +8 -30
- package/src/common/metadata/prompt.metadata.d.ts +4 -161
- package/src/common/metadata/provider.metadata.d.ts +2 -12
- package/src/common/metadata/resource.metadata.d.ts +6 -98
- package/src/common/metadata/resource.metadata.js +15 -6
- package/src/common/metadata/resource.metadata.js.map +1 -1
- package/src/common/metadata/tool-ui.metadata.d.ts +10 -0
- package/src/common/metadata/tool-ui.metadata.js +12 -0
- package/src/common/metadata/tool-ui.metadata.js.map +1 -0
- package/src/common/metadata/tool.metadata.d.ts +78 -199
- package/src/common/metadata/tool.metadata.js +11 -14
- package/src/common/metadata/tool.metadata.js.map +1 -1
- package/src/common/providers/base-config.provider.d.ts +84 -0
- package/src/common/providers/base-config.provider.js +128 -0
- package/src/common/providers/base-config.provider.js.map +1 -0
- package/src/common/records/plugin.record.d.ts +5 -6
- package/src/common/records/plugin.record.js.map +1 -1
- package/src/common/records/prompt.record.js.map +1 -1
- package/src/common/records/resource.record.d.ts +17 -1
- package/src/common/records/resource.record.js +12 -6
- package/src/common/records/resource.record.js.map +1 -1
- package/src/common/records/tool.record.js.map +1 -1
- package/src/common/schemas/annotated-class.schema.d.ts +9 -9
- package/src/common/schemas/annotated-class.schema.js +92 -27
- package/src/common/schemas/annotated-class.schema.js.map +1 -1
- package/src/common/schemas/http-input.schema.d.ts +6 -30
- package/src/common/schemas/http-output.schema.d.ts +326 -1630
- package/src/common/schemas/http-output.schema.js +39 -1
- package/src/common/schemas/http-output.schema.js.map +1 -1
- package/src/common/tokens/front-mcp.tokens.js +4 -1
- package/src/common/tokens/front-mcp.tokens.js.map +1 -1
- package/src/common/tokens/resource.tokens.d.ts +2 -0
- package/src/common/tokens/resource.tokens.js +4 -1
- package/src/common/tokens/resource.tokens.js.map +1 -1
- package/src/common/tokens/tool.tokens.d.ts +2 -0
- package/src/common/tokens/tool.tokens.js +2 -0
- package/src/common/tokens/tool.tokens.js.map +1 -1
- package/src/common/types/auth/jwt.types.d.ts +5 -31
- package/src/common/types/auth/session.types.d.ts +97 -192
- package/src/common/types/auth/session.types.js +24 -11
- package/src/common/types/auth/session.types.js.map +1 -1
- package/src/common/types/options/auth.options.d.ts +1013 -490
- package/src/common/types/options/auth.options.js +554 -36
- package/src/common/types/options/auth.options.js.map +1 -1
- package/src/common/types/options/http.options.d.ts +1 -9
- package/src/common/types/options/logging.options.d.ts +7 -13
- package/src/common/types/options/logging.options.js +4 -0
- package/src/common/types/options/logging.options.js.map +1 -1
- package/src/common/types/options/server-info.options.d.ts +3 -31
- package/src/common/types/options/session.options.d.ts +90 -10
- package/src/common/types/options/session.options.js +26 -3
- package/src/common/types/options/session.options.js.map +1 -1
- package/src/common/utils/decide-request-intent.utils.d.ts +8 -46
- package/src/common/utils/decide-request-intent.utils.js +88 -23
- package/src/common/utils/decide-request-intent.utils.js.map +1 -1
- package/src/completion/flows/complete.flow.d.ts +74 -0
- package/src/completion/flows/complete.flow.js +199 -0
- package/src/completion/flows/complete.flow.js.map +1 -0
- package/src/errors/authorization-required.error.d.ts +189 -0
- package/src/errors/authorization-required.error.js +274 -0
- package/src/errors/authorization-required.error.js.map +1 -0
- package/src/errors/index.d.ts +2 -1
- package/src/errors/index.js +17 -1
- package/src/errors/index.js.map +1 -1
- package/src/errors/mcp.error.d.ts +101 -1
- package/src/errors/mcp.error.js +147 -2
- package/src/errors/mcp.error.js.map +1 -1
- package/src/flows/flow.instance.js +4 -3
- package/src/flows/flow.instance.js.map +1 -1
- package/src/flows/flow.registry.js.map +1 -1
- package/src/flows/flow.stages.js +14 -11
- package/src/flows/flow.stages.js.map +1 -1
- package/src/front-mcp/front-mcp.providers.d.ts +464 -102
- package/src/front-mcp/front-mcp.providers.js +3 -5
- package/src/front-mcp/front-mcp.providers.js.map +1 -1
- package/src/hooks/hook.instance.d.ts +1 -1
- package/src/hooks/hook.instance.js +5 -2
- package/src/hooks/hook.instance.js.map +1 -1
- package/src/hooks/hook.registry.js +7 -5
- package/src/hooks/hook.registry.js.map +1 -1
- package/src/index.d.ts +28 -9
- package/src/index.js +5 -1
- package/src/index.js.map +1 -1
- package/src/logger/instances/instance.logger.js +3 -2
- package/src/logger/instances/instance.logger.js.map +1 -1
- package/src/logger/logger.registry.js +7 -2
- package/src/logger/logger.registry.js.map +1 -1
- package/src/logging/flows/set-level.flow.d.ts +62 -0
- package/src/logging/flows/set-level.flow.js +108 -0
- package/src/logging/flows/set-level.flow.js.map +1 -0
- package/src/mcp-apps/csp.d.ts +111 -0
- package/src/mcp-apps/csp.js +267 -0
- package/src/mcp-apps/csp.js.map +1 -0
- package/src/mcp-apps/index.d.ts +23 -0
- package/src/mcp-apps/index.js +91 -0
- package/src/mcp-apps/index.js.map +1 -0
- package/src/mcp-apps/schemas.d.ts +403 -0
- package/src/mcp-apps/schemas.js +345 -0
- package/src/mcp-apps/schemas.js.map +1 -0
- package/src/mcp-apps/template.d.ts +94 -0
- package/src/mcp-apps/template.js +419 -0
- package/src/mcp-apps/template.js.map +1 -0
- package/src/mcp-apps/types.d.ts +323 -0
- package/src/mcp-apps/types.js +59 -0
- package/src/mcp-apps/types.js.map +1 -0
- package/src/notification/index.d.ts +1 -0
- package/src/notification/index.js +13 -0
- package/src/notification/index.js.map +1 -0
- package/src/notification/notification.service.d.ts +378 -0
- package/src/notification/notification.service.js +727 -0
- package/src/notification/notification.service.js.map +1 -0
- package/src/plugin/plugin.registry.js +12 -9
- package/src/plugin/plugin.registry.js.map +1 -1
- package/src/prompt/flows/get-prompt.flow.d.ts +153 -0
- package/src/prompt/flows/get-prompt.flow.js +214 -0
- package/src/prompt/flows/get-prompt.flow.js.map +1 -0
- package/src/prompt/flows/prompts-list.flow.d.ts +67 -0
- package/src/prompt/flows/prompts-list.flow.js +176 -0
- package/src/prompt/flows/prompts-list.flow.js.map +1 -0
- package/src/prompt/index.d.ts +7 -0
- package/src/prompt/index.js +17 -0
- package/src/prompt/index.js.map +1 -0
- package/src/prompt/prompt.events.d.ts +17 -0
- package/src/prompt/prompt.events.js +25 -0
- package/src/prompt/prompt.events.js.map +1 -0
- package/src/prompt/prompt.instance.d.ts +30 -0
- package/src/prompt/prompt.instance.js +120 -0
- package/src/prompt/prompt.instance.js.map +1 -0
- package/src/prompt/prompt.registry.d.ts +79 -12
- package/src/prompt/prompt.registry.js +360 -15
- package/src/prompt/prompt.registry.js.map +1 -1
- package/src/prompt/prompt.types.d.ts +26 -0
- package/src/prompt/prompt.types.js +11 -0
- package/src/prompt/prompt.types.js.map +1 -0
- package/src/prompt/prompt.utils.d.ts +26 -0
- package/src/prompt/prompt.utils.js +136 -0
- package/src/prompt/prompt.utils.js.map +1 -0
- package/src/provider/provider.registry.d.ts +12 -5
- package/src/provider/provider.registry.js +30 -138
- package/src/provider/provider.registry.js.map +1 -1
- package/src/regsitry/registry.base.d.ts +1 -1
- package/src/regsitry/registry.base.js.map +1 -1
- package/src/resource/flows/read-resource.flow.d.ts +91 -0
- package/src/resource/flows/read-resource.flow.js +270 -0
- package/src/resource/flows/read-resource.flow.js.map +1 -0
- package/src/resource/flows/resource-templates-list.flow.d.ts +64 -0
- package/src/resource/flows/resource-templates-list.flow.js +191 -0
- package/src/resource/flows/resource-templates-list.flow.js.map +1 -0
- package/src/resource/flows/resources-list.flow.d.ts +64 -0
- package/src/resource/flows/resources-list.flow.js +196 -0
- package/src/resource/flows/resources-list.flow.js.map +1 -0
- package/src/resource/flows/subscribe-resource.flow.d.ts +45 -0
- package/src/resource/flows/subscribe-resource.flow.js +123 -0
- package/src/resource/flows/subscribe-resource.flow.js.map +1 -0
- package/src/resource/flows/unsubscribe-resource.flow.d.ts +44 -0
- package/src/resource/flows/unsubscribe-resource.flow.js +107 -0
- package/src/resource/flows/unsubscribe-resource.flow.js.map +1 -0
- package/src/resource/index.d.ts +8 -0
- package/src/resource/index.js +20 -0
- package/src/resource/index.js.map +1 -0
- package/src/resource/resource.events.d.ts +24 -0
- package/src/resource/resource.events.js +17 -0
- package/src/resource/resource.events.js.map +1 -0
- package/src/resource/resource.instance.d.ts +35 -0
- package/src/resource/resource.instance.js +163 -0
- package/src/resource/resource.instance.js.map +1 -0
- package/src/resource/resource.registry.d.ts +106 -12
- package/src/resource/resource.registry.js +449 -13
- package/src/resource/resource.registry.js.map +1 -1
- package/src/resource/resource.types.d.ts +35 -0
- package/src/resource/resource.types.js +11 -0
- package/src/resource/resource.types.js.map +1 -0
- package/src/resource/resource.utils.d.ts +30 -0
- package/src/resource/resource.utils.js +151 -0
- package/src/resource/resource.utils.js.map +1 -0
- package/src/scope/flows/http.request.flow.d.ts +48 -330
- package/src/scope/flows/http.request.flow.js +306 -78
- package/src/scope/flows/http.request.flow.js.map +1 -1
- package/src/scope/scope.instance.d.ts +12 -0
- package/src/scope/scope.instance.js +145 -15
- package/src/scope/scope.instance.js.map +1 -1
- package/src/tool/flows/call-tool.flow.d.ts +64 -1110
- package/src/tool/flows/call-tool.flow.js +303 -15
- package/src/tool/flows/call-tool.flow.js.map +1 -1
- package/src/tool/flows/tools-list.flow.d.ts +32 -473
- package/src/tool/flows/tools-list.flow.js +121 -40
- package/src/tool/flows/tools-list.flow.js.map +1 -1
- package/src/tool/tool.events.d.ts +8 -1
- package/src/tool/tool.events.js.map +1 -1
- package/src/tool/tool.instance.d.ts +3 -1
- package/src/tool/tool.instance.js +17 -3
- package/src/tool/tool.instance.js.map +1 -1
- package/src/tool/tool.registry.d.ts +7 -1
- package/src/tool/tool.registry.js +26 -10
- package/src/tool/tool.registry.js.map +1 -1
- package/src/tool/tool.types.d.ts +4 -4
- package/src/tool/tool.types.js.map +1 -1
- package/src/tool/tool.utils.d.ts +3 -12
- package/src/tool/tool.utils.js +39 -193
- package/src/tool/tool.utils.js.map +1 -1
- package/src/tool/ui/index.d.ts +22 -0
- package/src/tool/ui/index.js +63 -0
- package/src/tool/ui/index.js.map +1 -0
- package/src/tool/ui/platform-adapters.d.ts +10 -0
- package/src/tool/ui/platform-adapters.js +18 -0
- package/src/tool/ui/platform-adapters.js.map +1 -0
- package/src/tool/ui/template-helpers.d.ts +46 -0
- package/src/tool/ui/template-helpers.js +112 -0
- package/src/tool/ui/template-helpers.js.map +1 -0
- package/src/tool/ui/ui-resource-template.d.ts +34 -0
- package/src/tool/ui/ui-resource-template.js +64 -0
- package/src/tool/ui/ui-resource-template.js.map +1 -0
- package/src/tool/ui/ui-resource.handler.d.ts +74 -0
- package/src/tool/ui/ui-resource.handler.js +129 -0
- package/src/tool/ui/ui-resource.handler.js.map +1 -0
- package/src/transport/adapters/transport.local.adapter.d.ts +2 -2
- package/src/transport/adapters/transport.local.adapter.js +28 -7
- package/src/transport/adapters/transport.local.adapter.js.map +1 -1
- package/src/transport/adapters/transport.sse.adapter.d.ts +2 -2
- package/src/transport/adapters/transport.sse.adapter.js +4 -3
- package/src/transport/adapters/transport.sse.adapter.js.map +1 -1
- package/src/transport/adapters/transport.streamable-http.adapter.d.ts +10 -3
- package/src/transport/adapters/transport.streamable-http.adapter.js +54 -8
- package/src/transport/adapters/transport.streamable-http.adapter.js.map +1 -1
- package/src/transport/flows/handle.sse.flow.d.ts +29 -63
- package/src/transport/flows/handle.sse.flow.js +78 -10
- package/src/transport/flows/handle.sse.flow.js.map +1 -1
- package/src/transport/flows/handle.stateless-http.flow.d.ts +29 -0
- package/src/transport/flows/handle.stateless-http.flow.js +102 -0
- package/src/transport/flows/handle.stateless-http.flow.js.map +1 -0
- package/src/transport/flows/handle.streamable-http.flow.d.ts +32 -64
- package/src/transport/flows/handle.streamable-http.flow.js +158 -26
- package/src/transport/flows/handle.streamable-http.flow.js.map +1 -1
- package/src/transport/legacy/legacy.sse.tranporter.d.ts +9 -0
- package/src/transport/legacy/legacy.sse.tranporter.js +17 -2
- package/src/transport/legacy/legacy.sse.tranporter.js.map +1 -1
- package/src/transport/mcp-handlers/call-tool-request.handler.js +27 -1
- package/src/transport/mcp-handlers/call-tool-request.handler.js.map +1 -1
- package/src/transport/mcp-handlers/complete-request.handler.d.ts +69 -0
- package/src/transport/mcp-handlers/complete-request.handler.js +11 -0
- package/src/transport/mcp-handlers/complete-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/get-prompt-request.handler.d.ts +87 -0
- package/src/transport/mcp-handlers/get-prompt-request.handler.js +11 -0
- package/src/transport/mcp-handlers/get-prompt-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/index.d.ts +517 -208
- package/src/transport/mcp-handlers/index.js +39 -2
- package/src/transport/mcp-handlers/index.js.map +1 -1
- package/src/transport/mcp-handlers/initialize-request.handler.d.ts +1 -1
- package/src/transport/mcp-handlers/initialize-request.handler.js +73 -7
- package/src/transport/mcp-handlers/initialize-request.handler.js.map +1 -1
- package/src/transport/mcp-handlers/list-prompts-request.handler.d.ts +54 -0
- package/src/transport/mcp-handlers/list-prompts-request.handler.js +11 -0
- package/src/transport/mcp-handlers/list-prompts-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/list-resource-templates-request.handler.d.ts +51 -0
- package/src/transport/mcp-handlers/list-resource-templates-request.handler.js +12 -0
- package/src/transport/mcp-handlers/list-resource-templates-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/list-resources-request.handler.d.ts +51 -0
- package/src/transport/mcp-handlers/list-resources-request.handler.js +12 -0
- package/src/transport/mcp-handlers/list-resources-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/list-tools-request.handler.d.ts +19 -146
- package/src/transport/mcp-handlers/logging-set-level-request.handler.d.ts +46 -0
- package/src/transport/mcp-handlers/logging-set-level-request.handler.js +34 -0
- package/src/transport/mcp-handlers/logging-set-level-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/mcp-handlers.types.d.ts +3 -7
- package/src/transport/mcp-handlers/mcp-handlers.types.js.map +1 -1
- package/src/transport/mcp-handlers/read-resource-request.handler.d.ts +46 -0
- package/src/transport/mcp-handlers/read-resource-request.handler.js +12 -0
- package/src/transport/mcp-handlers/read-resource-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/roots-list-changed-notification.handler.d.ts +11 -0
- package/src/transport/mcp-handlers/roots-list-changed-notification.handler.js +26 -0
- package/src/transport/mcp-handlers/roots-list-changed-notification.handler.js.map +1 -0
- package/src/transport/mcp-handlers/subscribe-request.handler.d.ts +37 -0
- package/src/transport/mcp-handlers/subscribe-request.handler.js +34 -0
- package/src/transport/mcp-handlers/subscribe-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/unsubscribe-request.handler.d.ts +37 -0
- package/src/transport/mcp-handlers/unsubscribe-request.handler.js +34 -0
- package/src/transport/mcp-handlers/unsubscribe-request.handler.js.map +1 -0
- package/src/transport/transport.local.js +7 -2
- package/src/transport/transport.local.js.map +1 -1
- package/src/transport/transport.registry.d.ts +30 -0
- package/src/transport/transport.registry.js +84 -1
- package/src/transport/transport.registry.js.map +1 -1
- package/src/transport/transport.types.d.ts +3 -3
- package/src/transport/transport.types.js.map +1 -1
- package/src/utils/content.utils.d.ts +48 -0
- package/src/utils/content.utils.js +194 -0
- package/src/utils/content.utils.js.map +1 -0
- package/src/utils/index.d.ts +8 -0
- package/src/utils/index.js +55 -0
- package/src/utils/index.js.map +1 -0
- package/src/utils/lineage.utils.d.ts +40 -0
- package/src/utils/lineage.utils.js +82 -0
- package/src/utils/lineage.utils.js.map +1 -0
- package/src/utils/naming.utils.d.ts +46 -0
- package/src/utils/naming.utils.js +136 -0
- package/src/utils/naming.utils.js.map +1 -0
- package/src/utils/types.utils.d.ts +2 -2
- package/src/utils/types.utils.js.map +1 -1
- package/src/utils/uri-template.utils.d.ts +57 -0
- package/src/utils/uri-template.utils.js +113 -0
- package/src/utils/uri-template.utils.js.map +1 -0
- package/src/utils/uri-validation.utils.d.ts +40 -0
- package/src/utils/uri-validation.utils.js +76 -0
- package/src/utils/uri-validation.utils.js.map +1 -0
- package/src/__test-utils__/fixtures/hook.fixtures.d.ts +0 -46
- package/src/__test-utils__/fixtures/hook.fixtures.js +0 -114
- package/src/__test-utils__/fixtures/hook.fixtures.js.map +0 -1
- package/src/__test-utils__/fixtures/index.d.ts +0 -7
- package/src/__test-utils__/fixtures/index.js +0 -11
- package/src/__test-utils__/fixtures/index.js.map +0 -1
- package/src/__test-utils__/fixtures/plugin.fixtures.d.ts +0 -46
- package/src/__test-utils__/fixtures/plugin.fixtures.js +0 -127
- package/src/__test-utils__/fixtures/plugin.fixtures.js.map +0 -1
- package/src/__test-utils__/fixtures/provider.fixtures.d.ts +0 -69
- package/src/__test-utils__/fixtures/provider.fixtures.js +0 -131
- package/src/__test-utils__/fixtures/provider.fixtures.js.map +0 -1
- package/src/__test-utils__/fixtures/scope.fixtures.d.ts +0 -14
- package/src/__test-utils__/fixtures/scope.fixtures.js +0 -59
- package/src/__test-utils__/fixtures/scope.fixtures.js.map +0 -1
- package/src/__test-utils__/fixtures/tool.fixtures.d.ts +0 -36
- package/src/__test-utils__/fixtures/tool.fixtures.js +0 -91
- package/src/__test-utils__/fixtures/tool.fixtures.js.map +0 -1
- package/src/__test-utils__/helpers/assertion.helpers.d.ts +0 -45
- package/src/__test-utils__/helpers/assertion.helpers.js +0 -153
- package/src/__test-utils__/helpers/assertion.helpers.js.map +0 -1
- package/src/__test-utils__/helpers/async.helpers.d.ts +0 -48
- package/src/__test-utils__/helpers/async.helpers.js +0 -112
- package/src/__test-utils__/helpers/async.helpers.js.map +0 -1
- package/src/__test-utils__/helpers/index.d.ts +0 -6
- package/src/__test-utils__/helpers/index.js +0 -10
- package/src/__test-utils__/helpers/index.js.map +0 -1
- package/src/__test-utils__/helpers/setup.helpers.d.ts +0 -54
- package/src/__test-utils__/helpers/setup.helpers.js +0 -106
- package/src/__test-utils__/helpers/setup.helpers.js.map +0 -1
- package/src/__test-utils__/index.d.ts +0 -9
- package/src/__test-utils__/index.js +0 -14
- package/src/__test-utils__/index.js.map +0 -1
- package/src/__test-utils__/mocks/flow-instance.mock.d.ts +0 -50
- package/src/__test-utils__/mocks/flow-instance.mock.js +0 -72
- package/src/__test-utils__/mocks/flow-instance.mock.js.map +0 -1
- package/src/__test-utils__/mocks/hook-registry.mock.d.ts +0 -25
- package/src/__test-utils__/mocks/hook-registry.mock.js +0 -65
- package/src/__test-utils__/mocks/hook-registry.mock.js.map +0 -1
- package/src/__test-utils__/mocks/index.d.ts +0 -8
- package/src/__test-utils__/mocks/index.js +0 -12
- package/src/__test-utils__/mocks/index.js.map +0 -1
- package/src/__test-utils__/mocks/plugin-registry.mock.d.ts +0 -43
- package/src/__test-utils__/mocks/plugin-registry.mock.js +0 -70
- package/src/__test-utils__/mocks/plugin-registry.mock.js.map +0 -1
- package/src/__test-utils__/mocks/provider-registry.mock.d.ts +0 -39
- package/src/__test-utils__/mocks/provider-registry.mock.js +0 -72
- package/src/__test-utils__/mocks/provider-registry.mock.js.map +0 -1
- package/src/__test-utils__/mocks/tool-registry.mock.d.ts +0 -43
- package/src/__test-utils__/mocks/tool-registry.mock.js +0 -79
- package/src/__test-utils__/mocks/tool-registry.mock.js.map +0 -1
- package/src/auth/path.utils.d.ts +0 -20
- package/src/auth/path.utils.js +0 -71
- package/src/auth/path.utils.js.map +0 -1
- package/src/common/decorators-old/async-with.decorator.d.ts +0 -10
- package/src/common/decorators-old/async-with.decorator.js +0 -24
- package/src/common/decorators-old/async-with.decorator.js.map +0 -1
- package/src/common/decorators-old/auth-hook.decorator.d.ts +0 -14
- package/src/common/decorators-old/auth-hook.decorator.js +0 -27
- package/src/common/decorators-old/auth-hook.decorator.js.map +0 -1
- package/src/common/decorators-old/session-hook.decorator.d.ts +0 -14
- package/src/common/decorators-old/session-hook.decorator.js +0 -27
- package/src/common/decorators-old/session-hook.decorator.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-config.provider.js","sourceRoot":"","sources":["../../../../src/common/providers/base-config.provider.ts"],"names":[],"mappings":";AAAA,8DAA8D;;;AAyB9D;;GAEG;AACH,MAAsB,UAAU;IACX,MAAM,CAAU;IAEnC,YAAY,MAAe;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,MAAM;QACJ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cesContent":["// file: libs/sdk/src/common/providers/base-config.provider.ts\n\n/**\n * Type-safe dotted path builder for nested object access\n * Examples: 'vm.preset', 'embedding.strategy', 'directCalls.enabled'\n */\nexport type DottedPath<T, Prefix extends string = ''> = T extends object\n ? {\n [K in keyof T & string]: T[K] extends object\n ? `${Prefix}${K}` | DottedPath<T[K], `${Prefix}${K}.`>\n : `${Prefix}${K}`;\n }[keyof T & string]\n : never;\n\n/**\n * Get the type at a dotted path\n */\nexport type PathValue<T, P extends string> = P extends `${infer Key}.${infer Rest}`\n ? Key extends keyof T\n ? PathValue<T[Key], Rest>\n : never\n : P extends keyof T\n ? T[P]\n : never;\n\n/**\n * Base configuration provider with type-safe path lookup and convict-like API\n */\nexport abstract class BaseConfig<TConfig extends object> {\n protected readonly config: TConfig;\n\n constructor(config: TConfig) {\n this.config = config;\n }\n\n /**\n * Get the complete configuration object\n */\n getAll(): TConfig {\n return this.config;\n }\n\n /**\n * Get a value using dotted path notation (convict-like)\n * @example\n * config.get('vm.preset') // returns 'secure'\n * config.get('embedding.strategy') // returns 'tfidf'\n * config.get('directCalls.enabled') // returns true\n * config.get('vm.timeout', 5000) // returns value or 5000 if undefined\n */\n get<P extends DottedPath<TConfig>>(path: P): PathValue<TConfig, P>;\n get<P extends DottedPath<TConfig>>(path: P, defaultValue: PathValue<TConfig, P>): PathValue<TConfig, P>;\n get<P extends DottedPath<TConfig>>(path: P, defaultValue?: PathValue<TConfig, P>): PathValue<TConfig, P> {\n const keys = (path as string).split('.');\n let result: any = this.config;\n\n for (const key of keys) {\n if (result && typeof result === 'object' && key in result) {\n result = result[key];\n } else {\n return defaultValue !== undefined ? defaultValue : (undefined as PathValue<TConfig, P>);\n }\n }\n\n const value = result as PathValue<TConfig, P>;\n return value !== undefined\n ? value\n : defaultValue !== undefined\n ? defaultValue\n : (undefined as PathValue<TConfig, P>);\n }\n\n /**\n * Check if a path exists in the configuration\n * @example\n * config.has('vm.preset') // returns true\n * config.has('nonexistent.path') // returns false\n */\n has(path: string): boolean {\n const keys = path.split('.');\n let result: any = this.config;\n\n for (const key of keys) {\n if (result && typeof result === 'object' && key in result) {\n result = result[key];\n } else {\n return false;\n }\n }\n\n return result !== undefined;\n }\n\n /**\n * Get a value with a default fallback\n * @example\n * config.getOrDefault('vm.timeout', 5000)\n */\n getOrDefault<P extends DottedPath<TConfig>>(path: P, defaultValue: PathValue<TConfig, P>): PathValue<TConfig, P> {\n const value = this.get(path);\n return value !== undefined ? value : defaultValue;\n }\n\n /**\n * Get a required value (throws if undefined)\n * @example\n * config.getRequired('vm.preset')\n * config.getOrThrow('vm.preset')\n */\n getRequired<P extends DottedPath<TConfig>>(path: P): PathValue<TConfig, P> {\n const value = this.get(path);\n if (value === undefined) {\n throw new Error(`Required configuration path \"${path}\" is undefined`);\n }\n return value;\n }\n\n /**\n * Alias for getRequired - Get a required value (throws if undefined)\n * @example\n * config.getOrThrow('vm.preset')\n */\n getOrThrow<P extends DottedPath<TConfig>>(path: P): PathValue<TConfig, P> {\n return this.getRequired(path);\n }\n\n /**\n * Get a nested object at a path\n * @example\n * config.getSection('vm') // returns entire vm config\n */\n getSection<K extends keyof TConfig>(section: K): TConfig[K] {\n return this.config[section];\n }\n\n /**\n * Check if the configuration matches a specific value at a path\n * @example\n * config.matches('vm.preset', 'secure') // returns true/false\n */\n matches<P extends DottedPath<TConfig>>(path: P, value: PathValue<TConfig, P>): boolean {\n return this.get(path) === value;\n }\n\n /**\n * Get multiple values at once\n * @example\n * config.getMany(['vm.preset', 'embedding.strategy', 'topK'])\n */\n getMany<P extends DottedPath<TConfig>>(paths: P[]): Record<P, PathValue<TConfig, P>> {\n const result = {} as Record<P, PathValue<TConfig, P>>;\n for (const path of paths) {\n result[path] = this.get(path);\n }\n return result;\n }\n\n /**\n * Convert configuration to JSON\n */\n toJSON(): TConfig {\n return this.config;\n }\n\n /**\n * Convert configuration to string\n */\n toString(): string {\n return JSON.stringify(this.config, null, 2);\n }\n}\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ClassType, FactoryType, Type, ValueType } from '../interfaces';
|
|
1
|
+
import { ClassType, FactoryType, ProviderType, Type, ValueType } from '../interfaces';
|
|
2
2
|
import { PluginMetadata } from '../metadata';
|
|
3
|
-
import { ProviderRecord } from "./provider.record";
|
|
4
3
|
export declare enum PluginKind {
|
|
5
4
|
CLASS_TOKEN = "CLASS_TOKEN",
|
|
6
5
|
CLASS = "CLASS",
|
|
@@ -11,21 +10,21 @@ export interface PluginClassTokenRecord {
|
|
|
11
10
|
kind: PluginKind.CLASS_TOKEN;
|
|
12
11
|
provide: Type;
|
|
13
12
|
metadata: PluginMetadata;
|
|
14
|
-
providers?:
|
|
13
|
+
providers?: ProviderType[];
|
|
15
14
|
}
|
|
16
15
|
export interface PluginClassRecord extends ClassType<any> {
|
|
17
16
|
kind: PluginKind.CLASS;
|
|
18
17
|
metadata: PluginMetadata;
|
|
19
|
-
providers?:
|
|
18
|
+
providers?: ProviderType[];
|
|
20
19
|
}
|
|
21
20
|
export interface PluginFactoryRecord extends FactoryType<any, any[]> {
|
|
22
21
|
kind: PluginKind.FACTORY;
|
|
23
22
|
metadata: PluginMetadata;
|
|
24
|
-
providers?:
|
|
23
|
+
providers?: ProviderType[];
|
|
25
24
|
}
|
|
26
25
|
export interface PluginValueRecord extends ValueType<any> {
|
|
27
26
|
kind: PluginKind.VALUE;
|
|
28
27
|
metadata: PluginMetadata;
|
|
29
|
-
providers?:
|
|
28
|
+
providers?: ProviderType[];
|
|
30
29
|
}
|
|
31
30
|
export type PluginRecord = PluginClassTokenRecord | PluginClassRecord | PluginFactoryRecord | PluginValueRecord;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.record.js","sourceRoot":"","sources":["../../../../src/common/records/plugin.record.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"plugin.record.js","sourceRoot":"","sources":["../../../../src/common/records/plugin.record.ts"],"names":[],"mappings":";;;AAGA,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,yCAA2B,CAAA;IAC3B,6BAAe,CAAA;IACf,iCAAmB,CAAA;IACnB,6BAAe,CAAA;AACjB,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB","sourcesContent":["import { ClassType, FactoryType, ProviderType, Type, ValueType } from '../interfaces';\nimport { PluginMetadata } from '../metadata';\n\nexport enum PluginKind {\n CLASS_TOKEN = 'CLASS_TOKEN',\n CLASS = 'CLASS',\n FACTORY = 'FACTORY',\n VALUE = 'VALUE',\n}\n\nexport interface PluginClassTokenRecord {\n kind: PluginKind.CLASS_TOKEN;\n provide: Type;\n metadata: PluginMetadata;\n providers?: ProviderType[];\n}\n\nexport interface PluginClassRecord extends ClassType<any> {\n kind: PluginKind.CLASS;\n metadata: PluginMetadata;\n providers?: ProviderType[];\n}\n\nexport interface PluginFactoryRecord extends FactoryType<any, any[]> {\n kind: PluginKind.FACTORY;\n metadata: PluginMetadata;\n providers?: ProviderType[];\n}\n\nexport interface PluginValueRecord extends ValueType<any> {\n kind: PluginKind.VALUE;\n metadata: PluginMetadata;\n providers?: ProviderType[];\n}\n\nexport type PluginRecord = PluginClassTokenRecord | PluginClassRecord | PluginFactoryRecord | PluginValueRecord;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.record.js","sourceRoot":"","sources":["../../../../src/common/records/prompt.record.ts"],"names":[],"mappings":";;;AAIA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,yCAA2B,CAAA;IAC3B,mCAAqB,CAAA;AACvB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB","sourcesContent":["import { Type } from '../interfaces';\nimport { PromptMetadata } from '../metadata';\nimport { PromptEntry } from '../entries';\n\nexport enum PromptKind {\n CLASS_TOKEN = 'CLASS_TOKEN',\n FUNCTION = 'FUNCTION',\n}\n\nexport type PromptClassTokenRecord = {\n kind: PromptKind.CLASS_TOKEN;\n provide: Type<PromptEntry>;\n metadata: PromptMetadata
|
|
1
|
+
{"version":3,"file":"prompt.record.js","sourceRoot":"","sources":["../../../../src/common/records/prompt.record.ts"],"names":[],"mappings":";;;AAIA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,yCAA2B,CAAA;IAC3B,mCAAqB,CAAA;AACvB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB","sourcesContent":["import { Type } from '../interfaces';\nimport { PromptMetadata } from '../metadata';\nimport { PromptEntry } from '../entries';\n\nexport enum PromptKind {\n CLASS_TOKEN = 'CLASS_TOKEN',\n FUNCTION = 'FUNCTION',\n}\n\nexport type PromptClassTokenRecord = {\n kind: PromptKind.CLASS_TOKEN;\n provide: Type<PromptEntry>;\n metadata: PromptMetadata;\n};\n\n// NOTE: `any` is intentional - function providers must be loosely typed\n// to support various input/output schema combinations at runtime\nexport type PromptFunctionTokenRecord = {\n kind: PromptKind.FUNCTION;\n provide: (...args: any[]) => any | Promise<any>;\n metadata: PromptMetadata;\n};\n\nexport type PromptRecord = PromptClassTokenRecord | PromptFunctionTokenRecord;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from '../interfaces';
|
|
2
|
-
import { ResourceMetadata } from '../metadata';
|
|
2
|
+
import { ResourceMetadata, ResourceTemplateMetadata } from '../metadata';
|
|
3
3
|
import { ResourceEntry } from '../entries';
|
|
4
4
|
export declare enum ResourceKind {
|
|
5
5
|
CLASS_TOKEN = "CLASS_TOKEN",
|
|
@@ -16,3 +16,19 @@ export type ResourceFunctionRecord = {
|
|
|
16
16
|
metadata: ResourceMetadata;
|
|
17
17
|
};
|
|
18
18
|
export type ResourceRecord = ResourceClassTokenRecord | ResourceFunctionRecord;
|
|
19
|
+
export declare enum ResourceTemplateKind {
|
|
20
|
+
CLASS_TOKEN = "CLASS_TOKEN",
|
|
21
|
+
FUNCTION = "FUNCTION"
|
|
22
|
+
}
|
|
23
|
+
export type ResourceTemplateClassTokenRecord = {
|
|
24
|
+
kind: ResourceTemplateKind.CLASS_TOKEN;
|
|
25
|
+
provide: Type<ResourceEntry>;
|
|
26
|
+
metadata: ResourceTemplateMetadata;
|
|
27
|
+
};
|
|
28
|
+
export type ResourceTemplateFunctionRecord = {
|
|
29
|
+
kind: ResourceTemplateKind.FUNCTION;
|
|
30
|
+
provide: (...args: any[]) => any | Promise<any>;
|
|
31
|
+
metadata: ResourceTemplateMetadata;
|
|
32
|
+
};
|
|
33
|
+
export type ResourceTemplateRecord = ResourceTemplateClassTokenRecord | ResourceTemplateFunctionRecord;
|
|
34
|
+
export type AnyResourceRecord = ResourceRecord | ResourceTemplateRecord;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResourceKind = void 0;
|
|
3
|
+
exports.ResourceTemplateKind = exports.ResourceKind = void 0;
|
|
4
|
+
// ============================================================================
|
|
5
|
+
// Static Resource Records
|
|
6
|
+
// ============================================================================
|
|
4
7
|
var ResourceKind;
|
|
5
8
|
(function (ResourceKind) {
|
|
6
9
|
ResourceKind["CLASS_TOKEN"] = "CLASS_TOKEN";
|
|
7
10
|
ResourceKind["FUNCTION"] = "FUNCTION";
|
|
8
11
|
})(ResourceKind || (exports.ResourceKind = ResourceKind = {}));
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// Resource Template Records
|
|
14
|
+
// ============================================================================
|
|
15
|
+
var ResourceTemplateKind;
|
|
16
|
+
(function (ResourceTemplateKind) {
|
|
17
|
+
ResourceTemplateKind["CLASS_TOKEN"] = "CLASS_TOKEN";
|
|
18
|
+
ResourceTemplateKind["FUNCTION"] = "FUNCTION";
|
|
19
|
+
})(ResourceTemplateKind || (exports.ResourceTemplateKind = ResourceTemplateKind = {}));
|
|
14
20
|
//# sourceMappingURL=resource.record.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.record.js","sourceRoot":"","sources":["../../../../src/common/records/resource.record.ts"],"names":[],"mappings":";;;AAIA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,2CAA2B,CAAA;IAC3B,qCAAqB,CAAA;AACvB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;
|
|
1
|
+
{"version":3,"file":"resource.record.js","sourceRoot":"","sources":["../../../../src/common/records/resource.record.ts"],"names":[],"mappings":";;;AAIA,+EAA+E;AAC/E,0BAA0B;AAC1B,+EAA+E;AAE/E,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,2CAA2B,CAAA;IAC3B,qCAAqB,CAAA;AACvB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAkBD,+EAA+E;AAC/E,4BAA4B;AAC5B,+EAA+E;AAE/E,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,mDAA2B,CAAA;IAC3B,6CAAqB,CAAA;AACvB,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B","sourcesContent":["import { Type } from '../interfaces';\nimport { ResourceMetadata, ResourceTemplateMetadata } from '../metadata';\nimport { ResourceEntry } from '../entries';\n\n// ============================================================================\n// Static Resource Records\n// ============================================================================\n\nexport enum ResourceKind {\n CLASS_TOKEN = 'CLASS_TOKEN',\n FUNCTION = 'FUNCTION',\n}\n\nexport type ResourceClassTokenRecord = {\n kind: ResourceKind.CLASS_TOKEN;\n provide: Type<ResourceEntry>;\n metadata: ResourceMetadata;\n};\n\n// NOTE: `any` is intentional - function providers must be loosely typed\n// to support various input/output schema combinations at runtime\nexport type ResourceFunctionRecord = {\n kind: ResourceKind.FUNCTION;\n provide: (...args: any[]) => any | Promise<any>;\n metadata: ResourceMetadata;\n};\n\nexport type ResourceRecord = ResourceClassTokenRecord | ResourceFunctionRecord;\n\n// ============================================================================\n// Resource Template Records\n// ============================================================================\n\nexport enum ResourceTemplateKind {\n CLASS_TOKEN = 'CLASS_TOKEN',\n FUNCTION = 'FUNCTION',\n}\n\nexport type ResourceTemplateClassTokenRecord = {\n kind: ResourceTemplateKind.CLASS_TOKEN;\n provide: Type<ResourceEntry>;\n metadata: ResourceTemplateMetadata;\n};\n\n// NOTE: `any` is intentional - see ResourceFunctionRecord\nexport type ResourceTemplateFunctionRecord = {\n kind: ResourceTemplateKind.FUNCTION;\n provide: (...args: any[]) => any | Promise<any>;\n metadata: ResourceTemplateMetadata;\n};\n\nexport type ResourceTemplateRecord = ResourceTemplateClassTokenRecord | ResourceTemplateFunctionRecord;\n\n// ============================================================================\n// Union type for any resource record (static or template)\n// ============================================================================\n\nexport type AnyResourceRecord = ResourceRecord | ResourceTemplateRecord;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.record.js","sourceRoot":"","sources":["../../../../src/common/records/tool.record.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"tool.record.js","sourceRoot":"","sources":["../../../../src/common/records/tool.record.ts"],"names":[],"mappings":";;;AAGA,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,uCAA2B,CAAA;IAC3B,iCAAqB,CAAA;AACvB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB","sourcesContent":["import { ToolContext, Type } from '../interfaces';\nimport { ToolMetadata } from '../metadata';\n\nexport enum ToolKind {\n CLASS_TOKEN = 'CLASS_TOKEN',\n FUNCTION = 'FUNCTION',\n}\n\nexport type ToolClassTokenRecord = {\n kind: ToolKind.CLASS_TOKEN;\n provide: Type<ToolContext>;\n metadata: ToolMetadata;\n};\n\n// NOTE: `any` is intentional - function providers must be loosely typed\n// to support various input/output schema combinations at runtime\nexport type ToolFunctionTokenRecord = {\n kind: ToolKind.FUNCTION;\n provide: (...args: any[]) => any | Promise<any>;\n metadata: ToolMetadata;\n};\n\nexport type ToolRecord = ToolClassTokenRecord | ToolFunctionTokenRecord;\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Type } from '../interfaces';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
export declare const annotatedFrontMcpAppSchema: z.
|
|
4
|
-
export declare const annotatedFrontMcpProvidersSchema: z.
|
|
5
|
-
export declare const annotatedFrontMcpAuthProvidersSchema: z.
|
|
6
|
-
export declare const annotatedFrontMcpPluginsSchema: z.
|
|
7
|
-
export declare const annotatedFrontMcpAdaptersSchema: z.
|
|
8
|
-
export declare const annotatedFrontMcpToolsSchema: z.
|
|
9
|
-
export declare const annotatedFrontMcpResourcesSchema: z.
|
|
10
|
-
export declare const annotatedFrontMcpPromptsSchema: z.
|
|
11
|
-
export declare const annotatedFrontMcpLoggerSchema: z.
|
|
3
|
+
export declare const annotatedFrontMcpAppSchema: z.ZodCustom<Type<unknown>, Type<unknown>>;
|
|
4
|
+
export declare const annotatedFrontMcpProvidersSchema: z.ZodCustom<Type<unknown>, Type<unknown>>;
|
|
5
|
+
export declare const annotatedFrontMcpAuthProvidersSchema: z.ZodCustom<Type<unknown>, Type<unknown>>;
|
|
6
|
+
export declare const annotatedFrontMcpPluginsSchema: z.ZodCustom<Type<unknown>, Type<unknown>>;
|
|
7
|
+
export declare const annotatedFrontMcpAdaptersSchema: z.ZodCustom<Type<unknown>, Type<unknown>>;
|
|
8
|
+
export declare const annotatedFrontMcpToolsSchema: z.ZodCustom<Type<unknown>, Type<unknown>>;
|
|
9
|
+
export declare const annotatedFrontMcpResourcesSchema: z.ZodCustom<Type<unknown>, Type<unknown>>;
|
|
10
|
+
export declare const annotatedFrontMcpPromptsSchema: z.ZodCustom<Type<unknown>, Type<unknown>>;
|
|
11
|
+
export declare const annotatedFrontMcpLoggerSchema: z.ZodCustom<Type<unknown>, Type<unknown>>;
|
|
@@ -6,39 +6,104 @@ const tokens_1 = require("../tokens");
|
|
|
6
6
|
const metadata_1 = require("../metadata");
|
|
7
7
|
exports.annotatedFrontMcpAppSchema = zod_1.z.custom((v) => typeof v === 'function' && Reflect.hasMetadata(tokens_1.FrontMcpLocalAppTokens.type, v), { message: 'apps items must be annotated with @App() | @FrontMcpApp().' });
|
|
8
8
|
exports.annotatedFrontMcpProvidersSchema = zod_1.z.custom((v) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
if (typeof v === 'function' && Reflect.hasMetadata(tokens_1.FrontMcpProviderTokens.type, v)) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
if (typeof v === 'object' && v !== null) {
|
|
13
|
+
const obj = v;
|
|
14
|
+
const useValue = obj['useValue'];
|
|
15
|
+
if (useValue && typeof useValue === 'object' && useValue !== null) {
|
|
16
|
+
const ctor = useValue['constructor'];
|
|
17
|
+
if (ctor && Reflect.hasMetadata(tokens_1.FrontMcpProviderTokens.type, ctor)) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (obj['useFactory'] && metadata_1.frontMcpProviderMetadataSchema.passthrough().safeParse(v).success) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}, { message: 'providers items must be annotated with @Provider() | @FrontMcpProvider().' });
|
|
15
27
|
exports.annotatedFrontMcpAuthProvidersSchema = zod_1.z.custom((v) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
28
|
+
if (typeof v === 'function' && Reflect.hasMetadata(tokens_1.FrontMcpAuthProviderTokens.type, v)) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
if (typeof v === 'object' && v !== null) {
|
|
32
|
+
const obj = v;
|
|
33
|
+
const useValue = obj['useValue'];
|
|
34
|
+
if (useValue && typeof useValue === 'object' && useValue !== null) {
|
|
35
|
+
const ctor = useValue['constructor'];
|
|
36
|
+
if (ctor && Reflect.hasMetadata(tokens_1.FrontMcpAuthProviderTokens.type, ctor)) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (obj['useFactory'] && metadata_1.frontMcpAuthProviderMetadataSchema.passthrough().safeParse(v).success) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}, { message: 'auth providers items must be annotated with @AuthProvider() | @FrontMcpAuthProvider().' });
|
|
22
46
|
exports.annotatedFrontMcpPluginsSchema = zod_1.z.custom((v) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
47
|
+
if (typeof v === 'function' && Reflect.hasMetadata(tokens_1.FrontMcpPluginTokens.type, v)) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
if (typeof v === 'object' && v !== null) {
|
|
51
|
+
const obj = v;
|
|
52
|
+
const useValue = obj['useValue'];
|
|
53
|
+
if (useValue && typeof useValue === 'object' && useValue !== null) {
|
|
54
|
+
const ctor = useValue['constructor'];
|
|
55
|
+
if (ctor && Reflect.hasMetadata(tokens_1.FrontMcpPluginTokens.type, ctor)) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (obj['useFactory'] && metadata_1.frontMcpPluginMetadataSchema.passthrough().safeParse(v).success) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
28
64
|
}, { message: 'plugins items must be annotated with @Plugin() | @FrontMcpPlugin().' });
|
|
29
65
|
exports.annotatedFrontMcpAdaptersSchema = zod_1.z.custom((v) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
66
|
+
if (typeof v === 'function' && Reflect.hasMetadata(tokens_1.FrontMcpAdapterTokens.type, v)) {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
if (typeof v === 'object' && v !== null) {
|
|
70
|
+
const obj = v;
|
|
71
|
+
const useValue = obj['useValue'];
|
|
72
|
+
if (useValue && typeof useValue === 'object' && useValue !== null) {
|
|
73
|
+
const ctor = useValue['constructor'];
|
|
74
|
+
if (ctor && Reflect.hasMetadata(tokens_1.FrontMcpAdapterTokens.type, ctor)) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (obj['useFactory'] && metadata_1.frontMcpAdapterMetadataSchema.passthrough().safeParse(v).success) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
35
83
|
}, { message: 'adapters items must be annotated with @Adapter() | @FrontMcpAdapter().' });
|
|
36
84
|
exports.annotatedFrontMcpToolsSchema = zod_1.z.custom((v) => {
|
|
37
|
-
return typeof v === 'function' &&
|
|
38
|
-
||
|
|
39
|
-
v[tokens_1.FrontMcpToolTokens.type] !== undefined);
|
|
85
|
+
return (typeof v === 'function' &&
|
|
86
|
+
(Reflect.hasMetadata(tokens_1.FrontMcpToolTokens.type, v) || v[tokens_1.FrontMcpToolTokens.type] !== undefined));
|
|
40
87
|
}, { message: 'tools items must be annotated with @Tool() | @FrontMcpTool().' });
|
|
41
|
-
exports.annotatedFrontMcpResourcesSchema = zod_1.z.custom((v) =>
|
|
42
|
-
|
|
88
|
+
exports.annotatedFrontMcpResourcesSchema = zod_1.z.custom((v) => {
|
|
89
|
+
return (typeof v === 'function' &&
|
|
90
|
+
// Class-based @Resource decorator
|
|
91
|
+
(Reflect.hasMetadata(tokens_1.FrontMcpResourceTokens.type, v) ||
|
|
92
|
+
// Class-based @ResourceTemplate decorator
|
|
93
|
+
Reflect.hasMetadata(tokens_1.FrontMcpResourceTemplateTokens.type, v) ||
|
|
94
|
+
// Function-style resource() builder
|
|
95
|
+
v[tokens_1.FrontMcpResourceTokens.type] !== undefined ||
|
|
96
|
+
// Function-style resourceTemplate() builder
|
|
97
|
+
v[tokens_1.FrontMcpResourceTemplateTokens.type] !== undefined));
|
|
98
|
+
}, {
|
|
99
|
+
message: 'resources items must be annotated with @Resource() | @ResourceTemplate() or use resource() | resourceTemplate() builders.',
|
|
100
|
+
});
|
|
101
|
+
exports.annotatedFrontMcpPromptsSchema = zod_1.z.custom((v) => {
|
|
102
|
+
return (typeof v === 'function' &&
|
|
103
|
+
// Class-based @Prompt decorator
|
|
104
|
+
(Reflect.hasMetadata(tokens_1.FrontMcpPromptTokens.type, v) ||
|
|
105
|
+
// Function-style prompt() builder
|
|
106
|
+
v[tokens_1.FrontMcpPromptTokens.type] !== undefined));
|
|
107
|
+
}, { message: 'prompts items must be annotated with @Prompt() | @FrontMcpPrompt() or use prompt() builder.' });
|
|
43
108
|
exports.annotatedFrontMcpLoggerSchema = zod_1.z.custom((v) => typeof v === 'function' && Reflect.hasMetadata(tokens_1.FrontMcpLogTransportTokens.type, v), { message: 'logger items must be annotated with @Logger() | @FrontMcpLogger().' });
|
|
44
109
|
//# sourceMappingURL=annotated-class.schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotated-class.schema.js","sourceRoot":"","sources":["../../../../src/common/schemas/annotated-class.schema.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AACxB,sCAMmB;AACnB,0CAIqB;AAER,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAChD,CAAC,CAAC,EAAa,EAAE,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,+BAAsB,CAAC,IAAI,EAAE,CAAC,CAAC,EAChG,EAAE,OAAO,EAAE,4DAA4D,EAAE,CAC1E,CAAC;AAEW,QAAA,gCAAgC,GAAG,OAAC,CAAC,MAAM,CACtD,CAAC,CAAC,EAAa,EAAE;IACf,OAAO,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,+BAAsB,CAAC,IAAI,EAAE,CAAC,CAAC;;YAEnF,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,+BAAsB,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;;YAE3F,CAAC,CA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EW,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CACnD,CAAC,CAAC,EAAa,EAAE,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,mCAA0B,CAAC,IAAI,EAAE,CAAC,CAAC,EACpG,EAAE,OAAO,EAAE,oEAAoE,EAAE,CAClF,CAAC","sourcesContent":["import { Type } from '../interfaces';\nimport { z } from 'zod';\nimport {\n FrontMcpAdapterTokens, FrontMcpAuthProviderTokens,\n FrontMcpLocalAppTokens, FrontMcpLogTransportTokens,\n FrontMcpPluginTokens, FrontMcpPromptTokens,\n FrontMcpProviderTokens, FrontMcpResourceTokens,\n FrontMcpToolTokens,\n} from '../tokens';\nimport {\n frontMcpAdapterMetadataSchema,\n frontMcpAuthProviderMetadataSchema, frontMcpPluginMetadataSchema,\n frontMcpProviderMetadataSchema,\n} from '../metadata';\n\nexport const annotatedFrontMcpAppSchema = z.custom<Type>(\n (v): v is Type => typeof v === 'function' && Reflect.hasMetadata(FrontMcpLocalAppTokens.type, v),\n { message: 'apps items must be annotated with @App() | @FrontMcpApp().' },\n);\n\nexport const annotatedFrontMcpProvidersSchema = z.custom<Type>(\n (v): v is Type => {\n return typeof v === 'function' && Reflect.hasMetadata(FrontMcpProviderTokens.type, v)\n ||\n (v['useValue'] && Reflect.hasMetadata(FrontMcpProviderTokens.type, v.useValue.constructor))\n ||\n (v['useFactory'] && frontMcpProviderMetadataSchema.passthrough().safeParse(v).success);\n },\n { message: 'plugins items must be annotated with @Provider() | @FrontMcpProvider().' },\n);\n\nexport const annotatedFrontMcpAuthProvidersSchema = z.custom<Type>(\n (v): v is Type => {\n return typeof v === 'function' && Reflect.hasMetadata(FrontMcpAuthProviderTokens.type, v)\n ||\n (v['useValue'] && Reflect.hasMetadata(FrontMcpAuthProviderTokens.type, v.useValue.constructor))\n ||\n (v['useFactory'] && frontMcpAuthProviderMetadataSchema.passthrough().safeParse(v).success);\n },\n { message: 'plugins items must be annotated with @AuthProvider() | @FrontMcpAuthProvider().' },\n);\n\nexport const annotatedFrontMcpPluginsSchema = z.custom<Type>(\n (v): v is Type => {\n return (typeof v === 'function' && Reflect.hasMetadata(FrontMcpPluginTokens.type, v))\n ||\n (v['useValue'] && Reflect.hasMetadata(FrontMcpPluginTokens.type, v.useValue.constructor))\n ||\n (v['useFactory'] && frontMcpPluginMetadataSchema.passthrough().safeParse(v).success);\n },\n { message: 'plugins items must be annotated with @Plugin() | @FrontMcpPlugin().' },\n);\n\nexport const annotatedFrontMcpAdaptersSchema = z.custom<Type>(\n (v): v is Type => {\n return typeof v === 'function' && Reflect.hasMetadata(FrontMcpAdapterTokens.type, v)\n ||\n (v['useValue'] && Reflect.hasMetadata(FrontMcpAdapterTokens.type, v.useValue.constructor))\n ||\n (v['useFactory'] && frontMcpAdapterMetadataSchema.passthrough().safeParse(v).success);\n },\n { message: 'adapters items must be annotated with @Adapter() | @FrontMcpAdapter().' },\n);\n\nexport const annotatedFrontMcpToolsSchema = z.custom<Type>(\n (v): v is Type => {\n return typeof v === 'function' && (\n Reflect.hasMetadata(FrontMcpToolTokens.type, v)\n ||\n v[FrontMcpToolTokens.type] !== undefined\n );\n },\n { message: 'tools items must be annotated with @Tool() | @FrontMcpTool().' },\n);\n\nexport const annotatedFrontMcpResourcesSchema = z.custom<Type>(\n (v): v is Type => typeof v === 'function' && Reflect.hasMetadata(FrontMcpResourceTokens.type, v),\n { message: 'resources items must be annotated with @Resource() | @FrontMcpResource().' },\n);\n\nexport const annotatedFrontMcpPromptsSchema = z.custom<Type>(\n (v): v is Type => typeof v === 'function' && Reflect.hasMetadata(FrontMcpPromptTokens.type, v),\n { message: 'prompts items must be annotated with @Prompt() | @FrontMcpPrompt().' },\n);\n\nexport const annotatedFrontMcpLoggerSchema = z.custom<Type>(\n (v): v is Type => typeof v === 'function' && Reflect.hasMetadata(FrontMcpLogTransportTokens.type, v),\n { message: 'logger items must be annotated with @Logger() | @FrontMcpLogger().' },\n);"]}
|
|
1
|
+
{"version":3,"file":"annotated-class.schema.js","sourceRoot":"","sources":["../../../../src/common/schemas/annotated-class.schema.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AACxB,sCAWmB;AACnB,0CAKqB;AAER,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAChD,CAAC,CAAC,EAAa,EAAE,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,+BAAsB,CAAC,IAAI,EAAE,CAAC,CAAC,EAChG,EAAE,OAAO,EAAE,4DAA4D,EAAE,CAC1E,CAAC;AAEW,QAAA,gCAAgC,GAAG,OAAC,CAAC,MAAM,CACtD,CAAC,CAAC,EAAa,EAAE;IACf,IAAI,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,+BAAsB,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;QACnF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QACxC,MAAM,GAAG,GAAG,CAA4B,CAAC;QACzC,MAAM,QAAQ,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC;QACjC,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YAClE,MAAM,IAAI,GAAI,QAAoC,CAAC,aAAa,CAAC,CAAC;YAClE,IAAI,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,+BAAsB,CAAC,IAAI,EAAE,IAAc,CAAC,EAAE,CAAC;gBAC7E,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,IAAI,GAAG,CAAC,YAAY,CAAC,IAAI,yCAA8B,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;YAC3F,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CA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A,8BAA8B,GAAG,OAAC,CAAC,MAAM,CACpD,CAAC,CAAC,EAAa,EAAE;IACf,OAAO,CACL,OAAO,CAAC,KAAK,UAAU;QACvB,gCAAgC;QAChC,CAAC,OAAO,CAAC,WAAW,CAAC,6BAAoB,CAAC,IAAI,EAAE,CAAC,CAAC;YAChD,kCAAkC;YAClC,CAAC,CAAC,6BAAoB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAC9C,CAAC;AACJ,CAAC,EACD,EAAE,OAAO,EAAE,6FAA6F,EAAE,CAC3G,CAAC;AAEW,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CACnD,CAAC,CAAC,EAAa,EAAE,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,mCAA0B,CAAC,IAAI,EAAE,CAAC,CAAC,EACpG,EAAE,OAAO,EAAE,oEAAoE,EAAE,CAClF,CAAC","sourcesContent":["import { Type } from '../interfaces';\nimport { z } from 'zod';\nimport {\n FrontMcpAdapterTokens,\n FrontMcpAuthProviderTokens,\n FrontMcpLocalAppTokens,\n FrontMcpLogTransportTokens,\n FrontMcpPluginTokens,\n FrontMcpPromptTokens,\n FrontMcpProviderTokens,\n FrontMcpResourceTokens,\n FrontMcpResourceTemplateTokens,\n FrontMcpToolTokens,\n} from '../tokens';\nimport {\n frontMcpAdapterMetadataSchema,\n frontMcpAuthProviderMetadataSchema,\n frontMcpPluginMetadataSchema,\n frontMcpProviderMetadataSchema,\n} from '../metadata';\n\nexport const annotatedFrontMcpAppSchema = z.custom<Type>(\n (v): v is Type => typeof v === 'function' && Reflect.hasMetadata(FrontMcpLocalAppTokens.type, v),\n { message: 'apps items must be annotated with @App() | @FrontMcpApp().' },\n);\n\nexport const annotatedFrontMcpProvidersSchema = z.custom<Type>(\n (v): v is Type => {\n if (typeof v === 'function' && Reflect.hasMetadata(FrontMcpProviderTokens.type, v)) {\n return true;\n }\n if (typeof v === 'object' && v !== null) {\n const obj = v as Record<string, unknown>;\n const useValue = obj['useValue'];\n if (useValue && typeof useValue === 'object' && useValue !== null) {\n const ctor = (useValue as Record<string, unknown>)['constructor'];\n if (ctor && Reflect.hasMetadata(FrontMcpProviderTokens.type, ctor as object)) {\n return true;\n }\n }\n if (obj['useFactory'] && frontMcpProviderMetadataSchema.passthrough().safeParse(v).success) {\n return true;\n }\n }\n return false;\n },\n { message: 'providers items must be annotated with @Provider() | @FrontMcpProvider().' },\n);\n\nexport const annotatedFrontMcpAuthProvidersSchema = z.custom<Type>(\n (v): v is Type => {\n if (typeof v === 'function' && Reflect.hasMetadata(FrontMcpAuthProviderTokens.type, v)) {\n return true;\n }\n if (typeof v === 'object' && v !== null) {\n const obj = v as Record<string, unknown>;\n const useValue = obj['useValue'];\n if (useValue && typeof useValue === 'object' && useValue !== null) {\n const ctor = (useValue as Record<string, unknown>)['constructor'];\n if (ctor && Reflect.hasMetadata(FrontMcpAuthProviderTokens.type, ctor as object)) {\n return true;\n }\n }\n if (obj['useFactory'] && frontMcpAuthProviderMetadataSchema.passthrough().safeParse(v).success) {\n return true;\n }\n }\n return false;\n },\n { message: 'auth providers items must be annotated with @AuthProvider() | @FrontMcpAuthProvider().' },\n);\n\nexport const annotatedFrontMcpPluginsSchema = z.custom<Type>(\n (v): v is Type => {\n if (typeof v === 'function' && Reflect.hasMetadata(FrontMcpPluginTokens.type, v)) {\n return true;\n }\n if (typeof v === 'object' && v !== null) {\n const obj = v as Record<string, unknown>;\n const useValue = obj['useValue'];\n if (useValue && typeof useValue === 'object' && useValue !== null) {\n const ctor = (useValue as Record<string, unknown>)['constructor'];\n if (ctor && Reflect.hasMetadata(FrontMcpPluginTokens.type, ctor as object)) {\n return true;\n }\n }\n if (obj['useFactory'] && frontMcpPluginMetadataSchema.passthrough().safeParse(v).success) {\n return true;\n }\n }\n return false;\n },\n { message: 'plugins items must be annotated with @Plugin() | @FrontMcpPlugin().' },\n);\n\nexport const annotatedFrontMcpAdaptersSchema = z.custom<Type>(\n (v): v is Type => {\n if (typeof v === 'function' && Reflect.hasMetadata(FrontMcpAdapterTokens.type, v)) {\n return true;\n }\n if (typeof v === 'object' && v !== null) {\n const obj = v as Record<string, unknown>;\n const useValue = obj['useValue'];\n if (useValue && typeof useValue === 'object' && useValue !== null) {\n const ctor = (useValue as Record<string, unknown>)['constructor'];\n if (ctor && Reflect.hasMetadata(FrontMcpAdapterTokens.type, ctor as object)) {\n return true;\n }\n }\n if (obj['useFactory'] && frontMcpAdapterMetadataSchema.passthrough().safeParse(v).success) {\n return true;\n }\n }\n return false;\n },\n { message: 'adapters items must be annotated with @Adapter() | @FrontMcpAdapter().' },\n);\n\nexport const annotatedFrontMcpToolsSchema = z.custom<Type>(\n (v): v is Type => {\n return (\n typeof v === 'function' &&\n (Reflect.hasMetadata(FrontMcpToolTokens.type, v) || v[FrontMcpToolTokens.type] !== undefined)\n );\n },\n { message: 'tools items must be annotated with @Tool() | @FrontMcpTool().' },\n);\n\nexport const annotatedFrontMcpResourcesSchema = z.custom<Type>(\n (v): v is Type => {\n return (\n typeof v === 'function' &&\n // Class-based @Resource decorator\n (Reflect.hasMetadata(FrontMcpResourceTokens.type, v) ||\n // Class-based @ResourceTemplate decorator\n Reflect.hasMetadata(FrontMcpResourceTemplateTokens.type, v) ||\n // Function-style resource() builder\n v[FrontMcpResourceTokens.type] !== undefined ||\n // Function-style resourceTemplate() builder\n v[FrontMcpResourceTemplateTokens.type] !== undefined)\n );\n },\n {\n message:\n 'resources items must be annotated with @Resource() | @ResourceTemplate() or use resource() | resourceTemplate() builders.',\n },\n);\n\nexport const annotatedFrontMcpPromptsSchema = z.custom<Type>(\n (v): v is Type => {\n return (\n typeof v === 'function' &&\n // Class-based @Prompt decorator\n (Reflect.hasMetadata(FrontMcpPromptTokens.type, v) ||\n // Function-style prompt() builder\n v[FrontMcpPromptTokens.type] !== undefined)\n );\n },\n { message: 'prompts items must be annotated with @Prompt() | @FrontMcpPrompt() or use prompt() builder.' },\n);\n\nexport const annotatedFrontMcpLoggerSchema = z.custom<Type>(\n (v): v is Type => typeof v === 'function' && Reflect.hasMetadata(FrontMcpLogTransportTokens.type, v),\n { message: 'logger items must be annotated with @Logger() | @FrontMcpLogger().' },\n);\n"]}
|
|
@@ -1,33 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const httpInputSchema: z.ZodObject<{
|
|
3
|
-
request: z.ZodObject<{},
|
|
4
|
-
response: z.ZodObject<{},
|
|
5
|
-
next: z.ZodOptional<z.ZodFunction<z.
|
|
6
|
-
},
|
|
7
|
-
request: {} & {
|
|
8
|
-
[k: string]: unknown;
|
|
9
|
-
};
|
|
10
|
-
response: {} & {
|
|
11
|
-
[k: string]: unknown;
|
|
12
|
-
};
|
|
13
|
-
next?: ((...args: unknown[]) => unknown) | undefined;
|
|
14
|
-
}, {
|
|
15
|
-
request: {} & {
|
|
16
|
-
[k: string]: unknown;
|
|
17
|
-
};
|
|
18
|
-
response: {} & {
|
|
19
|
-
[k: string]: unknown;
|
|
20
|
-
};
|
|
21
|
-
next?: ((...args: unknown[]) => unknown) | undefined;
|
|
22
|
-
}>;
|
|
3
|
+
request: z.ZodObject<{}, z.core.$loose>;
|
|
4
|
+
response: z.ZodObject<{}, z.core.$loose>;
|
|
5
|
+
next: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
|
|
6
|
+
}, z.core.$strip>;
|
|
23
7
|
export declare const httpRequestInputSchema: z.ZodObject<{
|
|
24
|
-
request: z.ZodObject<{},
|
|
25
|
-
},
|
|
26
|
-
request: {} & {
|
|
27
|
-
[k: string]: unknown;
|
|
28
|
-
};
|
|
29
|
-
}, {
|
|
30
|
-
request: {} & {
|
|
31
|
-
[k: string]: unknown;
|
|
32
|
-
};
|
|
33
|
-
}>;
|
|
8
|
+
request: z.ZodObject<{}, z.core.$loose>;
|
|
9
|
+
}, z.core.$strip>;
|