@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.options.js","sourceRoot":"","sources":["../../../../../src/common/types/options/auth.options.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kCAA6E;AAsGhE,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,EAAE,EAAE,OAAC,CAAC,MA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GAAG,OAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC/D,+BAAuB,CAAC,MAAM,CAAC,sBAAsB,CAAC;IACtD,8BAAsB,CAAC,MAAM,CAAC,sBAAsB,CAAC;CACtD,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { JSONWebKeySet, jsonWebKeySetSchema, JWK, jwkSchema } from '../auth';\nimport { RawZodShape } from '../common.types';\n\nexport type RemoteAuthOptions = {\n type: 'remote';\n\n /**\n * unique id for the provider\n */\n id?: string;\n /**\n * human-readable name for the provider\n */\n name: string;\n /**\n * base url of the provider\n * if the provider does not support dcr it will be used with local auth provider proxy\n * to register client dynamically you have to provide client id for the registration flow\n * @example https://my-company.frontegg.com\n */\n baseUrl: string;\n\n /**\n * enable dynamic client registration (DCR) flow, if your provider does not support DCR\n * you can set this to false and provide clientId for authorization flow, we will use local auth provider proxy\n * to register a dynamic client with the provided clientId or by called clientId function with client info\n * by default, the provider will use the registration endpoint to register the client dynamically\n */\n dcrEnabled?: boolean;\n\n /**\n * Only used if your auth provider does not support DCR.\n * for Dcr auth provider the client id acquired by the registration flow\n */\n clientId?: string | ((clientInfo: { clientId: string }) => string);\n\n /**\n * Set default gateway oauth server mode, this will be overridden by discovery flow.\n * if set to transparent and the discovery flow detect orchestrated mode it will switch to orchestrated mode\n * @default 'transparent'\n */\n mode?: 'orchestrated' | 'transparent';\n\n /**\n * allow anonymous access to the provider\n * @default false - allowing anonymous access will make the provider to issue an orchestrated token\n */\n allowAnonymous?: boolean;\n\n /**\n * allow consent mode to select tools/resource/prompts after authorization\n * for scoped based access token\n * @default false - allowing anonymous access will make the provider to issue an orchestrated token\n */\n consent?: boolean;\n\n\n /**\n * scopes for the token endpoint\n * @default undefined - all scopes supported by th provider\n */\n scopes?: string[];\n /**\n * authorization provider supported grant types, currently only authorization_code and refresh_token are supported\n * @default undefined - default is what presented in the /.well-known/oauth-authorization-server\n */\n grantTypes?: ('authorization_code' | 'refresh_token')[];\n\n /**\n * authorization endpoint for the provider\n * @default undefined - default is what presented in the /.well-known/oauth-authorization-server\n */\n authEndpoint?: string;\n /**\n * token endpoint for the provider\n * @default undefined - default is what presented in the /.well-known/oauth-authorization-server\n */\n tokenEndpoint?: string;\n /**\n * registration endpoint for the provider (DCR)\n * @default undefined - default is what presented in the /.well-known/oauth-authorization-server\n */\n registrationEndpoint?: string;\n /**\n * user info endpoint for the provider\n * @default undefined - default is what presented in the /.well-known/oauth-authorization-server\n */\n userInfoEndpoint?: string;\n\n /**\n * Inline JWKS for the provider to verify tokens without automatic fetching\n * @default undefined - default is what presented in the /.well-known/jwks.json\n */\n jwks?: JSONWebKeySet;\n\n /**\n * jwks uri for the provider\n * @default undefined - default is what presented in the /.well-known/oauth-authorization-server\n */\n jwksUri?: string;\n};\n\nexport const remoteAuthOptionsSchema = z.object({\n type: z.literal('remote'),\n id: z.string().optional(),\n name: z.string(),\n baseUrl: z.string(),\n dcrEnabled: z.boolean().optional(),\n clientId: z\n .union([\n z.string(),\n z.function().args(z.object({ clientId: z.string() })).returns(z.string())])\n .optional(),\n mode: z.union([z.literal('orchestrated'), z.literal('transparent')]).optional(),\n allowAnonymous: z.boolean().optional(),\n consent: z.boolean().optional(),\n jwks: jsonWebKeySetSchema.optional(),\n scopes: z.array(z.string()).optional(),\n grantTypes: z.array(z.union([z.literal('authorization_code'), z.literal('refresh_token')])).optional(),\n authEndpoint: z.string().optional(),\n tokenEndpoint: z.string().optional(),\n registrationEndpoint: z.string().optional(),\n userInfoEndpoint: z.string().optional(),\n jwksUri: z.string().optional(),\n} satisfies RawZodShape<RemoteAuthOptions>);\n\nexport type LocalAuthOptions = {\n type: 'local';\n\n /**\n * unique id for the provider\n */\n id: string;\n\n /**\n * human-readable name for the provider\n */\n name: string;\n\n /**\n * scopes for the token endpoint\n * @default undefined - all scopes supported by th provider\n */\n scopes?: string[];\n /**\n * currently only authorization_code and refresh_token are supported\n * @default ['authorization_code', 'refresh_token']\n */\n grantTypes?: ('authorization_code' | 'refresh_token')[];\n\n /**\n * allow anonymous access to the provider\n * in this case the provider will act as an authorization server\n * @default true\n */\n allowAnonymous?: boolean;\n\n /**\n * allow consent mode to select tools/resource/prompts after authorization\n * for scoped based access token\n * @default false - allowing anonymous access will make the provider to issue an orchestrated token\n */\n consent?: boolean;\n\n /**\n * Inline JWKS for the provider to verify tokens for local provider\n * it will also used in /.well-known/jwks.json\n * @default undefined - default is auto generated keys and saved in the temp folder\n */\n jwks?: JSONWebKeySet;\n\n /**\n * private key signing tokens for local provider\n * @default undefined - default is auto generated keys and saved in the temp folder\n */\n signKey?: JWK | Uint8Array;\n\n};\n\n\nexport const localAuthOptionsSchema = z.object({\n type: z.literal('local'),\n id: z.string(),\n name: z.string(),\n scopes: z.array(z.string()).optional(),\n grantTypes: z.array(z.union([z.literal('authorization_code'), z.literal('refresh_token')])).optional(),\n allowAnonymous: z.boolean().optional(),\n consent: z.boolean().optional(),\n jwks: jsonWebKeySetSchema.optional(),\n signKey: jwkSchema.or(z.instanceof(Uint8Array)).optional(),\n} satisfies RawZodShape<LocalAuthOptions>);\n\n\nexport const authOptionsSchema = z.discriminatedUnion('type', [\n remoteAuthOptionsSchema,\n localAuthOptionsSchema,\n]);\n\nexport type AuthOptions = RemoteAuthOptions | LocalAuthOptions;\n\n\ntype StandaloneOption = {\n /**\n * if the provider is standalone or not, if standalone it will register an oauth service provider\n * on app's entry path, if not standalone it will be registered as a child provider\n * under the root provider\n * @default false\n */\n standalone?: boolean;\n\n /**\n * if the provider should be excluded from the parent provider's discovery\n * this used for standalone providers\n * @default false\n */\n excludeFromParent?: boolean;\n};\n\nconst standaloneOptionSchema = {\n standalone: z.boolean().optional(),\n excludeFromParent: z.boolean().optional(),\n} satisfies RawZodShape<StandaloneOption>;\n\nexport const appAuthOptionsSchema = z.discriminatedUnion('type', [\n remoteAuthOptionsSchema.extend(standaloneOptionSchema),\n localAuthOptionsSchema.extend(standaloneOptionSchema),\n]);\n\n\nexport type AppAuthOptions = (RemoteAuthOptions | LocalAuthOptions) & StandaloneOption;"]}
|
|
1
|
+
{"version":3,"file":"auth.options.js","sourceRoot":"","sources":["../../../../../src/common/types/options/auth.options.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;AAyuBvC,4CAEC;AAKD,oCAEC;AAKD,8CAEC;AAKD,gDAEC;AAKD,kDAEC;AAKD,oDAEC;AAKD,gDAKC;AAtxBD,6BAAwB;AACxB,kCAA6E;AAE7E,2FAA+F;AAE/F,+CAA+C;AAC/C,iBAAiB;AACjB,+CAA+C;AAE/C;;GAEG;AACU,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C;;;OAGG;IACH,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IAEtE;;;OAGG;IACH,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IAExE;;;OAGG;IACH,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CAClC,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C;;;OAGG;IACH,OAAO,EAAE,gBAAS,CAAC,EAAE,CAAC,OAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE;IAE1D;;;OAGG;IACH,IAAI,EAAE,0BAAmB,CAAC,QAAQ,EAAE;IAEpC;;;OAGG;IACH,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH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sB,CAAC;CACxD,CAAC,CAAC;AAKH,+CAA+C;AAC/C,mBAAmB;AACnB,+CAA+C;AAE/C;;GAEG;AACH,SAAgB,gBAAgB,CAAC,KAAuB;IACtD,OAAO,yBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,SAAgB,YAAY,CAAC,OAAuC;IAClE,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAAC,OAAuC;IACvE,OAAO,OAAO,CAAC,IAAI,KAAK,aAAa,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,OAAuC;IACxE,OAAO,OAAO,CAAC,IAAI,KAAK,cAAc,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CAAC,OAAgC;IAClE,OAAO,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAAC,OAAgC;IACnE,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,OAAoB;IACrD,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3C,IAAI,OAAO,CAAC,IAAI,KAAK,aAAa;QAAE,OAAO,OAAO,CAAC,cAAc,CAAC;IAClE,IAAI,OAAO,CAAC,IAAI,KAAK,cAAc;QAAE,OAAO,OAAO,CAAC,kBAAkB,CAAC;IACvE,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// common/types/options/auth.options.ts\n\nimport { z } from 'zod';\nimport { JSONWebKeySet, jsonWebKeySetSchema, JWK, jwkSchema } from '../auth';\nimport { RawZodShape } from '../common.types';\nimport { RedisConfig, redisConfigSchema } from '../../../auth/session/transport-session.types';\n\n// ============================================\n// SHARED SCHEMAS\n// ============================================\n\n/**\n * Public access configuration for tools/prompts\n */\nexport const publicAccessConfigSchema = z.object({\n /**\n * Allow all tools or explicit whitelist\n * @default 'all'\n */\n tools: z.union([z.literal('all'), z.array(z.string())]).default('all'),\n\n /**\n * Allow all prompts or explicit whitelist\n * @default 'all'\n */\n prompts: z.union([z.literal('all'), z.array(z.string())]).default('all'),\n\n /**\n * Rate limit per IP per minute\n * @default 60\n */\n rateLimit: z.number().default(60),\n});\n\n/**\n * Local signing configuration (for orchestrated local type)\n */\nexport const localSigningConfigSchema = z.object({\n /**\n * Private key for signing orchestrated tokens\n * @default auto-generated\n */\n signKey: jwkSchema.or(z.instanceof(Uint8Array)).optional(),\n\n /**\n * JWKS for token verification\n * @default auto-generated\n */\n jwks: jsonWebKeySetSchema.optional(),\n\n /**\n * Issuer identifier for orchestrated tokens\n * @default auto-derived from server URL\n */\n issuer: z.string().optional(),\n});\n\n/**\n * Remote OAuth provider configuration (for orchestrated remote and transparent)\n */\nexport const remoteProviderConfigSchema = z.object({\n /**\n * OAuth provider base URL\n * @example 'https://auth.example.com'\n */\n provider: z.string().url(),\n\n /**\n * Provider display name\n */\n name: z.string().optional(),\n\n /**\n * Unique identifier for this provider\n * @default derived from provider URL\n */\n id: z.string().optional(),\n\n /**\n * Inline JWKS for offline token verification\n * Falls back to fetching from provider's /.well-known/jwks.json\n */\n jwks: jsonWebKeySetSchema.optional(),\n\n /**\n * Custom JWKS URI if not at standard path\n */\n jwksUri: z.string().url().optional(),\n\n /**\n * Client ID for this MCP server (for orchestrated mode)\n */\n clientId: z.string().optional(),\n\n /**\n * Client secret (for confidential clients in orchestrated mode)\n */\n clientSecret: z.string().optional(),\n\n /**\n * Scopes to request from the upstream provider\n */\n scopes: z.array(z.string()).optional(),\n\n /**\n * Enable Dynamic Client Registration (DCR)\n * @default false\n */\n dcrEnabled: z.boolean().default(false),\n\n /**\n * Authorization endpoint override\n */\n authEndpoint: z.string().url().optional(),\n\n /**\n * Token endpoint override\n */\n tokenEndpoint: z.string().url().optional(),\n\n /**\n * Registration endpoint override (for DCR)\n */\n registrationEndpoint: z.string().url().optional(),\n\n /**\n * User info endpoint override\n */\n userInfoEndpoint: z.string().url().optional(),\n});\n\n/**\n * Token storage configuration for orchestrated mode\n */\nexport const tokenStorageConfigSchema = z.discriminatedUnion('type', [\n z.object({ type: z.literal('memory') }),\n z.object({ type: z.literal('redis'), config: redisConfigSchema }),\n]);\n\n/**\n * Token refresh configuration\n */\nexport const tokenRefreshConfigSchema = z.object({\n /**\n * Enable automatic token refresh\n * @default true\n */\n enabled: z.boolean().default(true),\n\n /**\n * Refresh token before expiry by this many seconds\n * @default 60\n */\n skewSeconds: z.number().default(60),\n});\n\n/**\n * Behavior when a tool from a skipped (not yet authorized) app is called\n */\nexport const skippedAppBehaviorSchema = z.enum(['anonymous', 'require-auth']);\n\n/**\n * Consent configuration for tool selection\n * Allows users to choose which MCP tools to expose to the LLM\n *\n * Note: This schema is the canonical definition. It is duplicated in\n * auth/consent/consent.types.ts for domain-specific use. Both schemas\n * MUST be kept in sync. The duplication exists to avoid circular\n * dependencies between common/ and auth/ modules.\n */\nexport const consentConfigSchema = z.object({\n /**\n * Enable consent flow for tool selection\n * When enabled, users can choose which tools to expose to the LLM\n * @default false\n */\n enabled: z.boolean().default(false),\n\n /**\n * Group tools by app in the consent UI\n * @default true\n */\n groupByApp: z.boolean().default(true),\n\n /**\n * Show tool descriptions in consent UI\n * @default true\n */\n showDescriptions: z.boolean().default(true),\n\n /**\n * Allow selecting all tools at once\n * @default true\n */\n allowSelectAll: z.boolean().default(true),\n\n /**\n * Require at least one tool to be selected\n * @default true\n */\n requireSelection: z.boolean().default(true),\n\n /**\n * Custom message to display on consent page\n */\n customMessage: z.string().optional(),\n\n /**\n * Remember consent for future sessions\n * @default true\n */\n rememberConsent: z.boolean().default(true),\n\n /**\n * Tools to exclude from consent (always available)\n * Useful for essential tools that should always be accessible\n */\n excludedTools: z.array(z.string()).optional(),\n\n /**\n * Tools to always include in consent (pre-selected)\n */\n defaultSelectedTools: z.array(z.string()).optional(),\n});\n\n/**\n * Progressive/Incremental authorization configuration\n * Allows users to authorize apps one at a time after initial auth\n */\nexport const incrementalAuthConfigSchema = z.object({\n /**\n * Enable incremental (progressive) authorization\n * When enabled, users can skip app authorizations during initial auth\n * and authorize individual apps later when needed\n * @default true\n */\n enabled: z.boolean().default(true),\n\n /**\n * Behavior when a tool from a skipped app is called\n * - 'anonymous': If app supports anonymous access, use it; otherwise require auth\n * - 'require-auth': Always require authorization (return auth_url)\n * @default 'anonymous'\n */\n skippedAppBehavior: skippedAppBehaviorSchema.default('anonymous'),\n\n /**\n * Allow users to skip app authorization during initial auth flow\n * @default true\n */\n allowSkip: z.boolean().default(true),\n\n /**\n * Show all apps in a single authorization page (vs step-by-step)\n * @default true\n */\n showAllAppsAtOnce: z.boolean().default(true),\n});\n\n// ============================================\n// TRANSPORT CONFIG\n// Protocol enablement and behavior settings\n// ============================================\n\n/**\n * Transport protocol configuration\n * Controls which transport protocols are enabled and their behavior\n */\nexport const transportConfigSchema = z.object({\n /**\n * Enable legacy SSE transport (old HTTP+SSE protocol)\n * @default false\n */\n enableLegacySSE: z.boolean().default(false),\n\n /**\n * Enable SSE listener for server-initiated messages (GET /mcp with Accept: text/event-stream)\n * @default true\n */\n enableSseListener: z.boolean().default(true),\n\n /**\n * Enable streamable HTTP transport (POST with SSE response)\n * @default true\n */\n enableStreamableHttp: z.boolean().default(true),\n\n /**\n * Enable stateless HTTP mode (requests without session ID)\n * When enabled, allows requests without prior initialize\n * Uses shared singleton transport for anonymous, per-token singleton for authenticated\n * @default false\n */\n enableStatelessHttp: z.boolean().default(false),\n\n /**\n * Enable stateful HTTP transport (JSON-only responses)\n * @default false\n */\n enableStatefulHttp: z.boolean().default(false),\n\n /**\n * Require session ID for streamable HTTP (non-stateless mode)\n * When false, streamable HTTP requests don't require prior initialize\n * @default true\n */\n requireSessionForStreamable: z.boolean().default(true),\n});\n\n// ============================================\n// PUBLIC MODE\n// No authentication required, anonymous access\n// ============================================\n\nexport const publicAuthOptionsSchema = z.object({\n mode: z.literal('public'),\n\n /**\n * Issuer identifier for anonymous JWTs\n * @default auto-derived from server URL\n */\n issuer: z.string().optional(),\n\n /**\n * Anonymous session TTL in seconds\n * @default 3600 (1 hour)\n */\n sessionTtl: z.number().default(3600),\n\n /**\n * Scopes granted to anonymous sessions\n * @default ['anonymous']\n */\n anonymousScopes: z.array(z.string()).default(['anonymous']),\n\n /**\n * Tool/prompt access configuration for anonymous users\n */\n publicAccess: publicAccessConfigSchema.optional(),\n\n /**\n * JWKS for token verification\n * @default auto-generated\n */\n jwks: jsonWebKeySetSchema.optional(),\n\n /**\n * Private key for signing anonymous tokens\n * @default auto-generated\n */\n signKey: jwkSchema.or(z.instanceof(Uint8Array)).optional(),\n\n /**\n * Transport protocol configuration\n * Controls which transports are enabled and their behavior\n */\n transport: transportConfigSchema.optional(),\n});\n\n// ============================================\n// TRANSPARENT MODE\n// Pass-through OAuth tokens from remote provider\n// ============================================\n\nexport const transparentAuthOptionsSchema = z.object({\n mode: z.literal('transparent'),\n\n /**\n * Remote OAuth provider configuration (required)\n */\n remote: remoteProviderConfigSchema,\n\n /**\n * Expected token audience\n * If not set, defaults to the resource URL\n */\n expectedAudience: z.union([z.string(), z.array(z.string())]).optional(),\n\n /**\n * Required scopes for access\n * Empty array means any valid token is accepted\n * @default []\n */\n requiredScopes: z.array(z.string()).default([]),\n\n /**\n * Allow anonymous fallback when no token is provided\n * @default false\n */\n allowAnonymous: z.boolean().default(false),\n\n /**\n * Scopes granted to anonymous sessions (when allowAnonymous=true)\n * @default ['anonymous']\n */\n anonymousScopes: z.array(z.string()).default(['anonymous']),\n\n /**\n * Public access config for anonymous users (when allowAnonymous=true)\n */\n publicAccess: publicAccessConfigSchema.optional(),\n\n /**\n * Transport protocol configuration\n * Controls which transports are enabled and their behavior\n */\n transport: transportConfigSchema.optional(),\n});\n\n// ============================================\n// ORCHESTRATED MODE\n// Local auth server that can proxy to remote or be fully local\n// ============================================\n\n/**\n * Orchestrated mode with local authentication only\n */\nexport const orchestratedLocalSchema = z.object({\n mode: z.literal('orchestrated'),\n type: z.literal('local'),\n\n /**\n * Local signing configuration\n */\n local: localSigningConfigSchema.optional(),\n\n /**\n * Token storage configuration\n * @default { type: 'memory' }\n */\n tokenStorage: tokenStorageConfigSchema.default({ type: 'memory' }),\n\n /**\n * Session storage mode\n * - 'stateful': Store sessions in Redis/memory, JWT contains only reference\n * - 'stateless': All state encrypted in JWT\n * @default 'stateful'\n */\n sessionMode: z.enum(['stateful', 'stateless']).default('stateful'),\n\n /**\n * Allow default public access for unauthenticated requests\n * When true: all tools are public by default, only tools marked with scopes require auth\n * When false: all tools require authentication by default\n * @default false\n */\n allowDefaultPublic: z.boolean().default(false),\n\n /**\n * Scopes granted to anonymous sessions (when allowDefaultPublic=true)\n * @default ['anonymous']\n */\n anonymousScopes: z.array(z.string()).default(['anonymous']),\n\n /**\n * Public access config (when allowDefaultPublic=true)\n */\n publicAccess: publicAccessConfigSchema.optional(),\n\n /**\n * Consent flow configuration for tool selection\n * Allows users to choose which MCP tools to expose to the LLM\n * @default { enabled: false }\n */\n consent: consentConfigSchema.optional(),\n\n /**\n * Token refresh settings\n */\n refresh: tokenRefreshConfigSchema.optional(),\n\n /**\n * Expected token audience for validation\n */\n expectedAudience: z.union([z.string(), z.array(z.string())]).optional(),\n\n /**\n * Incremental (progressive) authorization configuration\n * Allows users to skip app authorizations initially and authorize later\n * @default { enabled: true, skippedAppBehavior: 'anonymous' }\n */\n incrementalAuth: incrementalAuthConfigSchema.optional(),\n\n /**\n * Transport protocol configuration\n * Controls which transports are enabled and their behavior\n */\n transport: transportConfigSchema.optional(),\n});\n\n/**\n * Orchestrated mode with remote OAuth provider\n */\nexport const orchestratedRemoteSchema = z.object({\n mode: z.literal('orchestrated'),\n type: z.literal('remote'),\n\n /**\n * Remote OAuth provider configuration (required for remote type)\n */\n remote: remoteProviderConfigSchema,\n\n /**\n * Local signing configuration (for issuing local tokens after upstream auth)\n */\n local: localSigningConfigSchema.optional(),\n\n /**\n * Token storage configuration\n * @default { type: 'memory' }\n */\n tokenStorage: tokenStorageConfigSchema.default({ type: 'memory' }),\n\n /**\n * Session storage mode\n * - 'stateful': Store sessions in Redis/memory, JWT contains only reference\n * - 'stateless': All state encrypted in JWT\n * @default 'stateful'\n */\n sessionMode: z.enum(['stateful', 'stateless']).default('stateful'),\n\n /**\n * Allow default public access for unauthenticated requests\n * When true: all tools are public by default, only tools marked with scopes require auth\n * When false: all tools require authentication by default\n * @default false\n */\n allowDefaultPublic: z.boolean().default(false),\n\n /**\n * Scopes granted to anonymous sessions (when allowDefaultPublic=true)\n * @default ['anonymous']\n */\n anonymousScopes: z.array(z.string()).default(['anonymous']),\n\n /**\n * Public access config (when allowDefaultPublic=true)\n */\n publicAccess: publicAccessConfigSchema.optional(),\n\n /**\n * Consent flow configuration for tool selection\n * Allows users to choose which MCP tools to expose to the LLM\n * @default { enabled: false }\n */\n consent: consentConfigSchema.optional(),\n\n /**\n * Token refresh settings\n */\n refresh: tokenRefreshConfigSchema.optional(),\n\n /**\n * Expected token audience for validation\n */\n expectedAudience: z.union([z.string(), z.array(z.string())]).optional(),\n\n /**\n * Incremental (progressive) authorization configuration\n * Allows users to skip app authorizations initially and authorize later\n * @default { enabled: true, skippedAppBehavior: 'anonymous' }\n */\n incrementalAuth: incrementalAuthConfigSchema.optional(),\n\n /**\n * Transport protocol configuration\n * Controls which transports are enabled and their behavior\n */\n transport: transportConfigSchema.optional(),\n});\n\n// Combined orchestrated schema\nexport const orchestratedAuthOptionsSchema = z.discriminatedUnion('type', [\n orchestratedLocalSchema,\n orchestratedRemoteSchema,\n]);\n\n// ============================================\n// UNIFIED AUTH OPTIONS\n// ============================================\n\n/**\n * Main auth options schema - discriminated by 'mode'\n *\n * Uses z.union because we have nested discriminators (orchestrated has 'type')\n */\nexport const authOptionsSchema = z.union([\n publicAuthOptionsSchema,\n transparentAuthOptionsSchema,\n orchestratedLocalSchema,\n orchestratedRemoteSchema,\n]);\n\n// ============================================\n// TYPE EXPORTS\n// ============================================\n\n/**\n * Public access configuration\n */\nexport type PublicAccessConfig = z.infer<typeof publicAccessConfigSchema>;\nexport type PublicAccessConfigInput = z.input<typeof publicAccessConfigSchema>;\n\n/**\n * Local signing configuration\n */\nexport type LocalSigningConfig = z.infer<typeof localSigningConfigSchema>;\nexport type LocalSigningConfigInput = z.input<typeof localSigningConfigSchema>;\n\n/**\n * Remote provider configuration\n */\nexport type RemoteProviderConfig = z.infer<typeof remoteProviderConfigSchema>;\nexport type RemoteProviderConfigInput = z.input<typeof remoteProviderConfigSchema>;\n\n/**\n * Token storage configuration\n */\nexport type TokenStorageConfig = z.infer<typeof tokenStorageConfigSchema>;\nexport type TokenStorageConfigInput = z.input<typeof tokenStorageConfigSchema>;\n\n/**\n * Token refresh configuration\n */\nexport type TokenRefreshConfig = z.infer<typeof tokenRefreshConfigSchema>;\nexport type TokenRefreshConfigInput = z.input<typeof tokenRefreshConfigSchema>;\n\n/**\n * Incremental (progressive) authorization configuration\n */\nexport type IncrementalAuthConfig = z.infer<typeof incrementalAuthConfigSchema>;\nexport type IncrementalAuthConfigInput = z.input<typeof incrementalAuthConfigSchema>;\n\n/**\n * Skipped app behavior type\n */\nexport type SkippedAppBehavior = z.infer<typeof skippedAppBehaviorSchema>;\n\n/**\n * Consent configuration for tool selection\n */\nexport type ConsentConfig = z.infer<typeof consentConfigSchema>;\nexport type ConsentConfigInput = z.input<typeof consentConfigSchema>;\n\n/**\n * Transport protocol configuration\n */\nexport type TransportConfig = z.infer<typeof transportConfigSchema>;\nexport type TransportConfigInput = z.input<typeof transportConfigSchema>;\n\n/**\n * Public mode options (output type with defaults applied)\n */\nexport type PublicAuthOptions = z.infer<typeof publicAuthOptionsSchema>;\nexport type PublicAuthOptionsInput = z.input<typeof publicAuthOptionsSchema>;\n\n/**\n * Transparent mode options (output type with defaults applied)\n */\nexport type TransparentAuthOptions = z.infer<typeof transparentAuthOptionsSchema>;\nexport type TransparentAuthOptionsInput = z.input<typeof transparentAuthOptionsSchema>;\n\n/**\n * Orchestrated local mode options\n */\nexport type OrchestratedLocalOptions = z.infer<typeof orchestratedLocalSchema>;\nexport type OrchestratedLocalOptionsInput = z.input<typeof orchestratedLocalSchema>;\n\n/**\n * Orchestrated remote mode options\n */\nexport type OrchestratedRemoteOptions = z.infer<typeof orchestratedRemoteSchema>;\nexport type OrchestratedRemoteOptionsInput = z.input<typeof orchestratedRemoteSchema>;\n\n/**\n * Orchestrated mode options (union of local and remote)\n */\nexport type OrchestratedAuthOptions = z.infer<typeof orchestratedAuthOptionsSchema>;\nexport type OrchestratedAuthOptionsInput = z.input<typeof orchestratedAuthOptionsSchema>;\n\n/**\n * Auth options (output type with defaults applied)\n * Use this type when working with parsed/validated options\n */\nexport type AuthOptions = z.infer<typeof authOptionsSchema>;\n\n/**\n * Auth options input (input type for user configuration)\n * Use this type for the @frontmcp configuration\n */\nexport type AuthOptionsInput = z.input<typeof authOptionsSchema>;\n\n/**\n * Authentication mode\n */\nexport type AuthMode = 'public' | 'transparent' | 'orchestrated';\n\n/**\n * Orchestrated type (local or remote)\n */\nexport type OrchestratedType = 'local' | 'remote';\n\n// ============================================\n// APP-LEVEL AUTH OPTIONS (with standalone)\n// ============================================\n\ntype StandaloneOption = {\n /**\n * If the provider is standalone, it will register an OAuth service provider\n * on app's entry path. If not standalone, it will be registered as a child\n * provider under the root provider.\n * @default false\n */\n standalone?: boolean;\n\n /**\n * If the provider should be excluded from the parent provider's discovery.\n * Used for standalone providers.\n * @default false\n */\n excludeFromParent?: boolean;\n};\n\nconst standaloneOptionSchema = {\n standalone: z.boolean().optional(),\n excludeFromParent: z.boolean().optional(),\n} satisfies RawZodShape<StandaloneOption>;\n\nexport const appAuthOptionsSchema = z.union([\n publicAuthOptionsSchema.extend(standaloneOptionSchema),\n transparentAuthOptionsSchema.extend(standaloneOptionSchema),\n orchestratedLocalSchema.extend(standaloneOptionSchema),\n orchestratedRemoteSchema.extend(standaloneOptionSchema),\n]);\n\nexport type AppAuthOptions = z.infer<typeof appAuthOptionsSchema>;\nexport type AppAuthOptionsInput = z.input<typeof appAuthOptionsSchema>;\n\n// ============================================\n// HELPER FUNCTIONS\n// ============================================\n\n/**\n * Parse and validate auth options with defaults\n */\nexport function parseAuthOptions(input: AuthOptionsInput): AuthOptions {\n return authOptionsSchema.parse(input);\n}\n\n/**\n * Check if options are public mode\n */\nexport function isPublicMode(options: AuthOptions | AuthOptionsInput): options is PublicAuthOptions {\n return options.mode === 'public';\n}\n\n/**\n * Check if options are transparent mode\n */\nexport function isTransparentMode(options: AuthOptions | AuthOptionsInput): options is TransparentAuthOptions {\n return options.mode === 'transparent';\n}\n\n/**\n * Check if options are orchestrated mode\n */\nexport function isOrchestratedMode(options: AuthOptions | AuthOptionsInput): options is OrchestratedAuthOptions {\n return options.mode === 'orchestrated';\n}\n\n/**\n * Check if orchestrated options are local type\n */\nexport function isOrchestratedLocal(options: OrchestratedAuthOptions): options is OrchestratedLocalOptions {\n return options.type === 'local';\n}\n\n/**\n * Check if orchestrated options are remote type\n */\nexport function isOrchestratedRemote(options: OrchestratedAuthOptions): options is OrchestratedRemoteOptions {\n return options.type === 'remote';\n}\n\n/**\n * Check if options allow public/anonymous access\n */\nexport function allowsPublicAccess(options: AuthOptions): boolean {\n if (options.mode === 'public') return true;\n if (options.mode === 'transparent') return options.allowAnonymous;\n if (options.mode === 'orchestrated') return options.allowDefaultPublic;\n return false;\n}\n"]}
|
|
@@ -10,13 +10,5 @@ export declare const httpOptionsSchema: z.ZodObject<{
|
|
|
10
10
|
port: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
11
11
|
entryPath: z.ZodDefault<z.ZodString>;
|
|
12
12
|
hostFactory: z.ZodOptional<z.ZodAny>;
|
|
13
|
-
},
|
|
14
|
-
port: number;
|
|
15
|
-
entryPath: string;
|
|
16
|
-
hostFactory?: any;
|
|
17
|
-
}, {
|
|
18
|
-
port?: number | undefined;
|
|
19
|
-
entryPath?: string | undefined;
|
|
20
|
-
hostFactory?: any;
|
|
21
|
-
}>;
|
|
13
|
+
}, z.core.$strip>;
|
|
22
14
|
export type HttpConfig = z.infer<typeof httpOptionsSchema>;
|
|
@@ -2,7 +2,11 @@ import { z } from 'zod';
|
|
|
2
2
|
import { LogTransportType } from '../../interfaces';
|
|
3
3
|
export declare enum LogLevel {
|
|
4
4
|
Debug = 0,
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated use 'Verbose' instead
|
|
7
|
+
*/
|
|
5
8
|
VERBOSE = 1,
|
|
9
|
+
Verbose = 1,
|
|
6
10
|
Info = 2,
|
|
7
11
|
Warn = 3,
|
|
8
12
|
Error = 4,
|
|
@@ -20,19 +24,9 @@ export type LoggingOptions = {
|
|
|
20
24
|
transports?: LogTransportType[];
|
|
21
25
|
};
|
|
22
26
|
export declare const loggingOptionsSchema: z.ZodObject<{
|
|
23
|
-
level: z.ZodDefault<z.ZodOptional<z.
|
|
27
|
+
level: z.ZodDefault<z.ZodOptional<z.ZodEnum<typeof LogLevel>>>;
|
|
24
28
|
prefix: z.ZodOptional<z.ZodString>;
|
|
25
29
|
enableConsole: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
26
|
-
transports: z.ZodDefault<z.ZodOptional<z.ZodArray<z.
|
|
27
|
-
},
|
|
28
|
-
level: LogLevel;
|
|
29
|
-
enableConsole: boolean;
|
|
30
|
-
transports: import("../../interfaces").Type<unknown>[];
|
|
31
|
-
prefix?: string | undefined;
|
|
32
|
-
}, {
|
|
33
|
-
level?: LogLevel | undefined;
|
|
34
|
-
enableConsole?: boolean | undefined;
|
|
35
|
-
prefix?: string | undefined;
|
|
36
|
-
transports?: import("../../interfaces").Type<unknown>[] | undefined;
|
|
37
|
-
}>;
|
|
30
|
+
transports: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodCustom<import("../../interfaces").Type<unknown>, import("../../interfaces").Type<unknown>>>>>;
|
|
31
|
+
}, z.core.$strip>;
|
|
38
32
|
export type LoggingConfigType = Omit<z.infer<typeof loggingOptionsSchema>, 'transports'>;
|
|
@@ -6,7 +6,11 @@ const schemas_1 = require("../../schemas");
|
|
|
6
6
|
var LogLevel;
|
|
7
7
|
(function (LogLevel) {
|
|
8
8
|
LogLevel[LogLevel["Debug"] = 0] = "Debug";
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated use 'Verbose' instead
|
|
11
|
+
*/
|
|
9
12
|
LogLevel[LogLevel["VERBOSE"] = 1] = "VERBOSE";
|
|
13
|
+
LogLevel[LogLevel["Verbose"] = 1] = "Verbose";
|
|
10
14
|
LogLevel[LogLevel["Info"] = 2] = "Info";
|
|
11
15
|
LogLevel[LogLevel["Warn"] = 3] = "Warn";
|
|
12
16
|
LogLevel[LogLevel["Error"] = 4] = "Error";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.options.js","sourceRoot":"","sources":["../../../../../src/common/types/options/logging.options.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAA8D;AAI9D,IAAY,
|
|
1
|
+
{"version":3,"file":"logging.options.js","sourceRoot":"","sources":["../../../../../src/common/types/options/logging.options.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAA8D;AAI9D,IAAY,QAWX;AAXD,WAAY,QAAQ;IAClB,yCAAS,CAAA;IACT;;OAEG;IACH,6CAAW,CAAA;IACX,6CAAiB,CAAA;IACjB,uCAAQ,CAAA;IACR,uCAAQ,CAAA;IACR,yCAAS,CAAA;IACT,uCAAS,CAAA;AACX,CAAC,EAXW,QAAQ,wBAAR,QAAQ,QAWnB;AAEY,QAAA,YAAY,GAA6B;IACpD,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS;IAC7B,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;IACvB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;IACvB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK;CACtB,CAAC;AAaW,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,OAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC/D,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,aAAa,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACnD,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,uCAA6B,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CACpC,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { annotatedFrontMcpLoggerSchema } from '../../schemas';\nimport { LogTransportType } from '../../interfaces';\nimport { RawZodShape } from '../common.types';\n\nexport enum LogLevel {\n Debug = 0,\n /**\n * @deprecated use 'Verbose' instead\n */\n VERBOSE = 1,\n Verbose = VERBOSE,\n Info = 2,\n Warn = 3,\n Error = 4,\n Off = 100, // never log\n}\n\nexport const LogLevelName: Record<LogLevel, string> = {\n [LogLevel.Debug]: 'debug',\n [LogLevel.VERBOSE]: 'verbose',\n [LogLevel.Info]: 'info',\n [LogLevel.Warn]: 'warn',\n [LogLevel.Error]: 'error',\n [LogLevel.Off]: 'off',\n};\n\nexport type LoggingOptions = {\n level?: LogLevel; // default to 'info'\n enableConsole?: boolean;\n prefix?: string;\n /**\n * Additional custom LogTransport types to register.\n * @default []\n */\n transports?: LogTransportType[];\n};\n\nexport const loggingOptionsSchema = z.object({\n level: z.nativeEnum(LogLevel).optional().default(LogLevel.Info),\n prefix: z.string().optional(),\n enableConsole: z.boolean().optional().default(true),\n transports: z.array(annotatedFrontMcpLoggerSchema).optional().default([]),\n} satisfies RawZodShape<LoggingOptions>);\n\nexport type LoggingConfigType = Omit<z.infer<typeof loggingOptionsSchema>, 'transports'>;\n"]}
|
|
@@ -15,34 +15,6 @@ export declare const serverInfoOptionsSchema: z.ZodObject<{
|
|
|
15
15
|
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
16
16
|
src: z.ZodString;
|
|
17
17
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
18
|
-
sizes: z.ZodOptional<z.ZodArray<z.ZodString
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
mimeType?: string | undefined;
|
|
22
|
-
sizes?: string[] | undefined;
|
|
23
|
-
}, {
|
|
24
|
-
src: string;
|
|
25
|
-
mimeType?: string | undefined;
|
|
26
|
-
sizes?: string[] | undefined;
|
|
27
|
-
}>, "many">>;
|
|
28
|
-
}, "strip", z.ZodTypeAny, {
|
|
29
|
-
name: string;
|
|
30
|
-
version: string;
|
|
31
|
-
title?: string | undefined;
|
|
32
|
-
icons?: {
|
|
33
|
-
src: string;
|
|
34
|
-
mimeType?: string | undefined;
|
|
35
|
-
sizes?: string[] | undefined;
|
|
36
|
-
}[] | undefined;
|
|
37
|
-
websiteUrl?: string | undefined;
|
|
38
|
-
}, {
|
|
39
|
-
name: string;
|
|
40
|
-
version: string;
|
|
41
|
-
title?: string | undefined;
|
|
42
|
-
icons?: {
|
|
43
|
-
src: string;
|
|
44
|
-
mimeType?: string | undefined;
|
|
45
|
-
sizes?: string[] | undefined;
|
|
46
|
-
}[] | undefined;
|
|
47
|
-
websiteUrl?: string | undefined;
|
|
48
|
-
}>;
|
|
18
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
}, z.core.$strip>>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { AIPlatformType } from '../auth/session.types';
|
|
2
3
|
export type SessionMode = 'stateful' | 'stateless';
|
|
3
4
|
export type TransportIdMode = 'uuid' | 'jwt';
|
|
5
|
+
/**
|
|
6
|
+
* A single platform mapping entry for custom client-to-platform detection.
|
|
7
|
+
*/
|
|
8
|
+
export interface PlatformMappingEntry {
|
|
9
|
+
/** Pattern to match against clientInfo.name (string for exact match, RegExp for pattern) */
|
|
10
|
+
pattern: string | RegExp;
|
|
11
|
+
/** The platform type to assign when pattern matches */
|
|
12
|
+
platform: AIPlatformType;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Configuration for platform detection from MCP client info.
|
|
16
|
+
*/
|
|
17
|
+
export interface PlatformDetectionConfig {
|
|
18
|
+
/**
|
|
19
|
+
* Custom mappings to check before default detection.
|
|
20
|
+
* Mappings are evaluated in order; first match wins.
|
|
21
|
+
*/
|
|
22
|
+
mappings?: PlatformMappingEntry[];
|
|
23
|
+
/**
|
|
24
|
+
* If true, skip default detection when no custom mapping matches.
|
|
25
|
+
* The platform will be 'unknown' instead of attempting keyword-based detection.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
customOnly?: boolean;
|
|
29
|
+
}
|
|
4
30
|
export type SessionOptions = {
|
|
5
31
|
/**
|
|
6
32
|
* Defines how the session lifecycle and nested tokens are managed.
|
|
@@ -42,7 +68,7 @@ export type SessionOptions = {
|
|
|
42
68
|
* - For distributed systems, verification is optimized by checking if the session is already
|
|
43
69
|
* verified by an existing live transport ID. This allows fast validation when multiple
|
|
44
70
|
* transports are connected to a shared queue (high-availability setup).
|
|
45
|
-
* - If the JWT
|
|
71
|
+
* - If the JWT's transport ID is not found on the current worker node, the system attempts
|
|
46
72
|
* to connect to the corresponding remote transport in the distributed infrastructure.
|
|
47
73
|
*
|
|
48
74
|
* - When using `'uuid'`:
|
|
@@ -54,14 +80,68 @@ export type SessionOptions = {
|
|
|
54
80
|
* @default 'uuid'
|
|
55
81
|
*/
|
|
56
82
|
transportIdMode?: TransportIdMode | ((issuer: string) => Promise<TransportIdMode> | TransportIdMode);
|
|
83
|
+
/**
|
|
84
|
+
* Configuration for detecting the AI platform from MCP client info.
|
|
85
|
+
* Allows custom mappings to override or supplement the default keyword-based detection.
|
|
86
|
+
*/
|
|
87
|
+
platformDetection?: PlatformDetectionConfig;
|
|
57
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* Zod schema for platform mapping entry.
|
|
91
|
+
* Note: RegExp cannot be validated by zod, so we use passthrough for pattern.
|
|
92
|
+
*/
|
|
93
|
+
export declare const platformMappingEntrySchema: z.ZodObject<{
|
|
94
|
+
pattern: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<RegExp, RegExp>]>;
|
|
95
|
+
platform: z.ZodEnum<{
|
|
96
|
+
unknown: "unknown";
|
|
97
|
+
continue: "continue";
|
|
98
|
+
openai: "openai";
|
|
99
|
+
claude: "claude";
|
|
100
|
+
gemini: "gemini";
|
|
101
|
+
cursor: "cursor";
|
|
102
|
+
cody: "cody";
|
|
103
|
+
"generic-mcp": "generic-mcp";
|
|
104
|
+
"ext-apps": "ext-apps";
|
|
105
|
+
}>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
/**
|
|
108
|
+
* Zod schema for platform detection configuration.
|
|
109
|
+
*/
|
|
110
|
+
export declare const platformDetectionConfigSchema: z.ZodObject<{
|
|
111
|
+
mappings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
112
|
+
pattern: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<RegExp, RegExp>]>;
|
|
113
|
+
platform: z.ZodEnum<{
|
|
114
|
+
unknown: "unknown";
|
|
115
|
+
continue: "continue";
|
|
116
|
+
openai: "openai";
|
|
117
|
+
claude: "claude";
|
|
118
|
+
gemini: "gemini";
|
|
119
|
+
cursor: "cursor";
|
|
120
|
+
cody: "cody";
|
|
121
|
+
"generic-mcp": "generic-mcp";
|
|
122
|
+
"ext-apps": "ext-apps";
|
|
123
|
+
}>;
|
|
124
|
+
}, z.core.$strip>>>;
|
|
125
|
+
customOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
126
|
+
}, z.core.$strip>;
|
|
58
127
|
export declare const sessionOptionsSchema: z.ZodObject<{
|
|
59
|
-
sessionMode: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"stateful">, z.ZodLiteral<"stateless">, z.ZodFunction<z.
|
|
60
|
-
transportIdMode: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"uuid">, z.ZodLiteral<"jwt">, z.ZodFunction<z.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
128
|
+
sessionMode: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"stateful">, z.ZodLiteral<"stateless">, z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>]>>>;
|
|
129
|
+
transportIdMode: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"uuid">, z.ZodLiteral<"jwt">, z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>]>>>;
|
|
130
|
+
platformDetection: z.ZodOptional<z.ZodObject<{
|
|
131
|
+
mappings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
132
|
+
pattern: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<RegExp, RegExp>]>;
|
|
133
|
+
platform: z.ZodEnum<{
|
|
134
|
+
unknown: "unknown";
|
|
135
|
+
continue: "continue";
|
|
136
|
+
openai: "openai";
|
|
137
|
+
claude: "claude";
|
|
138
|
+
gemini: "gemini";
|
|
139
|
+
cursor: "cursor";
|
|
140
|
+
cody: "cody";
|
|
141
|
+
"generic-mcp": "generic-mcp";
|
|
142
|
+
"ext-apps": "ext-apps";
|
|
143
|
+
}>;
|
|
144
|
+
}, z.core.$strip>>>;
|
|
145
|
+
customOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
146
|
+
}, z.core.$strip>>;
|
|
147
|
+
}, z.core.$strip>;
|
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sessionOptionsSchema = void 0;
|
|
3
|
+
exports.sessionOptionsSchema = exports.platformDetectionConfigSchema = exports.platformMappingEntrySchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const session_types_1 = require("../auth/session.types");
|
|
6
|
+
/**
|
|
7
|
+
* Zod schema for platform mapping entry.
|
|
8
|
+
* Note: RegExp cannot be validated by zod, so we use passthrough for pattern.
|
|
9
|
+
*/
|
|
10
|
+
exports.platformMappingEntrySchema = zod_1.z.object({
|
|
11
|
+
pattern: zod_1.z.union([zod_1.z.string(), zod_1.z.instanceof(RegExp)]),
|
|
12
|
+
platform: session_types_1.aiPlatformTypeSchema,
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Zod schema for platform detection configuration.
|
|
16
|
+
*/
|
|
17
|
+
exports.platformDetectionConfigSchema = zod_1.z.object({
|
|
18
|
+
mappings: zod_1.z.array(exports.platformMappingEntrySchema).optional(),
|
|
19
|
+
customOnly: zod_1.z.boolean().optional().default(false),
|
|
20
|
+
});
|
|
5
21
|
exports.sessionOptionsSchema = zod_1.z.object({
|
|
6
|
-
sessionMode: zod_1.z
|
|
7
|
-
|
|
22
|
+
sessionMode: zod_1.z
|
|
23
|
+
.union([zod_1.z.literal('stateful'), zod_1.z.literal('stateless'), zod_1.z.function()])
|
|
24
|
+
.optional()
|
|
25
|
+
.default('stateless'),
|
|
26
|
+
transportIdMode: zod_1.z
|
|
27
|
+
.union([zod_1.z.literal('uuid'), zod_1.z.literal('jwt'), zod_1.z.function()])
|
|
28
|
+
.optional()
|
|
29
|
+
.default('uuid'),
|
|
30
|
+
platformDetection: exports.platformDetectionConfigSchema.optional(),
|
|
8
31
|
});
|
|
9
32
|
//# sourceMappingURL=session.options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.options.js","sourceRoot":"","sources":["../../../../../src/common/types/options/session.options.ts"],"names":[],"mappings":";;;AACA,6BAAwB;
|
|
1
|
+
{"version":3,"file":"session.options.js","sourceRoot":"","sources":["../../../../../src/common/types/options/session.options.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AACxB,yDAA6E;AA6F7E;;;GAGG;AACU,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACpD,QAAQ,EAAE,oCAAoB;CAC/B,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,kCAA0B,CAAC,CAAC,QAAQ,EAAE;IACxD,UAAU,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CAClD,CAAC,CAAC;AAEU,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,WAAW,EAAE,OAAC;SACX,KAAK,CAAC,CAAC,OAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,OAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,OAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;SACpE,QAAQ,EAAE;SACV,OAAO,CAAC,WAAW,CAAC;IACvB,eAAe,EAAE,OAAC;SACf,KAAK,CAAC,CAAC,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC1D,QAAQ,EAAE;SACV,OAAO,CAAC,MAAM,CAAC;IAClB,iBAAiB,EAAE,qCAA6B,CAAC,QAAQ,EAAE;CACtB,CAAC,CAAC","sourcesContent":["import { RawZodShape } from '../common.types';\nimport { z } from 'zod';\nimport { AIPlatformType, aiPlatformTypeSchema } from '../auth/session.types';\n\nexport type SessionMode = 'stateful' | 'stateless';\nexport type TransportIdMode = 'uuid' | 'jwt';\n\n/**\n * A single platform mapping entry for custom client-to-platform detection.\n */\nexport interface PlatformMappingEntry {\n /** Pattern to match against clientInfo.name (string for exact match, RegExp for pattern) */\n pattern: string | RegExp;\n /** The platform type to assign when pattern matches */\n platform: AIPlatformType;\n}\n\n/**\n * Configuration for platform detection from MCP client info.\n */\nexport interface PlatformDetectionConfig {\n /**\n * Custom mappings to check before default detection.\n * Mappings are evaluated in order; first match wins.\n */\n mappings?: PlatformMappingEntry[];\n /**\n * If true, skip default detection when no custom mapping matches.\n * The platform will be 'unknown' instead of attempting keyword-based detection.\n * @default false\n */\n customOnly?: boolean;\n}\n\nexport type SessionOptions = {\n /**\n * Defines how the session lifecycle and nested tokens are managed.\n *\n * Modes:\n * - `'stateful'`: Session and nested tokens are stored in a server-side store (e.g., Redis).\n * - `'stateless'`: All session data (including nested tokens) is embedded within a signed/encrypted JWT.\n *\n * **Behavior:**\n * - When using `'stateful'`:\n * - Nested OAuth tokens are **never exposed** in the JWT.\n * - Tokens are encrypted and persisted in Redis under a session key.\n * - The client receives only a lightweight reference (session key) instead of full credentials.\n * - Results in smaller JWT payloads and reduces token leakage risk.\n * - Allows seamless refresh of nested provider tokens without requiring user re-authorization.\n * - Recommended for multi-application environments or setups using short-lived OAuth tokens.\n *\n * - When using `'stateless'`:\n * - Stores all nested tokens directly within the JWT, enabling fully client-managed sessions.\n * - Does **not support token refresh** — once a nested provider token expires, re-authorization is required.\n * - Simplifies implementation but may degrade UX when tokens are short-lived.\n * - Best suited for lightweight or single-application environments where token rotation is less critical.\n *\n * @default 'stateful'\n */\n sessionMode?: SessionMode | ((issuer: string) => Promise<SessionMode> | SessionMode);\n /**\n * Defines how the Transport ID is generated, verified, and used across sessions.\n *\n * Modes:\n * - `'uuid'`: Generates a random UUID per session.\n * - `'jwt'`: Uses a signed JWT for stateless sessions, signed with a generated session key.\n *\n * **Behavior: **\n * - When using `'jwt'`:\n * - Requires an active Redis connection to support distributed, stateless transport sessions.\n * - Each token is verified using a generated public key associated with the existing session.\n * - Enables access to a streamable HTTP transport session ID.\n * - For distributed systems, verification is optimized by checking if the session is already\n * verified by an existing live transport ID. This allows fast validation when multiple\n * transports are connected to a shared queue (high-availability setup).\n * - If the JWT's transport ID is not found on the current worker node, the system attempts\n * to connect to the corresponding remote transport in the distributed infrastructure.\n *\n * - When using `'uuid'`:\n * - Provides a strict, node-bound session transport (single-node mode).\n * - Each request verifies the `Authorization` header and searches for a matching transport ID\n * derived from the hashed authorization header and the generated transport UUID.\n * - If no matching transport ID is found, an error (`TransportNotInitialized`) is thrown.\n *\n * @default 'uuid'\n */\n transportIdMode?: TransportIdMode | ((issuer: string) => Promise<TransportIdMode> | TransportIdMode);\n\n /**\n * Configuration for detecting the AI platform from MCP client info.\n * Allows custom mappings to override or supplement the default keyword-based detection.\n */\n platformDetection?: PlatformDetectionConfig;\n};\n\n/**\n * Zod schema for platform mapping entry.\n * Note: RegExp cannot be validated by zod, so we use passthrough for pattern.\n */\nexport const platformMappingEntrySchema = z.object({\n pattern: z.union([z.string(), z.instanceof(RegExp)]),\n platform: aiPlatformTypeSchema,\n});\n\n/**\n * Zod schema for platform detection configuration.\n */\nexport const platformDetectionConfigSchema = z.object({\n mappings: z.array(platformMappingEntrySchema).optional(),\n customOnly: z.boolean().optional().default(false),\n});\n\nexport const sessionOptionsSchema = z.object({\n sessionMode: z\n .union([z.literal('stateful'), z.literal('stateless'), z.function()])\n .optional()\n .default('stateless'),\n transportIdMode: z\n .union([z.literal('uuid'), z.literal('jwt'), z.function()])\n .optional()\n .default('uuid'),\n platformDetection: platformDetectionConfigSchema.optional(),\n} satisfies RawZodShape<SessionOptions>);\n"]}
|
|
@@ -1,58 +1,20 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ServerRequest } from
|
|
3
|
-
export declare const intentSchema: z.ZodUnion<[z.ZodLiteral<"legacy-sse">, z.ZodLiteral<"sse">, z.ZodLiteral<"streamable-http">, z.ZodLiteral<"stateful-http">, z.ZodLiteral<"stateless-http">, z.ZodLiteral<"unknown">]>;
|
|
2
|
+
import { ServerRequest } from '../interfaces';
|
|
3
|
+
export declare const intentSchema: z.ZodUnion<readonly [z.ZodLiteral<"legacy-sse">, z.ZodLiteral<"sse">, z.ZodLiteral<"streamable-http">, z.ZodLiteral<"stateful-http">, z.ZodLiteral<"stateless-http">, z.ZodLiteral<"delete-session">, z.ZodLiteral<"unknown">]>;
|
|
4
4
|
export declare const decisionSchema: z.ZodObject<{
|
|
5
|
-
intent: z.ZodUnion<[z.ZodLiteral<"legacy-sse">, z.ZodLiteral<"sse">, z.ZodLiteral<"streamable-http">, z.ZodLiteral<"stateful-http">, z.ZodLiteral<"stateless-http">, z.ZodLiteral<"unknown">]>;
|
|
6
|
-
reasons: z.ZodArray<z.ZodString
|
|
5
|
+
intent: z.ZodUnion<readonly [z.ZodLiteral<"legacy-sse">, z.ZodLiteral<"sse">, z.ZodLiteral<"streamable-http">, z.ZodLiteral<"stateful-http">, z.ZodLiteral<"stateless-http">, z.ZodLiteral<"delete-session">, z.ZodLiteral<"unknown">]>;
|
|
6
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
7
7
|
recommendation: z.ZodOptional<z.ZodObject<{
|
|
8
8
|
httpStatus: z.ZodNumber;
|
|
9
9
|
message: z.ZodString;
|
|
10
|
-
},
|
|
11
|
-
message: string;
|
|
12
|
-
httpStatus: number;
|
|
13
|
-
}, {
|
|
14
|
-
message: string;
|
|
15
|
-
httpStatus: number;
|
|
16
|
-
}>>;
|
|
10
|
+
}, z.core.$strip>>;
|
|
17
11
|
debug: z.ZodOptional<z.ZodObject<{
|
|
18
12
|
key: z.ZodNumber;
|
|
19
13
|
channel: z.ZodNumber;
|
|
20
14
|
flags: z.ZodNumber;
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
flags: number;
|
|
25
|
-
}, {
|
|
26
|
-
key: number;
|
|
27
|
-
channel: number;
|
|
28
|
-
flags: number;
|
|
29
|
-
}>>;
|
|
30
|
-
}, "strip", z.ZodTypeAny, {
|
|
31
|
-
intent: "unknown" | "sse" | "legacy-sse" | "streamable-http" | "stateful-http" | "stateless-http";
|
|
32
|
-
reasons: string[];
|
|
33
|
-
recommendation?: {
|
|
34
|
-
message: string;
|
|
35
|
-
httpStatus: number;
|
|
36
|
-
} | undefined;
|
|
37
|
-
debug?: {
|
|
38
|
-
key: number;
|
|
39
|
-
channel: number;
|
|
40
|
-
flags: number;
|
|
41
|
-
} | undefined;
|
|
42
|
-
}, {
|
|
43
|
-
intent: "unknown" | "sse" | "legacy-sse" | "streamable-http" | "stateful-http" | "stateless-http";
|
|
44
|
-
reasons: string[];
|
|
45
|
-
recommendation?: {
|
|
46
|
-
message: string;
|
|
47
|
-
httpStatus: number;
|
|
48
|
-
} | undefined;
|
|
49
|
-
debug?: {
|
|
50
|
-
key: number;
|
|
51
|
-
channel: number;
|
|
52
|
-
flags: number;
|
|
53
|
-
} | undefined;
|
|
54
|
-
}>;
|
|
55
|
-
export type HttpRequestIntent = 'legacy-sse' | 'sse' | 'streamable-http' | 'stateful-http' | 'stateless-http';
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type HttpRequestIntent = 'legacy-sse' | 'sse' | 'streamable-http' | 'stateful-http' | 'stateless-http' | 'delete-session';
|
|
56
18
|
export type Intent = HttpRequestIntent | 'unknown';
|
|
57
19
|
export type Decision = {
|
|
58
20
|
intent: Intent;
|