@frontmcp/sdk 0.4.0 → 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 +111 -10
- 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,403 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file schemas.ts
|
|
3
|
+
* @description Zod schemas for MCP Apps specification validation.
|
|
4
|
+
*
|
|
5
|
+
* @module @frontmcp/sdk/mcp-apps/schemas
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* MCP Apps MIME type schema.
|
|
10
|
+
*/
|
|
11
|
+
export declare const McpAppsMimeTypeSchema: z.ZodLiteral<"text/html+mcp">;
|
|
12
|
+
/**
|
|
13
|
+
* Display mode schema.
|
|
14
|
+
*/
|
|
15
|
+
export declare const McpAppsDisplayModeSchema: z.ZodEnum<{
|
|
16
|
+
inline: "inline";
|
|
17
|
+
fullscreen: "fullscreen";
|
|
18
|
+
pip: "pip";
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Platform type schema.
|
|
22
|
+
*/
|
|
23
|
+
export declare const McpAppsPlatformSchema: z.ZodEnum<{
|
|
24
|
+
web: "web";
|
|
25
|
+
desktop: "desktop";
|
|
26
|
+
mobile: "mobile";
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Theme schema.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ThemeSchema: z.ZodEnum<{
|
|
32
|
+
light: "light";
|
|
33
|
+
dark: "dark";
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Content Security Policy schema.
|
|
37
|
+
*/
|
|
38
|
+
export declare const McpAppsCSPSchema: z.ZodObject<{
|
|
39
|
+
connectDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
|
+
resourceDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
/**
|
|
43
|
+
* UI Resource metadata schema.
|
|
44
|
+
*/
|
|
45
|
+
export declare const UIResourceMetaSchema: z.ZodObject<{
|
|
46
|
+
csp: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
connectDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
|
+
resourceDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
+
}, z.core.$strict>>;
|
|
50
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
51
|
+
prefersBorder: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
/**
|
|
54
|
+
* UI Resource schema.
|
|
55
|
+
*/
|
|
56
|
+
export declare const UIResourceSchema: z.ZodObject<{
|
|
57
|
+
uri: z.ZodString;
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
description: z.ZodOptional<z.ZodString>;
|
|
60
|
+
mimeType: z.ZodLiteral<"text/html+mcp">;
|
|
61
|
+
_meta: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
ui: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
csp: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
connectDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
|
+
resourceDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
66
|
+
}, z.core.$strict>>;
|
|
67
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
68
|
+
prefersBorder: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
}, z.core.$strict>>;
|
|
70
|
+
}, z.core.$strip>>;
|
|
71
|
+
}, z.core.$strict>;
|
|
72
|
+
/**
|
|
73
|
+
* Device capabilities schema.
|
|
74
|
+
*/
|
|
75
|
+
export declare const DeviceCapabilitiesSchema: z.ZodObject<{
|
|
76
|
+
touch: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
hover: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
/**
|
|
80
|
+
* Safe area insets schema.
|
|
81
|
+
*/
|
|
82
|
+
export declare const SafeAreaInsetsSchema: z.ZodObject<{
|
|
83
|
+
top: z.ZodNumber;
|
|
84
|
+
right: z.ZodNumber;
|
|
85
|
+
bottom: z.ZodNumber;
|
|
86
|
+
left: z.ZodNumber;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
/**
|
|
89
|
+
* Viewport info schema.
|
|
90
|
+
*/
|
|
91
|
+
export declare const ViewportInfoSchema: z.ZodObject<{
|
|
92
|
+
width: z.ZodNumber;
|
|
93
|
+
height: z.ZodNumber;
|
|
94
|
+
maxHeight: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
maxWidth: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
/**
|
|
98
|
+
* Tool info schema.
|
|
99
|
+
*/
|
|
100
|
+
export declare const ToolInfoSchema: z.ZodObject<{
|
|
101
|
+
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
102
|
+
tool: z.ZodObject<{
|
|
103
|
+
name: z.ZodString;
|
|
104
|
+
description: z.ZodOptional<z.ZodString>;
|
|
105
|
+
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
}, z.core.$strict>;
|
|
108
|
+
/**
|
|
109
|
+
* Host context schema.
|
|
110
|
+
*/
|
|
111
|
+
export declare const McpAppsHostContextSchema: z.ZodObject<{
|
|
112
|
+
toolInfo: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
114
|
+
tool: z.ZodObject<{
|
|
115
|
+
name: z.ZodString;
|
|
116
|
+
description: z.ZodOptional<z.ZodString>;
|
|
117
|
+
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
}, z.core.$strict>>;
|
|
120
|
+
theme: z.ZodOptional<z.ZodEnum<{
|
|
121
|
+
light: "light";
|
|
122
|
+
dark: "dark";
|
|
123
|
+
}>>;
|
|
124
|
+
displayMode: z.ZodOptional<z.ZodEnum<{
|
|
125
|
+
inline: "inline";
|
|
126
|
+
fullscreen: "fullscreen";
|
|
127
|
+
pip: "pip";
|
|
128
|
+
}>>;
|
|
129
|
+
viewport: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
width: z.ZodNumber;
|
|
131
|
+
height: z.ZodNumber;
|
|
132
|
+
maxHeight: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
maxWidth: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
}, z.core.$strict>>;
|
|
135
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
136
|
+
timeZone: z.ZodOptional<z.ZodString>;
|
|
137
|
+
platform: z.ZodOptional<z.ZodEnum<{
|
|
138
|
+
web: "web";
|
|
139
|
+
desktop: "desktop";
|
|
140
|
+
mobile: "mobile";
|
|
141
|
+
}>>;
|
|
142
|
+
deviceCapabilities: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
touch: z.ZodOptional<z.ZodBoolean>;
|
|
144
|
+
hover: z.ZodOptional<z.ZodBoolean>;
|
|
145
|
+
}, z.core.$strict>>;
|
|
146
|
+
safeAreaInsets: z.ZodOptional<z.ZodObject<{
|
|
147
|
+
top: z.ZodNumber;
|
|
148
|
+
right: z.ZodNumber;
|
|
149
|
+
bottom: z.ZodNumber;
|
|
150
|
+
left: z.ZodNumber;
|
|
151
|
+
}, z.core.$strict>>;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
/**
|
|
154
|
+
* JSON-RPC error schema.
|
|
155
|
+
*/
|
|
156
|
+
export declare const JsonRpcErrorSchema: z.ZodObject<{
|
|
157
|
+
code: z.ZodNumber;
|
|
158
|
+
message: z.ZodString;
|
|
159
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
160
|
+
}, z.core.$strict>;
|
|
161
|
+
/**
|
|
162
|
+
* JSON-RPC request schema.
|
|
163
|
+
*/
|
|
164
|
+
export declare const JsonRpcRequestSchema: z.ZodObject<{
|
|
165
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
166
|
+
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
167
|
+
method: z.ZodString;
|
|
168
|
+
params: z.ZodOptional<z.ZodUnknown>;
|
|
169
|
+
}, z.core.$strict>;
|
|
170
|
+
/**
|
|
171
|
+
* JSON-RPC response schema.
|
|
172
|
+
*/
|
|
173
|
+
export declare const JsonRpcResponseSchema: z.ZodObject<{
|
|
174
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
175
|
+
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
176
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
177
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
178
|
+
code: z.ZodNumber;
|
|
179
|
+
message: z.ZodString;
|
|
180
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
181
|
+
}, z.core.$strict>>;
|
|
182
|
+
}, z.core.$strict>;
|
|
183
|
+
/**
|
|
184
|
+
* JSON-RPC notification schema.
|
|
185
|
+
*/
|
|
186
|
+
export declare const JsonRpcNotificationSchema: z.ZodObject<{
|
|
187
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
188
|
+
method: z.ZodString;
|
|
189
|
+
params: z.ZodOptional<z.ZodUnknown>;
|
|
190
|
+
}, z.core.$strict>;
|
|
191
|
+
/**
|
|
192
|
+
* UI Initialize params schema.
|
|
193
|
+
*/
|
|
194
|
+
export declare const McpUiInitializeParamsSchema: z.ZodObject<{
|
|
195
|
+
protocolVersion: z.ZodString;
|
|
196
|
+
capabilities: z.ZodOptional<z.ZodObject<{
|
|
197
|
+
messages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
198
|
+
}, z.core.$strip>>;
|
|
199
|
+
}, z.core.$strict>;
|
|
200
|
+
/**
|
|
201
|
+
* UI Initialize result schema.
|
|
202
|
+
*/
|
|
203
|
+
export declare const McpUiInitializeResultSchema: z.ZodObject<{
|
|
204
|
+
protocolVersion: z.ZodString;
|
|
205
|
+
capabilities: z.ZodObject<{
|
|
206
|
+
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
hostContext: z.ZodObject<{
|
|
209
|
+
toolInfo: z.ZodOptional<z.ZodObject<{
|
|
210
|
+
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
211
|
+
tool: z.ZodObject<{
|
|
212
|
+
name: z.ZodString;
|
|
213
|
+
description: z.ZodOptional<z.ZodString>;
|
|
214
|
+
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
}, z.core.$strict>>;
|
|
217
|
+
theme: z.ZodOptional<z.ZodEnum<{
|
|
218
|
+
light: "light";
|
|
219
|
+
dark: "dark";
|
|
220
|
+
}>>;
|
|
221
|
+
displayMode: z.ZodOptional<z.ZodEnum<{
|
|
222
|
+
inline: "inline";
|
|
223
|
+
fullscreen: "fullscreen";
|
|
224
|
+
pip: "pip";
|
|
225
|
+
}>>;
|
|
226
|
+
viewport: z.ZodOptional<z.ZodObject<{
|
|
227
|
+
width: z.ZodNumber;
|
|
228
|
+
height: z.ZodNumber;
|
|
229
|
+
maxHeight: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
maxWidth: z.ZodOptional<z.ZodNumber>;
|
|
231
|
+
}, z.core.$strict>>;
|
|
232
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
233
|
+
timeZone: z.ZodOptional<z.ZodString>;
|
|
234
|
+
platform: z.ZodOptional<z.ZodEnum<{
|
|
235
|
+
web: "web";
|
|
236
|
+
desktop: "desktop";
|
|
237
|
+
mobile: "mobile";
|
|
238
|
+
}>>;
|
|
239
|
+
deviceCapabilities: z.ZodOptional<z.ZodObject<{
|
|
240
|
+
touch: z.ZodOptional<z.ZodBoolean>;
|
|
241
|
+
hover: z.ZodOptional<z.ZodBoolean>;
|
|
242
|
+
}, z.core.$strict>>;
|
|
243
|
+
safeAreaInsets: z.ZodOptional<z.ZodObject<{
|
|
244
|
+
top: z.ZodNumber;
|
|
245
|
+
right: z.ZodNumber;
|
|
246
|
+
bottom: z.ZodNumber;
|
|
247
|
+
left: z.ZodNumber;
|
|
248
|
+
}, z.core.$strict>>;
|
|
249
|
+
}, z.core.$strict>;
|
|
250
|
+
}, z.core.$strict>;
|
|
251
|
+
/**
|
|
252
|
+
* Tool input params schema.
|
|
253
|
+
*/
|
|
254
|
+
export declare const McpUiToolInputParamsSchema: z.ZodObject<{
|
|
255
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
256
|
+
}, z.core.$strict>;
|
|
257
|
+
/**
|
|
258
|
+
* Tool input partial params schema.
|
|
259
|
+
*/
|
|
260
|
+
export declare const McpUiToolInputPartialParamsSchema: z.ZodObject<{
|
|
261
|
+
argumentsDelta: z.ZodString;
|
|
262
|
+
}, z.core.$strict>;
|
|
263
|
+
/**
|
|
264
|
+
* Tool result content item schema.
|
|
265
|
+
*/
|
|
266
|
+
export declare const ToolResultContentItemSchema: z.ZodObject<{
|
|
267
|
+
type: z.ZodEnum<{
|
|
268
|
+
image: "image";
|
|
269
|
+
resource: "resource";
|
|
270
|
+
text: "text";
|
|
271
|
+
}>;
|
|
272
|
+
text: z.ZodOptional<z.ZodString>;
|
|
273
|
+
data: z.ZodOptional<z.ZodString>;
|
|
274
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
275
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
276
|
+
}, z.core.$strip>;
|
|
277
|
+
/**
|
|
278
|
+
* Tool result params schema.
|
|
279
|
+
*/
|
|
280
|
+
export declare const McpUiToolResultParamsSchema: z.ZodObject<{
|
|
281
|
+
content: z.ZodArray<z.ZodObject<{
|
|
282
|
+
type: z.ZodEnum<{
|
|
283
|
+
image: "image";
|
|
284
|
+
resource: "resource";
|
|
285
|
+
text: "text";
|
|
286
|
+
}>;
|
|
287
|
+
text: z.ZodOptional<z.ZodString>;
|
|
288
|
+
data: z.ZodOptional<z.ZodString>;
|
|
289
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
290
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
291
|
+
}, z.core.$strip>>;
|
|
292
|
+
structuredContent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
293
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
294
|
+
}, z.core.$strict>;
|
|
295
|
+
/**
|
|
296
|
+
* Tool cancelled params schema.
|
|
297
|
+
*/
|
|
298
|
+
export declare const McpUiToolCancelledParamsSchema: z.ZodObject<{
|
|
299
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
300
|
+
}, z.core.$strict>;
|
|
301
|
+
/**
|
|
302
|
+
* Size change params schema.
|
|
303
|
+
*/
|
|
304
|
+
export declare const McpUiSizeChangeParamsSchema: z.ZodObject<{
|
|
305
|
+
viewport: z.ZodObject<{
|
|
306
|
+
width: z.ZodNumber;
|
|
307
|
+
height: z.ZodNumber;
|
|
308
|
+
maxHeight: z.ZodOptional<z.ZodNumber>;
|
|
309
|
+
maxWidth: z.ZodOptional<z.ZodNumber>;
|
|
310
|
+
}, z.core.$strict>;
|
|
311
|
+
}, z.core.$strict>;
|
|
312
|
+
/**
|
|
313
|
+
* Host context change params schema.
|
|
314
|
+
*/
|
|
315
|
+
export declare const McpUiHostContextChangeParamsSchema: z.ZodObject<{
|
|
316
|
+
changes: z.ZodObject<{
|
|
317
|
+
toolInfo: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
318
|
+
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
319
|
+
tool: z.ZodObject<{
|
|
320
|
+
name: z.ZodString;
|
|
321
|
+
description: z.ZodOptional<z.ZodString>;
|
|
322
|
+
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
323
|
+
}, z.core.$strip>;
|
|
324
|
+
}, z.core.$strict>>>;
|
|
325
|
+
theme: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
|
|
326
|
+
light: "light";
|
|
327
|
+
dark: "dark";
|
|
328
|
+
}>>>;
|
|
329
|
+
displayMode: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
|
|
330
|
+
inline: "inline";
|
|
331
|
+
fullscreen: "fullscreen";
|
|
332
|
+
pip: "pip";
|
|
333
|
+
}>>>;
|
|
334
|
+
viewport: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
335
|
+
width: z.ZodNumber;
|
|
336
|
+
height: z.ZodNumber;
|
|
337
|
+
maxHeight: z.ZodOptional<z.ZodNumber>;
|
|
338
|
+
maxWidth: z.ZodOptional<z.ZodNumber>;
|
|
339
|
+
}, z.core.$strict>>>;
|
|
340
|
+
locale: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
341
|
+
timeZone: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
342
|
+
platform: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
|
|
343
|
+
web: "web";
|
|
344
|
+
desktop: "desktop";
|
|
345
|
+
mobile: "mobile";
|
|
346
|
+
}>>>;
|
|
347
|
+
deviceCapabilities: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
348
|
+
touch: z.ZodOptional<z.ZodBoolean>;
|
|
349
|
+
hover: z.ZodOptional<z.ZodBoolean>;
|
|
350
|
+
}, z.core.$strict>>>;
|
|
351
|
+
safeAreaInsets: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
352
|
+
top: z.ZodNumber;
|
|
353
|
+
right: z.ZodNumber;
|
|
354
|
+
bottom: z.ZodNumber;
|
|
355
|
+
left: z.ZodNumber;
|
|
356
|
+
}, z.core.$strict>>>;
|
|
357
|
+
}, z.core.$strict>;
|
|
358
|
+
}, z.core.$strict>;
|
|
359
|
+
/**
|
|
360
|
+
* Open link params schema.
|
|
361
|
+
*/
|
|
362
|
+
export declare const McpUiOpenLinkParamsSchema: z.ZodObject<{
|
|
363
|
+
url: z.ZodString;
|
|
364
|
+
}, z.core.$strict>;
|
|
365
|
+
/**
|
|
366
|
+
* Message params schema.
|
|
367
|
+
*/
|
|
368
|
+
export declare const McpUiMessageParamsSchema: z.ZodObject<{
|
|
369
|
+
content: z.ZodString;
|
|
370
|
+
}, z.core.$strict>;
|
|
371
|
+
/**
|
|
372
|
+
* MCP Apps extension capability schema.
|
|
373
|
+
*/
|
|
374
|
+
export declare const McpAppsExtensionCapabilitySchema: z.ZodObject<{
|
|
375
|
+
mimeTypes: z.ZodArray<z.ZodLiteral<"text/html+mcp">>;
|
|
376
|
+
}, z.core.$strict>;
|
|
377
|
+
/**
|
|
378
|
+
* Tool UI metadata schema.
|
|
379
|
+
*/
|
|
380
|
+
export declare const ToolUIMetaSchema: z.ZodObject<{
|
|
381
|
+
'ui/resourceUri': z.ZodOptional<z.ZodString>;
|
|
382
|
+
'ui/mimeType': z.ZodOptional<z.ZodLiteral<"text/html+mcp">>;
|
|
383
|
+
}, z.core.$loose>;
|
|
384
|
+
/**
|
|
385
|
+
* Validate a UI resource URI.
|
|
386
|
+
*/
|
|
387
|
+
export declare function isValidUIResourceUri(uri: string): boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Validate MCP Apps protocol version.
|
|
390
|
+
*/
|
|
391
|
+
export declare function isValidProtocolVersion(version: string): boolean;
|
|
392
|
+
/**
|
|
393
|
+
* Parse and validate UI resource.
|
|
394
|
+
*/
|
|
395
|
+
export declare function parseUIResource(data: unknown): z.infer<typeof UIResourceSchema> | null;
|
|
396
|
+
/**
|
|
397
|
+
* Parse and validate host context.
|
|
398
|
+
*/
|
|
399
|
+
export declare function parseHostContext(data: unknown): z.infer<typeof McpAppsHostContextSchema> | null;
|
|
400
|
+
/**
|
|
401
|
+
* Default protocol version.
|
|
402
|
+
*/
|
|
403
|
+
export declare const DEFAULT_PROTOCOL_VERSION: "2025-01-01";
|