@frontmcp/sdk 0.7.2 → 0.8.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/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
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Vercel KV Session Store
|
|
3
3
|
*
|
|
4
4
|
* Session store implementation using Vercel KV (edge-compatible REST-based key-value store).
|
|
5
|
-
* Uses
|
|
5
|
+
* Uses @frontmcp/utils VercelKvStorageAdapter internally.
|
|
6
6
|
*
|
|
7
7
|
* @warning **Atomicity Limitation**: Vercel KV does not support atomic GET+EXPIRE (GETEX).
|
|
8
|
-
* The `get()` method uses separate GET and
|
|
8
|
+
* The `get()` method uses separate GET and EXPIRE calls, creating a small race window
|
|
9
9
|
* where the session could expire between these two operations. For mission-critical
|
|
10
10
|
* session handling requiring strict atomicity guarantees, consider using Redis directly
|
|
11
11
|
* via `RedisSessionStore`.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { SessionStore, StoredSession, SessionSecurityConfig } from './transport-session.types';
|
|
16
16
|
import { FrontMcpLogger } from '../../common/interfaces/logger.interface';
|
|
17
|
-
import type { VercelKvProviderOptions } from '../../common/types/options/redis
|
|
17
|
+
import type { VercelKvProviderOptions } from '../../common/types/options/redis';
|
|
18
18
|
export interface VercelKvSessionConfig {
|
|
19
19
|
/**
|
|
20
20
|
* KV REST API URL
|
|
@@ -46,34 +46,34 @@ export interface VercelKvSessionConfig {
|
|
|
46
46
|
*
|
|
47
47
|
* Provides persistent session storage for edge deployments using Vercel KV.
|
|
48
48
|
* Sessions are stored as JSON with optional TTL.
|
|
49
|
+
* Uses @frontmcp/utils VercelKvStorageAdapter internally.
|
|
49
50
|
*/
|
|
50
51
|
export declare class VercelKvSessionStore implements SessionStore {
|
|
51
|
-
private
|
|
52
|
-
private connectPromise;
|
|
52
|
+
private readonly storage;
|
|
53
53
|
private readonly keyPrefix;
|
|
54
54
|
private readonly defaultTtlMs;
|
|
55
55
|
private readonly logger?;
|
|
56
|
-
private readonly config;
|
|
57
56
|
private readonly security;
|
|
58
57
|
private readonly rateLimiter?;
|
|
59
58
|
constructor(config: VercelKvSessionConfig | VercelKvProviderOptions, logger?: FrontMcpLogger);
|
|
59
|
+
/**
|
|
60
|
+
* Validate session ID
|
|
61
|
+
* @throws Error if sessionId is empty
|
|
62
|
+
*/
|
|
63
|
+
private validateSessionId;
|
|
60
64
|
/**
|
|
61
65
|
* Connect to Vercel KV
|
|
62
|
-
*
|
|
63
|
-
* Thread-safe: concurrent calls will share the same connection promise.
|
|
66
|
+
* Thread-safe: concurrent calls will share the same connection via adapter.
|
|
64
67
|
*/
|
|
65
68
|
connect(): Promise<void>;
|
|
66
|
-
private doConnect;
|
|
67
|
-
private ensureConnected;
|
|
68
69
|
/**
|
|
69
|
-
*
|
|
70
|
-
* @throws Error if sessionId is empty
|
|
70
|
+
* Ensure the storage adapter is connected
|
|
71
71
|
*/
|
|
72
|
-
private
|
|
72
|
+
private ensureConnected;
|
|
73
73
|
/**
|
|
74
74
|
* Get a stored session by ID
|
|
75
75
|
*
|
|
76
|
-
* Note: Vercel KV doesn't support GETEX, so we use GET +
|
|
76
|
+
* Note: Vercel KV doesn't support GETEX, so we use GET + EXPIRE separately.
|
|
77
77
|
* This is slightly less atomic than Redis GETEX but sufficient for most use cases.
|
|
78
78
|
*
|
|
79
79
|
* @param sessionId - The session ID to look up
|
|
@@ -103,11 +103,11 @@ export declare class VercelKvSessionStore implements SessionStore {
|
|
|
103
103
|
allocId(): string;
|
|
104
104
|
/**
|
|
105
105
|
* Disconnect from Vercel KV
|
|
106
|
-
* Vercel KV uses REST API, so
|
|
106
|
+
* Vercel KV uses REST API, so this just clears internal state
|
|
107
107
|
*/
|
|
108
108
|
disconnect(): Promise<void>;
|
|
109
109
|
/**
|
|
110
|
-
* Test Vercel KV connection by
|
|
110
|
+
* Test Vercel KV connection by checking if we can access the API.
|
|
111
111
|
* Useful for validating connection on startup.
|
|
112
112
|
*
|
|
113
113
|
* @returns true if connection is healthy, false otherwise
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vercel-kv-session.store.d.ts","sourceRoot":"","sources":["../../../src/auth/session/vercel-kv-session.store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAuB,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"vercel-kv-session.store.d.ts","sourceRoot":"","sources":["../../../src/auth/session/vercel-kv-session.store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAuB,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAIhF,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC;AAED;;;;;;GAMG;AACH,qBAAa,oBAAqB,YAAW,YAAY;IACvD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IACjD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAiB;IAGzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwB;IACjD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAqB;gBAEtC,MAAM,EAAE,qBAAqB,GAAG,uBAAuB,EAAE,MAAM,CAAC,EAAE,cAAc;IAwB5F;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAMzB;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAK9B;;OAEG;YACW,eAAe;IAK7B;;;;;;;;;;;OAWG;IACG,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAsHpG;;OAEG;IACG,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA+BnF;;OAEG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM9C;;OAEG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMjD;;OAEG;IACH,OAAO,IAAI,MAAM;IAIjB;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;CAW/B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derive a consistent authorization ID from a JWT token.
|
|
3
|
+
*
|
|
4
|
+
* Uses the token's signature (third part) to generate a deterministic
|
|
5
|
+
* ID that uniquely identifies this authorization without exposing
|
|
6
|
+
* the full token.
|
|
7
|
+
*
|
|
8
|
+
* @param token - JWT token string
|
|
9
|
+
* @returns 16-character hex string authorization ID
|
|
10
|
+
*/
|
|
11
|
+
export declare function deriveAuthorizationId(token: string): string;
|
|
12
|
+
//# sourceMappingURL=authorization-id.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization-id.utils.d.ts","sourceRoot":"","sources":["../../../src/auth/utils/authorization-id.utils.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI3D"}
|
package/auth/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/utils/index.ts"],"names":[],"mappings":"AAEA,cAAc,0BAA0B,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/utils/index.ts"],"names":[],"mappings":"AAEA,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthProvidersAccessor - Interface for accessing auth provider credentials
|
|
3
|
+
*
|
|
4
|
+
* This interface provides the runtime API for tools to access credentials
|
|
5
|
+
* from registered auth providers. It supports:
|
|
6
|
+
* - Credential retrieval by provider name
|
|
7
|
+
* - Lazy loading with session-scoped caching
|
|
8
|
+
* - Automatic token refresh for OAuth providers
|
|
9
|
+
* - Headers generation for HTTP requests
|
|
10
|
+
*/
|
|
11
|
+
import { Token } from '@frontmcp/di';
|
|
12
|
+
import type { Credential, ResolvedCredential, GetCredentialOptions } from '@frontmcp/auth';
|
|
13
|
+
/**
|
|
14
|
+
* AuthProvidersAccessor - Runtime accessor for auth providers in tool contexts.
|
|
15
|
+
*
|
|
16
|
+
* Available in tool execution via `this.authProviders`:
|
|
17
|
+
* ```typescript
|
|
18
|
+
* @Tool({ name: 'my_tool' })
|
|
19
|
+
* class MyTool extends ToolContext {
|
|
20
|
+
* async execute(input: Input) {
|
|
21
|
+
* const github = await this.authProviders.get('github');
|
|
22
|
+
* const headers = await this.authProviders.headers('github');
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export interface AuthProvidersAccessor {
|
|
28
|
+
/**
|
|
29
|
+
* Get a credential by provider name.
|
|
30
|
+
*
|
|
31
|
+
* @param providerName - Registered provider name (e.g., 'github', 'google')
|
|
32
|
+
* @param options - Retrieval options (forceRefresh, scopes, timeout)
|
|
33
|
+
* @returns Resolved credential or null if not available
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const cred = await this.authProviders.get('github');
|
|
38
|
+
* if (cred?.credential.type === 'oauth') {
|
|
39
|
+
* const token = cred.credential.accessToken;
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example Force refresh
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const cred = await this.authProviders.get('github', { forceRefresh: true });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
get<T extends Credential = Credential>(providerName: string, options?: GetCredentialOptions): Promise<ResolvedCredential<T> | null>;
|
|
49
|
+
/**
|
|
50
|
+
* Get multiple credentials by provider names.
|
|
51
|
+
* Executes all retrievals in parallel for efficiency.
|
|
52
|
+
*
|
|
53
|
+
* @param providerNames - Array of provider names
|
|
54
|
+
* @param options - Retrieval options applied to all providers
|
|
55
|
+
* @returns Map of provider name to resolved credential (null if not available)
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const creds = await this.authProviders.getMany(['github', 'jira']);
|
|
60
|
+
* const github = creds.get('github');
|
|
61
|
+
* const jira = creds.get('jira');
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
getMany(providerNames: string[], options?: GetCredentialOptions): Promise<Map<string, ResolvedCredential | null>>;
|
|
65
|
+
/**
|
|
66
|
+
* Get headers for a provider (convenience method).
|
|
67
|
+
* Automatically handles different credential types:
|
|
68
|
+
* - OAuth/Bearer: `Authorization: Bearer <token>`
|
|
69
|
+
* - API Key: Uses configured header name
|
|
70
|
+
* - Basic: `Authorization: Basic <base64>`
|
|
71
|
+
*
|
|
72
|
+
* @param providerName - Provider name
|
|
73
|
+
* @returns Headers record or empty object if not available
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* const headers = await this.authProviders.headers('github');
|
|
78
|
+
* const response = await fetch(url, { headers });
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
headers(providerName: string): Promise<Record<string, string>>;
|
|
82
|
+
/**
|
|
83
|
+
* Get headers for multiple providers merged into a single object.
|
|
84
|
+
* Later providers override earlier ones if headers conflict.
|
|
85
|
+
*
|
|
86
|
+
* @param providerNames - Array of provider names
|
|
87
|
+
* @returns Merged headers from all providers
|
|
88
|
+
*/
|
|
89
|
+
headersMany(providerNames: string[]): Promise<Record<string, string>>;
|
|
90
|
+
/**
|
|
91
|
+
* Force refresh a credential (for OAuth token refresh).
|
|
92
|
+
* Uses the provider's refresh function if available, otherwise calls factory.
|
|
93
|
+
*
|
|
94
|
+
* @param providerName - Provider name to refresh
|
|
95
|
+
* @returns New credential or null if refresh failed
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* // On 401 response, try refreshing
|
|
100
|
+
* if (response.status === 401) {
|
|
101
|
+
* const newCred = await this.authProviders.refresh('github');
|
|
102
|
+
* if (newCred) {
|
|
103
|
+
* // Retry request with new credential
|
|
104
|
+
* }
|
|
105
|
+
* }
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
refresh(providerName: string): Promise<ResolvedCredential | null>;
|
|
109
|
+
/**
|
|
110
|
+
* Check if a provider credential is available and valid.
|
|
111
|
+
* Does not trigger credential loading.
|
|
112
|
+
*
|
|
113
|
+
* @param providerName - Provider name
|
|
114
|
+
* @returns true if credential exists in cache/vault and is valid
|
|
115
|
+
*/
|
|
116
|
+
has(providerName: string): Promise<boolean>;
|
|
117
|
+
/**
|
|
118
|
+
* Check if a provider is registered (regardless of credential availability).
|
|
119
|
+
*
|
|
120
|
+
* @param providerName - Provider name
|
|
121
|
+
* @returns true if provider is registered
|
|
122
|
+
*/
|
|
123
|
+
isRegistered(providerName: string): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Invalidate cached credential (triggers reload on next access).
|
|
126
|
+
* Does not remove from persistent vault storage.
|
|
127
|
+
*
|
|
128
|
+
* @param providerName - Provider name to invalidate
|
|
129
|
+
*/
|
|
130
|
+
invalidate(providerName: string): void;
|
|
131
|
+
/**
|
|
132
|
+
* Invalidate all cached credentials for this session.
|
|
133
|
+
*/
|
|
134
|
+
invalidateAll(): void;
|
|
135
|
+
/**
|
|
136
|
+
* List all registered provider names.
|
|
137
|
+
*/
|
|
138
|
+
listProviders(): string[];
|
|
139
|
+
/**
|
|
140
|
+
* List all available credentials (loaded in cache or vault).
|
|
141
|
+
*/
|
|
142
|
+
listAvailable(): Promise<string[]>;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* DI Token for AuthProvidersAccessor
|
|
146
|
+
*
|
|
147
|
+
* Used to resolve the accessor in tool contexts:
|
|
148
|
+
* ```typescript
|
|
149
|
+
* const accessor = this.get(AUTH_PROVIDERS_ACCESSOR);
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
export declare const AUTH_PROVIDERS_ACCESSOR: Token<AuthProvidersAccessor>;
|
|
153
|
+
//# sourceMappingURL=auth-providers.accessor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-providers.accessor.d.ts","sourceRoot":"","sources":["../../../src/auth/vault/auth-providers.accessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3F;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,GAAG,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,EACnC,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAEzC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC,CAAC,CAAC;IAElH;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAE/D;;;;;;OAMG;IACH,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAEtE;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAElE;;;;;;OAMG;IACH,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE5C;;;;;OAKG;IACH,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAE5C;;;;;OAKG;IACH,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvC;;OAEG;IACH,aAAa,IAAI,IAAI,CAAC;IAEtB;;OAEG;IACH,aAAa,IAAI,MAAM,EAAE,CAAC;IAE1B;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,EAAqD,KAAK,CAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthProvidersAccessorImpl - Implementation of AuthProvidersAccessor
|
|
3
|
+
*
|
|
4
|
+
* Provides runtime access to credential providers in tool contexts.
|
|
5
|
+
* Handles caching, vault storage, lazy loading, and credential refresh.
|
|
6
|
+
*/
|
|
7
|
+
import type { Credential, CredentialCache, CredentialFactoryContext, GetCredentialOptions, ResolvedCredential } from '@frontmcp/auth';
|
|
8
|
+
import type { AuthProvidersAccessor } from './auth-providers.accessor';
|
|
9
|
+
import type { AuthProvidersRegistry } from './auth-providers.registry';
|
|
10
|
+
import type { AuthProvidersVault } from './auth-providers.vault';
|
|
11
|
+
import type { LazyCredentialLoader } from './credential-loaders/lazy-loader';
|
|
12
|
+
import { FrontMcpLogger } from '../../common';
|
|
13
|
+
/**
|
|
14
|
+
* AuthProvidersAccessorImpl - Runtime implementation
|
|
15
|
+
*/
|
|
16
|
+
export declare class AuthProvidersAccessorImpl implements AuthProvidersAccessor {
|
|
17
|
+
private readonly registry;
|
|
18
|
+
private readonly vault;
|
|
19
|
+
private readonly cache;
|
|
20
|
+
private readonly loader;
|
|
21
|
+
private readonly context;
|
|
22
|
+
private readonly logger?;
|
|
23
|
+
constructor(registry: AuthProvidersRegistry, vault: AuthProvidersVault, cache: CredentialCache, loader: LazyCredentialLoader, context: CredentialFactoryContext, logger?: FrontMcpLogger);
|
|
24
|
+
get<T extends Credential = Credential>(providerName: string, options?: GetCredentialOptions): Promise<ResolvedCredential<T> | null>;
|
|
25
|
+
getMany(providerNames: string[], options?: GetCredentialOptions): Promise<Map<string, ResolvedCredential | null>>;
|
|
26
|
+
headers(providerName: string): Promise<Record<string, string>>;
|
|
27
|
+
headersMany(providerNames: string[]): Promise<Record<string, string>>;
|
|
28
|
+
refresh(providerName: string): Promise<ResolvedCredential | null>;
|
|
29
|
+
has(providerName: string): Promise<boolean>;
|
|
30
|
+
isRegistered(providerName: string): boolean;
|
|
31
|
+
invalidate(providerName: string): void;
|
|
32
|
+
invalidateAll(): void;
|
|
33
|
+
listProviders(): string[];
|
|
34
|
+
listAvailable(): Promise<string[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Load credential from vault storage
|
|
37
|
+
*/
|
|
38
|
+
private loadFromVault;
|
|
39
|
+
/**
|
|
40
|
+
* Store credential in vault storage
|
|
41
|
+
*/
|
|
42
|
+
private storeInVault;
|
|
43
|
+
/**
|
|
44
|
+
* Check if a resolved credential is still valid
|
|
45
|
+
*/
|
|
46
|
+
private isValid;
|
|
47
|
+
/**
|
|
48
|
+
* Generate default headers for a credential type
|
|
49
|
+
*/
|
|
50
|
+
private defaultHeaders;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=auth-providers.accessor.impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-providers.accessor.impl.d.ts","sourceRoot":"","sources":["../../../src/auth/vault/auth-providers.accessor.impl.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAA4B,MAAM,2BAA2B,CAAC;AACjG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;GAEG;AACH,qBAAa,yBAA0B,YAAW,qBAAqB;IAInE,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAP1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAiB;gBAGtB,QAAQ,EAAE,qBAAqB,EAC/B,KAAK,EAAE,kBAAkB,EACzB,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EAAE,wBAAwB,EAClD,MAAM,CAAC,EAAE,cAAc;IAKnB,GAAG,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,EACzC,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAwClC,OAAO,CACX,aAAa,EAAE,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAuB5C,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAc9D,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAWrE,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAgCjE,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAqBjD,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAI3C,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAKtC,aAAa,IAAI,IAAI;IAKrB,aAAa,IAAI,MAAM,EAAE;IAInB,aAAa,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAYxC;;OAEG;YACW,aAAa;IA8B3B;;OAEG;YACW,YAAY;IAkB1B;;OAEG;IACH,OAAO,CAAC,OAAO;IAYf;;OAEG;IACH,OAAO,CAAC,cAAc;CAmCvB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthProviders Context Extension
|
|
3
|
+
*
|
|
4
|
+
* Provides module augmentation and context extension configuration
|
|
5
|
+
* for adding `this.authProviders` to ExecutionContextBase.
|
|
6
|
+
*/
|
|
7
|
+
import type { ContextExtension } from '../../common/metadata/plugin.metadata';
|
|
8
|
+
import { AuthProvidersAccessor } from './auth-providers.accessor';
|
|
9
|
+
/**
|
|
10
|
+
* Module augmentation to add type safety for this.authProviders
|
|
11
|
+
*/
|
|
12
|
+
declare module '../../common/interfaces/execution-context.interface' {
|
|
13
|
+
interface ExecutionContextBase {
|
|
14
|
+
/**
|
|
15
|
+
* Access auth providers for credential retrieval.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* @Tool({ name: 'my_tool' })
|
|
20
|
+
* class MyTool extends ToolContext {
|
|
21
|
+
* async execute(input: Input): Promise<Output> {
|
|
22
|
+
* // Get a specific credential
|
|
23
|
+
* const github = await this.authProviders.get('github');
|
|
24
|
+
*
|
|
25
|
+
* // Get headers for HTTP requests
|
|
26
|
+
* const headers = await this.authProviders.headers('github');
|
|
27
|
+
*
|
|
28
|
+
* // Check if credential is available
|
|
29
|
+
* if (await this.authProviders.has('jira')) {
|
|
30
|
+
* const jira = await this.authProviders.get('jira');
|
|
31
|
+
* }
|
|
32
|
+
*
|
|
33
|
+
* // Force refresh a credential
|
|
34
|
+
* const refreshed = await this.authProviders.refresh('github');
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
readonly authProviders: AuthProvidersAccessor;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Context extension configuration for authProviders.
|
|
44
|
+
* Used to register the lazy getter on ExecutionContextBase.prototype.
|
|
45
|
+
*/
|
|
46
|
+
export declare const authProvidersContextExtension: ContextExtension;
|
|
47
|
+
/**
|
|
48
|
+
* Get AuthProvidersAccessor from context.
|
|
49
|
+
* Throws if not available.
|
|
50
|
+
*
|
|
51
|
+
* @param ctx - Execution context
|
|
52
|
+
* @returns AuthProvidersAccessor
|
|
53
|
+
* @throws Error if AuthProviders not configured
|
|
54
|
+
*/
|
|
55
|
+
export declare function getAuthProviders(ctx: {
|
|
56
|
+
get: <T>(token: unknown) => T;
|
|
57
|
+
}): AuthProvidersAccessor;
|
|
58
|
+
/**
|
|
59
|
+
* Try to get AuthProvidersAccessor from context.
|
|
60
|
+
* Returns undefined if not available (graceful degradation).
|
|
61
|
+
*
|
|
62
|
+
* @param ctx - Execution context
|
|
63
|
+
* @returns AuthProvidersAccessor or undefined
|
|
64
|
+
*/
|
|
65
|
+
export declare function tryGetAuthProviders(ctx: {
|
|
66
|
+
get: <T>(token: unknown) => T;
|
|
67
|
+
}): AuthProvidersAccessor | undefined;
|
|
68
|
+
//# sourceMappingURL=auth-providers.context-extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-providers.context-extension.d.ts","sourceRoot":"","sources":["../../../src/auth/vault/auth-providers.context-extension.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAA2B,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAM3F;;GAEG;AACH,OAAO,QAAQ,qDAAqD,CAAC;IACnE,UAAU,oBAAoB;QAC5B;;;;;;;;;;;;;;;;;;;;;;;;WAwBG;QACH,QAAQ,CAAC,aAAa,EAAE,qBAAqB,CAAC;KAC/C;CACF;AASD;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,gBAM3C,CAAC;AAMF;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE;IAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,CAAC,CAAA;CAAE,GAAG,qBAAqB,CAU9F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE;IAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,CAAC,CAAA;CAAE,GAAG,qBAAqB,GAAG,SAAS,CAM7G"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthProviders DI Providers
|
|
3
|
+
*
|
|
4
|
+
* Defines dependency injection providers for the AuthProviders vault system.
|
|
5
|
+
* These providers are registered at scope initialization when AuthProviders is enabled.
|
|
6
|
+
*/
|
|
7
|
+
import type { Token } from '@frontmcp/di';
|
|
8
|
+
import { ProviderScope } from '@frontmcp/di';
|
|
9
|
+
import type { AuthorizationVault, AuthProvidersVaultOptions } from '@frontmcp/auth';
|
|
10
|
+
import { LazyCredentialLoader } from './credential-loaders/lazy-loader';
|
|
11
|
+
/**
|
|
12
|
+
* Token for lazy loader (internal use)
|
|
13
|
+
*/
|
|
14
|
+
export declare const LAZY_CREDENTIAL_LOADER: Token<LazyCredentialLoader>;
|
|
15
|
+
/**
|
|
16
|
+
* Provider definition type for AuthProviders system.
|
|
17
|
+
* Extended to include scope at top level for SDK compatibility.
|
|
18
|
+
*/
|
|
19
|
+
interface AuthProvidersProviderDef {
|
|
20
|
+
provide: Token;
|
|
21
|
+
scope: ProviderScope;
|
|
22
|
+
name?: string;
|
|
23
|
+
useFactory?: (...args: any[]) => any;
|
|
24
|
+
useValue?: unknown;
|
|
25
|
+
inject?: () => readonly Token[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create providers for AuthProviders vault system
|
|
29
|
+
*
|
|
30
|
+
* @param options - Vault configuration options
|
|
31
|
+
* @param baseVault - Base AuthorizationVault for storage
|
|
32
|
+
* @returns Array of provider definitions
|
|
33
|
+
*/
|
|
34
|
+
export declare function createAuthProvidersProviders(options: AuthProvidersVaultOptions, baseVault: AuthorizationVault): AuthProvidersProviderDef[];
|
|
35
|
+
/**
|
|
36
|
+
* Check if AuthProviders should be enabled based on options
|
|
37
|
+
*/
|
|
38
|
+
export declare function isAuthProvidersEnabled(options?: AuthProvidersVaultOptions): boolean;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=auth-providers.providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-providers.providers.d.ts","sourceRoot":"","sources":["../../../src/auth/vault/auth-providers.providers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAA4B,MAAM,gBAAgB,CAAC;AAU9G,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAoD,KAAK,CAAC,oBAAoB,CAAC,CAAC;AAEnH;;;GAGG;AACH,UAAU,wBAAwB;IAChC,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,SAAS,KAAK,EAAE,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,yBAAyB,EAClC,SAAS,EAAE,kBAAkB,GAC5B,wBAAwB,EAAE,CA4E5B;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAWnF"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthProvidersRegistry - Registry for credential providers
|
|
3
|
+
*
|
|
4
|
+
* Manages registration and lookup of credential providers.
|
|
5
|
+
* Providers are registered at scope initialization and
|
|
6
|
+
* remain available for the lifetime of the scope.
|
|
7
|
+
*/
|
|
8
|
+
import { Token } from '@frontmcp/di';
|
|
9
|
+
import type { Credential, CredentialProviderConfig, CredentialScope, LoadingStrategy, AuthProvidersVaultOptions } from '@frontmcp/auth';
|
|
10
|
+
/**
|
|
11
|
+
* Normalized provider config with defaults applied
|
|
12
|
+
*/
|
|
13
|
+
export interface NormalizedProviderConfig<T extends Credential = Credential> extends Required<Pick<CredentialProviderConfig<T>, 'name' | 'scope' | 'loading'>> {
|
|
14
|
+
description?: string;
|
|
15
|
+
cacheTtl: number;
|
|
16
|
+
factory: CredentialProviderConfig<T>['factory'];
|
|
17
|
+
refresh?: CredentialProviderConfig<T>['refresh'];
|
|
18
|
+
toHeaders?: CredentialProviderConfig<T>['toHeaders'];
|
|
19
|
+
metadata?: Record<string, unknown>;
|
|
20
|
+
required: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* AuthProvidersRegistry - Manages credential provider configurations
|
|
24
|
+
*/
|
|
25
|
+
export declare class AuthProvidersRegistry {
|
|
26
|
+
private readonly providers;
|
|
27
|
+
private readonly defaultCacheTtl;
|
|
28
|
+
constructor(options?: AuthProvidersVaultOptions);
|
|
29
|
+
/**
|
|
30
|
+
* Register a credential provider
|
|
31
|
+
*
|
|
32
|
+
* @param config - Provider configuration
|
|
33
|
+
* @throws Error if provider with same name already registered
|
|
34
|
+
*/
|
|
35
|
+
register<T extends Credential = Credential>(config: CredentialProviderConfig<T>): void;
|
|
36
|
+
/**
|
|
37
|
+
* Unregister a credential provider
|
|
38
|
+
*
|
|
39
|
+
* @param name - Provider name to unregister
|
|
40
|
+
* @returns true if provider was unregistered, false if not found
|
|
41
|
+
*/
|
|
42
|
+
unregister(name: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Get a provider configuration by name
|
|
45
|
+
*
|
|
46
|
+
* @param name - Provider name
|
|
47
|
+
* @returns Provider config or undefined if not found
|
|
48
|
+
*/
|
|
49
|
+
get<T extends Credential = Credential>(name: string): NormalizedProviderConfig<T> | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Check if a provider is registered
|
|
52
|
+
*
|
|
53
|
+
* @param name - Provider name
|
|
54
|
+
* @returns true if provider is registered
|
|
55
|
+
*/
|
|
56
|
+
has(name: string): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Get all registered provider names
|
|
59
|
+
*/
|
|
60
|
+
getNames(): string[];
|
|
61
|
+
/**
|
|
62
|
+
* Get all provider configurations
|
|
63
|
+
*/
|
|
64
|
+
getAll(): NormalizedProviderConfig[];
|
|
65
|
+
/**
|
|
66
|
+
* Get providers by scope
|
|
67
|
+
*
|
|
68
|
+
* @param scope - Credential scope to filter by
|
|
69
|
+
*/
|
|
70
|
+
getByScope(scope: CredentialScope): NormalizedProviderConfig[];
|
|
71
|
+
/**
|
|
72
|
+
* Get providers by loading strategy
|
|
73
|
+
*
|
|
74
|
+
* @param loading - Loading strategy to filter by
|
|
75
|
+
*/
|
|
76
|
+
getByLoading(loading: LoadingStrategy): NormalizedProviderConfig[];
|
|
77
|
+
/**
|
|
78
|
+
* Get providers that are required
|
|
79
|
+
*/
|
|
80
|
+
getRequired(): NormalizedProviderConfig[];
|
|
81
|
+
/**
|
|
82
|
+
* Get providers that should be eagerly loaded
|
|
83
|
+
*/
|
|
84
|
+
getEager(): NormalizedProviderConfig[];
|
|
85
|
+
/**
|
|
86
|
+
* Get providers that should be lazily loaded
|
|
87
|
+
*/
|
|
88
|
+
getLazy(): NormalizedProviderConfig[];
|
|
89
|
+
/**
|
|
90
|
+
* Get the number of registered providers
|
|
91
|
+
*/
|
|
92
|
+
get size(): number;
|
|
93
|
+
/**
|
|
94
|
+
* Check if registry is empty
|
|
95
|
+
*/
|
|
96
|
+
isEmpty(): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Clear all registered providers
|
|
99
|
+
*/
|
|
100
|
+
clear(): void;
|
|
101
|
+
/**
|
|
102
|
+
* Normalize provider config with defaults
|
|
103
|
+
*/
|
|
104
|
+
private normalize;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* DI Token for AuthProvidersRegistry
|
|
108
|
+
*/
|
|
109
|
+
export declare const AUTH_PROVIDERS_REGISTRY: Token<AuthProvidersRegistry>;
|
|
110
|
+
//# sourceMappingURL=auth-providers.registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-providers.registry.d.ts","sourceRoot":"","sources":["../../../src/auth/vault/auth-providers.registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EACV,UAAU,EACV,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,yBAAyB,EAC1B,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,CACzE,SAAQ,QAAQ,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAChD,OAAO,CAAC,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACjD,SAAS,CAAC,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+C;IACzE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;gBAE7B,OAAO,CAAC,EAAE,yBAAyB;IAU/C;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,EAAE,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC,GAAG,IAAI;IAUtF;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIjC;;;;;OAKG;IACH,GAAG,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,wBAAwB,CAAC,CAAC,CAAC,GAAG,SAAS;IAI7F;;;;;OAKG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B;;OAEG;IACH,QAAQ,IAAI,MAAM,EAAE;IAIpB;;OAEG;IACH,MAAM,IAAI,wBAAwB,EAAE;IAIpC;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,wBAAwB,EAAE;IAI9D;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,wBAAwB,EAAE;IAIlE;;OAEG;IACH,WAAW,IAAI,wBAAwB,EAAE;IAIzC;;OAEG;IACH,QAAQ,IAAI,wBAAwB,EAAE;IAItC;;OAEG;IACH,OAAO,IAAI,wBAAwB,EAAE;IAIrC;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,OAAO,CAAC,SAAS;CAclB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAqD,KAAK,CAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthProvidersVault - Dedicated storage namespace for auth provider credentials
|
|
3
|
+
*
|
|
4
|
+
* Uses the same underlying storage (Redis/Vercel KV) as AuthorizationVault
|
|
5
|
+
* but with a separate namespace to avoid conflicts.
|
|
6
|
+
*/
|
|
7
|
+
import { Token } from '@frontmcp/di';
|
|
8
|
+
import type { Credential, AuthorizationVault, AppCredential, CredentialScope } from '@frontmcp/auth';
|
|
9
|
+
import { FrontMcpLogger } from '../../common';
|
|
10
|
+
/**
|
|
11
|
+
* AuthProvidersVault - Storage layer for auth provider credentials
|
|
12
|
+
*/
|
|
13
|
+
export declare class AuthProvidersVault {
|
|
14
|
+
private readonly baseVault;
|
|
15
|
+
private readonly namespace;
|
|
16
|
+
private readonly logger?;
|
|
17
|
+
constructor(baseVault: AuthorizationVault, namespace?: string, logger?: FrontMcpLogger);
|
|
18
|
+
/**
|
|
19
|
+
* Store a credential in the vault
|
|
20
|
+
*
|
|
21
|
+
* @param sessionId - Current session ID
|
|
22
|
+
* @param providerId - Provider name
|
|
23
|
+
* @param credential - Credential to store
|
|
24
|
+
* @param scope - Credential scope
|
|
25
|
+
* @param userId - User ID (required for user scope)
|
|
26
|
+
*/
|
|
27
|
+
storeCredential<T extends Credential>(sessionId: string, providerId: string, credential: T, scope: CredentialScope, userId?: string): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Get a credential from the vault
|
|
30
|
+
*
|
|
31
|
+
* @param sessionId - Current session ID
|
|
32
|
+
* @param providerId - Provider name
|
|
33
|
+
* @param scope - Credential scope
|
|
34
|
+
* @param userId - User ID (required for user scope)
|
|
35
|
+
* @returns Credential or null if not found
|
|
36
|
+
*/
|
|
37
|
+
getCredential<T extends Credential>(sessionId: string, providerId: string, scope: CredentialScope, userId?: string): Promise<T | null>;
|
|
38
|
+
/**
|
|
39
|
+
* Remove a credential from the vault
|
|
40
|
+
*
|
|
41
|
+
* @param sessionId - Current session ID
|
|
42
|
+
* @param providerId - Provider name
|
|
43
|
+
* @param scope - Credential scope
|
|
44
|
+
* @param userId - User ID (required for user scope)
|
|
45
|
+
*/
|
|
46
|
+
removeCredential(sessionId: string, providerId: string, scope: CredentialScope, userId?: string): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Invalidate a credential (mark as invalid without removing)
|
|
49
|
+
*
|
|
50
|
+
* @param sessionId - Current session ID
|
|
51
|
+
* @param providerId - Provider name
|
|
52
|
+
* @param scope - Credential scope
|
|
53
|
+
* @param reason - Reason for invalidation
|
|
54
|
+
* @param userId - User ID (required for user scope)
|
|
55
|
+
*/
|
|
56
|
+
invalidateCredential(sessionId: string, providerId: string, scope: CredentialScope, reason: string, userId?: string): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Update OAuth credential tokens (for refresh)
|
|
59
|
+
*
|
|
60
|
+
* @param sessionId - Current session ID
|
|
61
|
+
* @param providerId - Provider name
|
|
62
|
+
* @param scope - Credential scope
|
|
63
|
+
* @param tokens - New tokens
|
|
64
|
+
* @param userId - User ID (required for user scope)
|
|
65
|
+
*/
|
|
66
|
+
refreshOAuthCredential(sessionId: string, providerId: string, scope: CredentialScope, tokens: {
|
|
67
|
+
accessToken: string;
|
|
68
|
+
refreshToken?: string;
|
|
69
|
+
expiresAt?: number;
|
|
70
|
+
}, userId?: string): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Get all credentials for a session
|
|
73
|
+
*
|
|
74
|
+
* @param sessionId - Current session ID
|
|
75
|
+
* @param scope - Optional scope filter
|
|
76
|
+
* @param userId - User ID (required for user scope)
|
|
77
|
+
*/
|
|
78
|
+
getAllCredentials(sessionId: string, scope?: CredentialScope, userId?: string): Promise<AppCredential[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Build vault key based on scope
|
|
81
|
+
*
|
|
82
|
+
* Key patterns:
|
|
83
|
+
* - global: `authproviders:global`
|
|
84
|
+
* - user: `authproviders:user:{userId}`
|
|
85
|
+
* - session: `authproviders:session:{sessionId}`
|
|
86
|
+
*/
|
|
87
|
+
private buildVaultKey;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* DI Token for AuthProvidersVault
|
|
91
|
+
*/
|
|
92
|
+
export declare const AUTH_PROVIDERS_VAULT: Token<AuthProvidersVault>;
|
|
93
|
+
//# sourceMappingURL=auth-providers.vault.d.ts.map
|