@frontmcp/sdk 0.7.2 → 0.8.1
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/agent/adapters/adapter.factory.d.ts +27 -18
- package/agent/adapters/adapter.factory.d.ts.map +1 -1
- package/agent/agent.instance.d.ts +5 -0
- package/agent/agent.instance.d.ts.map +1 -1
- package/agent/agent.scope.d.ts +54 -72
- package/agent/agent.scope.d.ts.map +1 -1
- package/agent/flows/call-agent.flow.d.ts +1 -0
- package/agent/flows/call-agent.flow.d.ts.map +1 -1
- package/app/instances/app.local.instance.d.ts +3 -0
- package/app/instances/app.local.instance.d.ts.map +1 -1
- package/app/instances/app.remote.instance.d.ts +3 -0
- package/app/instances/app.remote.instance.d.ts.map +1 -1
- package/auth/auth.registry.d.ts.map +1 -1
- package/auth/authorization/authorization.types.d.ts +7 -180
- package/auth/authorization/authorization.types.d.ts.map +1 -1
- package/auth/authorization/index.d.ts +2 -0
- package/auth/authorization/index.d.ts.map +1 -1
- package/auth/authorization/orchestrated.accessor.d.ts +161 -0
- package/auth/authorization/orchestrated.accessor.d.ts.map +1 -0
- package/auth/authorization/orchestrated.authorization.d.ts +19 -4
- package/auth/authorization/orchestrated.authorization.d.ts.map +1 -1
- package/auth/authorization/orchestrated.context-extension.d.ts +108 -0
- package/auth/authorization/orchestrated.context-extension.d.ts.map +1 -0
- package/auth/cimd/index.d.ts +14 -0
- package/auth/cimd/index.d.ts.map +1 -0
- package/auth/flows/auth.verify.flow.d.ts.map +1 -1
- package/auth/flows/oauth.authorize.flow.d.ts +30 -3
- package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts +11 -3
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.provider-callback.flow.d.ts +118 -0
- package/auth/flows/oauth.provider-callback.flow.d.ts.map +1 -0
- package/auth/flows/oauth.register.flow.d.ts +1 -1
- package/auth/flows/oauth.token.flow.d.ts +1 -1
- package/auth/flows/session.verify.flow.d.ts +8 -0
- package/auth/flows/session.verify.flow.d.ts.map +1 -1
- package/auth/flows/well-known.jwks.flow.d.ts +3 -3
- package/auth/flows/well-known.oauth-authorization-server.flow.d.ts +3 -2
- package/auth/flows/well-known.oauth-authorization-server.flow.d.ts.map +1 -1
- package/auth/flows/well-known.prm.flow.d.ts +1 -1
- package/auth/instances/instance.local-primary-auth.d.ts +88 -1
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/auth/machine-id.d.ts +14 -0
- package/auth/machine-id.d.ts.map +1 -1
- package/auth/session/encrypted-authorization-vault.d.ts +2 -3
- package/auth/session/encrypted-authorization-vault.d.ts.map +1 -1
- package/auth/session/federated-auth.session.d.ts +252 -0
- package/auth/session/federated-auth.session.d.ts.map +1 -0
- package/auth/session/index.d.ts +6 -2
- package/auth/session/index.d.ts.map +1 -1
- package/auth/session/orchestrated-token.store.d.ts +155 -0
- package/auth/session/orchestrated-token.store.d.ts.map +1 -0
- package/auth/session/record/session.base.d.ts +7 -7
- package/auth/session/record/session.base.d.ts.map +1 -1
- package/auth/session/record/session.mcp.d.ts +11 -0
- package/auth/session/record/session.mcp.d.ts.map +1 -0
- package/auth/session/redis-session.store.d.ts +10 -5
- package/auth/session/redis-session.store.d.ts.map +1 -1
- package/auth/session/session-crypto.d.ts +6 -9
- package/auth/session/session-crypto.d.ts.map +1 -1
- package/{store/store.factory.d.ts → auth/session/session-store.factory.d.ts} +10 -36
- package/auth/session/session-store.factory.d.ts.map +1 -0
- package/auth/session/session.service.d.ts +4 -8
- package/auth/session/session.service.d.ts.map +1 -1
- package/auth/session/session.transport.d.ts +8 -2
- package/auth/session/session.transport.d.ts.map +1 -1
- package/auth/session/session.types.d.ts +5 -5
- package/auth/session/session.types.d.ts.map +1 -1
- package/auth/session/token.refresh.d.ts +1 -2
- package/auth/session/token.refresh.d.ts.map +1 -1
- package/auth/session/transport-session.manager.d.ts +7 -6
- package/auth/session/transport-session.manager.d.ts.map +1 -1
- package/auth/session/utils/session-id.utils.d.ts +18 -1
- package/auth/session/utils/session-id.utils.d.ts.map +1 -1
- package/auth/session/vercel-kv-session.store.d.ts +16 -16
- package/auth/session/vercel-kv-session.store.d.ts.map +1 -1
- package/auth/utils/authorization-id.utils.d.ts +12 -0
- package/auth/utils/authorization-id.utils.d.ts.map +1 -0
- package/auth/utils/index.d.ts +1 -2
- package/auth/utils/index.d.ts.map +1 -1
- package/auth/vault/auth-providers.accessor.d.ts +153 -0
- package/auth/vault/auth-providers.accessor.d.ts.map +1 -0
- package/auth/vault/auth-providers.accessor.impl.d.ts +52 -0
- package/auth/vault/auth-providers.accessor.impl.d.ts.map +1 -0
- package/auth/vault/auth-providers.context-extension.d.ts +68 -0
- package/auth/vault/auth-providers.context-extension.d.ts.map +1 -0
- package/auth/vault/auth-providers.providers.d.ts +40 -0
- package/auth/vault/auth-providers.providers.d.ts.map +1 -0
- package/auth/vault/auth-providers.registry.d.ts +110 -0
- package/auth/vault/auth-providers.registry.d.ts.map +1 -0
- package/auth/vault/auth-providers.vault.d.ts +93 -0
- package/auth/vault/auth-providers.vault.d.ts.map +1 -0
- package/auth/vault/credential-cache.d.ts +13 -0
- package/auth/vault/credential-cache.d.ts.map +1 -0
- package/auth/vault/credential-loaders/eager-loader.d.ts +46 -0
- package/auth/vault/credential-loaders/eager-loader.d.ts.map +1 -0
- package/auth/vault/credential-loaders/index.d.ts +7 -0
- package/auth/vault/credential-loaders/index.d.ts.map +1 -0
- package/auth/vault/credential-loaders/lazy-loader.d.ts +53 -0
- package/auth/vault/credential-loaders/lazy-loader.d.ts.map +1 -0
- package/auth/vault/index.d.ts +56 -0
- package/auth/vault/index.d.ts.map +1 -0
- package/builtin/config/config-resolver.d.ts +162 -0
- package/builtin/config/config-resolver.d.ts.map +1 -0
- package/builtin/config/config.plugin.d.ts +63 -0
- package/builtin/config/config.plugin.d.ts.map +1 -0
- package/builtin/config/config.symbols.d.ts +7 -0
- package/builtin/config/config.symbols.d.ts.map +1 -0
- package/builtin/config/config.types.d.ts +71 -0
- package/builtin/config/config.types.d.ts.map +1 -0
- package/builtin/config/index.d.ts +68 -0
- package/builtin/config/index.d.ts.map +1 -0
- package/builtin/config/providers/config-loader.d.ts +36 -0
- package/builtin/config/providers/config-loader.d.ts.map +1 -0
- package/builtin/config/providers/config.service.d.ts +108 -0
- package/builtin/config/providers/config.service.d.ts.map +1 -0
- package/builtin/config/providers/env-loader.d.ts +76 -0
- package/builtin/config/providers/env-loader.d.ts.map +1 -0
- package/builtin/index.d.ts +7 -0
- package/builtin/index.d.ts.map +1 -0
- package/common/decorators/front-mcp.decorator.d.ts.map +1 -1
- package/common/decorators/hook.decorator.d.ts +0 -10
- package/common/decorators/hook.decorator.d.ts.map +1 -1
- package/common/decorators/index.d.ts +1 -0
- package/common/decorators/index.d.ts.map +1 -1
- package/common/decorators/skill.decorator.d.ts +105 -0
- package/common/decorators/skill.decorator.d.ts.map +1 -0
- package/common/dynamic/dynamic.adapter.d.ts +14 -4
- package/common/dynamic/dynamic.adapter.d.ts.map +1 -1
- package/common/entries/app.entry.d.ts +2 -0
- package/common/entries/app.entry.d.ts.map +1 -1
- package/common/entries/index.d.ts +1 -0
- package/common/entries/index.d.ts.map +1 -1
- package/common/entries/prompt.entry.d.ts +0 -6
- package/common/entries/prompt.entry.d.ts.map +1 -1
- package/common/entries/resource.entry.d.ts +0 -6
- package/common/entries/resource.entry.d.ts.map +1 -1
- package/common/entries/scope.entry.d.ts +2 -0
- package/common/entries/scope.entry.d.ts.map +1 -1
- package/common/entries/skill.entry.d.ts +95 -0
- package/common/entries/skill.entry.d.ts.map +1 -0
- package/common/entries/tool.entry.d.ts +17 -9
- package/common/entries/tool.entry.d.ts.map +1 -1
- package/common/interfaces/agent.interface.d.ts +35 -6
- package/common/interfaces/agent.interface.d.ts.map +1 -1
- package/common/interfaces/execution-context.interface.d.ts +14 -0
- package/common/interfaces/execution-context.interface.d.ts.map +1 -1
- package/common/interfaces/index.d.ts +1 -0
- package/common/interfaces/index.d.ts.map +1 -1
- package/common/interfaces/internal/primary-auth-provider.interface.d.ts +1 -7
- package/common/interfaces/internal/primary-auth-provider.interface.d.ts.map +1 -1
- package/common/interfaces/internal/registry.interface.d.ts +4 -1
- package/common/interfaces/internal/registry.interface.d.ts.map +1 -1
- package/common/interfaces/skill.interface.d.ts +91 -0
- package/common/interfaces/skill.interface.d.ts.map +1 -0
- package/common/interfaces/tool.interface.d.ts +39 -0
- package/common/interfaces/tool.interface.d.ts.map +1 -1
- package/common/metadata/agent.metadata.d.ts +62 -2
- package/common/metadata/agent.metadata.d.ts.map +1 -1
- package/common/metadata/app.metadata.d.ts +168 -169
- package/common/metadata/app.metadata.d.ts.map +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +2182 -721
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/metadata/index.d.ts +1 -0
- package/common/metadata/index.d.ts.map +1 -1
- package/common/metadata/plugin.metadata.d.ts +8 -1
- package/common/metadata/plugin.metadata.d.ts.map +1 -1
- package/common/metadata/skill.metadata.d.ts +366 -0
- package/common/metadata/skill.metadata.d.ts.map +1 -0
- package/common/metadata/tool.metadata.d.ts +71 -0
- package/common/metadata/tool.metadata.d.ts.map +1 -1
- package/common/records/index.d.ts +1 -0
- package/common/records/index.d.ts.map +1 -1
- package/common/records/skill.record.d.ts +55 -0
- package/common/records/skill.record.d.ts.map +1 -0
- package/common/schemas/annotated-class.schema.d.ts +1 -0
- package/common/schemas/annotated-class.schema.d.ts.map +1 -1
- package/common/schemas/http-output.schema.d.ts +24 -24
- package/common/tokens/app.tokens.d.ts.map +1 -1
- package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
- package/common/tokens/index.d.ts +1 -0
- package/common/tokens/index.d.ts.map +1 -1
- package/common/tokens/plugin.tokens.d.ts +1 -0
- package/common/tokens/plugin.tokens.d.ts.map +1 -1
- package/common/tokens/skill.tokens.d.ts +18 -0
- package/common/tokens/skill.tokens.d.ts.map +1 -0
- package/common/tokens/tool.tokens.d.ts +2 -0
- package/common/tokens/tool.tokens.d.ts.map +1 -1
- package/common/types/auth/session.types.d.ts +21 -0
- package/common/types/auth/session.types.d.ts.map +1 -1
- package/common/types/options/auth/app-auth.schema.d.ts +80 -84
- package/common/types/options/auth/app-auth.schema.d.ts.map +1 -1
- package/common/types/options/auth/index.d.ts +6 -8
- package/common/types/options/auth/index.d.ts.map +1 -1
- package/common/types/options/auth/{auth.interfaces.d.ts → interfaces.d.ts} +17 -48
- package/common/types/options/auth/interfaces.d.ts.map +1 -0
- package/common/types/options/auth/orchestrated.schema.d.ts +160 -84
- package/common/types/options/auth/orchestrated.schema.d.ts.map +1 -1
- package/common/types/options/auth/public.schema.d.ts +0 -21
- package/common/types/options/auth/public.schema.d.ts.map +1 -1
- package/common/types/options/auth/{auth.schema.d.ts → schema.d.ts} +81 -85
- package/common/types/options/auth/schema.d.ts.map +1 -0
- package/common/types/options/auth/shared.schemas.d.ts +12 -0
- package/common/types/options/auth/shared.schemas.d.ts.map +1 -1
- package/common/types/options/auth/transparent.schema.d.ts +0 -21
- package/common/types/options/auth/transparent.schema.d.ts.map +1 -1
- package/common/types/options/auth/typecheck.d.ts +2 -0
- package/common/types/options/auth/typecheck.d.ts.map +1 -0
- package/common/types/options/auth/{auth.utils.d.ts → utils.d.ts} +2 -2
- package/common/types/options/auth/utils.d.ts.map +1 -0
- package/common/types/options/elicitation/index.d.ts +4 -0
- package/common/types/options/elicitation/index.d.ts.map +1 -0
- package/common/types/options/elicitation/interfaces.d.ts +80 -0
- package/common/types/options/elicitation/interfaces.d.ts.map +1 -0
- package/common/types/options/elicitation/schema.d.ts +75 -0
- package/common/types/options/elicitation/schema.d.ts.map +1 -0
- package/common/types/options/ext-apps/index.d.ts +3 -0
- package/common/types/options/ext-apps/index.d.ts.map +1 -0
- package/common/types/options/ext-apps/interfaces.d.ts +2 -0
- package/common/types/options/ext-apps/interfaces.d.ts.map +1 -0
- package/common/types/options/ext-apps/schema.d.ts +80 -0
- package/common/types/options/ext-apps/schema.d.ts.map +1 -0
- package/common/types/options/http/index.d.ts +4 -0
- package/common/types/options/http/index.d.ts.map +1 -0
- package/common/types/options/http/interfaces.d.ts +23 -0
- package/common/types/options/http/interfaces.d.ts.map +1 -0
- package/common/types/options/http/schema.d.ts +18 -0
- package/common/types/options/http/schema.d.ts.map +1 -0
- package/common/types/options/index.d.ts +10 -6
- package/common/types/options/index.d.ts.map +1 -1
- package/common/types/options/logging/index.d.ts +5 -0
- package/common/types/options/logging/index.d.ts.map +1 -0
- package/common/types/options/logging/interfaces.d.ts +41 -0
- package/common/types/options/logging/interfaces.d.ts.map +1 -0
- package/common/types/options/logging/schema.d.ts +24 -0
- package/common/types/options/logging/schema.d.ts.map +1 -0
- package/common/types/options/pagination/index.d.ts +4 -0
- package/common/types/options/pagination/index.d.ts.map +1 -0
- package/common/types/options/pagination/interfaces.d.ts +43 -0
- package/common/types/options/pagination/interfaces.d.ts.map +1 -0
- package/common/types/options/pagination/schema.d.ts +41 -0
- package/common/types/options/pagination/schema.d.ts.map +1 -0
- package/common/types/options/redis/index.d.ts +4 -0
- package/common/types/options/redis/index.d.ts.map +1 -0
- package/common/types/options/redis/interfaces.d.ts +81 -0
- package/common/types/options/redis/interfaces.d.ts.map +1 -0
- package/common/types/options/{redis.options.d.ts → redis/schema.d.ts} +2 -2
- package/common/types/options/redis/schema.d.ts.map +1 -0
- package/common/types/options/server-info/index.d.ts +4 -0
- package/common/types/options/server-info/index.d.ts.map +1 -0
- package/common/types/options/server-info/interfaces.d.ts +27 -0
- package/common/types/options/server-info/interfaces.d.ts.map +1 -0
- package/common/types/options/{server-info.options.d.ts → server-info/schema.d.ts} +13 -10
- package/common/types/options/server-info/schema.d.ts.map +1 -0
- package/common/types/options/session/index.d.ts +4 -0
- package/common/types/options/session/index.d.ts.map +1 -0
- package/common/types/options/session/interfaces.d.ts +66 -0
- package/common/types/options/session/interfaces.d.ts.map +1 -0
- package/common/types/options/session/schema.d.ts +79 -0
- package/common/types/options/session/schema.d.ts.map +1 -0
- package/common/types/options/skills-http/index.d.ts +4 -0
- package/common/types/options/skills-http/index.d.ts.map +1 -0
- package/common/types/options/skills-http/interfaces.d.ts +321 -0
- package/common/types/options/skills-http/interfaces.d.ts.map +1 -0
- package/common/types/options/skills-http/schema.d.ts +139 -0
- package/common/types/options/skills-http/schema.d.ts.map +1 -0
- package/common/types/options/transport/index.d.ts +4 -0
- package/common/types/options/transport/index.d.ts.map +1 -0
- package/common/types/options/transport/interfaces.d.ts +354 -0
- package/common/types/options/transport/interfaces.d.ts.map +1 -0
- package/common/types/options/transport/schema.d.ts +309 -0
- package/common/types/options/transport/schema.d.ts.map +1 -0
- package/common/types/options/transport/typecheck.d.ts +2 -0
- package/common/types/options/transport/typecheck.d.ts.map +1 -0
- package/common/utils/decide-request-intent.utils.d.ts +3 -3
- package/common/utils/decide-request-intent.utils.d.ts.map +1 -1
- package/context/context-extension.d.ts +1 -28
- package/context/context-extension.d.ts.map +1 -1
- package/context/frontmcp-context-storage.d.ts.map +1 -1
- package/context/frontmcp-context.d.ts +36 -39
- package/context/frontmcp-context.d.ts.map +1 -1
- package/context/frontmcp-context.provider.d.ts +3 -9
- package/context/frontmcp-context.provider.d.ts.map +1 -1
- package/context/index.d.ts +5 -20
- package/context/index.d.ts.map +1 -1
- package/context/metadata.utils.d.ts +24 -0
- package/context/metadata.utils.d.ts.map +1 -0
- package/direct/client.types.d.ts +447 -0
- package/direct/client.types.d.ts.map +1 -0
- package/direct/connect.d.ts +188 -0
- package/direct/connect.d.ts.map +1 -0
- package/direct/direct-client.d.ts +7 -0
- package/direct/direct-client.d.ts.map +1 -0
- package/direct/direct-server.d.ts +38 -0
- package/direct/direct-server.d.ts.map +1 -0
- package/direct/direct.types.d.ts +134 -0
- package/direct/direct.types.d.ts.map +1 -0
- package/direct/index.d.ts +15 -0
- package/direct/index.d.ts.map +1 -0
- package/direct/llm-platform.d.ts +94 -0
- package/direct/llm-platform.d.ts.map +1 -0
- package/elicitation/elicitation-fallback.schema.d.ts +32 -0
- package/elicitation/elicitation-fallback.schema.d.ts.map +1 -0
- package/elicitation/elicitation.types.d.ts +160 -0
- package/elicitation/elicitation.types.d.ts.map +1 -0
- package/elicitation/flows/elicitation-request.flow.d.ts +98 -0
- package/elicitation/flows/elicitation-request.flow.d.ts.map +1 -0
- package/elicitation/flows/elicitation-result.flow.d.ts +79 -0
- package/elicitation/flows/elicitation-result.flow.d.ts.map +1 -0
- package/elicitation/flows/index.d.ts +10 -0
- package/elicitation/flows/index.d.ts.map +1 -0
- package/elicitation/helpers/elicit.helper.d.ts +65 -0
- package/elicitation/helpers/elicit.helper.d.ts.map +1 -0
- package/elicitation/helpers/extend-output-schema.d.ts +31 -0
- package/elicitation/helpers/extend-output-schema.d.ts.map +1 -0
- package/elicitation/helpers/fallback.helper.d.ts +60 -0
- package/elicitation/helpers/fallback.helper.d.ts.map +1 -0
- package/elicitation/helpers/index.d.ts +12 -0
- package/elicitation/helpers/index.d.ts.map +1 -0
- package/elicitation/helpers/validate-elicitation-content.d.ts +52 -0
- package/elicitation/helpers/validate-elicitation-content.d.ts.map +1 -0
- package/elicitation/hooks/elicitation.hooks.d.ts +66 -0
- package/elicitation/hooks/elicitation.hooks.d.ts.map +1 -0
- package/elicitation/hooks/index.d.ts +9 -0
- package/elicitation/hooks/index.d.ts.map +1 -0
- package/elicitation/index.d.ts +18 -0
- package/elicitation/index.d.ts.map +1 -0
- package/elicitation/send-elicitation-result.tool.d.ts +18 -0
- package/elicitation/send-elicitation-result.tool.d.ts.map +1 -0
- package/elicitation/store/elicitation-encryption.d.ts +134 -0
- package/elicitation/store/elicitation-encryption.d.ts.map +1 -0
- package/elicitation/store/elicitation-store.factory.d.ts +197 -0
- package/elicitation/store/elicitation-store.factory.d.ts.map +1 -0
- package/elicitation/store/elicitation.store.d.ts +191 -0
- package/elicitation/store/elicitation.store.d.ts.map +1 -0
- package/elicitation/store/encrypted-elicitation.store.d.ts +121 -0
- package/elicitation/store/encrypted-elicitation.store.d.ts.map +1 -0
- package/elicitation/store/index.d.ts +14 -0
- package/elicitation/store/index.d.ts.map +1 -0
- package/elicitation/store/storage-elicitation.store.d.ts +118 -0
- package/elicitation/store/storage-elicitation.store.d.ts.map +1 -0
- package/errors/elicitation.error.d.ts +115 -0
- package/errors/elicitation.error.d.ts.map +1 -0
- package/errors/index.d.ts +1 -0
- package/errors/index.d.ts.map +1 -1
- package/esm/index.mjs +30824 -19537
- package/esm/package.json +13 -7
- package/ext-apps/ext-apps.handler.d.ts +177 -0
- package/ext-apps/ext-apps.handler.d.ts.map +1 -0
- package/ext-apps/ext-apps.types.d.ts +273 -0
- package/ext-apps/ext-apps.types.d.ts.map +1 -0
- package/ext-apps/index.d.ts +13 -0
- package/ext-apps/index.d.ts.map +1 -0
- package/flows/flow.instance.d.ts.map +1 -1
- package/front-mcp/front-mcp.d.ts +64 -2
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/front-mcp/front-mcp.providers.d.ts +604 -236
- package/front-mcp/front-mcp.providers.d.ts.map +1 -1
- package/index.d.ts +17 -0
- package/index.d.ts.map +1 -1
- package/index.js +31066 -19707
- package/notification/index.d.ts +1 -1
- package/notification/index.d.ts.map +1 -1
- package/notification/notification.service.d.ts +18 -0
- package/notification/notification.service.d.ts.map +1 -1
- package/package.json +13 -7
- package/plugin/plugin.registry.d.ts +2 -0
- package/plugin/plugin.registry.d.ts.map +1 -1
- package/provider/provider.registry.d.ts +8 -3
- package/provider/provider.registry.d.ts.map +1 -1
- package/scope/flows/http.request.flow.d.ts +4 -0
- package/scope/flows/http.request.flow.d.ts.map +1 -1
- package/scope/scope.instance.d.ts +74 -0
- package/scope/scope.instance.d.ts.map +1 -1
- package/server/server.instance.d.ts +3 -3
- package/server/server.instance.d.ts.map +1 -1
- package/skill/auth/index.d.ts +10 -0
- package/skill/auth/index.d.ts.map +1 -0
- package/skill/auth/skill-http-auth.d.ts +112 -0
- package/skill/auth/skill-http-auth.d.ts.map +1 -0
- package/skill/cache/index.d.ts +13 -0
- package/skill/cache/index.d.ts.map +1 -0
- package/skill/cache/skill-http-cache.d.ts +144 -0
- package/skill/cache/skill-http-cache.d.ts.map +1 -0
- package/skill/cache/skill-http-cache.factory.d.ts +83 -0
- package/skill/cache/skill-http-cache.factory.d.ts.map +1 -0
- package/skill/cache/skill-http-cache.holder.d.ts +35 -0
- package/skill/cache/skill-http-cache.holder.d.ts.map +1 -0
- package/skill/errors/index.d.ts +3 -0
- package/skill/errors/index.d.ts.map +1 -0
- package/skill/errors/skill-validation.error.d.ts +110 -0
- package/skill/errors/skill-validation.error.d.ts.map +1 -0
- package/skill/errors/tool-not-allowed.error.d.ts +66 -0
- package/skill/errors/tool-not-allowed.error.d.ts.map +1 -0
- package/skill/flows/http/index.d.ts +12 -0
- package/skill/flows/http/index.d.ts.map +1 -0
- package/skill/flows/http/llm-full-txt.flow.d.ts +70 -0
- package/skill/flows/http/llm-full-txt.flow.d.ts.map +1 -0
- package/skill/flows/http/llm-txt.flow.d.ts +77 -0
- package/skill/flows/http/llm-txt.flow.d.ts.map +1 -0
- package/skill/flows/http/skills-api.flow.d.ts +81 -0
- package/skill/flows/http/skills-api.flow.d.ts.map +1 -0
- package/skill/flows/index.d.ts +13 -0
- package/skill/flows/index.d.ts.map +1 -0
- package/skill/flows/load-skill.flow.d.ts +169 -0
- package/skill/flows/load-skill.flow.d.ts.map +1 -0
- package/skill/flows/search-skills.flow.d.ts +101 -0
- package/skill/flows/search-skills.flow.d.ts.map +1 -0
- package/skill/guards/index.d.ts +2 -0
- package/skill/guards/index.d.ts.map +1 -0
- package/skill/guards/tool-authorization.guard.d.ts +87 -0
- package/skill/guards/tool-authorization.guard.d.ts.map +1 -0
- package/skill/hooks/index.d.ts +2 -0
- package/skill/hooks/index.d.ts.map +1 -0
- package/skill/hooks/skill-tool.hook.d.ts +52 -0
- package/skill/hooks/skill-tool.hook.d.ts.map +1 -0
- package/skill/index.d.ts +74 -0
- package/skill/index.d.ts.map +1 -0
- package/skill/providers/external-skill.provider.d.ts +240 -0
- package/skill/providers/external-skill.provider.d.ts.map +1 -0
- package/skill/providers/index.d.ts +12 -0
- package/skill/providers/index.d.ts.map +1 -0
- package/skill/providers/memory-skill.provider.d.ts +97 -0
- package/skill/providers/memory-skill.provider.d.ts.map +1 -0
- package/skill/session/index.d.ts +4 -0
- package/skill/session/index.d.ts.map +1 -0
- package/skill/session/skill-session-store.interface.d.ts +79 -0
- package/skill/session/skill-session-store.interface.d.ts.map +1 -0
- package/skill/session/skill-session.manager.d.ts +137 -0
- package/skill/session/skill-session.manager.d.ts.map +1 -0
- package/skill/session/skill-session.types.d.ts +303 -0
- package/skill/session/skill-session.types.d.ts.map +1 -0
- package/skill/skill-http.utils.d.ts +107 -0
- package/skill/skill-http.utils.d.ts.map +1 -0
- package/skill/skill-mode.utils.d.ts +53 -0
- package/skill/skill-mode.utils.d.ts.map +1 -0
- package/skill/skill-scope.helper.d.ts +55 -0
- package/skill/skill-scope.helper.d.ts.map +1 -0
- package/skill/skill-storage.factory.d.ts +194 -0
- package/skill/skill-storage.factory.d.ts.map +1 -0
- package/skill/skill-storage.interface.d.ts +230 -0
- package/skill/skill-storage.interface.d.ts.map +1 -0
- package/skill/skill-validator.d.ts +63 -0
- package/skill/skill-validator.d.ts.map +1 -0
- package/skill/skill.events.d.ts +88 -0
- package/skill/skill.events.d.ts.map +1 -0
- package/skill/skill.instance.d.ts +92 -0
- package/skill/skill.instance.d.ts.map +1 -0
- package/skill/skill.registry.d.ts +309 -0
- package/skill/skill.registry.d.ts.map +1 -0
- package/skill/skill.utils.d.ts +90 -0
- package/skill/skill.utils.d.ts.map +1 -0
- package/skill/sync/index.d.ts +16 -0
- package/skill/sync/index.d.ts.map +1 -0
- package/skill/sync/memory-sync-state.store.d.ts +49 -0
- package/skill/sync/memory-sync-state.store.d.ts.map +1 -0
- package/skill/sync/skill-hash.d.ts +65 -0
- package/skill/sync/skill-hash.d.ts.map +1 -0
- package/skill/sync/sync-state.interface.d.ts +125 -0
- package/skill/sync/sync-state.interface.d.ts.map +1 -0
- package/skill/tools/index.d.ts +21 -0
- package/skill/tools/index.d.ts.map +1 -0
- package/skill/tools/load-skills.tool.d.ts +76 -0
- package/skill/tools/load-skills.tool.d.ts.map +1 -0
- package/skill/tools/search-skills.tool.d.ts +61 -0
- package/skill/tools/search-skills.tool.d.ts.map +1 -0
- package/tool/flows/call-tool.flow.d.ts +1 -0
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tools-list.flow.d.ts +15 -0
- package/tool/flows/tools-list.flow.d.ts.map +1 -1
- package/tool/tool.instance.d.ts +8 -0
- package/tool/tool.instance.d.ts.map +1 -1
- package/tool/tool.registry.d.ts +11 -0
- package/tool/tool.registry.d.ts.map +1 -1
- package/tool/tool.utils.d.ts.map +1 -1
- package/tool/ui/template-helpers.d.ts +0 -5
- package/tool/ui/template-helpers.d.ts.map +1 -1
- package/transport/adapters/streamable-http-transport.d.ts.map +1 -1
- package/transport/adapters/transport.local.adapter.d.ts +54 -9
- package/transport/adapters/transport.local.adapter.d.ts.map +1 -1
- package/transport/adapters/transport.sse.adapter.d.ts +11 -2
- package/transport/adapters/transport.sse.adapter.d.ts.map +1 -1
- package/transport/adapters/transport.streamable-http.adapter.d.ts +21 -2
- package/transport/adapters/transport.streamable-http.adapter.d.ts.map +1 -1
- package/transport/event-stores/event-store.factory.d.ts +96 -0
- package/transport/event-stores/event-store.factory.d.ts.map +1 -0
- package/transport/event-stores/index.d.ts +47 -0
- package/transport/event-stores/index.d.ts.map +1 -0
- package/transport/event-stores/memory.event-store.d.ts +51 -0
- package/transport/event-stores/memory.event-store.d.ts.map +1 -0
- package/transport/event-stores/redis.event-store.d.ts +79 -0
- package/transport/event-stores/redis.event-store.d.ts.map +1 -0
- package/transport/flows/handle.sse.flow.d.ts.map +1 -1
- package/transport/flows/handle.streamable-http.flow.d.ts +3 -1
- package/transport/flows/handle.streamable-http.flow.d.ts.map +1 -1
- package/transport/in-memory-server.d.ts +85 -0
- package/transport/in-memory-server.d.ts.map +1 -0
- package/transport/index.d.ts +47 -0
- package/transport/index.d.ts.map +1 -1
- package/transport/mcp-handlers/complete-request.handler.d.ts +3 -84
- package/transport/mcp-handlers/complete-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/get-prompt-request.handler.d.ts +3 -128
- package/transport/mcp-handlers/get-prompt-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/index.d.ts +463 -490
- package/transport/mcp-handlers/index.d.ts.map +1 -1
- package/transport/mcp-handlers/initialize-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-prompts-request.handler.d.ts +3 -70
- package/transport/mcp-handlers/list-prompts-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-resource-templates-request.handler.d.ts +3 -72
- package/transport/mcp-handlers/list-resource-templates-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-resources-request.handler.d.ts +3 -72
- package/transport/mcp-handlers/list-resources-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-tools-request.handler.d.ts +3 -85
- package/transport/mcp-handlers/list-tools-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/read-resource-request.handler.d.ts +3 -61
- package/transport/mcp-handlers/read-resource-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-list-request.handler.d.ts +9 -0
- package/transport/mcp-handlers/skills-list-request.handler.d.ts.map +1 -0
- package/transport/mcp-handlers/skills-load-request.handler.d.ts +9 -0
- package/transport/mcp-handlers/skills-load-request.handler.d.ts.map +1 -0
- package/transport/mcp-handlers/skills-mcp.types.d.ts +157 -0
- package/transport/mcp-handlers/skills-mcp.types.d.ts.map +1 -0
- package/transport/mcp-handlers/skills-search-request.handler.d.ts +9 -0
- package/transport/mcp-handlers/skills-search-request.handler.d.ts.map +1 -0
- package/transport/transport.registry.d.ts +9 -1
- package/transport/transport.registry.d.ts.map +1 -1
- package/transport/transport.types.d.ts +1 -8
- package/transport/transport.types.d.ts.map +1 -1
- package/auth/jwks/dev-key-persistence.d.ts +0 -64
- package/auth/jwks/dev-key-persistence.d.ts.map +0 -1
- package/auth/jwks/index.d.ts +0 -4
- package/auth/jwks/index.d.ts.map +0 -1
- package/auth/jwks/jwks.service.d.ts +0 -58
- package/auth/jwks/jwks.service.d.ts.map +0 -1
- package/auth/jwks/jwks.types.d.ts +0 -33
- package/auth/jwks/jwks.types.d.ts.map +0 -1
- package/auth/jwks/jwks.utils.d.ts +0 -5
- package/auth/jwks/jwks.utils.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.authorize.flow.d.ts +0 -32
- package/auth/oauth/flows/oauth.authorize.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.device-authorization.flow.d.ts +0 -47
- package/auth/oauth/flows/oauth.device-authorization.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.introspect.flow.d.ts +0 -27
- package/auth/oauth/flows/oauth.introspect.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.par.flow.d.ts +0 -28
- package/auth/oauth/flows/oauth.par.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.revoke.flow.d.ts +0 -26
- package/auth/oauth/flows/oauth.revoke.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.token.flow.d.ts +0 -58
- package/auth/oauth/flows/oauth.token.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.userinfo.flow.d.ts +0 -23
- package/auth/oauth/flows/oauth.userinfo.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oidc.logout.flow.d.ts +0 -19
- package/auth/oauth/flows/oidc.logout.flow.d.ts.map +0 -1
- package/auth/session/authorization-vault.d.ts +0 -612
- package/auth/session/authorization-vault.d.ts.map +0 -1
- package/auth/session/authorization.store.d.ts +0 -302
- package/auth/session/authorization.store.d.ts.map +0 -1
- package/auth/session/record/session.stateful.d.ts +0 -21
- package/auth/session/record/session.stateful.d.ts.map +0 -1
- package/auth/session/record/session.stateless.d.ts +0 -18
- package/auth/session/record/session.stateless.d.ts.map +0 -1
- package/auth/session/record/session.transparent.d.ts +0 -18
- package/auth/session/record/session.transparent.d.ts.map +0 -1
- package/auth/session/session.crypto.d.ts +0 -8
- package/auth/session/session.crypto.d.ts.map +0 -1
- package/auth/session/session.schema.d.ts +0 -6
- package/auth/session/session.schema.d.ts.map +0 -1
- package/auth/session/token.store.d.ts +0 -36
- package/auth/session/token.store.d.ts.map +0 -1
- package/auth/session/token.vault.d.ts +0 -27
- package/auth/session/token.vault.d.ts.map +0 -1
- package/auth/session/vault-encryption.d.ts +0 -190
- package/auth/session/vault-encryption.d.ts.map +0 -1
- package/auth/utils/audience.validator.d.ts +0 -130
- package/auth/utils/audience.validator.d.ts.map +0 -1
- package/auth/utils/www-authenticate.utils.d.ts +0 -98
- package/auth/utils/www-authenticate.utils.d.ts.map +0 -1
- package/common/migrate/auth-transport.migrate.d.ts +0 -63
- package/common/migrate/auth-transport.migrate.d.ts.map +0 -1
- package/common/migrate/index.d.ts +0 -2
- package/common/migrate/index.d.ts.map +0 -1
- package/common/types/options/auth/auth.interfaces.d.ts.map +0 -1
- package/common/types/options/auth/auth.schema.d.ts.map +0 -1
- package/common/types/options/auth/auth.typecheck.d.ts +0 -2
- package/common/types/options/auth/auth.typecheck.d.ts.map +0 -1
- package/common/types/options/auth/auth.utils.d.ts.map +0 -1
- package/common/types/options/auth/transport.deprecated.d.ts +0 -64
- package/common/types/options/auth/transport.deprecated.d.ts.map +0 -1
- package/common/types/options/http.options.d.ts +0 -15
- package/common/types/options/http.options.d.ts.map +0 -1
- package/common/types/options/logging.options.d.ts +0 -29
- package/common/types/options/logging.options.d.ts.map +0 -1
- package/common/types/options/redis.options.d.ts.map +0 -1
- package/common/types/options/server-info.options.d.ts.map +0 -1
- package/common/types/options/session.options.d.ts +0 -148
- package/common/types/options/session.options.d.ts.map +0 -1
- package/common/types/options/transport.options.d.ts +0 -178
- package/common/types/options/transport.options.d.ts.map +0 -1
- package/context/request-context-storage.d.ts +0 -90
- package/context/request-context-storage.d.ts.map +0 -1
- package/context/request-context.d.ts +0 -185
- package/context/request-context.d.ts.map +0 -1
- package/context/request-context.provider.d.ts +0 -38
- package/context/request-context.provider.d.ts.map +0 -1
- package/context/session-key.provider.d.ts +0 -46
- package/context/session-key.provider.d.ts.map +0 -1
- package/store/adapters/store.base.adapter.d.ts +0 -22
- package/store/adapters/store.base.adapter.d.ts.map +0 -1
- package/store/adapters/store.memory.adapter.d.ts +0 -27
- package/store/adapters/store.memory.adapter.d.ts.map +0 -1
- package/store/adapters/store.redis.adapter.d.ts +0 -34
- package/store/adapters/store.redis.adapter.d.ts.map +0 -1
- package/store/adapters/store.vercel-kv.adapter.d.ts +0 -87
- package/store/adapters/store.vercel-kv.adapter.d.ts.map +0 -1
- package/store/index.d.ts +0 -11
- package/store/index.d.ts.map +0 -1
- package/store/store.factory.d.ts.map +0 -1
- package/store/store.helpers.d.ts +0 -10
- package/store/store.helpers.d.ts.map +0 -1
- package/store/store.registry.d.ts +0 -14
- package/store/store.registry.d.ts.map +0 -1
- package/store/store.tokens.d.ts +0 -4
- package/store/store.tokens.d.ts.map +0 -1
- package/store/store.types.d.ts +0 -65
- package/store/store.types.d.ts.map +0 -1
- package/store/store.utils.d.ts +0 -9
- package/store/store.utils.d.ts.map +0 -1
- package/transport/transport.event-store.d.ts +0 -11
- package/transport/transport.event-store.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"redis.options.d.ts","sourceRoot":"","sources":["../../../../src/common/types/options/redis.options.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;EAAiC,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAyDpE;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;iBASH,CAAC;AAE9B,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAMvE;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;iBAmBN,CAAC;AAE9B,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAmB7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA4E,CAAC;AAE5G;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAMnE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAoD,CAAC;AAErF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAMrE;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,IAAI,oBAAoB,CAEtF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,IAAI,uBAAuB,CAE5F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,IAAI,oBAAoB,CAE1F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server-info.options.d.ts","sourceRoot":"","sources":["../../../../src/common/types/options/server-info.options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,MAAM,iBAAiB,GAAG;IAE9B,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,OAAO,EAAE,MAAM,CAAC;IAEhB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAChB,CAAA;AAGD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;iBAMO,CAAC"}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { AIPlatformType } from '../auth/session.types';
|
|
3
|
-
export type SessionMode = 'stateful' | 'stateless';
|
|
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
|
-
}
|
|
30
|
-
export type SessionOptions = {
|
|
31
|
-
/**
|
|
32
|
-
* Defines how the session lifecycle and nested tokens are managed.
|
|
33
|
-
*
|
|
34
|
-
* Modes:
|
|
35
|
-
* - `'stateful'`: Session and nested tokens are stored in a server-side store (e.g., Redis).
|
|
36
|
-
* - `'stateless'`: All session data (including nested tokens) is embedded within a signed/encrypted JWT.
|
|
37
|
-
*
|
|
38
|
-
* **Behavior:**
|
|
39
|
-
* - When using `'stateful'`:
|
|
40
|
-
* - Nested OAuth tokens are **never exposed** in the JWT.
|
|
41
|
-
* - Tokens are encrypted and persisted in Redis under a session key.
|
|
42
|
-
* - The client receives only a lightweight reference (session key) instead of full credentials.
|
|
43
|
-
* - Results in smaller JWT payloads and reduces token leakage risk.
|
|
44
|
-
* - Allows seamless refresh of nested provider tokens without requiring user re-authorization.
|
|
45
|
-
* - Recommended for multi-application environments or setups using short-lived OAuth tokens.
|
|
46
|
-
*
|
|
47
|
-
* - When using `'stateless'`:
|
|
48
|
-
* - Stores all nested tokens directly within the JWT, enabling fully client-managed sessions.
|
|
49
|
-
* - Does **not support token refresh** — once a nested provider token expires, re-authorization is required.
|
|
50
|
-
* - Simplifies implementation but may degrade UX when tokens are short-lived.
|
|
51
|
-
* - Best suited for lightweight or single-application environments where token rotation is less critical.
|
|
52
|
-
*
|
|
53
|
-
* @default 'stateful'
|
|
54
|
-
*/
|
|
55
|
-
sessionMode?: SessionMode | ((issuer: string) => Promise<SessionMode> | SessionMode);
|
|
56
|
-
/**
|
|
57
|
-
* Defines how the Transport ID is generated, verified, and used across sessions.
|
|
58
|
-
*
|
|
59
|
-
* Modes:
|
|
60
|
-
* - `'uuid'`: Generates a random UUID per session.
|
|
61
|
-
* - `'jwt'`: Uses a signed JWT for stateless sessions, signed with a generated session key.
|
|
62
|
-
*
|
|
63
|
-
* **Behavior: **
|
|
64
|
-
* - When using `'jwt'`:
|
|
65
|
-
* - Requires an active Redis connection to support distributed, stateless transport sessions.
|
|
66
|
-
* - Each token is verified using a generated public key associated with the existing session.
|
|
67
|
-
* - Enables access to a streamable HTTP transport session ID.
|
|
68
|
-
* - For distributed systems, verification is optimized by checking if the session is already
|
|
69
|
-
* verified by an existing live transport ID. This allows fast validation when multiple
|
|
70
|
-
* transports are connected to a shared queue (high-availability setup).
|
|
71
|
-
* - If the JWT's transport ID is not found on the current worker node, the system attempts
|
|
72
|
-
* to connect to the corresponding remote transport in the distributed infrastructure.
|
|
73
|
-
*
|
|
74
|
-
* - When using `'uuid'`:
|
|
75
|
-
* - Provides a strict, node-bound session transport (single-node mode).
|
|
76
|
-
* - Each request verifies the `Authorization` header and searches for a matching transport ID
|
|
77
|
-
* derived from the hashed authorization header and the generated transport UUID.
|
|
78
|
-
* - If no matching transport ID is found, an error (`TransportNotInitialized`) is thrown.
|
|
79
|
-
*
|
|
80
|
-
* @default 'uuid'
|
|
81
|
-
*/
|
|
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;
|
|
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>;
|
|
127
|
-
export declare const sessionOptionsSchema: z.ZodObject<{
|
|
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>;
|
|
148
|
-
//# sourceMappingURL=session.options.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session.options.d.ts","sourceRoot":"","sources":["../../../../src/common/types/options/session.options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAwB,MAAM,uBAAuB,CAAC;AAE7E,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,KAAK,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,4FAA4F;IAC5F,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,uDAAuD;IACvD,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,QAAQ,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAClC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC,CAAC;IACrF;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,eAAe,CAAC,EAAE,eAAe,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC,CAAC;IAErG;;;OAGG;IACH,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;iBAGrC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;iBAGxC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;iBAUO,CAAC"}
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { SessionMode, TransportIdMode, PlatformMappingEntry, PlatformDetectionConfig, platformDetectionConfigSchema } from './session.options';
|
|
3
|
-
export type { SessionMode, TransportIdMode, PlatformMappingEntry, PlatformDetectionConfig };
|
|
4
|
-
/**
|
|
5
|
-
* Transport persistence configuration
|
|
6
|
-
* Enables session persistence to Redis/Vercel KV and automatic transport recreation after server restart.
|
|
7
|
-
*
|
|
8
|
-
* **Auto-enable behavior**: When top-level `redis` is configured at the `@FrontMcp` level,
|
|
9
|
-
* transport persistence is automatically enabled using that configuration.
|
|
10
|
-
* - To disable: explicitly set `enabled: false`
|
|
11
|
-
* - To use different redis config: explicitly set `redis: {...}`
|
|
12
|
-
*/
|
|
13
|
-
export declare const transportPersistenceConfigSchema: z.ZodObject<{
|
|
14
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
15
|
-
redis: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
16
|
-
provider: z.ZodLiteral<"redis">;
|
|
17
|
-
host: z.ZodString;
|
|
18
|
-
port: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
19
|
-
password: z.ZodOptional<z.ZodString>;
|
|
20
|
-
db: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
21
|
-
tls: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
22
|
-
keyPrefix: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
23
|
-
defaultTtlMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
24
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
25
|
-
provider: z.ZodLiteral<"vercel-kv">;
|
|
26
|
-
url: z.ZodOptional<z.ZodString>;
|
|
27
|
-
token: z.ZodOptional<z.ZodString>;
|
|
28
|
-
keyPrefix: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
29
|
-
defaultTtlMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
30
|
-
}, z.core.$strip>, z.ZodPipe<z.ZodObject<{
|
|
31
|
-
host: z.ZodString;
|
|
32
|
-
port: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
33
|
-
password: z.ZodOptional<z.ZodString>;
|
|
34
|
-
db: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
35
|
-
tls: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
36
|
-
keyPrefix: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
37
|
-
defaultTtlMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
38
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
39
|
-
provider: "redis";
|
|
40
|
-
host: string;
|
|
41
|
-
port: number;
|
|
42
|
-
db: number;
|
|
43
|
-
tls: boolean;
|
|
44
|
-
keyPrefix: string;
|
|
45
|
-
defaultTtlMs: number;
|
|
46
|
-
password?: string | undefined;
|
|
47
|
-
}, {
|
|
48
|
-
host: string;
|
|
49
|
-
port: number;
|
|
50
|
-
db: number;
|
|
51
|
-
tls: boolean;
|
|
52
|
-
keyPrefix: string;
|
|
53
|
-
defaultTtlMs: number;
|
|
54
|
-
password?: string | undefined;
|
|
55
|
-
}>>]>>;
|
|
56
|
-
defaultTtlMs: z.ZodDefault<z.ZodNumber>;
|
|
57
|
-
}, z.core.$strip>;
|
|
58
|
-
/**
|
|
59
|
-
* Transport options schema
|
|
60
|
-
* Consolidates transport protocol config + session lifecycle config
|
|
61
|
-
*/
|
|
62
|
-
export declare const transportOptionsSchema: z.ZodObject<{
|
|
63
|
-
sessionMode: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"stateful">, z.ZodLiteral<"stateless">, z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>]>>>;
|
|
64
|
-
transportIdMode: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"uuid">, z.ZodLiteral<"jwt">, z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>]>>>;
|
|
65
|
-
platformDetection: z.ZodOptional<z.ZodObject<{
|
|
66
|
-
mappings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
67
|
-
pattern: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<RegExp, RegExp>]>;
|
|
68
|
-
platform: z.ZodEnum<{
|
|
69
|
-
unknown: "unknown";
|
|
70
|
-
continue: "continue";
|
|
71
|
-
openai: "openai";
|
|
72
|
-
claude: "claude";
|
|
73
|
-
gemini: "gemini";
|
|
74
|
-
cursor: "cursor";
|
|
75
|
-
cody: "cody";
|
|
76
|
-
"generic-mcp": "generic-mcp";
|
|
77
|
-
"ext-apps": "ext-apps";
|
|
78
|
-
}>;
|
|
79
|
-
}, z.core.$strip>>>;
|
|
80
|
-
customOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
81
|
-
}, z.core.$strip>>;
|
|
82
|
-
enableLegacySSE: z.ZodDefault<z.ZodBoolean>;
|
|
83
|
-
enableSseListener: z.ZodDefault<z.ZodBoolean>;
|
|
84
|
-
enableStreamableHttp: z.ZodDefault<z.ZodBoolean>;
|
|
85
|
-
enableStatelessHttp: z.ZodDefault<z.ZodBoolean>;
|
|
86
|
-
enableStatefulHttp: z.ZodDefault<z.ZodBoolean>;
|
|
87
|
-
requireSessionForStreamable: z.ZodDefault<z.ZodBoolean>;
|
|
88
|
-
persistence: z.ZodOptional<z.ZodObject<{
|
|
89
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
90
|
-
redis: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
91
|
-
provider: z.ZodLiteral<"redis">;
|
|
92
|
-
host: z.ZodString;
|
|
93
|
-
port: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
94
|
-
password: z.ZodOptional<z.ZodString>;
|
|
95
|
-
db: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
96
|
-
tls: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
97
|
-
keyPrefix: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
98
|
-
defaultTtlMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
99
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
100
|
-
provider: z.ZodLiteral<"vercel-kv">;
|
|
101
|
-
url: z.ZodOptional<z.ZodString>;
|
|
102
|
-
token: z.ZodOptional<z.ZodString>;
|
|
103
|
-
keyPrefix: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
104
|
-
defaultTtlMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
105
|
-
}, z.core.$strip>, z.ZodPipe<z.ZodObject<{
|
|
106
|
-
host: z.ZodString;
|
|
107
|
-
port: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
108
|
-
password: z.ZodOptional<z.ZodString>;
|
|
109
|
-
db: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
110
|
-
tls: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
111
|
-
keyPrefix: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
112
|
-
defaultTtlMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
113
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
114
|
-
provider: "redis";
|
|
115
|
-
host: string;
|
|
116
|
-
port: number;
|
|
117
|
-
db: number;
|
|
118
|
-
tls: boolean;
|
|
119
|
-
keyPrefix: string;
|
|
120
|
-
defaultTtlMs: number;
|
|
121
|
-
password?: string | undefined;
|
|
122
|
-
}, {
|
|
123
|
-
host: string;
|
|
124
|
-
port: number;
|
|
125
|
-
db: number;
|
|
126
|
-
tls: boolean;
|
|
127
|
-
keyPrefix: string;
|
|
128
|
-
defaultTtlMs: number;
|
|
129
|
-
password?: string | undefined;
|
|
130
|
-
}>>]>>;
|
|
131
|
-
defaultTtlMs: z.ZodDefault<z.ZodNumber>;
|
|
132
|
-
}, z.core.$strip>>;
|
|
133
|
-
distributed: z.ZodOptional<z.ZodObject<{
|
|
134
|
-
enabled: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
|
|
135
|
-
providerCaching: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
-
}, z.core.$strip>>;
|
|
137
|
-
}, z.core.$strip>;
|
|
138
|
-
/**
|
|
139
|
-
* Transport options type (with defaults applied)
|
|
140
|
-
*/
|
|
141
|
-
export type TransportOptions = z.infer<typeof transportOptionsSchema>;
|
|
142
|
-
/**
|
|
143
|
-
* Transport options input type (for user configuration)
|
|
144
|
-
*/
|
|
145
|
-
export type TransportOptionsInput = z.input<typeof transportOptionsSchema>;
|
|
146
|
-
/**
|
|
147
|
-
* Transport persistence configuration type
|
|
148
|
-
*/
|
|
149
|
-
export type TransportPersistenceConfig = z.infer<typeof transportPersistenceConfigSchema>;
|
|
150
|
-
/**
|
|
151
|
-
* Transport persistence configuration input type
|
|
152
|
-
*/
|
|
153
|
-
export type TransportPersistenceConfigInput = z.input<typeof transportPersistenceConfigSchema>;
|
|
154
|
-
/**
|
|
155
|
-
* Platform detection configuration type
|
|
156
|
-
*/
|
|
157
|
-
export type PlatformDetectionConfigType = z.infer<typeof platformDetectionConfigSchema>;
|
|
158
|
-
/**
|
|
159
|
-
* Distributed mode configuration type (with defaults applied)
|
|
160
|
-
*/
|
|
161
|
-
export type DistributedConfig = NonNullable<TransportOptions['distributed']>;
|
|
162
|
-
/**
|
|
163
|
-
* Distributed mode configuration input type (for user configuration)
|
|
164
|
-
*/
|
|
165
|
-
export type DistributedConfigInput = {
|
|
166
|
-
enabled?: boolean | 'auto';
|
|
167
|
-
providerCaching?: boolean;
|
|
168
|
-
};
|
|
169
|
-
/**
|
|
170
|
-
* Check if distributed mode is enabled based on configuration.
|
|
171
|
-
* Handles 'auto' detection for serverless environments.
|
|
172
|
-
*/
|
|
173
|
-
export declare function isDistributedMode(config?: DistributedConfigInput): boolean;
|
|
174
|
-
/**
|
|
175
|
-
* Get effective provider caching setting based on distributed config.
|
|
176
|
-
*/
|
|
177
|
-
export declare function shouldCacheProviders(config?: DistributedConfigInput): boolean;
|
|
178
|
-
//# sourceMappingURL=transport.options.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transport.options.d.ts","sourceRoot":"","sources":["../../../../src/common/types/options/transport.options.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EAEvB,6BAA6B,EAC9B,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,CAAC;AAM5F;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyB3C,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiJjC,CAAC;AAMH;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE/F;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAExF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAyB1E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAU7E"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RequestContextStorage - AsyncLocalStorage wrapper for request-scoped context
|
|
3
|
-
*
|
|
4
|
-
* Provides concurrent-safe request context propagation using Node.js AsyncLocalStorage.
|
|
5
|
-
* Access through DI only - never use static imports to access the storage directly.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* // In a flow or middleware
|
|
10
|
-
* const storage = this.get(RequestContextStorage);
|
|
11
|
-
* await storage.runFromHeaders(request.headers, {
|
|
12
|
-
* sessionId: sessionId,
|
|
13
|
-
* authInfo: authInfo,
|
|
14
|
-
* scopeId: scope.id,
|
|
15
|
-
* }, async () => {
|
|
16
|
-
* // All code here can access the context via DI
|
|
17
|
-
* const ctx = this.get(REQUEST_CONTEXT);
|
|
18
|
-
* });
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
import { RequestContext, RequestContextArgs } from './request-context';
|
|
22
|
-
/**
|
|
23
|
-
* RequestContextStorage provides request-scoped context via AsyncLocalStorage.
|
|
24
|
-
*
|
|
25
|
-
* This is a GLOBAL-scoped provider because it manages the storage itself,
|
|
26
|
-
* not the per-request data. The actual RequestContext is accessed via
|
|
27
|
-
* the REQUEST_CONTEXT token which is REQUEST-scoped.
|
|
28
|
-
*/
|
|
29
|
-
export declare class RequestContextStorage {
|
|
30
|
-
/**
|
|
31
|
-
* Run a callback with a new RequestContext.
|
|
32
|
-
*
|
|
33
|
-
* @param args - Arguments to create the context
|
|
34
|
-
* @param fn - Async function to run with the context
|
|
35
|
-
* @returns Result of the callback
|
|
36
|
-
*/
|
|
37
|
-
run<T>(args: RequestContextArgs, fn: () => T | Promise<T>): T | Promise<T>;
|
|
38
|
-
/**
|
|
39
|
-
* Run with context extracted from HTTP headers.
|
|
40
|
-
*
|
|
41
|
-
* Automatically parses trace context from headers using W3C Trace Context
|
|
42
|
-
* specification with fallback to x-frontmcp-trace-id.
|
|
43
|
-
*
|
|
44
|
-
* @param headers - HTTP headers
|
|
45
|
-
* @param args - Additional context args (sessionId, authInfo, scopeId)
|
|
46
|
-
* @param fn - Async function to run
|
|
47
|
-
* @returns Result of the callback
|
|
48
|
-
*/
|
|
49
|
-
runFromHeaders<T>(headers: Record<string, unknown>, args: Omit<RequestContextArgs, 'traceContext' | 'metadata'>, fn: () => T | Promise<T>): T | Promise<T>;
|
|
50
|
-
/**
|
|
51
|
-
* Run with an existing RequestContext.
|
|
52
|
-
*
|
|
53
|
-
* Useful when you need to propagate an existing context to a new async scope.
|
|
54
|
-
*
|
|
55
|
-
* @param context - Existing RequestContext
|
|
56
|
-
* @param fn - Async function to run
|
|
57
|
-
* @returns Result of the callback
|
|
58
|
-
*/
|
|
59
|
-
runWithContext<T>(context: RequestContext, fn: () => T | Promise<T>): T | Promise<T>;
|
|
60
|
-
/**
|
|
61
|
-
* Get the current RequestContext.
|
|
62
|
-
*
|
|
63
|
-
* @returns Current context or undefined if not in a request scope
|
|
64
|
-
*/
|
|
65
|
-
getStore(): RequestContext | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Get the current RequestContext, throwing if not available.
|
|
68
|
-
*
|
|
69
|
-
* @throws Error if not in a request scope
|
|
70
|
-
*/
|
|
71
|
-
getStoreOrThrow(): RequestContext;
|
|
72
|
-
/**
|
|
73
|
-
* Check if currently running within a request context.
|
|
74
|
-
*
|
|
75
|
-
* @returns True if a RequestContext is available
|
|
76
|
-
*/
|
|
77
|
-
hasContext(): boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Update the authInfo in the current context.
|
|
80
|
-
*
|
|
81
|
-
* This mutates the existing context in place to preserve internal state
|
|
82
|
-
* (marks, store, sessionMetadata) while updating auth info.
|
|
83
|
-
*
|
|
84
|
-
* @param authInfo - Auth info fields to set/update (merged with existing)
|
|
85
|
-
* @param fn - Function to run after update
|
|
86
|
-
* @returns Result of the callback
|
|
87
|
-
*/
|
|
88
|
-
updateAuthInfo<T>(authInfo: RequestContextArgs['authInfo'], fn: () => T | Promise<T>): T | Promise<T>;
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=request-context-storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-context-storage.d.ts","sourceRoot":"","sources":["../../src/context/request-context-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAmB,MAAM,mBAAmB,CAAC;AAWxF;;;;;;GAMG;AACH,qBAKa,qBAAqB;IAChC;;;;;;OAMG;IACH,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAK1E;;;;;;;;;;OAUG;IACH,cAAc,CAAC,CAAC,EACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,cAAc,GAAG,UAAU,CAAC,EAC3D,EAAE,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GACvB,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAWjB;;;;;;;;OAQG;IACH,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAIpF;;;;OAIG;IACH,QAAQ,IAAI,cAAc,GAAG,SAAS;IAItC;;;;OAIG;IACH,eAAe,IAAI,cAAc;IAQjC;;;;OAIG;IACH,UAAU,IAAI,OAAO;IAIrB;;;;;;;;;OASG;IACH,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAMtG"}
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RequestContext - Production-ready request context for FrontMCP
|
|
3
|
-
*
|
|
4
|
-
* Provides request-scoped state that flows through the entire async execution
|
|
5
|
-
* chain via AsyncLocalStorage. Access via DI only using the REQUEST_CONTEXT token.
|
|
6
|
-
*/
|
|
7
|
-
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
|
|
8
|
-
import { FrontMcpLogger } from '../common/interfaces/logger.interface';
|
|
9
|
-
import { TraceContext } from './trace-context';
|
|
10
|
-
import type { SessionIdPayload } from '../common/types';
|
|
11
|
-
/**
|
|
12
|
-
* Request metadata extracted from HTTP headers.
|
|
13
|
-
*/
|
|
14
|
-
export interface RequestMetadata {
|
|
15
|
-
/** User-Agent header */
|
|
16
|
-
userAgent?: string;
|
|
17
|
-
/** Content-Type header */
|
|
18
|
-
contentType?: string;
|
|
19
|
-
/** Accept header */
|
|
20
|
-
accept?: string;
|
|
21
|
-
/** Client IP address (from x-forwarded-for or socket) */
|
|
22
|
-
clientIp?: string;
|
|
23
|
-
/** Custom headers matching x-frontmcp-* pattern */
|
|
24
|
-
customHeaders: Record<string, string>;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Arguments for creating a RequestContext.
|
|
28
|
-
*/
|
|
29
|
-
export interface RequestContextArgs {
|
|
30
|
-
/** Optional request ID (generated if not provided) */
|
|
31
|
-
requestId?: string;
|
|
32
|
-
/** Optional trace context (generated if not provided) */
|
|
33
|
-
traceContext?: TraceContext;
|
|
34
|
-
/** Session identifier (required) */
|
|
35
|
-
sessionId: string;
|
|
36
|
-
/** Authentication information (can be partial, progressively populated) */
|
|
37
|
-
authInfo: Partial<AuthInfo>;
|
|
38
|
-
/** Scope identifier (required) */
|
|
39
|
-
scopeId: string;
|
|
40
|
-
/** Optional timestamp (defaults to Date.now()) */
|
|
41
|
-
timestamp?: number;
|
|
42
|
-
/** Optional request metadata */
|
|
43
|
-
metadata?: RequestMetadata;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* RequestContext provides per-request state that flows through
|
|
47
|
-
* the entire async execution chain via AsyncLocalStorage.
|
|
48
|
-
*
|
|
49
|
-
* Access via DI only using the REQUEST_CONTEXT token:
|
|
50
|
-
* ```typescript
|
|
51
|
-
* const ctx = this.get(REQUEST_CONTEXT);
|
|
52
|
-
* console.log(ctx.requestId, ctx.traceContext.traceId);
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
export declare class RequestContext {
|
|
56
|
-
/** Unique request identifier (UUID v4) */
|
|
57
|
-
readonly requestId: string;
|
|
58
|
-
/** W3C Trace Context or generated trace ID */
|
|
59
|
-
readonly traceContext: TraceContext;
|
|
60
|
-
/** Session identifier (from mcp-session-id header or authorization) */
|
|
61
|
-
readonly sessionId: string;
|
|
62
|
-
/**
|
|
63
|
-
* Authentication information.
|
|
64
|
-
* Note: This is mutable to allow updating after authorization is verified.
|
|
65
|
-
* It's Partial<AuthInfo> because auth info is progressively populated
|
|
66
|
-
* throughout the request lifecycle (some fields like transport are only
|
|
67
|
-
* available after the transport is established).
|
|
68
|
-
*/
|
|
69
|
-
private _authInfo;
|
|
70
|
-
/** Scope identifier */
|
|
71
|
-
readonly scopeId: string;
|
|
72
|
-
/** Request start timestamp */
|
|
73
|
-
readonly timestamp: number;
|
|
74
|
-
/** Request metadata (headers, user-agent, etc.) */
|
|
75
|
-
readonly metadata: RequestMetadata;
|
|
76
|
-
/** Timing marks for performance tracking */
|
|
77
|
-
private readonly marks;
|
|
78
|
-
/** Request-scoped data store */
|
|
79
|
-
private readonly store;
|
|
80
|
-
constructor(args: RequestContextArgs);
|
|
81
|
-
/**
|
|
82
|
-
* Get authentication information.
|
|
83
|
-
* Returns Partial<AuthInfo> because auth info is progressively populated.
|
|
84
|
-
*/
|
|
85
|
-
get authInfo(): Partial<AuthInfo>;
|
|
86
|
-
/**
|
|
87
|
-
* Update auth info after authorization is verified.
|
|
88
|
-
* Called by checkAuthorization stage after session verification.
|
|
89
|
-
* Can be called multiple times to progressively add fields.
|
|
90
|
-
*
|
|
91
|
-
* @param authInfo - The auth info fields to set/update
|
|
92
|
-
* @internal
|
|
93
|
-
*/
|
|
94
|
-
updateAuthInfo(authInfo: Partial<AuthInfo>): void;
|
|
95
|
-
/**
|
|
96
|
-
* Session metadata including protocol, platform type, and node info.
|
|
97
|
-
* Only available after session verification in authenticated flows.
|
|
98
|
-
*/
|
|
99
|
-
private _sessionMetadata?;
|
|
100
|
-
/**
|
|
101
|
-
* Get session metadata.
|
|
102
|
-
*
|
|
103
|
-
* Contains protocol type, platform type, nodeId, and authSignature.
|
|
104
|
-
* Only available after session verification completes.
|
|
105
|
-
*
|
|
106
|
-
* @returns Session metadata or undefined if not yet verified
|
|
107
|
-
*/
|
|
108
|
-
get sessionMetadata(): SessionIdPayload | undefined;
|
|
109
|
-
/**
|
|
110
|
-
* Update session metadata after session verification.
|
|
111
|
-
* Called by checkAuthorization stage after session verification.
|
|
112
|
-
*
|
|
113
|
-
* @param metadata - Session metadata from verified session
|
|
114
|
-
* @internal
|
|
115
|
-
*/
|
|
116
|
-
updateSessionMetadata(metadata: SessionIdPayload): void;
|
|
117
|
-
/**
|
|
118
|
-
* Get a child logger with request context attached.
|
|
119
|
-
*
|
|
120
|
-
* Creates a child logger with a prefix containing the request ID and trace ID
|
|
121
|
-
* for easy request tracing in logs.
|
|
122
|
-
*
|
|
123
|
-
* @param parentLogger - The parent logger to create a child from
|
|
124
|
-
* @returns A logger with requestId and traceId in the prefix
|
|
125
|
-
*/
|
|
126
|
-
getLogger(parentLogger: FrontMcpLogger): FrontMcpLogger;
|
|
127
|
-
/**
|
|
128
|
-
* Mark a timing point for performance tracking.
|
|
129
|
-
*
|
|
130
|
-
* @param name - Name of the timing mark
|
|
131
|
-
*/
|
|
132
|
-
mark(name: string): void;
|
|
133
|
-
/**
|
|
134
|
-
* Get elapsed time in milliseconds between two marks.
|
|
135
|
-
*
|
|
136
|
-
* @param from - Start mark name (defaults to 'init')
|
|
137
|
-
* @param to - End mark name (defaults to current time)
|
|
138
|
-
* @returns Elapsed time in milliseconds
|
|
139
|
-
*/
|
|
140
|
-
elapsed(from?: string, to?: string): number;
|
|
141
|
-
/**
|
|
142
|
-
* Get all timing marks.
|
|
143
|
-
*
|
|
144
|
-
* @returns Read-only map of mark names to timestamps
|
|
145
|
-
*/
|
|
146
|
-
getMarks(): ReadonlyMap<string, number>;
|
|
147
|
-
/**
|
|
148
|
-
* Store request-scoped data.
|
|
149
|
-
*
|
|
150
|
-
* @param key - Storage key
|
|
151
|
-
* @param value - Value to store
|
|
152
|
-
*/
|
|
153
|
-
set<T>(key: string | symbol, value: T): void;
|
|
154
|
-
/**
|
|
155
|
-
* Retrieve request-scoped data.
|
|
156
|
-
*
|
|
157
|
-
* @param key - Storage key
|
|
158
|
-
* @returns Stored value or undefined
|
|
159
|
-
*/
|
|
160
|
-
get<T>(key: string | symbol): T | undefined;
|
|
161
|
-
/**
|
|
162
|
-
* Check if a key exists in the request-scoped store.
|
|
163
|
-
*
|
|
164
|
-
* @param key - Storage key
|
|
165
|
-
* @returns True if key exists
|
|
166
|
-
*/
|
|
167
|
-
has(key: string | symbol): boolean;
|
|
168
|
-
/**
|
|
169
|
-
* Delete a key from the request-scoped store.
|
|
170
|
-
*
|
|
171
|
-
* @param key - Storage key
|
|
172
|
-
* @returns True if key was deleted
|
|
173
|
-
*/
|
|
174
|
-
delete(key: string | symbol): boolean;
|
|
175
|
-
/**
|
|
176
|
-
* Get a summary of the context for logging.
|
|
177
|
-
*
|
|
178
|
-
* Note: sessionId is hashed to prevent accidental exposure of user-identifying
|
|
179
|
-
* session identifiers in logs while still allowing correlation.
|
|
180
|
-
*
|
|
181
|
-
* @returns Object with key context fields
|
|
182
|
-
*/
|
|
183
|
-
toLogContext(): Record<string, unknown>;
|
|
184
|
-
}
|
|
185
|
-
//# sourceMappingURL=request-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/context/request-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAwB,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5B,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED;;;;;;;;;GASG;AACH,qBAAa,cAAc;IACzB,0CAA0C;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,8CAA8C;IAC9C,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpC,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;;;OAMG;IACH,OAAO,CAAC,SAAS,CAAoB;IAErC,uBAAuB;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,8BAA8B;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,mDAAmD;IACnD,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IAEnC,4CAA4C;IAC5C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkC;IAExD,gCAAgC;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA4C;gBAEtD,IAAI,EAAE,kBAAkB;IAmBpC;;;OAGG;IACH,IAAI,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,CAEhC;IAED;;;;;;;OAOG;IACH,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI;IAKjD;;;OAGG;IACH,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAE5C;;;;;;;OAOG;IACH,IAAI,eAAe,IAAI,gBAAgB,GAAG,SAAS,CAElD;IAED;;;;;;OAMG;IACH,qBAAqB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAIvD;;;;;;;;OAQG;IACH,SAAS,CAAC,YAAY,EAAE,cAAc,GAAG,cAAc;IAMvD;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIxB;;;;;;OAMG;IACH,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAM3C;;;;OAIG;IACH,QAAQ,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC;IAIvC;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAI5C;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,GAAG,SAAS;IAI3C;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO;IAIlC;;;;;OAKG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO;IAIrC;;;;;;;OAOG;IACH,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAYxC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* REQUEST_CONTEXT Provider
|
|
3
|
-
*
|
|
4
|
-
* Defines the DI token and factory provider for accessing RequestContext.
|
|
5
|
-
* The context is retrieved from AsyncLocalStorage via RequestContextStorage.
|
|
6
|
-
*/
|
|
7
|
-
import { ProviderFactoryType } from '../common/interfaces/provider.interface';
|
|
8
|
-
import { RequestContext } from './request-context';
|
|
9
|
-
import { RequestContextStorage } from './request-context-storage';
|
|
10
|
-
/**
|
|
11
|
-
* DI token for accessing the current RequestContext.
|
|
12
|
-
*
|
|
13
|
-
* Use this token to inject the current request context in any provider or context:
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* // In a tool/resource/prompt
|
|
18
|
-
* const ctx = this.get(REQUEST_CONTEXT);
|
|
19
|
-
* console.log(ctx.requestId, ctx.traceContext.traceId);
|
|
20
|
-
*
|
|
21
|
-
* // In a provider with constructor injection
|
|
22
|
-
* constructor(
|
|
23
|
-
* @Inject(REQUEST_CONTEXT) private ctx: RequestContext
|
|
24
|
-
* ) {}
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare const REQUEST_CONTEXT: unique symbol;
|
|
28
|
-
/**
|
|
29
|
-
* Factory provider for RequestContext.
|
|
30
|
-
*
|
|
31
|
-
* This provider is marked as REQUEST scope and retrieves the current
|
|
32
|
-
* RequestContext from AsyncLocalStorage via RequestContextStorage.
|
|
33
|
-
*
|
|
34
|
-
* Note: This provider will throw if called outside of a request scope
|
|
35
|
-
* (i.e., without first calling RequestContextStorage.run or runFromHeaders).
|
|
36
|
-
*/
|
|
37
|
-
export declare const RequestContextProvider: ProviderFactoryType<RequestContext, readonly [typeof RequestContextStorage]>;
|
|
38
|
-
//# sourceMappingURL=request-context.provider.d.ts.map
|