@frontmcp/sdk 0.2.5 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -99
- package/package.json +24 -2
- package/src/adapter/adapter.instance.d.ts +11 -0
- package/src/adapter/adapter.instance.js +65 -0
- package/src/adapter/adapter.instance.js.map +1 -0
- package/src/adapter/adapter.regsitry.d.ts +13 -0
- package/src/adapter/adapter.regsitry.js +54 -0
- package/src/adapter/adapter.regsitry.js.map +1 -0
- package/src/adapter/adapter.utils.d.ts +10 -0
- package/src/adapter/adapter.utils.js +83 -0
- package/src/adapter/adapter.utils.js.map +1 -0
- package/src/app/app.registry.d.ts +12 -0
- package/src/app/app.registry.js +64 -0
- package/src/app/app.registry.js.map +1 -0
- package/src/app/app.utils.d.ts +15 -0
- package/src/app/app.utils.js +58 -0
- package/src/app/app.utils.js.map +1 -0
- package/src/app/instances/app.local.instance.d.ts +25 -0
- package/src/app/instances/app.local.instance.js +70 -0
- package/src/app/instances/app.local.instance.js.map +1 -0
- package/src/app/instances/app.remote.instance.d.ts +13 -0
- package/src/app/instances/app.remote.instance.js +36 -0
- package/src/app/instances/app.remote.instance.js.map +1 -0
- package/src/app/instances/index.d.ts +2 -0
- package/src/app/instances/index.js +6 -0
- package/src/app/instances/index.js.map +1 -0
- package/src/auth/auth.registry.d.ts +13 -0
- package/src/auth/auth.registry.js +81 -0
- package/src/auth/auth.registry.js.map +1 -0
- package/src/auth/auth.utils.d.ts +10 -0
- package/src/auth/auth.utils.js +85 -0
- package/src/auth/auth.utils.js.map +1 -0
- package/src/auth/flows/oauth.authorize.flow.d.ts +231 -0
- package/src/auth/flows/oauth.authorize.flow.js +154 -0
- package/src/auth/flows/oauth.authorize.flow.js.map +1 -0
- package/src/auth/flows/oauth.register.flow.d.ts +202 -0
- package/src/auth/flows/oauth.register.flow.js +201 -0
- package/src/auth/flows/oauth.register.flow.js.map +1 -0
- package/src/auth/flows/oauth.token.flow.d.ts +242 -0
- package/src/auth/flows/oauth.token.flow.js +181 -0
- package/src/auth/flows/oauth.token.flow.js.map +1 -0
- package/src/auth/flows/session.verify.flow.d.ts +404 -0
- package/src/auth/flows/session.verify.flow.js +205 -0
- package/src/auth/flows/session.verify.flow.js.map +1 -0
- package/src/auth/flows/well-known.jwks.flow.d.ts +261 -0
- package/src/auth/flows/well-known.jwks.flow.js +82 -0
- package/src/auth/flows/well-known.jwks.flow.js.map +1 -0
- package/src/auth/flows/well-known.oauth-authorization-server.flow.d.ts +282 -0
- package/src/auth/flows/well-known.oauth-authorization-server.flow.js +123 -0
- package/src/auth/flows/well-known.oauth-authorization-server.flow.js.map +1 -0
- package/src/auth/flows/well-known.prm.flow.d.ts +159 -0
- package/src/auth/flows/well-known.prm.flow.js +107 -0
- package/src/auth/flows/well-known.prm.flow.js.map +1 -0
- package/src/auth/instances/instance.local-primary-auth.d.ts +19 -0
- package/src/auth/instances/instance.local-primary-auth.js +76 -0
- package/src/auth/instances/instance.local-primary-auth.js.map +1 -0
- package/src/auth/instances/instance.remote-primary-auth.d.ts +14 -0
- package/src/auth/instances/instance.remote-primary-auth.js +47 -0
- package/src/auth/instances/instance.remote-primary-auth.js.map +1 -0
- package/src/auth/jwks/index.d.ts +2 -0
- package/src/auth/jwks/index.js +6 -0
- package/src/auth/jwks/index.js.map +1 -0
- package/src/auth/jwks/jwks.service.d.ts +41 -0
- package/src/auth/jwks/jwks.service.js +235 -0
- package/src/auth/jwks/jwks.service.js.map +1 -0
- package/src/auth/jwks/jwks.types.d.ts +25 -0
- package/src/auth/jwks/jwks.types.js +3 -0
- package/src/auth/jwks/jwks.types.js.map +1 -0
- package/src/auth/jwks/jwks.utils.d.ts +4 -0
- package/src/auth/jwks/jwks.utils.js +32 -0
- package/src/auth/jwks/jwks.utils.js.map +1 -0
- package/src/auth/oauth/flows/oauth.authorize.flow.d.ts +31 -0
- package/src/auth/oauth/flows/oauth.authorize.flow.js +33 -0
- package/src/auth/oauth/flows/oauth.authorize.flow.js.map +1 -0
- package/src/auth/oauth/flows/oauth.device-authorization.flow.d.ts +46 -0
- package/src/auth/oauth/flows/oauth.device-authorization.flow.js +48 -0
- package/src/auth/oauth/flows/oauth.device-authorization.flow.js.map +1 -0
- package/src/auth/oauth/flows/oauth.introspect.flow.d.ts +26 -0
- package/src/auth/oauth/flows/oauth.introspect.flow.js +28 -0
- package/src/auth/oauth/flows/oauth.introspect.flow.js.map +1 -0
- package/src/auth/oauth/flows/oauth.par.flow.d.ts +27 -0
- package/src/auth/oauth/flows/oauth.par.flow.js +29 -0
- package/src/auth/oauth/flows/oauth.par.flow.js.map +1 -0
- package/src/auth/oauth/flows/oauth.revoke.flow.d.ts +25 -0
- package/src/auth/oauth/flows/oauth.revoke.flow.js +27 -0
- package/src/auth/oauth/flows/oauth.revoke.flow.js.map +1 -0
- package/src/auth/oauth/flows/oauth.token.flow.d.ts +57 -0
- package/src/auth/oauth/flows/oauth.token.flow.js +59 -0
- package/src/auth/oauth/flows/oauth.token.flow.js.map +1 -0
- package/src/auth/oauth/flows/oauth.userinfo.flow.d.ts +22 -0
- package/src/auth/oauth/flows/oauth.userinfo.flow.js +24 -0
- package/src/auth/oauth/flows/oauth.userinfo.flow.js.map +1 -0
- package/src/auth/oauth/flows/oidc.logout.flow.d.ts +18 -0
- package/src/auth/oauth/flows/oidc.logout.flow.js +20 -0
- package/src/auth/oauth/flows/oidc.logout.flow.js.map +1 -0
- package/src/auth/path.utils.d.ts +20 -0
- package/src/auth/path.utils.js +71 -0
- package/src/auth/path.utils.js.map +1 -0
- package/src/auth/session/index.d.ts +4 -0
- package/src/auth/session/index.js +10 -0
- package/src/auth/session/index.js.map +1 -0
- package/src/auth/session/record/session.base.d.ts +103 -0
- package/src/auth/session/record/session.base.js +123 -0
- package/src/auth/session/record/session.base.js.map +1 -0
- package/src/auth/session/record/session.stateful.d.ts +20 -0
- package/src/auth/session/record/session.stateful.js +55 -0
- package/src/auth/session/record/session.stateful.js.map +1 -0
- package/src/auth/session/record/session.stateless.d.ts +17 -0
- package/src/auth/session/record/session.stateless.js +30 -0
- package/src/auth/session/record/session.stateless.js.map +1 -0
- package/src/auth/session/record/session.transparent.d.ts +17 -0
- package/src/auth/session/record/session.transparent.js +22 -0
- package/src/auth/session/record/session.transparent.js.map +1 -0
- package/src/auth/session/session.crypto.d.ts +7 -0
- package/src/auth/session/session.crypto.js +47 -0
- package/src/auth/session/session.crypto.js.map +1 -0
- package/src/auth/session/session.schema.d.ts +5 -0
- package/src/auth/session/session.schema.js +13 -0
- package/src/auth/session/session.schema.js.map +1 -0
- package/src/auth/session/session.service.d.ts +17 -0
- package/src/auth/session/session.service.js +111 -0
- package/src/auth/session/session.service.js.map +1 -0
- package/src/auth/session/session.transport.d.ts +4 -0
- package/src/auth/session/session.transport.js +20 -0
- package/src/auth/session/session.transport.js.map +1 -0
- package/src/auth/session/session.types.d.ts +65 -0
- package/src/auth/session/session.types.js +4 -0
- package/src/auth/session/session.types.js.map +1 -0
- package/src/auth/session/token.refresh.d.ts +60 -0
- package/src/auth/session/token.refresh.js +63 -0
- package/src/auth/session/token.refresh.js.map +1 -0
- package/src/auth/session/token.store.d.ts +35 -0
- package/src/auth/session/token.store.js +53 -0
- package/src/auth/session/token.store.js.map +1 -0
- package/src/auth/session/token.vault.d.ts +26 -0
- package/src/auth/session/token.vault.js +54 -0
- package/src/auth/session/token.vault.js.map +1 -0
- package/src/auth/session/utils/auth-token.utils.d.ts +11 -0
- package/src/auth/session/utils/auth-token.utils.js +57 -0
- package/src/auth/session/utils/auth-token.utils.js.map +1 -0
- package/src/auth/session/utils/session-id.utils.d.ts +17 -0
- package/src/auth/session/utils/session-id.utils.js +129 -0
- package/src/auth/session/utils/session-id.utils.js.map +1 -0
- package/src/auth/session/utils/tiny-ttl-cache.d.ts +7 -0
- package/src/auth/session/utils/tiny-ttl-cache.js +26 -0
- package/src/auth/session/utils/tiny-ttl-cache.js.map +1 -0
- package/src/common/common.schema.d.ts +29 -0
- package/src/common/common.schema.js +35 -0
- package/src/common/common.schema.js.map +1 -0
- package/src/common/constants.d.ts +2 -0
- package/src/common/constants.js +8 -0
- package/src/common/constants.js.map +1 -0
- package/src/common/decorators/adapter.decorator.js.map +1 -0
- package/src/common/decorators/app.decorator.js.map +1 -0
- package/src/common/decorators/auth-provider.decorator.js.map +1 -0
- package/src/common/decorators/flow.decorator.js.map +1 -0
- package/src/common/decorators/front-mcp.decorator.js +40 -0
- package/src/common/decorators/front-mcp.decorator.js.map +1 -0
- package/src/common/decorators/hook.decorator.js.map +1 -0
- package/src/common/decorators/index.js.map +1 -0
- package/src/common/decorators/logger.decorator.js.map +1 -0
- package/src/common/decorators/plugin.decorator.js.map +1 -0
- package/src/common/decorators/prompt.decorator.js.map +1 -0
- package/src/common/decorators/provider.decorator.js.map +1 -0
- package/src/common/decorators/resource.decorator.js.map +1 -0
- package/src/common/decorators/tool.decorator.d.ts +42 -0
- package/src/common/decorators/tool.decorator.js +46 -0
- package/src/common/decorators/tool.decorator.js.map +1 -0
- package/src/common/decorators-old/async-with.decorator.d.ts +10 -0
- package/src/common/decorators-old/async-with.decorator.js +24 -0
- package/src/common/decorators-old/async-with.decorator.js.map +1 -0
- package/src/common/decorators-old/auth-hook.decorator.js.map +1 -0
- package/src/common/decorators-old/session-hook.decorator.js.map +1 -0
- package/src/common/dynamic/dynamic.adapter.js.map +1 -0
- package/src/common/dynamic/dynamic.plugin.js.map +1 -0
- package/src/common/dynamic/dynamic.utils.d.ts +3 -0
- package/src/common/dynamic/dynamic.utils.js.map +1 -0
- package/src/common/dynamic/index.js.map +1 -0
- package/src/common/entries/adapter.entry.js.map +1 -0
- package/src/common/entries/app.entry.d.ts +13 -0
- package/src/common/entries/app.entry.js.map +1 -0
- package/src/common/entries/auth-provider.entry.js.map +1 -0
- package/src/common/entries/base.entry.js.map +1 -0
- package/src/common/entries/flow.entry.js.map +1 -0
- package/src/common/entries/hook.entry.js.map +1 -0
- package/src/common/entries/index.js.map +1 -0
- package/src/common/entries/logger.entry.js.map +1 -0
- package/src/common/entries/plugin.entry.js.map +1 -0
- package/src/common/entries/prompt.entry.js.map +1 -0
- package/src/common/entries/provider.entry.js.map +1 -0
- package/src/common/entries/resource.entry.js.map +1 -0
- package/src/common/entries/scope.entry.js.map +1 -0
- package/src/common/entries/tool.entry.js.map +1 -0
- package/src/common/index.d.ts +17 -0
- package/src/common/index.js +21 -0
- package/src/common/index.js.map +1 -0
- package/src/common/interfaces/adapter.interface.js.map +1 -0
- package/src/common/interfaces/app.interface.js.map +1 -0
- package/src/common/interfaces/auth-hook.interface.js.map +1 -0
- package/src/common/interfaces/auth-provider.interface.js.map +1 -0
- package/src/common/interfaces/base.interface.js.map +1 -0
- package/src/common/interfaces/flow.interface.d.ts +41 -0
- package/src/common/interfaces/flow.interface.js.map +1 -0
- package/src/common/interfaces/front-mcp.interface.js.map +1 -0
- package/src/common/interfaces/hook.interface.js.map +1 -0
- package/src/common/interfaces/index.js.map +1 -0
- package/src/common/interfaces/internal/flow.utils.d.ts +23 -0
- package/src/common/interfaces/internal/flow.utils.js.map +1 -0
- package/src/common/interfaces/internal/index.js.map +1 -0
- package/src/common/interfaces/internal/primary-auth-provider.interface.d.ts +24 -0
- package/src/common/interfaces/internal/primary-auth-provider.interface.js.map +1 -0
- package/src/common/interfaces/internal/registry.interface.d.ts +95 -0
- package/src/common/interfaces/internal/registry.interface.js.map +1 -0
- package/src/common/interfaces/logger.interface.js.map +1 -0
- package/src/common/interfaces/plugin.interface.js.map +1 -0
- package/src/common/interfaces/prompt.interface.js.map +1 -0
- package/src/common/interfaces/provider.interface.js.map +1 -0
- package/src/common/interfaces/resource.interface.js.map +1 -0
- package/src/common/interfaces/scope.interface.js.map +1 -0
- package/src/common/interfaces/server.interface.js.map +1 -0
- package/src/common/interfaces/session-hook.interface.js.map +1 -0
- package/src/common/interfaces/tool-hook.interface.js.map +1 -0
- package/src/common/interfaces/tool.interface.js.map +1 -0
- package/src/common/metadata/adapter.metadata.js.map +1 -0
- package/src/common/metadata/app.metadata.d.ts +872 -0
- package/src/common/metadata/app.metadata.js.map +1 -0
- package/src/common/metadata/auth-provider.metadata.js.map +1 -0
- package/src/common/metadata/flow.metadata.d.ts +77 -0
- package/src/common/metadata/flow.metadata.js.map +1 -0
- package/src/common/metadata/front-mcp.metadata.d.ts +1144 -0
- package/src/common/metadata/front-mcp.metadata.js.map +1 -0
- package/src/common/metadata/hook.metadata.js.map +1 -0
- package/src/common/metadata/index.js.map +1 -0
- package/src/common/metadata/logger.metadata.js.map +1 -0
- package/src/common/metadata/plugin.metadata.js.map +1 -0
- package/src/common/metadata/prompt.metadata.js.map +1 -0
- package/src/common/metadata/provider.metadata.js.map +1 -0
- package/src/common/metadata/resource.metadata.js.map +1 -0
- package/src/common/metadata/tool.metadata.d.ts +178 -0
- package/src/common/metadata/tool.metadata.js.map +1 -0
- package/src/common/providers/session.provider.js.map +1 -0
- package/src/common/records/adapter.record.js.map +1 -0
- package/src/common/records/app.record.js.map +1 -0
- package/src/common/records/auth-provider.record.js.map +1 -0
- package/src/common/records/flow.record.js.map +1 -0
- package/src/common/records/hook.record.js.map +1 -0
- package/src/common/records/index.js.map +1 -0
- package/src/common/records/logger.record.d.ts +11 -0
- package/src/common/records/logger.record.js.map +1 -0
- package/src/common/records/plugin.record.js.map +1 -0
- package/src/common/records/prompt.record.js.map +1 -0
- package/src/common/records/provider.record.js.map +1 -0
- package/src/common/records/resource.record.js.map +1 -0
- package/src/common/records/scope.record.js.map +1 -0
- package/src/common/records/tool.record.js.map +1 -0
- package/src/common/schemas/annotated-class.schema.js.map +1 -0
- package/src/common/schemas/http-input.schema.js.map +1 -0
- package/src/common/schemas/http-output.schema.d.ts +2011 -0
- package/src/common/schemas/http-output.schema.js.map +1 -0
- package/src/common/schemas/index.js.map +1 -0
- package/src/common/tokens/adapter.tokens.js.map +1 -0
- package/src/common/tokens/app.tokens.js.map +1 -0
- package/src/common/tokens/auth-provider.tokens.js.map +1 -0
- package/src/common/tokens/base.tokens.js.map +1 -0
- package/src/common/tokens/flow-hook.tokens.js.map +1 -0
- package/src/common/tokens/flow.tokens.js.map +1 -0
- package/src/common/tokens/front-mcp.tokens.js.map +1 -0
- package/src/common/tokens/index.js.map +1 -0
- package/src/common/tokens/logger.tokens.js.map +1 -0
- package/src/common/tokens/plugin.tokens.js.map +1 -0
- package/src/common/tokens/prompt.tokens.js.map +1 -0
- package/src/common/tokens/provider.tokens.js.map +1 -0
- package/src/common/tokens/resource.tokens.js.map +1 -0
- package/src/common/tokens/server.tokens.js.map +1 -0
- package/src/common/tokens/tool.tokens.js.map +1 -0
- package/src/common/types/auth/index.js.map +1 -0
- package/src/common/types/auth/jwt.types.js.map +1 -0
- package/src/common/types/auth/session.types.d.ts +263 -0
- package/src/common/types/auth/session.types.js.map +1 -0
- package/src/common/types/common.types.js.map +1 -0
- package/src/common/types/index.js.map +1 -0
- package/src/common/types/options/auth.options.d.ts +513 -0
- package/src/common/types/options/auth.options.js.map +1 -0
- package/src/common/types/options/http.options.js.map +1 -0
- package/src/common/types/options/index.js.map +1 -0
- package/src/common/types/options/logging.options.d.ts +39 -0
- package/src/common/types/options/logging.options.js.map +1 -0
- package/src/common/types/options/server-info.options.d.ts +48 -0
- package/src/common/types/options/server-info.options.js.map +1 -0
- package/src/common/types/options/session.options.d.ts +67 -0
- package/src/common/types/options/session.options.js.map +1 -0
- package/src/common/utils/decide-request-intent.utils.d.ts +79 -0
- package/src/common/utils/decide-request-intent.utils.js.map +1 -0
- package/src/common/utils/index.js.map +1 -0
- package/src/common/utils/path.utils.d.ts +20 -0
- package/src/common/utils/path.utils.js.map +1 -0
- package/src/exceptions/mcp-exceptions/session-missing.exception.d.ts +3 -0
- package/src/exceptions/mcp-exceptions/session-missing.exception.js +11 -0
- package/src/exceptions/mcp-exceptions/session-missing.exception.js.map +1 -0
- package/src/exceptions/mcp-exceptions/unsupported-client-version.exception.d.ts +5 -0
- package/src/exceptions/mcp-exceptions/unsupported-client-version.exception.js +15 -0
- package/src/exceptions/mcp-exceptions/unsupported-client-version.exception.js.map +1 -0
- package/src/flows/flow.instance.d.ts +16 -0
- package/src/flows/flow.instance.js +332 -0
- package/src/flows/flow.instance.js.map +1 -0
- package/src/flows/flow.registry.d.ts +14 -0
- package/src/flows/flow.registry.js +79 -0
- package/src/flows/flow.registry.js.map +1 -0
- package/src/flows/flow.stages.d.ts +12 -0
- package/src/flows/flow.stages.js +110 -0
- package/src/flows/flow.stages.js.map +1 -0
- package/src/flows/flow.utils.d.ts +8 -0
- package/src/flows/flow.utils.js +36 -0
- package/src/flows/flow.utils.js.map +1 -0
- package/src/front-mcp/front-mcp.d.ts +12 -0
- package/src/front-mcp/front-mcp.js +44 -0
- package/src/front-mcp/front-mcp.js.map +1 -0
- package/src/front-mcp/front-mcp.providers.d.ts +198 -0
- package/src/front-mcp/front-mcp.providers.js +30 -0
- package/src/front-mcp/front-mcp.providers.js.map +1 -0
- package/src/front-mcp/front-mcp.tokens.d.ts +2 -0
- package/src/front-mcp/front-mcp.tokens.js +5 -0
- package/src/front-mcp/front-mcp.tokens.js.map +1 -0
- package/src/front-mcp/index.d.ts +1 -0
- package/src/front-mcp/index.js +5 -0
- package/src/front-mcp/index.js.map +1 -0
- package/src/hooks/hook.instance.d.ts +7 -0
- package/src/hooks/hook.instance.js +23 -0
- package/src/hooks/hook.instance.js.map +1 -0
- package/src/hooks/hook.registry.d.ts +34 -0
- package/src/hooks/hook.registry.js +138 -0
- package/src/hooks/hook.registry.js.map +1 -0
- package/src/hooks/hooks.utils.d.ts +3 -0
- package/src/hooks/hooks.utils.js +27 -0
- package/src/hooks/hooks.utils.js.map +1 -0
- package/src/index.d.ts +21 -18
- package/src/index.js +9 -18
- package/src/index.js.map +1 -1
- package/src/logger/instances/instance.console-logger.d.ts +10 -0
- package/src/logger/instances/instance.console-logger.js +75 -0
- package/src/logger/instances/instance.console-logger.js.map +1 -0
- package/src/logger/instances/instance.logger.d.ts +24 -0
- package/src/logger/instances/instance.logger.js +77 -0
- package/src/logger/instances/instance.logger.js.map +1 -0
- package/src/logger/logger.registry.d.ts +13 -0
- package/src/logger/logger.registry.js +91 -0
- package/src/logger/logger.registry.js.map +1 -0
- package/src/logger/logger.tokens.d.ts +1 -0
- package/src/logger/logger.tokens.js +3 -0
- package/src/logger/logger.tokens.js.map +1 -0
- package/src/logger/logger.types.d.ts +10 -0
- package/src/logger/logger.types.js +8 -0
- package/src/logger/logger.types.js.map +1 -0
- package/src/logger/logger.utils.d.ts +15 -0
- package/src/logger/logger.utils.js +42 -0
- package/src/logger/logger.utils.js.map +1 -0
- package/src/plugin/plugin.registry.d.ts +24 -0
- package/src/plugin/plugin.registry.js +137 -0
- package/src/plugin/plugin.registry.js.map +1 -0
- package/src/plugin/plugin.utils.d.ts +10 -0
- package/src/plugin/plugin.utils.js +88 -0
- package/src/plugin/plugin.utils.js.map +1 -0
- package/src/prompt/prompt.registry.d.ts +16 -0
- package/src/prompt/prompt.registry.js +34 -0
- package/src/prompt/prompt.registry.js.map +1 -0
- package/src/provider/provider.registry.d.ts +75 -0
- package/src/provider/provider.registry.js +679 -0
- package/src/provider/provider.registry.js.map +1 -0
- package/src/provider/provider.types.d.ts +9 -0
- package/src/provider/provider.types.js +3 -0
- package/src/provider/provider.types.js.map +1 -0
- package/src/provider/provider.utils.d.ts +13 -0
- package/src/provider/provider.utils.js +103 -0
- package/src/provider/provider.utils.js.map +1 -0
- package/src/regsitry/index.d.ts +1 -0
- package/src/regsitry/index.js +5 -0
- package/src/regsitry/index.js.map +1 -0
- package/src/regsitry/registry.base.d.ts +25 -0
- package/src/regsitry/registry.base.js +32 -0
- package/src/regsitry/registry.base.js.map +1 -0
- package/src/resource/resource.registry.d.ts +15 -0
- package/src/resource/resource.registry.js +31 -0
- package/src/resource/resource.registry.js.map +1 -0
- package/src/scope/flows/http.request.flow.d.ts +384 -0
- package/src/scope/flows/http.request.flow.js +210 -0
- package/src/scope/flows/http.request.flow.js.map +1 -0
- package/src/scope/index.d.ts +1 -0
- package/src/scope/index.js +6 -0
- package/src/scope/index.js.map +1 -0
- package/src/scope/scope.instance.d.ts +35 -0
- package/src/scope/scope.instance.js +120 -0
- package/src/scope/scope.instance.js.map +1 -0
- package/src/scope/scope.registry.d.ts +10 -0
- package/src/scope/scope.registry.js +93 -0
- package/src/scope/scope.registry.js.map +1 -0
- package/src/scope/scope.utils.d.ts +13 -0
- package/src/scope/scope.utils.js +59 -0
- package/src/scope/scope.utils.js.map +1 -0
- package/src/server/adapters/base.host.adapter.d.ts +7 -0
- package/src/server/adapters/base.host.adapter.js +8 -0
- package/src/server/adapters/base.host.adapter.js.map +1 -0
- package/src/server/adapters/express.host.adapter.d.ts +12 -0
- package/src/server/adapters/express.host.adapter.js +50 -0
- package/src/server/adapters/express.host.adapter.js.map +1 -0
- package/src/server/server.instance.d.ts +12 -0
- package/src/server/server.instance.js +47 -0
- package/src/server/server.instance.js.map +1 -0
- package/src/server/server.types.d.ts +24 -0
- package/src/server/server.types.js +3 -0
- package/src/server/server.types.js.map +1 -0
- package/src/server/server.validation.d.ts +2 -0
- package/src/server/server.validation.js +192 -0
- package/src/server/server.validation.js.map +1 -0
- package/src/store/adapters/store.base.adapter.d.ts +21 -0
- package/src/store/adapters/store.base.adapter.js +16 -0
- package/src/store/adapters/store.base.adapter.js.map +1 -0
- package/src/store/adapters/store.memory.adapter.d.ts +26 -0
- package/src/store/adapters/store.memory.adapter.js +87 -0
- package/src/store/adapters/store.memory.adapter.js.map +1 -0
- package/src/store/adapters/store.redis.adapter.d.ts +33 -0
- package/src/store/adapters/store.redis.adapter.js +104 -0
- package/src/store/adapters/store.redis.adapter.js.map +1 -0
- package/src/store/index.d.ts +8 -0
- package/src/store/index.js +12 -0
- package/src/store/index.js.map +1 -0
- package/src/store/store.helpers.d.ts +9 -0
- package/src/store/store.helpers.js +67 -0
- package/src/store/store.helpers.js.map +1 -0
- package/src/store/store.registry.d.ts +13 -0
- package/src/store/store.registry.js +37 -0
- package/src/store/store.registry.js.map +1 -0
- package/src/store/store.tokens.d.ts +3 -0
- package/src/store/store.tokens.js +7 -0
- package/src/store/store.tokens.js.map +1 -0
- package/src/store/store.types.d.ts +64 -0
- package/src/store/store.types.js +11 -0
- package/src/store/store.types.js.map +1 -0
- package/src/store/store.utils.d.ts +8 -0
- package/src/store/store.utils.js +18 -0
- package/src/store/store.utils.js.map +1 -0
- package/src/tool/flows/call-tool.flow.d.ts +875 -0
- package/src/tool/flows/call-tool.flow.js +249 -0
- package/src/tool/flows/call-tool.flow.js.map +1 -0
- package/src/tool/flows/tools-list.flow.d.ts +771 -0
- package/src/tool/flows/tools-list.flow.js +149 -0
- package/src/tool/flows/tools-list.flow.js.map +1 -0
- package/src/tool/tool.events.d.ts +17 -0
- package/src/tool/tool.events.js +16 -0
- package/src/tool/tool.events.js.map +1 -0
- package/src/tool/tool.instance.d.ts +15 -0
- package/src/tool/tool.instance.js +68 -0
- package/src/tool/tool.instance.js.map +1 -0
- package/src/tool/tool.registry.d.ts +72 -0
- package/src/tool/tool.registry.js +339 -0
- package/src/tool/tool.registry.js.map +1 -0
- package/src/tool/tool.types.d.ts +25 -0
- package/src/tool/tool.types.js +10 -0
- package/src/tool/tool.types.js.map +1 -0
- package/src/tool/tool.utils.d.ts +20 -0
- package/src/tool/tool.utils.js +157 -0
- package/src/tool/tool.utils.js.map +1 -0
- package/src/transport/adapters/transport.local.adapter.d.ts +41 -0
- package/src/transport/adapters/transport.local.adapter.js +127 -0
- package/src/transport/adapters/transport.local.adapter.js.map +1 -0
- package/src/transport/adapters/transport.sse.adapter.d.ts +14 -0
- package/src/transport/adapters/transport.sse.adapter.js +63 -0
- package/src/transport/adapters/transport.sse.adapter.js.map +1 -0
- package/src/transport/adapters/transport.streamable-http.adapter.d.ts +13 -0
- package/src/transport/adapters/transport.streamable-http.adapter.js +65 -0
- package/src/transport/adapters/transport.streamable-http.adapter.js.map +1 -0
- package/src/transport/flows/handle.sse.flow.d.ts +92 -0
- package/src/transport/flows/handle.sse.flow.js +129 -0
- package/src/transport/flows/handle.sse.flow.js.map +1 -0
- package/src/transport/flows/handle.streamable-http.flow.d.ts +93 -0
- package/src/transport/flows/handle.streamable-http.flow.js +125 -0
- package/src/transport/flows/handle.streamable-http.flow.js.map +1 -0
- package/src/transport/legacy/legacy.sse.tranporter.d.ts +75 -0
- package/src/transport/legacy/legacy.sse.tranporter.js +170 -0
- package/src/transport/legacy/legacy.sse.tranporter.js.map +1 -0
- package/src/transport/mcp-handlers/Initialized-notification.hanlder.d.ts +3 -0
- package/src/transport/mcp-handlers/Initialized-notification.hanlder.js +14 -0
- package/src/transport/mcp-handlers/Initialized-notification.hanlder.js.map +1 -0
- package/src/transport/mcp-handlers/call-tool-request.handler.d.ts +3 -0
- package/src/transport/mcp-handlers/call-tool-request.handler.js +15 -0
- package/src/transport/mcp-handlers/call-tool-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/index.d.ts +521 -0
- package/src/transport/mcp-handlers/index.js +20 -0
- package/src/transport/mcp-handlers/index.js.map +1 -0
- package/src/transport/mcp-handlers/initialize-request.handler.d.ts +3 -0
- package/src/transport/mcp-handlers/initialize-request.handler.js +33 -0
- package/src/transport/mcp-handlers/initialize-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/list-tools-request.handler.d.ts +285 -0
- package/src/transport/mcp-handlers/list-tools-request.handler.js +11 -0
- package/src/transport/mcp-handlers/list-tools-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/mcp-handlers.types.d.ts +37 -0
- package/src/transport/mcp-handlers/mcp-handlers.types.js +3 -0
- package/src/transport/mcp-handlers/mcp-handlers.types.js.map +1 -0
- package/src/transport/transport.error.d.ts +4 -0
- package/src/transport/transport.error.js +25 -0
- package/src/transport/transport.error.js.map +1 -0
- package/src/transport/transport.event-store.d.ts +10 -0
- package/src/transport/transport.event-store.js +36 -0
- package/src/transport/transport.event-store.js.map +1 -0
- package/src/transport/transport.local.d.ts +17 -0
- package/src/transport/transport.local.js +65 -0
- package/src/transport/transport.local.js.map +1 -0
- package/src/transport/transport.registry.d.ts +23 -0
- package/src/transport/transport.registry.js +138 -0
- package/src/transport/transport.registry.js.map +1 -0
- package/src/transport/transport.remote.d.ts +15 -0
- package/src/transport/transport.remote.js +31 -0
- package/src/transport/transport.remote.js.map +1 -0
- package/src/transport/transport.types.d.ts +54 -0
- package/src/transport/transport.types.js +3 -0
- package/src/transport/transport.types.js.map +1 -0
- package/src/types/drinen-hooks.types.d.ts +20 -0
- package/src/types/drinen-hooks.types.js +3 -0
- package/src/types/drinen-hooks.types.js.map +1 -0
- package/src/types/invoke.type.d.ts +15 -0
- package/src/types/invoke.type.js +34 -0
- package/src/types/invoke.type.js.map +1 -0
- package/src/types/token.types.d.ts +1 -0
- package/src/types/token.types.js +3 -0
- package/src/types/token.types.js.map +1 -0
- package/src/utils/metadata.utils.d.ts +5 -0
- package/src/utils/metadata.utils.js +26 -0
- package/src/utils/metadata.utils.js.map +1 -0
- package/src/utils/server.utils.d.ts +19 -0
- package/src/utils/server.utils.js +59 -0
- package/src/utils/server.utils.js.map +1 -0
- package/src/utils/string.utils.d.ts +1 -0
- package/src/utils/string.utils.js +10 -0
- package/src/utils/string.utils.js.map +1 -0
- package/src/utils/token.utils.d.ts +11 -0
- package/src/utils/token.utils.js +65 -0
- package/src/utils/token.utils.js.map +1 -0
- package/src/utils/types.utils.d.ts +7 -0
- package/src/utils/types.utils.js +3 -0
- package/src/utils/types.utils.js.map +1 -0
- package/src/constants.d.ts +0 -30
- package/src/constants.js +0 -36
- package/src/constants.js.map +0 -1
- package/src/decorators/adapter.decorator.js.map +0 -1
- package/src/decorators/app.decorator.js.map +0 -1
- package/src/decorators/auth-provider.decorator.js.map +0 -1
- package/src/decorators/flow.decorator.js.map +0 -1
- package/src/decorators/front-mcp.decorator.js +0 -40
- package/src/decorators/front-mcp.decorator.js.map +0 -1
- package/src/decorators/hook.decorator.js.map +0 -1
- package/src/decorators/index.js.map +0 -1
- package/src/decorators/logger.decorator.js.map +0 -1
- package/src/decorators/plugin.decorator.js.map +0 -1
- package/src/decorators/prompt.decorator.js.map +0 -1
- package/src/decorators/provider.decorator.js.map +0 -1
- package/src/decorators/resource.decorator.js.map +0 -1
- package/src/decorators/tool.decorator.d.ts +0 -42
- package/src/decorators/tool.decorator.js +0 -45
- package/src/decorators/tool.decorator.js.map +0 -1
- package/src/decorators-old/async-with.decorator.d.ts +0 -9
- package/src/decorators-old/async-with.decorator.js +0 -23
- package/src/decorators-old/async-with.decorator.js.map +0 -1
- package/src/decorators-old/auth-hook.decorator.js.map +0 -1
- package/src/decorators-old/session-hook.decorator.js.map +0 -1
- package/src/decorators-old/tool-hook.decorator.d.ts +0 -14
- package/src/decorators-old/tool-hook.decorator.js +0 -27
- package/src/decorators-old/tool-hook.decorator.js.map +0 -1
- package/src/dynamic/dynamic.adapter.js.map +0 -1
- package/src/dynamic/dynamic.plugin.js.map +0 -1
- package/src/dynamic/dynamic.utils.d.ts +0 -3
- package/src/dynamic/dynamic.utils.js.map +0 -1
- package/src/dynamic/index.js.map +0 -1
- package/src/entries/adapter.entry.js.map +0 -1
- package/src/entries/app.entry.d.ts +0 -13
- package/src/entries/app.entry.js.map +0 -1
- package/src/entries/auth-provider.entry.js.map +0 -1
- package/src/entries/base.entry.js.map +0 -1
- package/src/entries/flow.entry.js.map +0 -1
- package/src/entries/hook.entry.js.map +0 -1
- package/src/entries/index.js.map +0 -1
- package/src/entries/logger.entry.js.map +0 -1
- package/src/entries/plugin.entry.js.map +0 -1
- package/src/entries/prompt.entry.js.map +0 -1
- package/src/entries/provider.entry.js.map +0 -1
- package/src/entries/resource.entry.js.map +0 -1
- package/src/entries/scope.entry.js.map +0 -1
- package/src/entries/tool.entry.js.map +0 -1
- package/src/interfaces/adapter.interface.js.map +0 -1
- package/src/interfaces/app.interface.js.map +0 -1
- package/src/interfaces/auth-hook.interface.js.map +0 -1
- package/src/interfaces/auth-provider.interface.js.map +0 -1
- package/src/interfaces/base.interface.js.map +0 -1
- package/src/interfaces/flow.interface.d.ts +0 -41
- package/src/interfaces/flow.interface.js.map +0 -1
- package/src/interfaces/front-mcp.interface.js.map +0 -1
- package/src/interfaces/hook.interface.js.map +0 -1
- package/src/interfaces/index.js.map +0 -1
- package/src/interfaces/internal/flow.utils.d.ts +0 -24
- package/src/interfaces/internal/flow.utils.js.map +0 -1
- package/src/interfaces/internal/index.js.map +0 -1
- package/src/interfaces/internal/primary-auth-provider.interface.d.ts +0 -24
- package/src/interfaces/internal/primary-auth-provider.interface.js.map +0 -1
- package/src/interfaces/internal/registry.interface.d.ts +0 -97
- package/src/interfaces/internal/registry.interface.js.map +0 -1
- package/src/interfaces/logger.interface.js.map +0 -1
- package/src/interfaces/plugin.interface.js.map +0 -1
- package/src/interfaces/prompt.interface.js.map +0 -1
- package/src/interfaces/provider.interface.js.map +0 -1
- package/src/interfaces/resource.interface.js.map +0 -1
- package/src/interfaces/scope.interface.js.map +0 -1
- package/src/interfaces/server.interface.js.map +0 -1
- package/src/interfaces/session-hook.interface.js.map +0 -1
- package/src/interfaces/tool-hook.interface.js.map +0 -1
- package/src/interfaces/tool.interface.js.map +0 -1
- package/src/metadata/adapter.metadata.js.map +0 -1
- package/src/metadata/app.metadata.d.ts +0 -872
- package/src/metadata/app.metadata.js.map +0 -1
- package/src/metadata/auth-provider.metadata.js.map +0 -1
- package/src/metadata/flow.metadata.d.ts +0 -77
- package/src/metadata/flow.metadata.js.map +0 -1
- package/src/metadata/front-mcp.metadata.d.ts +0 -1144
- package/src/metadata/front-mcp.metadata.js.map +0 -1
- package/src/metadata/hook.metadata.js.map +0 -1
- package/src/metadata/index.js.map +0 -1
- package/src/metadata/logger.metadata.js.map +0 -1
- package/src/metadata/plugin.metadata.js.map +0 -1
- package/src/metadata/prompt.metadata.js.map +0 -1
- package/src/metadata/provider.metadata.js.map +0 -1
- package/src/metadata/resource.metadata.js.map +0 -1
- package/src/metadata/tool.metadata.d.ts +0 -178
- package/src/metadata/tool.metadata.js.map +0 -1
- package/src/providers/session.provider.js.map +0 -1
- package/src/records/adapter.record.js.map +0 -1
- package/src/records/app.record.js.map +0 -1
- package/src/records/auth-provider.record.js.map +0 -1
- package/src/records/flow.record.js.map +0 -1
- package/src/records/hook.record.js.map +0 -1
- package/src/records/index.js.map +0 -1
- package/src/records/logger.record.d.ts +0 -11
- package/src/records/logger.record.js.map +0 -1
- package/src/records/plugin.record.js.map +0 -1
- package/src/records/prompt.record.js.map +0 -1
- package/src/records/provider.record.js.map +0 -1
- package/src/records/resource.record.js.map +0 -1
- package/src/records/scope.record.js.map +0 -1
- package/src/records/tool.record.js.map +0 -1
- package/src/schemas/annotated-class.schema.js.map +0 -1
- package/src/schemas/http-input.schema.js.map +0 -1
- package/src/schemas/http-output.schema.d.ts +0 -2011
- package/src/schemas/http-output.schema.js.map +0 -1
- package/src/schemas/index.js.map +0 -1
- package/src/tokens/adapter.tokens.js.map +0 -1
- package/src/tokens/app.tokens.js.map +0 -1
- package/src/tokens/auth-provider.tokens.js.map +0 -1
- package/src/tokens/base.tokens.js.map +0 -1
- package/src/tokens/flow-hook.tokens.js.map +0 -1
- package/src/tokens/flow.tokens.js.map +0 -1
- package/src/tokens/front-mcp.tokens.js.map +0 -1
- package/src/tokens/index.js.map +0 -1
- package/src/tokens/logger.tokens.js.map +0 -1
- package/src/tokens/plugin.tokens.js.map +0 -1
- package/src/tokens/prompt.tokens.js.map +0 -1
- package/src/tokens/provider.tokens.js.map +0 -1
- package/src/tokens/resource.tokens.js.map +0 -1
- package/src/tokens/server.tokens.js.map +0 -1
- package/src/tokens/tool.tokens.js.map +0 -1
- package/src/types/auth/index.js.map +0 -1
- package/src/types/auth/jwt.types.js.map +0 -1
- package/src/types/auth/session.types.d.ts +0 -263
- package/src/types/auth/session.types.js.map +0 -1
- package/src/types/common.types.js.map +0 -1
- package/src/types/index.js.map +0 -1
- package/src/types/options/auth.options.d.ts +0 -513
- package/src/types/options/auth.options.js.map +0 -1
- package/src/types/options/http.options.js.map +0 -1
- package/src/types/options/index.js.map +0 -1
- package/src/types/options/logging.options.d.ts +0 -39
- package/src/types/options/logging.options.js.map +0 -1
- package/src/types/options/server-info.options.d.ts +0 -48
- package/src/types/options/server-info.options.js.map +0 -1
- package/src/types/options/session.options.d.ts +0 -67
- package/src/types/options/session.options.js.map +0 -1
- package/src/utils/decide-request-intent.utils.d.ts +0 -79
- package/src/utils/decide-request-intent.utils.js.map +0 -1
- package/src/utils/index.js.map +0 -1
- package/src/utils/path.utils.d.ts +0 -20
- package/src/utils/path.utils.js.map +0 -1
- /package/src/{decorators → common/decorators}/adapter.decorator.d.ts +0 -0
- /package/src/{decorators → common/decorators}/adapter.decorator.js +0 -0
- /package/src/{decorators → common/decorators}/app.decorator.d.ts +0 -0
- /package/src/{decorators → common/decorators}/app.decorator.js +0 -0
- /package/src/{decorators → common/decorators}/auth-provider.decorator.d.ts +0 -0
- /package/src/{decorators → common/decorators}/auth-provider.decorator.js +0 -0
- /package/src/{decorators → common/decorators}/flow.decorator.d.ts +0 -0
- /package/src/{decorators → common/decorators}/flow.decorator.js +0 -0
- /package/src/{decorators → common/decorators}/front-mcp.decorator.d.ts +0 -0
- /package/src/{decorators → common/decorators}/hook.decorator.d.ts +0 -0
- /package/src/{decorators → common/decorators}/hook.decorator.js +0 -0
- /package/src/{decorators → common/decorators}/index.d.ts +0 -0
- /package/src/{decorators → common/decorators}/index.js +0 -0
- /package/src/{decorators → common/decorators}/logger.decorator.d.ts +0 -0
- /package/src/{decorators → common/decorators}/logger.decorator.js +0 -0
- /package/src/{decorators → common/decorators}/plugin.decorator.d.ts +0 -0
- /package/src/{decorators → common/decorators}/plugin.decorator.js +0 -0
- /package/src/{decorators → common/decorators}/prompt.decorator.d.ts +0 -0
- /package/src/{decorators → common/decorators}/prompt.decorator.js +0 -0
- /package/src/{decorators → common/decorators}/provider.decorator.d.ts +0 -0
- /package/src/{decorators → common/decorators}/provider.decorator.js +0 -0
- /package/src/{decorators → common/decorators}/resource.decorator.d.ts +0 -0
- /package/src/{decorators → common/decorators}/resource.decorator.js +0 -0
- /package/src/{decorators-old → common/decorators-old}/auth-hook.decorator.d.ts +0 -0
- /package/src/{decorators-old → common/decorators-old}/auth-hook.decorator.js +0 -0
- /package/src/{decorators-old → common/decorators-old}/session-hook.decorator.d.ts +0 -0
- /package/src/{decorators-old → common/decorators-old}/session-hook.decorator.js +0 -0
- /package/src/{dynamic → common/dynamic}/dynamic.adapter.d.ts +0 -0
- /package/src/{dynamic → common/dynamic}/dynamic.adapter.js +0 -0
- /package/src/{dynamic → common/dynamic}/dynamic.plugin.d.ts +0 -0
- /package/src/{dynamic → common/dynamic}/dynamic.plugin.js +0 -0
- /package/src/{dynamic → common/dynamic}/dynamic.utils.js +0 -0
- /package/src/{dynamic → common/dynamic}/index.d.ts +0 -0
- /package/src/{dynamic → common/dynamic}/index.js +0 -0
- /package/src/{entries → common/entries}/adapter.entry.d.ts +0 -0
- /package/src/{entries → common/entries}/adapter.entry.js +0 -0
- /package/src/{entries → common/entries}/app.entry.js +0 -0
- /package/src/{entries → common/entries}/auth-provider.entry.d.ts +0 -0
- /package/src/{entries → common/entries}/auth-provider.entry.js +0 -0
- /package/src/{entries → common/entries}/base.entry.d.ts +0 -0
- /package/src/{entries → common/entries}/base.entry.js +0 -0
- /package/src/{entries → common/entries}/flow.entry.d.ts +0 -0
- /package/src/{entries → common/entries}/flow.entry.js +0 -0
- /package/src/{entries → common/entries}/hook.entry.d.ts +0 -0
- /package/src/{entries → common/entries}/hook.entry.js +0 -0
- /package/src/{entries → common/entries}/index.d.ts +0 -0
- /package/src/{entries → common/entries}/index.js +0 -0
- /package/src/{entries → common/entries}/logger.entry.d.ts +0 -0
- /package/src/{entries → common/entries}/logger.entry.js +0 -0
- /package/src/{entries → common/entries}/plugin.entry.d.ts +0 -0
- /package/src/{entries → common/entries}/plugin.entry.js +0 -0
- /package/src/{entries → common/entries}/prompt.entry.d.ts +0 -0
- /package/src/{entries → common/entries}/prompt.entry.js +0 -0
- /package/src/{entries → common/entries}/provider.entry.d.ts +0 -0
- /package/src/{entries → common/entries}/provider.entry.js +0 -0
- /package/src/{entries → common/entries}/resource.entry.d.ts +0 -0
- /package/src/{entries → common/entries}/resource.entry.js +0 -0
- /package/src/{entries → common/entries}/scope.entry.d.ts +0 -0
- /package/src/{entries → common/entries}/scope.entry.js +0 -0
- /package/src/{entries → common/entries}/tool.entry.d.ts +0 -0
- /package/src/{entries → common/entries}/tool.entry.js +0 -0
- /package/src/{interfaces → common/interfaces}/adapter.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/adapter.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/app.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/app.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/auth-hook.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/auth-hook.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/auth-provider.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/auth-provider.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/base.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/base.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/flow.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/front-mcp.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/front-mcp.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/hook.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/hook.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/index.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/index.js +0 -0
- /package/src/{interfaces → common/interfaces}/internal/flow.utils.js +0 -0
- /package/src/{interfaces → common/interfaces}/internal/index.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/internal/index.js +0 -0
- /package/src/{interfaces → common/interfaces}/internal/primary-auth-provider.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/internal/registry.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/logger.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/logger.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/plugin.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/plugin.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/prompt.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/prompt.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/provider.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/provider.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/resource.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/resource.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/scope.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/scope.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/server.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/server.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/session-hook.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/session-hook.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/tool-hook.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/tool-hook.interface.js +0 -0
- /package/src/{interfaces → common/interfaces}/tool.interface.d.ts +0 -0
- /package/src/{interfaces → common/interfaces}/tool.interface.js +0 -0
- /package/src/{metadata → common/metadata}/adapter.metadata.d.ts +0 -0
- /package/src/{metadata → common/metadata}/adapter.metadata.js +0 -0
- /package/src/{metadata → common/metadata}/app.metadata.js +0 -0
- /package/src/{metadata → common/metadata}/auth-provider.metadata.d.ts +0 -0
- /package/src/{metadata → common/metadata}/auth-provider.metadata.js +0 -0
- /package/src/{metadata → common/metadata}/flow.metadata.js +0 -0
- /package/src/{metadata → common/metadata}/front-mcp.metadata.js +0 -0
- /package/src/{metadata → common/metadata}/hook.metadata.d.ts +0 -0
- /package/src/{metadata → common/metadata}/hook.metadata.js +0 -0
- /package/src/{metadata → common/metadata}/index.d.ts +0 -0
- /package/src/{metadata → common/metadata}/index.js +0 -0
- /package/src/{metadata → common/metadata}/logger.metadata.d.ts +0 -0
- /package/src/{metadata → common/metadata}/logger.metadata.js +0 -0
- /package/src/{metadata → common/metadata}/plugin.metadata.d.ts +0 -0
- /package/src/{metadata → common/metadata}/plugin.metadata.js +0 -0
- /package/src/{metadata → common/metadata}/prompt.metadata.d.ts +0 -0
- /package/src/{metadata → common/metadata}/prompt.metadata.js +0 -0
- /package/src/{metadata → common/metadata}/provider.metadata.d.ts +0 -0
- /package/src/{metadata → common/metadata}/provider.metadata.js +0 -0
- /package/src/{metadata → common/metadata}/resource.metadata.d.ts +0 -0
- /package/src/{metadata → common/metadata}/resource.metadata.js +0 -0
- /package/src/{metadata → common/metadata}/tool.metadata.js +0 -0
- /package/src/{providers → common/providers}/session.provider.d.ts +0 -0
- /package/src/{providers → common/providers}/session.provider.js +0 -0
- /package/src/{records → common/records}/adapter.record.d.ts +0 -0
- /package/src/{records → common/records}/adapter.record.js +0 -0
- /package/src/{records → common/records}/app.record.d.ts +0 -0
- /package/src/{records → common/records}/app.record.js +0 -0
- /package/src/{records → common/records}/auth-provider.record.d.ts +0 -0
- /package/src/{records → common/records}/auth-provider.record.js +0 -0
- /package/src/{records → common/records}/flow.record.d.ts +0 -0
- /package/src/{records → common/records}/flow.record.js +0 -0
- /package/src/{records → common/records}/hook.record.d.ts +0 -0
- /package/src/{records → common/records}/hook.record.js +0 -0
- /package/src/{records → common/records}/index.d.ts +0 -0
- /package/src/{records → common/records}/index.js +0 -0
- /package/src/{records → common/records}/logger.record.js +0 -0
- /package/src/{records → common/records}/plugin.record.d.ts +0 -0
- /package/src/{records → common/records}/plugin.record.js +0 -0
- /package/src/{records → common/records}/prompt.record.d.ts +0 -0
- /package/src/{records → common/records}/prompt.record.js +0 -0
- /package/src/{records → common/records}/provider.record.d.ts +0 -0
- /package/src/{records → common/records}/provider.record.js +0 -0
- /package/src/{records → common/records}/resource.record.d.ts +0 -0
- /package/src/{records → common/records}/resource.record.js +0 -0
- /package/src/{records → common/records}/scope.record.d.ts +0 -0
- /package/src/{records → common/records}/scope.record.js +0 -0
- /package/src/{records → common/records}/tool.record.d.ts +0 -0
- /package/src/{records → common/records}/tool.record.js +0 -0
- /package/src/{schemas → common/schemas}/annotated-class.schema.d.ts +0 -0
- /package/src/{schemas → common/schemas}/annotated-class.schema.js +0 -0
- /package/src/{schemas → common/schemas}/http-input.schema.d.ts +0 -0
- /package/src/{schemas → common/schemas}/http-input.schema.js +0 -0
- /package/src/{schemas → common/schemas}/http-output.schema.js +0 -0
- /package/src/{schemas → common/schemas}/index.d.ts +0 -0
- /package/src/{schemas → common/schemas}/index.js +0 -0
- /package/src/{tokens → common/tokens}/adapter.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/adapter.tokens.js +0 -0
- /package/src/{tokens → common/tokens}/app.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/app.tokens.js +0 -0
- /package/src/{tokens → common/tokens}/auth-provider.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/auth-provider.tokens.js +0 -0
- /package/src/{tokens → common/tokens}/base.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/base.tokens.js +0 -0
- /package/src/{tokens → common/tokens}/flow-hook.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/flow-hook.tokens.js +0 -0
- /package/src/{tokens → common/tokens}/flow.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/flow.tokens.js +0 -0
- /package/src/{tokens → common/tokens}/front-mcp.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/front-mcp.tokens.js +0 -0
- /package/src/{tokens → common/tokens}/index.d.ts +0 -0
- /package/src/{tokens → common/tokens}/index.js +0 -0
- /package/src/{tokens → common/tokens}/logger.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/logger.tokens.js +0 -0
- /package/src/{tokens → common/tokens}/plugin.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/plugin.tokens.js +0 -0
- /package/src/{tokens → common/tokens}/prompt.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/prompt.tokens.js +0 -0
- /package/src/{tokens → common/tokens}/provider.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/provider.tokens.js +0 -0
- /package/src/{tokens → common/tokens}/resource.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/resource.tokens.js +0 -0
- /package/src/{tokens → common/tokens}/server.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/server.tokens.js +0 -0
- /package/src/{tokens → common/tokens}/tool.tokens.d.ts +0 -0
- /package/src/{tokens → common/tokens}/tool.tokens.js +0 -0
- /package/src/{types → common/types}/auth/index.d.ts +0 -0
- /package/src/{types → common/types}/auth/index.js +0 -0
- /package/src/{types → common/types}/auth/jwt.types.d.ts +0 -0
- /package/src/{types → common/types}/auth/jwt.types.js +0 -0
- /package/src/{types → common/types}/auth/session.types.js +0 -0
- /package/src/{types → common/types}/common.types.d.ts +0 -0
- /package/src/{types → common/types}/common.types.js +0 -0
- /package/src/{types → common/types}/index.d.ts +0 -0
- /package/src/{types → common/types}/index.js +0 -0
- /package/src/{types → common/types}/options/auth.options.js +0 -0
- /package/src/{types → common/types}/options/http.options.d.ts +0 -0
- /package/src/{types → common/types}/options/http.options.js +0 -0
- /package/src/{types → common/types}/options/index.d.ts +0 -0
- /package/src/{types → common/types}/options/index.js +0 -0
- /package/src/{types → common/types}/options/logging.options.js +0 -0
- /package/src/{types → common/types}/options/server-info.options.js +0 -0
- /package/src/{types → common/types}/options/session.options.js +0 -0
- /package/src/{utils → common/utils}/decide-request-intent.utils.js +0 -0
- /package/src/{utils → common/utils}/index.d.ts +0 -0
- /package/src/{utils → common/utils}/index.js +0 -0
- /package/src/{utils → common/utils}/path.utils.js +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
/**
|
|
3
|
+
* Pushed Authorization Requests (PAR) — POST /oauth/par
|
|
4
|
+
*
|
|
5
|
+
* Who calls: Client (before sending user to /authorize).
|
|
6
|
+
*
|
|
7
|
+
* Purpose: Client uploads the full authorization request; you return a request_uri the client forwards to /authorize.
|
|
8
|
+
*
|
|
9
|
+
* Why: Prevents parameter tampering and URL-length issues; recommended for high-security setups and with DPoP/JAR.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Typical parameter shapes
|
|
13
|
+
|
|
14
|
+
* /oauth/par (POST): same authz params as /authorize (client-authenticated), returns { request_uri, expires_in }
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Quick checklist (security & correctness)
|
|
18
|
+
* - PKCE (S256) required for public clients (and basically for all).
|
|
19
|
+
* - Use authorization code grant only (no implicit/hybrid).
|
|
20
|
+
* - Rotate refresh tokens and bind them to client + user + scopes.
|
|
21
|
+
* - Prefer private_key_jwt or mTLS for confidential clients.
|
|
22
|
+
* - PAR + JAR recommended for higher security.
|
|
23
|
+
* - Consider DPoP (proof-of-possession) to reduce token replay.
|
|
24
|
+
* - Keep codes very short-lived (e.g., ≤60 s) and single-use.
|
|
25
|
+
* - Publish discovery and JWKS, rotate keys safely.
|
|
26
|
+
* - Decide JWT vs opaque access tokens; provide introspection if opaque.
|
|
27
|
+
*/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Pushed Authorization Requests (PAR) — POST /oauth/par
|
|
5
|
+
*
|
|
6
|
+
* Who calls: Client (before sending user to /authorize).
|
|
7
|
+
*
|
|
8
|
+
* Purpose: Client uploads the full authorization request; you return a request_uri the client forwards to /authorize.
|
|
9
|
+
*
|
|
10
|
+
* Why: Prevents parameter tampering and URL-length issues; recommended for high-security setups and with DPoP/JAR.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Typical parameter shapes
|
|
14
|
+
|
|
15
|
+
* /oauth/par (POST): same authz params as /authorize (client-authenticated), returns { request_uri, expires_in }
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Quick checklist (security & correctness)
|
|
19
|
+
* - PKCE (S256) required for public clients (and basically for all).
|
|
20
|
+
* - Use authorization code grant only (no implicit/hybrid).
|
|
21
|
+
* - Rotate refresh tokens and bind them to client + user + scopes.
|
|
22
|
+
* - Prefer private_key_jwt or mTLS for confidential clients.
|
|
23
|
+
* - PAR + JAR recommended for higher security.
|
|
24
|
+
* - Consider DPoP (proof-of-possession) to reduce token replay.
|
|
25
|
+
* - Keep codes very short-lived (e.g., ≤60 s) and single-use.
|
|
26
|
+
* - Publish discovery and JWKS, rotate keys safely.
|
|
27
|
+
* - Decide JWT vs opaque access tokens; provide introspection if opaque.
|
|
28
|
+
*/
|
|
29
|
+
//# sourceMappingURL=oauth.par.flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.par.flow.js","sourceRoot":"","sources":["../../../../../src/auth/oauth/flows/oauth.par.flow.ts"],"names":[],"mappings":";;AAAA;;;;;;;;GAQG;AACH;;;;GAIG;AACH;;;;;;;;;;;GAWG","sourcesContent":["/**\n * Pushed Authorization Requests (PAR) — POST /oauth/par\n *\n * Who calls: Client (before sending user to /authorize).\n *\n * Purpose: Client uploads the full authorization request; you return a request_uri the client forwards to /authorize.\n *\n * Why: Prevents parameter tampering and URL-length issues; recommended for high-security setups and with DPoP/JAR.\n */\n/**\n * Typical parameter shapes\n\n * /oauth/par (POST): same authz params as /authorize (client-authenticated), returns { request_uri, expires_in }\n */\n/**\n * Quick checklist (security & correctness)\n * - PKCE (S256) required for public clients (and basically for all).\n * - Use authorization code grant only (no implicit/hybrid).\n * - Rotate refresh tokens and bind them to client + user + scopes.\n * - Prefer private_key_jwt or mTLS for confidential clients.\n * - PAR + JAR recommended for higher security.\n * - Consider DPoP (proof-of-possession) to reduce token replay.\n * - Keep codes very short-lived (e.g., ≤60 s) and single-use.\n * - Publish discovery and JWKS, rotate keys safely.\n * - Decide JWT vs opaque access tokens; provide introspection if opaque.\n */\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
/**
|
|
3
|
+
* Token Revocation — POST /oauth/revoke
|
|
4
|
+
*
|
|
5
|
+
* Who calls: Client.
|
|
6
|
+
*
|
|
7
|
+
* Purpose: Invalidate an access or refresh token early (RFC 7009).
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Typical parameter shapes
|
|
11
|
+
*
|
|
12
|
+
* /oauth/revoke (POST): token, token_type_hint=access_token|refresh_token
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Quick checklist (security & correctness)
|
|
16
|
+
* - PKCE (S256) required for public clients (and basically for all).
|
|
17
|
+
* - Use authorization code grant only (no implicit/hybrid).
|
|
18
|
+
* - Rotate refresh tokens and bind them to client + user + scopes.
|
|
19
|
+
* - Prefer private_key_jwt or mTLS for confidential clients.
|
|
20
|
+
* - PAR + JAR recommended for higher security.
|
|
21
|
+
* - Consider DPoP (proof-of-possession) to reduce token replay.
|
|
22
|
+
* - Keep codes very short-lived (e.g., ≤60 s) and single-use.
|
|
23
|
+
* - Publish discovery and JWKS, rotate keys safely.
|
|
24
|
+
* - Decide JWT vs opaque access tokens; provide introspection if opaque.
|
|
25
|
+
*/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Token Revocation — POST /oauth/revoke
|
|
5
|
+
*
|
|
6
|
+
* Who calls: Client.
|
|
7
|
+
*
|
|
8
|
+
* Purpose: Invalidate an access or refresh token early (RFC 7009).
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Typical parameter shapes
|
|
12
|
+
*
|
|
13
|
+
* /oauth/revoke (POST): token, token_type_hint=access_token|refresh_token
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Quick checklist (security & correctness)
|
|
17
|
+
* - PKCE (S256) required for public clients (and basically for all).
|
|
18
|
+
* - Use authorization code grant only (no implicit/hybrid).
|
|
19
|
+
* - Rotate refresh tokens and bind them to client + user + scopes.
|
|
20
|
+
* - Prefer private_key_jwt or mTLS for confidential clients.
|
|
21
|
+
* - PAR + JAR recommended for higher security.
|
|
22
|
+
* - Consider DPoP (proof-of-possession) to reduce token replay.
|
|
23
|
+
* - Keep codes very short-lived (e.g., ≤60 s) and single-use.
|
|
24
|
+
* - Publish discovery and JWKS, rotate keys safely.
|
|
25
|
+
* - Decide JWT vs opaque access tokens; provide introspection if opaque.
|
|
26
|
+
*/
|
|
27
|
+
//# sourceMappingURL=oauth.revoke.flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.revoke.flow.js","sourceRoot":"","sources":["../../../../../src/auth/oauth/flows/oauth.revoke.flow.ts"],"names":[],"mappings":";;AAAA;;;;;;GAMG;AACH;;;;GAIG;AACH;;;;;;;;;;;GAWG","sourcesContent":["/**\n * Token Revocation — POST /oauth/revoke\n *\n * Who calls: Client.\n *\n * Purpose: Invalidate an access or refresh token early (RFC 7009).\n */\n/**\n * Typical parameter shapes\n *\n * /oauth/revoke (POST): token, token_type_hint=access_token|refresh_token\n */\n/**\n * Quick checklist (security & correctness)\n * - PKCE (S256) required for public clients (and basically for all).\n * - Use authorization code grant only (no implicit/hybrid).\n * - Rotate refresh tokens and bind them to client + user + scopes.\n * - Prefer private_key_jwt or mTLS for confidential clients.\n * - PAR + JAR recommended for higher security.\n * - Consider DPoP (proof-of-possession) to reduce token replay.\n * - Keep codes very short-lived (e.g., ≤60 s) and single-use.\n * - Publish discovery and JWKS, rotate keys safely.\n * - Decide JWT vs opaque access tokens; provide introspection if opaque.\n */\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token Endpoint — POST /oauth/token
|
|
3
|
+
*
|
|
4
|
+
* Who calls: Client (server-to-server).
|
|
5
|
+
*
|
|
6
|
+
* When: After getting the code (or for refresh).
|
|
7
|
+
*
|
|
8
|
+
* Purpose: Exchange authorization code + PKCE verifier for access token (and optional refresh token), or refresh an access token.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Typical parameter shapes
|
|
12
|
+
*
|
|
13
|
+
* /oauth/token (POST, application/x-www-form-urlencoded)
|
|
14
|
+
*
|
|
15
|
+
* For code exchange: grant_type=authorization_code, code, redirect_uri, client_id (and auth), code_verifier
|
|
16
|
+
*
|
|
17
|
+
* For refresh: grant_type=refresh_token, refresh_token, client_id (and auth)
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Quick checklist (security & correctness)
|
|
21
|
+
* - PKCE (S256) required for public clients (and basically for all).
|
|
22
|
+
* - Use authorization code grant only (no implicit/hybrid).
|
|
23
|
+
* - Rotate refresh tokens and bind them to client + user + scopes.
|
|
24
|
+
* - Prefer private_key_jwt or mTLS for confidential clients.
|
|
25
|
+
* - PAR + JAR recommended for higher security.
|
|
26
|
+
* - Consider DPoP (proof-of-possession) to reduce token replay.
|
|
27
|
+
* - Keep codes very short-lived (e.g., ≤60 s) and single-use.
|
|
28
|
+
* - Publish discovery and JWKS, rotate keys safely.
|
|
29
|
+
* - Decide JWT vs opaque access tokens; provide introspection if opaque.
|
|
30
|
+
*/
|
|
31
|
+
export {};
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* OAuth 2.0 Device Authorization Grant (“device code flow”)
|
|
35
|
+
* Who does what (at a glance)
|
|
36
|
+
*
|
|
37
|
+
* Device/TV/CLI (no browser)
|
|
38
|
+
* Calls POST /oauth/device_authorization, shows the user a code + URL, and polls POST /oauth/token.
|
|
39
|
+
*
|
|
40
|
+
* User (on phone/laptop browser)
|
|
41
|
+
* Visits the given verification_uri and authenticates using your normal OAuth login (whatever you already have). No new UI required beyond two tiny endpoints.
|
|
42
|
+
*
|
|
43
|
+
* Auth Server (you)
|
|
44
|
+
* Stores the device transaction and, after the user authenticates, marks it as approved so the device’s /oauth/token polling succeeds.
|
|
45
|
+
*
|
|
46
|
+
* Endpoints you need (only two “new” ones)
|
|
47
|
+
*
|
|
48
|
+
* POST /oauth/device_authorization ✅ (device calls)
|
|
49
|
+
*
|
|
50
|
+
* POST /oauth/token with grant urn:ietf:params:oauth:grant-type:device_code ✅ (device polls)
|
|
51
|
+
*
|
|
52
|
+
* GET /activate ➜ “UI handler” (user lands here from verification_uri — this just redirects into your existing /oauth/authorize)
|
|
53
|
+
*
|
|
54
|
+
* GET /activate/callback ➜ “UI handler” (your existing flow returns here after the user logs in; you flip the device record to approved and show a basic “All set” page)
|
|
55
|
+
*
|
|
56
|
+
* That’s it. No pages with complex consent screens are required; reuse your normal /oauth/authorize
|
|
57
|
+
*/
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Token Endpoint — POST /oauth/token
|
|
4
|
+
*
|
|
5
|
+
* Who calls: Client (server-to-server).
|
|
6
|
+
*
|
|
7
|
+
* When: After getting the code (or for refresh).
|
|
8
|
+
*
|
|
9
|
+
* Purpose: Exchange authorization code + PKCE verifier for access token (and optional refresh token), or refresh an access token.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Typical parameter shapes
|
|
13
|
+
*
|
|
14
|
+
* /oauth/token (POST, application/x-www-form-urlencoded)
|
|
15
|
+
*
|
|
16
|
+
* For code exchange: grant_type=authorization_code, code, redirect_uri, client_id (and auth), code_verifier
|
|
17
|
+
*
|
|
18
|
+
* For refresh: grant_type=refresh_token, refresh_token, client_id (and auth)
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Quick checklist (security & correctness)
|
|
22
|
+
* - PKCE (S256) required for public clients (and basically for all).
|
|
23
|
+
* - Use authorization code grant only (no implicit/hybrid).
|
|
24
|
+
* - Rotate refresh tokens and bind them to client + user + scopes.
|
|
25
|
+
* - Prefer private_key_jwt or mTLS for confidential clients.
|
|
26
|
+
* - PAR + JAR recommended for higher security.
|
|
27
|
+
* - Consider DPoP (proof-of-possession) to reduce token replay.
|
|
28
|
+
* - Keep codes very short-lived (e.g., ≤60 s) and single-use.
|
|
29
|
+
* - Publish discovery and JWKS, rotate keys safely.
|
|
30
|
+
* - Decide JWT vs opaque access tokens; provide introspection if opaque.
|
|
31
|
+
*/
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* OAuth 2.0 Device Authorization Grant (“device code flow”)
|
|
36
|
+
* Who does what (at a glance)
|
|
37
|
+
*
|
|
38
|
+
* Device/TV/CLI (no browser)
|
|
39
|
+
* Calls POST /oauth/device_authorization, shows the user a code + URL, and polls POST /oauth/token.
|
|
40
|
+
*
|
|
41
|
+
* User (on phone/laptop browser)
|
|
42
|
+
* Visits the given verification_uri and authenticates using your normal OAuth login (whatever you already have). No new UI required beyond two tiny endpoints.
|
|
43
|
+
*
|
|
44
|
+
* Auth Server (you)
|
|
45
|
+
* Stores the device transaction and, after the user authenticates, marks it as approved so the device’s /oauth/token polling succeeds.
|
|
46
|
+
*
|
|
47
|
+
* Endpoints you need (only two “new” ones)
|
|
48
|
+
*
|
|
49
|
+
* POST /oauth/device_authorization ✅ (device calls)
|
|
50
|
+
*
|
|
51
|
+
* POST /oauth/token with grant urn:ietf:params:oauth:grant-type:device_code ✅ (device polls)
|
|
52
|
+
*
|
|
53
|
+
* GET /activate ➜ “UI handler” (user lands here from verification_uri — this just redirects into your existing /oauth/authorize)
|
|
54
|
+
*
|
|
55
|
+
* GET /activate/callback ➜ “UI handler” (your existing flow returns here after the user logs in; you flip the device record to approved and show a basic “All set” page)
|
|
56
|
+
*
|
|
57
|
+
* That’s it. No pages with complex consent screens are required; reuse your normal /oauth/authorize
|
|
58
|
+
*/
|
|
59
|
+
//# sourceMappingURL=oauth.token.flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.token.flow.js","sourceRoot":"","sources":["../../../../../src/auth/oauth/flows/oauth.token.flow.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AACH;;;;;;;;GAQG;AACH;;;;;;;;;;;GAWG;;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG","sourcesContent":["/**\n * Token Endpoint — POST /oauth/token\n *\n * Who calls: Client (server-to-server).\n *\n * When: After getting the code (or for refresh).\n *\n * Purpose: Exchange authorization code + PKCE verifier for access token (and optional refresh token), or refresh an access token.\n */\n/**\n * Typical parameter shapes\n *\n * /oauth/token (POST, application/x-www-form-urlencoded)\n *\n * For code exchange: grant_type=authorization_code, code, redirect_uri, client_id (and auth), code_verifier\n *\n * For refresh: grant_type=refresh_token, refresh_token, client_id (and auth)\n */\n/**\n * Quick checklist (security & correctness)\n * - PKCE (S256) required for public clients (and basically for all).\n * - Use authorization code grant only (no implicit/hybrid).\n * - Rotate refresh tokens and bind them to client + user + scopes.\n * - Prefer private_key_jwt or mTLS for confidential clients.\n * - PAR + JAR recommended for higher security.\n * - Consider DPoP (proof-of-possession) to reduce token replay.\n * - Keep codes very short-lived (e.g., ≤60 s) and single-use.\n * - Publish discovery and JWKS, rotate keys safely.\n * - Decide JWT vs opaque access tokens; provide introspection if opaque.\n */\n\n/**\n *\n * OAuth 2.0 Device Authorization Grant (“device code flow”)\n * Who does what (at a glance)\n *\n * Device/TV/CLI (no browser)\n * Calls POST /oauth/device_authorization, shows the user a code + URL, and polls POST /oauth/token.\n *\n * User (on phone/laptop browser)\n * Visits the given verification_uri and authenticates using your normal OAuth login (whatever you already have). No new UI required beyond two tiny endpoints.\n *\n * Auth Server (you)\n * Stores the device transaction and, after the user authenticates, marks it as approved so the device’s /oauth/token polling succeeds.\n *\n * Endpoints you need (only two “new” ones)\n *\n * POST /oauth/device_authorization ✅ (device calls)\n *\n * POST /oauth/token with grant urn:ietf:params:oauth:grant-type:device_code ✅ (device polls)\n *\n * GET /activate ➜ “UI handler” (user lands here from verification_uri — this just redirects into your existing /oauth/authorize)\n *\n * GET /activate/callback ➜ “UI handler” (your existing flow returns here after the user logs in; you flip the device record to approved and show a basic “All set” page)\n *\n * That’s it. No pages with complex consent screens are required; reuse your normal /oauth/authorize\n */\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
/**
|
|
3
|
+
* UserInfo (OIDC) — GET/POST /oauth/userinfo (Only if you add OpenID Connect)
|
|
4
|
+
*
|
|
5
|
+
* Who calls: Client with access token.
|
|
6
|
+
*
|
|
7
|
+
* Purpose: Return standard user claims.
|
|
8
|
+
*
|
|
9
|
+
* Note: Requires the openid scope; if you do OIDC, also expose /.well-known/openid-configuration (separate from OAuth discovery).
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Quick checklist (security & correctness)
|
|
13
|
+
* - PKCE (S256) required for public clients (and basically for all).
|
|
14
|
+
* - Use authorization code grant only (no implicit/hybrid).
|
|
15
|
+
* - Rotate refresh tokens and bind them to client + user + scopes.
|
|
16
|
+
* - Prefer private_key_jwt or mTLS for confidential clients.
|
|
17
|
+
* - PAR + JAR recommended for higher security.
|
|
18
|
+
* - Consider DPoP (proof-of-possession) to reduce token replay.
|
|
19
|
+
* - Keep codes very short-lived (e.g., ≤60 s) and single-use.
|
|
20
|
+
* - Publish discovery and JWKS, rotate keys safely.
|
|
21
|
+
* - Decide JWT vs opaque access tokens; provide introspection if opaque.
|
|
22
|
+
*/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* UserInfo (OIDC) — GET/POST /oauth/userinfo (Only if you add OpenID Connect)
|
|
5
|
+
*
|
|
6
|
+
* Who calls: Client with access token.
|
|
7
|
+
*
|
|
8
|
+
* Purpose: Return standard user claims.
|
|
9
|
+
*
|
|
10
|
+
* Note: Requires the openid scope; if you do OIDC, also expose /.well-known/openid-configuration (separate from OAuth discovery).
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Quick checklist (security & correctness)
|
|
14
|
+
* - PKCE (S256) required for public clients (and basically for all).
|
|
15
|
+
* - Use authorization code grant only (no implicit/hybrid).
|
|
16
|
+
* - Rotate refresh tokens and bind them to client + user + scopes.
|
|
17
|
+
* - Prefer private_key_jwt or mTLS for confidential clients.
|
|
18
|
+
* - PAR + JAR recommended for higher security.
|
|
19
|
+
* - Consider DPoP (proof-of-possession) to reduce token replay.
|
|
20
|
+
* - Keep codes very short-lived (e.g., ≤60 s) and single-use.
|
|
21
|
+
* - Publish discovery and JWKS, rotate keys safely.
|
|
22
|
+
* - Decide JWT vs opaque access tokens; provide introspection if opaque.
|
|
23
|
+
*/
|
|
24
|
+
//# sourceMappingURL=oauth.userinfo.flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.userinfo.flow.js","sourceRoot":"","sources":["../../../../../src/auth/oauth/flows/oauth.userinfo.flow.ts"],"names":[],"mappings":";;AAAA;;;;;;;;GAQG;AACH;;;;;;;;;;;GAWG","sourcesContent":["/**\n * UserInfo (OIDC) — GET/POST /oauth/userinfo (Only if you add OpenID Connect)\n *\n * Who calls: Client with access token.\n *\n * Purpose: Return standard user claims.\n *\n * Note: Requires the openid scope; if you do OIDC, also expose /.well-known/openid-configuration (separate from OAuth discovery).\n */\n/**\n * Quick checklist (security & correctness)\n * - PKCE (S256) required for public clients (and basically for all).\n * - Use authorization code grant only (no implicit/hybrid).\n * - Rotate refresh tokens and bind them to client + user + scopes.\n * - Prefer private_key_jwt or mTLS for confidential clients.\n * - PAR + JAR recommended for higher security.\n * - Consider DPoP (proof-of-possession) to reduce token replay.\n * - Keep codes very short-lived (e.g., ≤60 s) and single-use.\n * - Publish discovery and JWKS, rotate keys safely.\n * - Decide JWT vs opaque access tokens; provide introspection if opaque.\n */\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
/**
|
|
3
|
+
* Session/Logout (OIDC) — e.g., GET /oidc/logout (front-/back-channel variants)
|
|
4
|
+
*
|
|
5
|
+
* Purpose: Coordinate RP logout if you support OIDC logout.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Quick checklist (security & correctness)
|
|
9
|
+
* - PKCE (S256) required for public clients (and basically for all).
|
|
10
|
+
* - Use authorization code grant only (no implicit/hybrid).
|
|
11
|
+
* - Rotate refresh tokens and bind them to client + user + scopes.
|
|
12
|
+
* - Prefer private_key_jwt or mTLS for confidential clients.
|
|
13
|
+
* - PAR + JAR recommended for higher security.
|
|
14
|
+
* - Consider DPoP (proof-of-possession) to reduce token replay.
|
|
15
|
+
* - Keep codes very short-lived (e.g., ≤60 s) and single-use.
|
|
16
|
+
* - Publish discovery and JWKS, rotate keys safely.
|
|
17
|
+
* - Decide JWT vs opaque access tokens; provide introspection if opaque.
|
|
18
|
+
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Session/Logout (OIDC) — e.g., GET /oidc/logout (front-/back-channel variants)
|
|
5
|
+
*
|
|
6
|
+
* Purpose: Coordinate RP logout if you support OIDC logout.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Quick checklist (security & correctness)
|
|
10
|
+
* - PKCE (S256) required for public clients (and basically for all).
|
|
11
|
+
* - Use authorization code grant only (no implicit/hybrid).
|
|
12
|
+
* - Rotate refresh tokens and bind them to client + user + scopes.
|
|
13
|
+
* - Prefer private_key_jwt or mTLS for confidential clients.
|
|
14
|
+
* - PAR + JAR recommended for higher security.
|
|
15
|
+
* - Consider DPoP (proof-of-possession) to reduce token replay.
|
|
16
|
+
* - Keep codes very short-lived (e.g., ≤60 s) and single-use.
|
|
17
|
+
* - Publish discovery and JWKS, rotate keys safely.
|
|
18
|
+
* - Decide JWT vs opaque access tokens; provide introspection if opaque.
|
|
19
|
+
*/
|
|
20
|
+
//# sourceMappingURL=oidc.logout.flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oidc.logout.flow.js","sourceRoot":"","sources":["../../../../../src/auth/oauth/flows/oidc.logout.flow.ts"],"names":[],"mappings":";;AAAA;;;;GAIG;AACH;;;;;;;;;;;GAWG","sourcesContent":["/**\n * Session/Logout (OIDC) — e.g., GET /oidc/logout (front-/back-channel variants)\n *\n * Purpose: Coordinate RP logout if you support OIDC logout.\n */\n/**\n * Quick checklist (security & correctness)\n * - PKCE (S256) required for public clients (and basically for all).\n * - Use authorization code grant only (no implicit/hybrid).\n * - Rotate refresh tokens and bind them to client + user + scopes.\n * - Prefer private_key_jwt or mTLS for confidential clients.\n * - PAR + JAR recommended for higher security.\n * - Consider DPoP (proof-of-possession) to reduce token replay.\n * - Keep codes very short-lived (e.g., ≤60 s) and single-use.\n * - Publish discovery and JWKS, rotate keys safely.\n * - Decide JWT vs opaque access tokens; provide introspection if opaque.\n */\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ServerRequest } from '../common';
|
|
2
|
+
export declare function trimSlashes(s: string): string;
|
|
3
|
+
/** Normalize entryPath (gateway prefix) to "" or "/mcp" */
|
|
4
|
+
export declare function normalizeEntryPrefix(entryPath?: string): string;
|
|
5
|
+
/** Normalize a scope base (per-app or per-auth) to "" or "/app1" */
|
|
6
|
+
export declare function normalizeScopeBase(scopeBase?: string): string;
|
|
7
|
+
/** Join URL path segments with a single slash and no trailing slash */
|
|
8
|
+
export declare function joinPath(...parts: string[]): string;
|
|
9
|
+
export declare function getRequestBaseUrl(req: ServerRequest, entryPath?: string): string;
|
|
10
|
+
export declare function computeIssuer(req: ServerRequest, entryPath: string, scopeBase: string): string;
|
|
11
|
+
export declare function computeResource(req: ServerRequest, entryPath: string, scopeBase: string): string;
|
|
12
|
+
/** Derive a safe provider id from a URL when no id is provided. */
|
|
13
|
+
export declare function urlToSafeId(url: string): string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Build all path variants for a given well-known name:
|
|
16
|
+
* - reversed under root: /.well-known/<name><entryPrefix><scopeBase>
|
|
17
|
+
* - in prefix root: <entryPrefix>/.well-known/<name><scopeBase>
|
|
18
|
+
* - in prefix + scope: <entryPrefix><scopeBase>/.well-known/<name>
|
|
19
|
+
*/
|
|
20
|
+
export declare function makeWellKnownPaths(name: string, entryPrefix: string, scopeBase?: string): Set<string>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// auth/path.utils.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.trimSlashes = trimSlashes;
|
|
5
|
+
exports.normalizeEntryPrefix = normalizeEntryPrefix;
|
|
6
|
+
exports.normalizeScopeBase = normalizeScopeBase;
|
|
7
|
+
exports.joinPath = joinPath;
|
|
8
|
+
exports.getRequestBaseUrl = getRequestBaseUrl;
|
|
9
|
+
exports.computeIssuer = computeIssuer;
|
|
10
|
+
exports.computeResource = computeResource;
|
|
11
|
+
exports.urlToSafeId = urlToSafeId;
|
|
12
|
+
exports.makeWellKnownPaths = makeWellKnownPaths;
|
|
13
|
+
function trimSlashes(s) {
|
|
14
|
+
return (s ?? '').replace(/^\/+|\/+$/g, '');
|
|
15
|
+
}
|
|
16
|
+
/** Normalize entryPath (gateway prefix) to "" or "/mcp" */
|
|
17
|
+
function normalizeEntryPrefix(entryPath) {
|
|
18
|
+
const t = trimSlashes(entryPath ?? '');
|
|
19
|
+
return t ? `/${t}` : '';
|
|
20
|
+
}
|
|
21
|
+
/** Normalize a scope base (per-app or per-auth) to "" or "/app1" */
|
|
22
|
+
function normalizeScopeBase(scopeBase) {
|
|
23
|
+
const t = trimSlashes(scopeBase ?? '');
|
|
24
|
+
return t ? `/${t}` : '';
|
|
25
|
+
}
|
|
26
|
+
/** Join URL path segments with a single slash and no trailing slash */
|
|
27
|
+
function joinPath(...parts) {
|
|
28
|
+
const cleaned = parts.map((p) => trimSlashes(p)).filter(Boolean);
|
|
29
|
+
return cleaned.length ? `/${cleaned.join('/')}` : '';
|
|
30
|
+
}
|
|
31
|
+
function getRequestBaseUrl(req, entryPath) {
|
|
32
|
+
const proto = req.headers['x-forwarded-proto'] || req.protocol || 'http';
|
|
33
|
+
const host = req.headers['x-forwarded-host'] || req.headers['host'];
|
|
34
|
+
return `${proto}://${host}${entryPath ?? ''}`;
|
|
35
|
+
}
|
|
36
|
+
function computeIssuer(req, entryPath, scopeBase) {
|
|
37
|
+
const entryPrefix = normalizeEntryPrefix(entryPath);
|
|
38
|
+
const scope = normalizeScopeBase(scopeBase);
|
|
39
|
+
return `${getRequestBaseUrl(req)}${entryPrefix}${scope}`;
|
|
40
|
+
}
|
|
41
|
+
function computeResource(req, entryPath, scopeBase) {
|
|
42
|
+
const entryPrefix = normalizeEntryPrefix(entryPath);
|
|
43
|
+
const scope = normalizeScopeBase(scopeBase);
|
|
44
|
+
return `${getRequestBaseUrl(req)}${entryPrefix}${scope}`;
|
|
45
|
+
}
|
|
46
|
+
/** Derive a safe provider id from a URL when no id is provided. */
|
|
47
|
+
function urlToSafeId(url) {
|
|
48
|
+
try {
|
|
49
|
+
const u = new URL(url);
|
|
50
|
+
const raw = (u.host + (u.pathname && u.pathname !== '/' ? u.pathname : '')).replace(/\/+$/, '');
|
|
51
|
+
return trimSlashes(raw).replace(/[^a-zA-Z0-9_-]/g, '-');
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Build all path variants for a given well-known name:
|
|
59
|
+
* - reversed under root: /.well-known/<name><entryPrefix><scopeBase>
|
|
60
|
+
* - in prefix root: <entryPrefix>/.well-known/<name><scopeBase>
|
|
61
|
+
* - in prefix + scope: <entryPrefix><scopeBase>/.well-known/<name>
|
|
62
|
+
*/
|
|
63
|
+
function makeWellKnownPaths(name, entryPrefix, scopeBase = '') {
|
|
64
|
+
const prefix = normalizeEntryPrefix(entryPrefix);
|
|
65
|
+
const scope = normalizeScopeBase(scopeBase);
|
|
66
|
+
const reversed = joinPath('.well-known', name) + `${prefix}${scope}`; // /.well-known/name + /mcp/app1
|
|
67
|
+
const inPrefixRoot = `${prefix}${joinPath('.well-known', name)}${scope}`; // /mcp/.well-known/name + /app1
|
|
68
|
+
const inPrefixScope = `${prefix}${scope}${joinPath('.well-known', name)}`; // /mcp/app1/.well-known/name
|
|
69
|
+
return new Set([reversed, inPrefixRoot, inPrefixScope]);
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=path.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.utils.js","sourceRoot":"","sources":["../../../src/auth/path.utils.ts"],"names":[],"mappings":";AAAA,qBAAqB;;AAIrB,kCAEC;AAGD,oDAGC;AAGD,gDAGC;AAGD,4BAGC;AAGD,8CAIC;AAED,sCAIC;AAED,0CAIC;AAGD,kCAQC;AAQD,gDAOC;AAjED,SAAgB,WAAW,CAAC,CAAS;IACnC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,2DAA2D;AAC3D,SAAgB,oBAAoB,CAAC,SAAkB;IACrD,MAAM,CAAC,GAAG,WAAW,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IACvC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1B,CAAC;AAED,oEAAoE;AACpE,SAAgB,kBAAkB,CAAC,SAAkB;IACnD,MAAM,CAAC,GAAG,WAAW,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IACvC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1B,CAAC;AAED,uEAAuE;AACvE,SAAgB,QAAQ,CAAC,GAAG,KAAe;IACzC,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACjE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACvD,CAAC;AAGD,SAAgB,iBAAiB,CAAC,GAAkB,EAAE,SAAkB;IACtE,MAAM,KAAK,GAAI,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAY,IAAK,GAAW,CAAC,QAAQ,IAAI,MAAM,CAAC;IAC9F,MAAM,IAAI,GAAI,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAY,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChF,OAAO,GAAG,KAAK,MAAM,IAAI,GAAG,SAAS,IAAI,EAAE,EAAE,CAAC;AAChD,CAAC;AAED,SAAgB,aAAa,CAAC,GAAkB,EAAE,SAAiB,EAAE,SAAiB;IACpF,MAAM,WAAW,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC5C,OAAO,GAAG,iBAAiB,CAAC,GAAG,CAAC,GAAG,WAAW,GAAG,KAAK,EAAE,CAAC;AAC3D,CAAC;AAED,SAAgB,eAAe,CAAC,GAAkB,EAAE,SAAiB,EAAE,SAAiB;IACtF,MAAM,WAAW,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC5C,OAAO,GAAG,iBAAiB,CAAC,GAAG,CAAC,GAAG,WAAW,GAAG,KAAK,EAAE,CAAC;AAC3D,CAAC;AAED,mEAAmE;AACnE,SAAgB,WAAW,CAAC,GAAW;IACrC,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAChG,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;IAC1D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,IAAY,EAAE,WAAmB,EAAE,SAAS,GAAG,EAAE;IAClF,MAAM,MAAM,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC;IACjD,MAAM,KAAK,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,GAAG,MAAM,GAAG,KAAK,EAAE,CAAC,CAAC,gCAAgC;IACtG,MAAM,YAAY,GAAG,GAAG,MAAM,GAAG,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,gCAAgC;IAC1G,MAAM,aAAa,GAAG,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,6BAA6B;IACxG,OAAO,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["// auth/path.utils.ts\n\nimport { ServerRequest } from '../common';\n\nexport function trimSlashes(s: string) {\n return (s ?? '').replace(/^\\/+|\\/+$/g, '');\n}\n\n/** Normalize entryPath (gateway prefix) to \"\" or \"/mcp\" */\nexport function normalizeEntryPrefix(entryPath?: string): string {\n const t = trimSlashes(entryPath ?? '');\n return t ? `/${t}` : '';\n}\n\n/** Normalize a scope base (per-app or per-auth) to \"\" or \"/app1\" */\nexport function normalizeScopeBase(scopeBase?: string): string {\n const t = trimSlashes(scopeBase ?? '');\n return t ? `/${t}` : '';\n}\n\n/** Join URL path segments with a single slash and no trailing slash */\nexport function joinPath(...parts: string[]) {\n const cleaned = parts.map((p) => trimSlashes(p)).filter(Boolean);\n return cleaned.length ? `/${cleaned.join('/')}` : '';\n}\n\n\nexport function getRequestBaseUrl(req: ServerRequest, entryPath?: string) {\n const proto = (req.headers['x-forwarded-proto'] as string) || (req as any).protocol || 'http';\n const host = (req.headers['x-forwarded-host'] as string) || req.headers['host'];\n return `${proto}://${host}${entryPath ?? ''}`;\n}\n\nexport function computeIssuer(req: ServerRequest, entryPath: string, scopeBase: string) {\n const entryPrefix = normalizeEntryPrefix(entryPath);\n const scope = normalizeScopeBase(scopeBase);\n return `${getRequestBaseUrl(req)}${entryPrefix}${scope}`;\n}\n\nexport function computeResource(req: ServerRequest, entryPath: string, scopeBase: string) {\n const entryPrefix = normalizeEntryPrefix(entryPath);\n const scope = normalizeScopeBase(scopeBase);\n return `${getRequestBaseUrl(req)}${entryPrefix}${scope}`;\n}\n\n/** Derive a safe provider id from a URL when no id is provided. */\nexport function urlToSafeId(url: string): string | undefined {\n try {\n const u = new URL(url);\n const raw = (u.host + (u.pathname && u.pathname !== '/' ? u.pathname : '')).replace(/\\/+$/, '');\n return trimSlashes(raw).replace(/[^a-zA-Z0-9_-]/g, '-');\n } catch {\n return undefined;\n }\n}\n\n/**\n * Build all path variants for a given well-known name:\n * - reversed under root: /.well-known/<name><entryPrefix><scopeBase>\n * - in prefix root: <entryPrefix>/.well-known/<name><scopeBase>\n * - in prefix + scope: <entryPrefix><scopeBase>/.well-known/<name>\n */\nexport function makeWellKnownPaths(name: string, entryPrefix: string, scopeBase = '') {\n const prefix = normalizeEntryPrefix(entryPrefix);\n const scope = normalizeScopeBase(scopeBase);\n const reversed = joinPath('.well-known', name) + `${prefix}${scope}`; // /.well-known/name + /mcp/app1\n const inPrefixRoot = `${prefix}${joinPath('.well-known', name)}${scope}`; // /mcp/.well-known/name + /app1\n const inPrefixScope = `${prefix}${scope}${joinPath('.well-known', name)}`; // /mcp/app1/.well-known/name\n return new Set([reversed, inPrefixRoot, inPrefixScope]);\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Session = exports.isSoonExpiringProvider = exports.SessionService = void 0;
|
|
4
|
+
var session_service_1 = require("./session.service");
|
|
5
|
+
Object.defineProperty(exports, "SessionService", { enumerable: true, get: function () { return session_service_1.SessionService; } });
|
|
6
|
+
var token_refresh_1 = require("./token.refresh");
|
|
7
|
+
Object.defineProperty(exports, "isSoonExpiringProvider", { enumerable: true, get: function () { return token_refresh_1.isSoonExpiringProvider; } });
|
|
8
|
+
var session_base_1 = require("./record/session.base");
|
|
9
|
+
Object.defineProperty(exports, "Session", { enumerable: true, get: function () { return session_base_1.Session; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/auth/session/index.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AAEvB,iDAAyD;AAAhD,uHAAA,sBAAsB,OAAA;AAE/B,sDAAgD;AAAvC,uGAAA,OAAO,OAAA","sourcesContent":["export { SessionService } from './session.service';\nexport type { CreateSessionArgs } from './session.types';\nexport { isSoonExpiringProvider } from './token.refresh';\n\nexport { Session } from './record/session.base';\n"]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { ProviderSnapshot, SessionMode } from '../session.types';
|
|
2
|
+
import { Scope } from '../../../scope';
|
|
3
|
+
export interface BaseCreateCtx {
|
|
4
|
+
id: string;
|
|
5
|
+
sessionId?: string;
|
|
6
|
+
scope: Scope;
|
|
7
|
+
issuer: string;
|
|
8
|
+
token: string;
|
|
9
|
+
user: SessionUser;
|
|
10
|
+
claims?: SessionClaims;
|
|
11
|
+
createdAt?: number;
|
|
12
|
+
authorizedProviders?: Record<string, ProviderSnapshot>;
|
|
13
|
+
authorizedProviderIds?: string[];
|
|
14
|
+
authorizedApps?: Record<string, {
|
|
15
|
+
id: string;
|
|
16
|
+
toolIds: string[];
|
|
17
|
+
}>;
|
|
18
|
+
authorizedAppIds?: string[];
|
|
19
|
+
authorizedResources?: string[];
|
|
20
|
+
scopes?: string[];
|
|
21
|
+
authorizedTools?: Record<string, {
|
|
22
|
+
executionPath: [string, string];
|
|
23
|
+
details?: Record<string, any>;
|
|
24
|
+
}>;
|
|
25
|
+
authorizedToolIds?: string[];
|
|
26
|
+
authorizedPrompts?: Record<string, {
|
|
27
|
+
executionPath: [string, string];
|
|
28
|
+
details?: Record<string, any>;
|
|
29
|
+
}>;
|
|
30
|
+
authorizedPromptIds?: string[];
|
|
31
|
+
}
|
|
32
|
+
export interface SessionUser {
|
|
33
|
+
sub?: string;
|
|
34
|
+
name?: string;
|
|
35
|
+
email?: string;
|
|
36
|
+
picture?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface SessionClaims {
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}
|
|
41
|
+
export declare abstract class Session {
|
|
42
|
+
#private;
|
|
43
|
+
readonly id: string;
|
|
44
|
+
abstract readonly mode: SessionMode;
|
|
45
|
+
readonly createdAt: number;
|
|
46
|
+
readonly scopeId: string;
|
|
47
|
+
readonly user: SessionUser;
|
|
48
|
+
readonly claims?: Record<string, unknown>;
|
|
49
|
+
/** Epoch millis when the bearer token expires (if available). */
|
|
50
|
+
readonly expiresAt?: number;
|
|
51
|
+
readonly authorizedProviders: Record<string, ProviderSnapshot>;
|
|
52
|
+
readonly authorizedProviderIds: string[];
|
|
53
|
+
readonly authorizedApps: Record<string, {
|
|
54
|
+
id: string;
|
|
55
|
+
toolIds: string[];
|
|
56
|
+
}>;
|
|
57
|
+
readonly authorizedAppIds: string[];
|
|
58
|
+
readonly authorizedResources: string[];
|
|
59
|
+
readonly scopes?: string[];
|
|
60
|
+
readonly authorizedTools?: Record<string, {
|
|
61
|
+
executionPath: [string, string];
|
|
62
|
+
details?: Record<string, any>;
|
|
63
|
+
}>;
|
|
64
|
+
readonly authorizedToolIds?: string[];
|
|
65
|
+
readonly authorizedPrompts?: Record<string, {
|
|
66
|
+
executionPath: [string, string];
|
|
67
|
+
details?: Record<string, any>;
|
|
68
|
+
}>;
|
|
69
|
+
readonly authorizedPromptIds?: string[];
|
|
70
|
+
protected token: string;
|
|
71
|
+
protected constructor(ctx: BaseCreateCtx);
|
|
72
|
+
/**
|
|
73
|
+
* Get the scope associated with this session.
|
|
74
|
+
* Can be used by subclasses to implement custom scope handling.
|
|
75
|
+
* @protected
|
|
76
|
+
*/
|
|
77
|
+
protected get scope(): Scope;
|
|
78
|
+
get issuer(): string;
|
|
79
|
+
getTransportSessionId(): Promise<string>;
|
|
80
|
+
/**
|
|
81
|
+
* Get the access token for a given provider.
|
|
82
|
+
* Must be implemented in subclasses based on session topology.
|
|
83
|
+
* @protected
|
|
84
|
+
* @param providerId
|
|
85
|
+
*/
|
|
86
|
+
abstract getToken(providerId?: string): Promise<string> | string;
|
|
87
|
+
scoped(allowed: string | string[] | ((id: string) => boolean)): SessionView;
|
|
88
|
+
}
|
|
89
|
+
export declare class SessionView {
|
|
90
|
+
private readonly parent;
|
|
91
|
+
private readonly allow;
|
|
92
|
+
constructor(parent: Session, allow: (id: string) => boolean);
|
|
93
|
+
get id(): string;
|
|
94
|
+
get mode(): SessionMode;
|
|
95
|
+
get user(): SessionUser;
|
|
96
|
+
get claims(): Record<string, unknown> | undefined;
|
|
97
|
+
get authorizedApps(): Record<string, {
|
|
98
|
+
id: string;
|
|
99
|
+
toolIds: string[];
|
|
100
|
+
}>;
|
|
101
|
+
getToken(providerId: string): Promise<string>;
|
|
102
|
+
get transportId(): () => Promise<string>;
|
|
103
|
+
}
|