@frontmcp/sdk 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -18
- package/package.json +20 -5
- package/src/app/app.registry.d.ts +3 -2
- package/src/app/app.registry.js +3 -1
- package/src/app/app.registry.js.map +1 -1
- package/src/app/instances/app.local.instance.js +2 -2
- package/src/app/instances/app.local.instance.js.map +1 -1
- package/src/auth/auth.registry.d.ts +34 -2
- package/src/auth/auth.registry.js +162 -24
- package/src/auth/auth.registry.js.map +1 -1
- package/src/auth/auth.utils.js +8 -9
- package/src/auth/auth.utils.js.map +1 -1
- package/src/auth/authorization/authorization.class.d.ts +125 -0
- package/src/auth/authorization/authorization.class.js +224 -0
- package/src/auth/authorization/authorization.class.js.map +1 -0
- package/src/auth/authorization/authorization.types.d.ts +300 -0
- package/src/auth/authorization/authorization.types.js +79 -0
- package/src/auth/authorization/authorization.types.js.map +1 -0
- package/src/auth/authorization/index.d.ts +5 -0
- package/src/auth/authorization/index.js +19 -0
- package/src/auth/authorization/index.js.map +1 -0
- package/src/auth/authorization/orchestrated.authorization.d.ts +242 -0
- package/src/auth/authorization/orchestrated.authorization.js +306 -0
- package/src/auth/authorization/orchestrated.authorization.js.map +1 -0
- package/src/auth/authorization/public.authorization.d.ts +91 -0
- package/src/auth/authorization/public.authorization.js +132 -0
- package/src/auth/authorization/public.authorization.js.map +1 -0
- package/src/auth/authorization/transparent.authorization.d.ts +130 -0
- package/src/auth/authorization/transparent.authorization.js +147 -0
- package/src/auth/authorization/transparent.authorization.js.map +1 -0
- package/src/auth/consent/consent.types.d.ts +111 -0
- package/src/auth/consent/consent.types.js +119 -0
- package/src/auth/consent/consent.types.js.map +1 -0
- package/src/auth/consent/index.d.ts +1 -0
- package/src/auth/consent/index.js +13 -0
- package/src/auth/consent/index.js.map +1 -0
- package/src/auth/detection/auth-provider-detection.d.ts +84 -0
- package/src/auth/detection/auth-provider-detection.js +230 -0
- package/src/auth/detection/auth-provider-detection.js.map +1 -0
- package/src/auth/detection/index.d.ts +1 -0
- package/src/auth/detection/index.js +15 -0
- package/src/auth/detection/index.js.map +1 -0
- package/src/auth/flows/auth.verify.flow.d.ts +110 -0
- package/src/auth/flows/auth.verify.flow.js +379 -0
- package/src/auth/flows/auth.verify.flow.js.map +1 -0
- package/src/auth/flows/oauth.authorize.flow.d.ts +118 -164
- package/src/auth/flows/oauth.authorize.flow.js +701 -33
- package/src/auth/flows/oauth.authorize.flow.js.map +1 -1
- package/src/auth/flows/oauth.callback.flow.d.ts +117 -0
- package/src/auth/flows/oauth.callback.flow.js +357 -0
- package/src/auth/flows/oauth.callback.flow.js.map +1 -0
- package/src/auth/flows/oauth.register.flow.d.ts +32 -125
- package/src/auth/flows/oauth.token.flow.d.ts +52 -154
- package/src/auth/flows/oauth.token.flow.js +193 -55
- package/src/auth/flows/oauth.token.flow.js.map +1 -1
- package/src/auth/flows/session.verify.flow.d.ts +66 -321
- package/src/auth/flows/session.verify.flow.js +107 -18
- package/src/auth/flows/session.verify.flow.js.map +1 -1
- package/src/auth/flows/well-known.jwks.flow.d.ts +34 -205
- package/src/auth/flows/well-known.jwks.flow.js +15 -8
- package/src/auth/flows/well-known.jwks.flow.js.map +1 -1
- package/src/auth/flows/well-known.oauth-authorization-server.flow.d.ts +48 -223
- package/src/auth/flows/well-known.oauth-authorization-server.flow.js +2 -3
- package/src/auth/flows/well-known.oauth-authorization-server.flow.js.map +1 -1
- package/src/auth/flows/well-known.prm.flow.d.ts +19 -120
- package/src/auth/flows/well-known.prm.flow.js +3 -4
- package/src/auth/flows/well-known.prm.flow.js.map +1 -1
- package/src/auth/instances/instance.local-primary-auth.d.ts +91 -4
- package/src/auth/instances/instance.local-primary-auth.js +236 -6
- package/src/auth/instances/instance.local-primary-auth.js.map +1 -1
- package/src/auth/instances/instance.remote-primary-auth.d.ts +4 -3
- package/src/auth/instances/instance.remote-primary-auth.js +2 -2
- package/src/auth/instances/instance.remote-primary-auth.js.map +1 -1
- package/src/auth/session/authorization-vault.d.ts +611 -0
- package/src/auth/session/authorization-vault.js +817 -0
- package/src/auth/session/authorization-vault.js.map +1 -0
- package/src/auth/session/authorization.store.d.ts +301 -0
- package/src/auth/session/authorization.store.js +323 -0
- package/src/auth/session/authorization.store.js.map +1 -0
- package/src/auth/session/encrypted-authorization-vault.d.ts +181 -0
- package/src/auth/session/encrypted-authorization-vault.js +493 -0
- package/src/auth/session/encrypted-authorization-vault.js.map +1 -0
- package/src/auth/session/index.d.ts +4 -4
- package/src/auth/session/index.js +11 -7
- package/src/auth/session/index.js.map +1 -1
- package/src/auth/session/session.schema.d.ts +1 -1
- package/src/auth/session/session.service.d.ts +1 -1
- package/src/auth/session/transport-session.manager.d.ts +101 -0
- package/src/auth/session/transport-session.manager.js +300 -0
- package/src/auth/session/transport-session.manager.js.map +1 -0
- package/src/auth/session/transport-session.types.d.ts +457 -0
- package/src/auth/session/transport-session.types.js +110 -0
- package/src/auth/session/transport-session.types.js.map +1 -0
- package/src/auth/session/utils/session-id.utils.d.ts +14 -2
- package/src/auth/session/utils/session-id.utils.js +68 -19
- package/src/auth/session/utils/session-id.utils.js.map +1 -1
- package/src/auth/session/vault-encryption.d.ts +189 -0
- package/src/auth/session/vault-encryption.js +263 -0
- package/src/auth/session/vault-encryption.js.map +1 -0
- package/src/auth/ui/base-layout.d.ts +188 -0
- package/src/auth/ui/base-layout.js +292 -0
- package/src/auth/ui/base-layout.js.map +1 -0
- package/src/auth/ui/htmx-templates.d.ts +135 -0
- package/src/auth/ui/htmx-templates.js +433 -0
- package/src/auth/ui/htmx-templates.js.map +1 -0
- package/src/auth/ui/index.d.ts +11 -0
- package/src/auth/ui/index.js +35 -0
- package/src/auth/ui/index.js.map +1 -0
- package/src/auth/utils/audience.validator.d.ts +129 -0
- package/src/auth/utils/audience.validator.js +196 -0
- package/src/auth/utils/audience.validator.js.map +1 -0
- package/src/auth/utils/index.d.ts +2 -0
- package/src/auth/utils/index.js +7 -0
- package/src/auth/utils/index.js.map +1 -0
- package/src/auth/utils/www-authenticate.utils.d.ts +97 -0
- package/src/auth/utils/www-authenticate.utils.js +183 -0
- package/src/auth/utils/www-authenticate.utils.js.map +1 -0
- package/src/common/common.schema.d.ts +2 -16
- package/src/common/constants.d.ts +3 -0
- package/src/common/constants.js +6 -1
- package/src/common/constants.js.map +1 -1
- package/src/common/decorators/decorator-utils.d.ts +131 -0
- package/src/common/decorators/decorator-utils.js +195 -0
- package/src/common/decorators/decorator-utils.js.map +1 -0
- package/src/common/decorators/front-mcp.decorator.js +3 -2
- package/src/common/decorators/front-mcp.decorator.js.map +1 -1
- package/src/common/decorators/hook.decorator.d.ts +58 -2
- package/src/common/decorators/hook.decorator.js +127 -17
- package/src/common/decorators/hook.decorator.js.map +1 -1
- package/src/common/decorators/plugin.decorator.d.ts +1 -1
- package/src/common/decorators/plugin.decorator.js +11 -10
- package/src/common/decorators/plugin.decorator.js.map +1 -1
- package/src/common/decorators/resource.decorator.d.ts +32 -3
- package/src/common/decorators/resource.decorator.js +46 -4
- package/src/common/decorators/resource.decorator.js.map +1 -1
- package/src/common/decorators/tool.decorator.d.ts +54 -5
- package/src/common/decorators/tool.decorator.js.map +1 -1
- package/src/common/dynamic/dynamic.plugin.d.ts +22 -11
- package/src/common/dynamic/dynamic.plugin.js +7 -1
- package/src/common/dynamic/dynamic.plugin.js.map +1 -1
- package/src/common/entries/prompt.entry.d.ts +46 -2
- package/src/common/entries/prompt.entry.js +10 -0
- package/src/common/entries/prompt.entry.js.map +1 -1
- package/src/common/entries/resource.entry.d.ts +69 -6
- package/src/common/entries/resource.entry.js +27 -3
- package/src/common/entries/resource.entry.js.map +1 -1
- package/src/common/entries/scope.entry.d.ts +5 -1
- package/src/common/entries/scope.entry.js +3 -3
- package/src/common/entries/scope.entry.js.map +1 -1
- package/src/common/flow/flow.utils.d.ts +56 -0
- package/src/common/flow/flow.utils.js +96 -0
- package/src/common/flow/flow.utils.js.map +1 -0
- package/src/common/index.d.ts +2 -2
- package/src/common/index.js +2 -2
- package/src/common/index.js.map +1 -1
- package/src/common/interfaces/execution-context.interface.d.ts +59 -0
- package/src/common/interfaces/execution-context.interface.js +81 -0
- package/src/common/interfaces/execution-context.interface.js.map +1 -0
- package/src/common/interfaces/flow.interface.d.ts +1 -1
- package/src/common/interfaces/flow.interface.js.map +1 -1
- package/src/common/interfaces/index.d.ts +1 -0
- package/src/common/interfaces/index.js +1 -0
- package/src/common/interfaces/index.js.map +1 -1
- package/src/common/interfaces/internal/primary-auth-provider.interface.d.ts +17 -2
- package/src/common/interfaces/internal/primary-auth-provider.interface.js +52 -4
- package/src/common/interfaces/internal/primary-auth-provider.interface.js.map +1 -1
- package/src/common/interfaces/internal/registry.interface.d.ts +16 -2
- package/src/common/interfaces/internal/registry.interface.js.map +1 -1
- package/src/common/interfaces/plugin.interface.js.map +1 -1
- package/src/common/interfaces/prompt.interface.d.ts +53 -4
- package/src/common/interfaces/prompt.interface.js +78 -0
- package/src/common/interfaces/prompt.interface.js.map +1 -1
- package/src/common/interfaces/resource.interface.d.ts +47 -17
- package/src/common/interfaces/resource.interface.js +53 -0
- package/src/common/interfaces/resource.interface.js.map +1 -1
- package/src/common/interfaces/tool.interface.d.ts +39 -22
- package/src/common/interfaces/tool.interface.js +61 -34
- package/src/common/interfaces/tool.interface.js.map +1 -1
- package/src/common/metadata/adapter.metadata.d.ts +1 -9
- package/src/common/metadata/app.metadata.d.ts +425 -730
- package/src/common/metadata/auth-provider.metadata.d.ts +2 -12
- package/src/common/metadata/flow.metadata.d.ts +10 -25
- package/src/common/metadata/front-mcp.metadata.d.ts +602 -1023
- package/src/common/metadata/front-mcp.metadata.js +6 -4
- package/src/common/metadata/front-mcp.metadata.js.map +1 -1
- package/src/common/metadata/hook.metadata.d.ts +1 -1
- package/src/common/metadata/hook.metadata.js.map +1 -1
- package/src/common/metadata/index.d.ts +1 -0
- package/src/common/metadata/index.js +1 -0
- package/src/common/metadata/index.js.map +1 -1
- package/src/common/metadata/logger.metadata.d.ts +1 -9
- package/src/common/metadata/plugin.metadata.d.ts +8 -30
- package/src/common/metadata/prompt.metadata.d.ts +4 -161
- package/src/common/metadata/provider.metadata.d.ts +2 -12
- package/src/common/metadata/resource.metadata.d.ts +6 -98
- package/src/common/metadata/resource.metadata.js +15 -6
- package/src/common/metadata/resource.metadata.js.map +1 -1
- package/src/common/metadata/tool-ui.metadata.d.ts +10 -0
- package/src/common/metadata/tool-ui.metadata.js +12 -0
- package/src/common/metadata/tool-ui.metadata.js.map +1 -0
- package/src/common/metadata/tool.metadata.d.ts +78 -199
- package/src/common/metadata/tool.metadata.js +11 -14
- package/src/common/metadata/tool.metadata.js.map +1 -1
- package/src/common/providers/base-config.provider.d.ts +84 -0
- package/src/common/providers/base-config.provider.js +128 -0
- package/src/common/providers/base-config.provider.js.map +1 -0
- package/src/common/records/plugin.record.d.ts +5 -6
- package/src/common/records/plugin.record.js.map +1 -1
- package/src/common/records/prompt.record.js.map +1 -1
- package/src/common/records/resource.record.d.ts +17 -1
- package/src/common/records/resource.record.js +12 -6
- package/src/common/records/resource.record.js.map +1 -1
- package/src/common/records/tool.record.js.map +1 -1
- package/src/common/schemas/annotated-class.schema.d.ts +9 -9
- package/src/common/schemas/annotated-class.schema.js +92 -27
- package/src/common/schemas/annotated-class.schema.js.map +1 -1
- package/src/common/schemas/http-input.schema.d.ts +6 -30
- package/src/common/schemas/http-output.schema.d.ts +326 -1630
- package/src/common/schemas/http-output.schema.js +39 -1
- package/src/common/schemas/http-output.schema.js.map +1 -1
- package/src/common/tokens/front-mcp.tokens.js +4 -1
- package/src/common/tokens/front-mcp.tokens.js.map +1 -1
- package/src/common/tokens/resource.tokens.d.ts +2 -0
- package/src/common/tokens/resource.tokens.js +4 -1
- package/src/common/tokens/resource.tokens.js.map +1 -1
- package/src/common/tokens/tool.tokens.d.ts +2 -0
- package/src/common/tokens/tool.tokens.js +2 -0
- package/src/common/tokens/tool.tokens.js.map +1 -1
- package/src/common/types/auth/jwt.types.d.ts +5 -31
- package/src/common/types/auth/session.types.d.ts +97 -192
- package/src/common/types/auth/session.types.js +24 -11
- package/src/common/types/auth/session.types.js.map +1 -1
- package/src/common/types/options/auth.options.d.ts +1013 -490
- package/src/common/types/options/auth.options.js +554 -36
- package/src/common/types/options/auth.options.js.map +1 -1
- package/src/common/types/options/http.options.d.ts +1 -9
- package/src/common/types/options/logging.options.d.ts +7 -13
- package/src/common/types/options/logging.options.js +4 -0
- package/src/common/types/options/logging.options.js.map +1 -1
- package/src/common/types/options/server-info.options.d.ts +3 -31
- package/src/common/types/options/session.options.d.ts +90 -10
- package/src/common/types/options/session.options.js +26 -3
- package/src/common/types/options/session.options.js.map +1 -1
- package/src/common/utils/decide-request-intent.utils.d.ts +8 -46
- package/src/common/utils/decide-request-intent.utils.js +88 -23
- package/src/common/utils/decide-request-intent.utils.js.map +1 -1
- package/src/completion/flows/complete.flow.d.ts +74 -0
- package/src/completion/flows/complete.flow.js +199 -0
- package/src/completion/flows/complete.flow.js.map +1 -0
- package/src/errors/authorization-required.error.d.ts +189 -0
- package/src/errors/authorization-required.error.js +274 -0
- package/src/errors/authorization-required.error.js.map +1 -0
- package/src/errors/index.d.ts +2 -1
- package/src/errors/index.js +17 -1
- package/src/errors/index.js.map +1 -1
- package/src/errors/mcp.error.d.ts +101 -1
- package/src/errors/mcp.error.js +147 -2
- package/src/errors/mcp.error.js.map +1 -1
- package/src/flows/flow.instance.js +4 -3
- package/src/flows/flow.instance.js.map +1 -1
- package/src/flows/flow.registry.js.map +1 -1
- package/src/flows/flow.stages.js +14 -11
- package/src/flows/flow.stages.js.map +1 -1
- package/src/front-mcp/front-mcp.providers.d.ts +464 -102
- package/src/front-mcp/front-mcp.providers.js +3 -5
- package/src/front-mcp/front-mcp.providers.js.map +1 -1
- package/src/hooks/hook.instance.d.ts +1 -1
- package/src/hooks/hook.instance.js +5 -2
- package/src/hooks/hook.instance.js.map +1 -1
- package/src/hooks/hook.registry.js +7 -5
- package/src/hooks/hook.registry.js.map +1 -1
- package/src/index.d.ts +28 -9
- package/src/index.js +5 -1
- package/src/index.js.map +1 -1
- package/src/logger/instances/instance.logger.js +3 -2
- package/src/logger/instances/instance.logger.js.map +1 -1
- package/src/logger/logger.registry.js +7 -2
- package/src/logger/logger.registry.js.map +1 -1
- package/src/logging/flows/set-level.flow.d.ts +62 -0
- package/src/logging/flows/set-level.flow.js +108 -0
- package/src/logging/flows/set-level.flow.js.map +1 -0
- package/src/mcp-apps/csp.d.ts +111 -0
- package/src/mcp-apps/csp.js +267 -0
- package/src/mcp-apps/csp.js.map +1 -0
- package/src/mcp-apps/index.d.ts +23 -0
- package/src/mcp-apps/index.js +91 -0
- package/src/mcp-apps/index.js.map +1 -0
- package/src/mcp-apps/schemas.d.ts +403 -0
- package/src/mcp-apps/schemas.js +345 -0
- package/src/mcp-apps/schemas.js.map +1 -0
- package/src/mcp-apps/template.d.ts +94 -0
- package/src/mcp-apps/template.js +419 -0
- package/src/mcp-apps/template.js.map +1 -0
- package/src/mcp-apps/types.d.ts +323 -0
- package/src/mcp-apps/types.js +59 -0
- package/src/mcp-apps/types.js.map +1 -0
- package/src/notification/index.d.ts +1 -0
- package/src/notification/index.js +13 -0
- package/src/notification/index.js.map +1 -0
- package/src/notification/notification.service.d.ts +378 -0
- package/src/notification/notification.service.js +727 -0
- package/src/notification/notification.service.js.map +1 -0
- package/src/plugin/plugin.registry.js +12 -9
- package/src/plugin/plugin.registry.js.map +1 -1
- package/src/prompt/flows/get-prompt.flow.d.ts +153 -0
- package/src/prompt/flows/get-prompt.flow.js +214 -0
- package/src/prompt/flows/get-prompt.flow.js.map +1 -0
- package/src/prompt/flows/prompts-list.flow.d.ts +67 -0
- package/src/prompt/flows/prompts-list.flow.js +176 -0
- package/src/prompt/flows/prompts-list.flow.js.map +1 -0
- package/src/prompt/index.d.ts +7 -0
- package/src/prompt/index.js +17 -0
- package/src/prompt/index.js.map +1 -0
- package/src/prompt/prompt.events.d.ts +17 -0
- package/src/prompt/prompt.events.js +25 -0
- package/src/prompt/prompt.events.js.map +1 -0
- package/src/prompt/prompt.instance.d.ts +30 -0
- package/src/prompt/prompt.instance.js +120 -0
- package/src/prompt/prompt.instance.js.map +1 -0
- package/src/prompt/prompt.registry.d.ts +79 -12
- package/src/prompt/prompt.registry.js +360 -15
- package/src/prompt/prompt.registry.js.map +1 -1
- package/src/prompt/prompt.types.d.ts +26 -0
- package/src/prompt/prompt.types.js +11 -0
- package/src/prompt/prompt.types.js.map +1 -0
- package/src/prompt/prompt.utils.d.ts +26 -0
- package/src/prompt/prompt.utils.js +136 -0
- package/src/prompt/prompt.utils.js.map +1 -0
- package/src/provider/provider.registry.d.ts +12 -5
- package/src/provider/provider.registry.js +30 -138
- package/src/provider/provider.registry.js.map +1 -1
- package/src/regsitry/registry.base.d.ts +1 -1
- package/src/regsitry/registry.base.js.map +1 -1
- package/src/resource/flows/read-resource.flow.d.ts +91 -0
- package/src/resource/flows/read-resource.flow.js +270 -0
- package/src/resource/flows/read-resource.flow.js.map +1 -0
- package/src/resource/flows/resource-templates-list.flow.d.ts +64 -0
- package/src/resource/flows/resource-templates-list.flow.js +191 -0
- package/src/resource/flows/resource-templates-list.flow.js.map +1 -0
- package/src/resource/flows/resources-list.flow.d.ts +64 -0
- package/src/resource/flows/resources-list.flow.js +196 -0
- package/src/resource/flows/resources-list.flow.js.map +1 -0
- package/src/resource/flows/subscribe-resource.flow.d.ts +45 -0
- package/src/resource/flows/subscribe-resource.flow.js +123 -0
- package/src/resource/flows/subscribe-resource.flow.js.map +1 -0
- package/src/resource/flows/unsubscribe-resource.flow.d.ts +44 -0
- package/src/resource/flows/unsubscribe-resource.flow.js +107 -0
- package/src/resource/flows/unsubscribe-resource.flow.js.map +1 -0
- package/src/resource/index.d.ts +8 -0
- package/src/resource/index.js +20 -0
- package/src/resource/index.js.map +1 -0
- package/src/resource/resource.events.d.ts +24 -0
- package/src/resource/resource.events.js +17 -0
- package/src/resource/resource.events.js.map +1 -0
- package/src/resource/resource.instance.d.ts +35 -0
- package/src/resource/resource.instance.js +163 -0
- package/src/resource/resource.instance.js.map +1 -0
- package/src/resource/resource.registry.d.ts +106 -12
- package/src/resource/resource.registry.js +449 -13
- package/src/resource/resource.registry.js.map +1 -1
- package/src/resource/resource.types.d.ts +35 -0
- package/src/resource/resource.types.js +11 -0
- package/src/resource/resource.types.js.map +1 -0
- package/src/resource/resource.utils.d.ts +30 -0
- package/src/resource/resource.utils.js +151 -0
- package/src/resource/resource.utils.js.map +1 -0
- package/src/scope/flows/http.request.flow.d.ts +48 -330
- package/src/scope/flows/http.request.flow.js +306 -78
- package/src/scope/flows/http.request.flow.js.map +1 -1
- package/src/scope/scope.instance.d.ts +12 -0
- package/src/scope/scope.instance.js +145 -15
- package/src/scope/scope.instance.js.map +1 -1
- package/src/tool/flows/call-tool.flow.d.ts +64 -1110
- package/src/tool/flows/call-tool.flow.js +303 -15
- package/src/tool/flows/call-tool.flow.js.map +1 -1
- package/src/tool/flows/tools-list.flow.d.ts +32 -473
- package/src/tool/flows/tools-list.flow.js +121 -40
- package/src/tool/flows/tools-list.flow.js.map +1 -1
- package/src/tool/tool.events.d.ts +8 -1
- package/src/tool/tool.events.js.map +1 -1
- package/src/tool/tool.instance.d.ts +3 -1
- package/src/tool/tool.instance.js +17 -3
- package/src/tool/tool.instance.js.map +1 -1
- package/src/tool/tool.registry.d.ts +7 -1
- package/src/tool/tool.registry.js +26 -10
- package/src/tool/tool.registry.js.map +1 -1
- package/src/tool/tool.types.d.ts +4 -4
- package/src/tool/tool.types.js.map +1 -1
- package/src/tool/tool.utils.d.ts +3 -12
- package/src/tool/tool.utils.js +39 -193
- package/src/tool/tool.utils.js.map +1 -1
- package/src/tool/ui/index.d.ts +22 -0
- package/src/tool/ui/index.js +63 -0
- package/src/tool/ui/index.js.map +1 -0
- package/src/tool/ui/platform-adapters.d.ts +10 -0
- package/src/tool/ui/platform-adapters.js +18 -0
- package/src/tool/ui/platform-adapters.js.map +1 -0
- package/src/tool/ui/template-helpers.d.ts +46 -0
- package/src/tool/ui/template-helpers.js +112 -0
- package/src/tool/ui/template-helpers.js.map +1 -0
- package/src/tool/ui/ui-resource-template.d.ts +34 -0
- package/src/tool/ui/ui-resource-template.js +64 -0
- package/src/tool/ui/ui-resource-template.js.map +1 -0
- package/src/tool/ui/ui-resource.handler.d.ts +74 -0
- package/src/tool/ui/ui-resource.handler.js +129 -0
- package/src/tool/ui/ui-resource.handler.js.map +1 -0
- package/src/transport/adapters/transport.local.adapter.d.ts +2 -2
- package/src/transport/adapters/transport.local.adapter.js +28 -7
- package/src/transport/adapters/transport.local.adapter.js.map +1 -1
- package/src/transport/adapters/transport.sse.adapter.d.ts +2 -2
- package/src/transport/adapters/transport.sse.adapter.js +4 -3
- package/src/transport/adapters/transport.sse.adapter.js.map +1 -1
- package/src/transport/adapters/transport.streamable-http.adapter.d.ts +10 -3
- package/src/transport/adapters/transport.streamable-http.adapter.js +54 -8
- package/src/transport/adapters/transport.streamable-http.adapter.js.map +1 -1
- package/src/transport/flows/handle.sse.flow.d.ts +29 -63
- package/src/transport/flows/handle.sse.flow.js +78 -10
- package/src/transport/flows/handle.sse.flow.js.map +1 -1
- package/src/transport/flows/handle.stateless-http.flow.d.ts +29 -0
- package/src/transport/flows/handle.stateless-http.flow.js +102 -0
- package/src/transport/flows/handle.stateless-http.flow.js.map +1 -0
- package/src/transport/flows/handle.streamable-http.flow.d.ts +32 -64
- package/src/transport/flows/handle.streamable-http.flow.js +158 -26
- package/src/transport/flows/handle.streamable-http.flow.js.map +1 -1
- package/src/transport/legacy/legacy.sse.tranporter.d.ts +9 -0
- package/src/transport/legacy/legacy.sse.tranporter.js +17 -2
- package/src/transport/legacy/legacy.sse.tranporter.js.map +1 -1
- package/src/transport/mcp-handlers/call-tool-request.handler.js +27 -1
- package/src/transport/mcp-handlers/call-tool-request.handler.js.map +1 -1
- package/src/transport/mcp-handlers/complete-request.handler.d.ts +69 -0
- package/src/transport/mcp-handlers/complete-request.handler.js +11 -0
- package/src/transport/mcp-handlers/complete-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/get-prompt-request.handler.d.ts +87 -0
- package/src/transport/mcp-handlers/get-prompt-request.handler.js +11 -0
- package/src/transport/mcp-handlers/get-prompt-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/index.d.ts +517 -208
- package/src/transport/mcp-handlers/index.js +39 -2
- package/src/transport/mcp-handlers/index.js.map +1 -1
- package/src/transport/mcp-handlers/initialize-request.handler.d.ts +1 -1
- package/src/transport/mcp-handlers/initialize-request.handler.js +73 -7
- package/src/transport/mcp-handlers/initialize-request.handler.js.map +1 -1
- package/src/transport/mcp-handlers/list-prompts-request.handler.d.ts +54 -0
- package/src/transport/mcp-handlers/list-prompts-request.handler.js +11 -0
- package/src/transport/mcp-handlers/list-prompts-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/list-resource-templates-request.handler.d.ts +51 -0
- package/src/transport/mcp-handlers/list-resource-templates-request.handler.js +12 -0
- package/src/transport/mcp-handlers/list-resource-templates-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/list-resources-request.handler.d.ts +51 -0
- package/src/transport/mcp-handlers/list-resources-request.handler.js +12 -0
- package/src/transport/mcp-handlers/list-resources-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/list-tools-request.handler.d.ts +19 -146
- package/src/transport/mcp-handlers/logging-set-level-request.handler.d.ts +46 -0
- package/src/transport/mcp-handlers/logging-set-level-request.handler.js +34 -0
- package/src/transport/mcp-handlers/logging-set-level-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/mcp-handlers.types.d.ts +3 -7
- package/src/transport/mcp-handlers/mcp-handlers.types.js.map +1 -1
- package/src/transport/mcp-handlers/read-resource-request.handler.d.ts +46 -0
- package/src/transport/mcp-handlers/read-resource-request.handler.js +12 -0
- package/src/transport/mcp-handlers/read-resource-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/roots-list-changed-notification.handler.d.ts +11 -0
- package/src/transport/mcp-handlers/roots-list-changed-notification.handler.js +26 -0
- package/src/transport/mcp-handlers/roots-list-changed-notification.handler.js.map +1 -0
- package/src/transport/mcp-handlers/subscribe-request.handler.d.ts +37 -0
- package/src/transport/mcp-handlers/subscribe-request.handler.js +34 -0
- package/src/transport/mcp-handlers/subscribe-request.handler.js.map +1 -0
- package/src/transport/mcp-handlers/unsubscribe-request.handler.d.ts +37 -0
- package/src/transport/mcp-handlers/unsubscribe-request.handler.js +34 -0
- package/src/transport/mcp-handlers/unsubscribe-request.handler.js.map +1 -0
- package/src/transport/transport.local.js +7 -2
- package/src/transport/transport.local.js.map +1 -1
- package/src/transport/transport.registry.d.ts +30 -0
- package/src/transport/transport.registry.js +84 -1
- package/src/transport/transport.registry.js.map +1 -1
- package/src/transport/transport.types.d.ts +3 -3
- package/src/transport/transport.types.js.map +1 -1
- package/src/utils/content.utils.d.ts +48 -0
- package/src/utils/content.utils.js +194 -0
- package/src/utils/content.utils.js.map +1 -0
- package/src/utils/index.d.ts +8 -0
- package/src/utils/index.js +55 -0
- package/src/utils/index.js.map +1 -0
- package/src/utils/lineage.utils.d.ts +40 -0
- package/src/utils/lineage.utils.js +82 -0
- package/src/utils/lineage.utils.js.map +1 -0
- package/src/utils/naming.utils.d.ts +46 -0
- package/src/utils/naming.utils.js +136 -0
- package/src/utils/naming.utils.js.map +1 -0
- package/src/utils/types.utils.d.ts +2 -2
- package/src/utils/types.utils.js.map +1 -1
- package/src/utils/uri-template.utils.d.ts +57 -0
- package/src/utils/uri-template.utils.js +113 -0
- package/src/utils/uri-template.utils.js.map +1 -0
- package/src/utils/uri-validation.utils.d.ts +40 -0
- package/src/utils/uri-validation.utils.js +76 -0
- package/src/utils/uri-validation.utils.js.map +1 -0
- package/src/__test-utils__/fixtures/hook.fixtures.d.ts +0 -46
- package/src/__test-utils__/fixtures/hook.fixtures.js +0 -114
- package/src/__test-utils__/fixtures/hook.fixtures.js.map +0 -1
- package/src/__test-utils__/fixtures/index.d.ts +0 -7
- package/src/__test-utils__/fixtures/index.js +0 -11
- package/src/__test-utils__/fixtures/index.js.map +0 -1
- package/src/__test-utils__/fixtures/plugin.fixtures.d.ts +0 -46
- package/src/__test-utils__/fixtures/plugin.fixtures.js +0 -127
- package/src/__test-utils__/fixtures/plugin.fixtures.js.map +0 -1
- package/src/__test-utils__/fixtures/provider.fixtures.d.ts +0 -69
- package/src/__test-utils__/fixtures/provider.fixtures.js +0 -131
- package/src/__test-utils__/fixtures/provider.fixtures.js.map +0 -1
- package/src/__test-utils__/fixtures/scope.fixtures.d.ts +0 -14
- package/src/__test-utils__/fixtures/scope.fixtures.js +0 -59
- package/src/__test-utils__/fixtures/scope.fixtures.js.map +0 -1
- package/src/__test-utils__/fixtures/tool.fixtures.d.ts +0 -36
- package/src/__test-utils__/fixtures/tool.fixtures.js +0 -91
- package/src/__test-utils__/fixtures/tool.fixtures.js.map +0 -1
- package/src/__test-utils__/helpers/assertion.helpers.d.ts +0 -45
- package/src/__test-utils__/helpers/assertion.helpers.js +0 -153
- package/src/__test-utils__/helpers/assertion.helpers.js.map +0 -1
- package/src/__test-utils__/helpers/async.helpers.d.ts +0 -48
- package/src/__test-utils__/helpers/async.helpers.js +0 -112
- package/src/__test-utils__/helpers/async.helpers.js.map +0 -1
- package/src/__test-utils__/helpers/index.d.ts +0 -6
- package/src/__test-utils__/helpers/index.js +0 -10
- package/src/__test-utils__/helpers/index.js.map +0 -1
- package/src/__test-utils__/helpers/setup.helpers.d.ts +0 -54
- package/src/__test-utils__/helpers/setup.helpers.js +0 -106
- package/src/__test-utils__/helpers/setup.helpers.js.map +0 -1
- package/src/__test-utils__/index.d.ts +0 -9
- package/src/__test-utils__/index.js +0 -14
- package/src/__test-utils__/index.js.map +0 -1
- package/src/__test-utils__/mocks/flow-instance.mock.d.ts +0 -50
- package/src/__test-utils__/mocks/flow-instance.mock.js +0 -72
- package/src/__test-utils__/mocks/flow-instance.mock.js.map +0 -1
- package/src/__test-utils__/mocks/hook-registry.mock.d.ts +0 -25
- package/src/__test-utils__/mocks/hook-registry.mock.js +0 -65
- package/src/__test-utils__/mocks/hook-registry.mock.js.map +0 -1
- package/src/__test-utils__/mocks/index.d.ts +0 -8
- package/src/__test-utils__/mocks/index.js +0 -12
- package/src/__test-utils__/mocks/index.js.map +0 -1
- package/src/__test-utils__/mocks/plugin-registry.mock.d.ts +0 -43
- package/src/__test-utils__/mocks/plugin-registry.mock.js +0 -70
- package/src/__test-utils__/mocks/plugin-registry.mock.js.map +0 -1
- package/src/__test-utils__/mocks/provider-registry.mock.d.ts +0 -39
- package/src/__test-utils__/mocks/provider-registry.mock.js +0 -72
- package/src/__test-utils__/mocks/provider-registry.mock.js.map +0 -1
- package/src/__test-utils__/mocks/tool-registry.mock.d.ts +0 -43
- package/src/__test-utils__/mocks/tool-registry.mock.js +0 -79
- package/src/__test-utils__/mocks/tool-registry.mock.js.map +0 -1
- package/src/auth/path.utils.d.ts +0 -20
- package/src/auth/path.utils.js +0 -71
- package/src/auth/path.utils.js.map +0 -1
- package/src/common/decorators-old/async-with.decorator.d.ts +0 -10
- package/src/common/decorators-old/async-with.decorator.js +0 -24
- package/src/common/decorators-old/async-with.decorator.js.map +0 -1
- package/src/common/decorators-old/auth-hook.decorator.d.ts +0 -14
- package/src/common/decorators-old/auth-hook.decorator.js +0 -27
- package/src/common/decorators-old/auth-hook.decorator.js.map +0 -1
- package/src/common/decorators-old/session-hook.decorator.d.ts +0 -14
- package/src/common/decorators-old/session-hook.decorator.js +0 -27
- package/src/common/decorators-old/session-hook.decorator.js.map +0 -1
|
@@ -0,0 +1,611 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authorization Vault
|
|
3
|
+
*
|
|
4
|
+
* Secure storage for stateful authorization sessions.
|
|
5
|
+
* Stores provider tokens, consent selections, and session metadata.
|
|
6
|
+
*
|
|
7
|
+
* Supports multiple credential types:
|
|
8
|
+
* - OAuth tokens (access_token, refresh_token, scopes)
|
|
9
|
+
* - API Keys (key value, header name)
|
|
10
|
+
* - Basic Auth (username, password)
|
|
11
|
+
* - Private Keys (PEM/JWK format for signing)
|
|
12
|
+
* - Custom credentials (extensible)
|
|
13
|
+
*
|
|
14
|
+
* In stateful mode:
|
|
15
|
+
* - Access token is a non-rotatable key to this vault
|
|
16
|
+
* - All sensitive data stored server-side
|
|
17
|
+
* - Supports incremental authorization via links
|
|
18
|
+
*
|
|
19
|
+
* In stateless mode:
|
|
20
|
+
* - No vault used, all data in JWT claims
|
|
21
|
+
* - No incremental authorization support
|
|
22
|
+
*/
|
|
23
|
+
import { z } from 'zod';
|
|
24
|
+
/**
|
|
25
|
+
* Supported credential types for app authentication
|
|
26
|
+
*/
|
|
27
|
+
export declare const credentialTypeSchema: z.ZodEnum<{
|
|
28
|
+
custom: "custom";
|
|
29
|
+
oauth: "oauth";
|
|
30
|
+
api_key: "api_key";
|
|
31
|
+
basic: "basic";
|
|
32
|
+
bearer: "bearer";
|
|
33
|
+
private_key: "private_key";
|
|
34
|
+
mtls: "mtls";
|
|
35
|
+
}>;
|
|
36
|
+
export type CredentialType = z.infer<typeof credentialTypeSchema>;
|
|
37
|
+
/**
|
|
38
|
+
* OAuth credential - standard OAuth 2.0 tokens
|
|
39
|
+
*/
|
|
40
|
+
export declare const oauthCredentialSchema: z.ZodObject<{
|
|
41
|
+
type: z.ZodLiteral<"oauth">;
|
|
42
|
+
accessToken: z.ZodString;
|
|
43
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
44
|
+
tokenType: z.ZodDefault<z.ZodString>;
|
|
45
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
47
|
+
idToken: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
/**
|
|
50
|
+
* API Key credential - sent in header or query param
|
|
51
|
+
*/
|
|
52
|
+
export declare const apiKeyCredentialSchema: z.ZodObject<{
|
|
53
|
+
type: z.ZodLiteral<"api_key">;
|
|
54
|
+
key: z.ZodString;
|
|
55
|
+
headerName: z.ZodDefault<z.ZodString>;
|
|
56
|
+
headerPrefix: z.ZodOptional<z.ZodString>;
|
|
57
|
+
queryParam: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
/**
|
|
60
|
+
* Basic Auth credential - username and password
|
|
61
|
+
*/
|
|
62
|
+
export declare const basicAuthCredentialSchema: z.ZodObject<{
|
|
63
|
+
type: z.ZodLiteral<"basic">;
|
|
64
|
+
username: z.ZodString;
|
|
65
|
+
password: z.ZodString;
|
|
66
|
+
encodedValue: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
/**
|
|
69
|
+
* Bearer token credential - static bearer token
|
|
70
|
+
*/
|
|
71
|
+
export declare const bearerCredentialSchema: z.ZodObject<{
|
|
72
|
+
type: z.ZodLiteral<"bearer">;
|
|
73
|
+
token: z.ZodString;
|
|
74
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
/**
|
|
77
|
+
* Private key credential - for JWT signing or request signing
|
|
78
|
+
*/
|
|
79
|
+
export declare const privateKeyCredentialSchema: z.ZodObject<{
|
|
80
|
+
type: z.ZodLiteral<"private_key">;
|
|
81
|
+
format: z.ZodEnum<{
|
|
82
|
+
pem: "pem";
|
|
83
|
+
jwk: "jwk";
|
|
84
|
+
pkcs8: "pkcs8";
|
|
85
|
+
pkcs12: "pkcs12";
|
|
86
|
+
}>;
|
|
87
|
+
keyData: z.ZodString;
|
|
88
|
+
keyId: z.ZodOptional<z.ZodString>;
|
|
89
|
+
algorithm: z.ZodOptional<z.ZodString>;
|
|
90
|
+
passphrase: z.ZodOptional<z.ZodString>;
|
|
91
|
+
certificate: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
/**
|
|
94
|
+
* mTLS credential - client certificate for mutual TLS
|
|
95
|
+
*/
|
|
96
|
+
export declare const mtlsCredentialSchema: z.ZodObject<{
|
|
97
|
+
type: z.ZodLiteral<"mtls">;
|
|
98
|
+
certificate: z.ZodString;
|
|
99
|
+
privateKey: z.ZodString;
|
|
100
|
+
passphrase: z.ZodOptional<z.ZodString>;
|
|
101
|
+
caCertificate: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
/**
|
|
104
|
+
* Custom credential - extensible for app-specific auth
|
|
105
|
+
*/
|
|
106
|
+
export declare const customCredentialSchema: z.ZodObject<{
|
|
107
|
+
type: z.ZodLiteral<"custom">;
|
|
108
|
+
customType: z.ZodString;
|
|
109
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
110
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
/**
|
|
113
|
+
* Union of all credential types
|
|
114
|
+
*/
|
|
115
|
+
export declare const credentialSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
116
|
+
type: z.ZodLiteral<"oauth">;
|
|
117
|
+
accessToken: z.ZodString;
|
|
118
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
119
|
+
tokenType: z.ZodDefault<z.ZodString>;
|
|
120
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
122
|
+
idToken: z.ZodOptional<z.ZodString>;
|
|
123
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
124
|
+
type: z.ZodLiteral<"api_key">;
|
|
125
|
+
key: z.ZodString;
|
|
126
|
+
headerName: z.ZodDefault<z.ZodString>;
|
|
127
|
+
headerPrefix: z.ZodOptional<z.ZodString>;
|
|
128
|
+
queryParam: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
130
|
+
type: z.ZodLiteral<"basic">;
|
|
131
|
+
username: z.ZodString;
|
|
132
|
+
password: z.ZodString;
|
|
133
|
+
encodedValue: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
135
|
+
type: z.ZodLiteral<"bearer">;
|
|
136
|
+
token: z.ZodString;
|
|
137
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
139
|
+
type: z.ZodLiteral<"private_key">;
|
|
140
|
+
format: z.ZodEnum<{
|
|
141
|
+
pem: "pem";
|
|
142
|
+
jwk: "jwk";
|
|
143
|
+
pkcs8: "pkcs8";
|
|
144
|
+
pkcs12: "pkcs12";
|
|
145
|
+
}>;
|
|
146
|
+
keyData: z.ZodString;
|
|
147
|
+
keyId: z.ZodOptional<z.ZodString>;
|
|
148
|
+
algorithm: z.ZodOptional<z.ZodString>;
|
|
149
|
+
passphrase: z.ZodOptional<z.ZodString>;
|
|
150
|
+
certificate: z.ZodOptional<z.ZodString>;
|
|
151
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
152
|
+
type: z.ZodLiteral<"mtls">;
|
|
153
|
+
certificate: z.ZodString;
|
|
154
|
+
privateKey: z.ZodString;
|
|
155
|
+
passphrase: z.ZodOptional<z.ZodString>;
|
|
156
|
+
caCertificate: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
158
|
+
type: z.ZodLiteral<"custom">;
|
|
159
|
+
customType: z.ZodString;
|
|
160
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
161
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
162
|
+
}, z.core.$strip>], "type">;
|
|
163
|
+
export type OAuthCredential = z.infer<typeof oauthCredentialSchema>;
|
|
164
|
+
export type ApiKeyCredential = z.infer<typeof apiKeyCredentialSchema>;
|
|
165
|
+
export type BasicAuthCredential = z.infer<typeof basicAuthCredentialSchema>;
|
|
166
|
+
export type BearerCredential = z.infer<typeof bearerCredentialSchema>;
|
|
167
|
+
export type PrivateKeyCredential = z.infer<typeof privateKeyCredentialSchema>;
|
|
168
|
+
export type MtlsCredential = z.infer<typeof mtlsCredentialSchema>;
|
|
169
|
+
export type CustomCredential = z.infer<typeof customCredentialSchema>;
|
|
170
|
+
export type Credential = z.infer<typeof credentialSchema>;
|
|
171
|
+
/**
|
|
172
|
+
* Credential stored for an app in the vault
|
|
173
|
+
*/
|
|
174
|
+
export declare const appCredentialSchema: z.ZodObject<{
|
|
175
|
+
appId: z.ZodString;
|
|
176
|
+
providerId: z.ZodString;
|
|
177
|
+
credential: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
178
|
+
type: z.ZodLiteral<"oauth">;
|
|
179
|
+
accessToken: z.ZodString;
|
|
180
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
181
|
+
tokenType: z.ZodDefault<z.ZodString>;
|
|
182
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
184
|
+
idToken: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
186
|
+
type: z.ZodLiteral<"api_key">;
|
|
187
|
+
key: z.ZodString;
|
|
188
|
+
headerName: z.ZodDefault<z.ZodString>;
|
|
189
|
+
headerPrefix: z.ZodOptional<z.ZodString>;
|
|
190
|
+
queryParam: z.ZodOptional<z.ZodString>;
|
|
191
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
192
|
+
type: z.ZodLiteral<"basic">;
|
|
193
|
+
username: z.ZodString;
|
|
194
|
+
password: z.ZodString;
|
|
195
|
+
encodedValue: z.ZodOptional<z.ZodString>;
|
|
196
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
197
|
+
type: z.ZodLiteral<"bearer">;
|
|
198
|
+
token: z.ZodString;
|
|
199
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
201
|
+
type: z.ZodLiteral<"private_key">;
|
|
202
|
+
format: z.ZodEnum<{
|
|
203
|
+
pem: "pem";
|
|
204
|
+
jwk: "jwk";
|
|
205
|
+
pkcs8: "pkcs8";
|
|
206
|
+
pkcs12: "pkcs12";
|
|
207
|
+
}>;
|
|
208
|
+
keyData: z.ZodString;
|
|
209
|
+
keyId: z.ZodOptional<z.ZodString>;
|
|
210
|
+
algorithm: z.ZodOptional<z.ZodString>;
|
|
211
|
+
passphrase: z.ZodOptional<z.ZodString>;
|
|
212
|
+
certificate: z.ZodOptional<z.ZodString>;
|
|
213
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
214
|
+
type: z.ZodLiteral<"mtls">;
|
|
215
|
+
certificate: z.ZodString;
|
|
216
|
+
privateKey: z.ZodString;
|
|
217
|
+
passphrase: z.ZodOptional<z.ZodString>;
|
|
218
|
+
caCertificate: z.ZodOptional<z.ZodString>;
|
|
219
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
220
|
+
type: z.ZodLiteral<"custom">;
|
|
221
|
+
customType: z.ZodString;
|
|
222
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
223
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
224
|
+
}, z.core.$strip>], "type">;
|
|
225
|
+
acquiredAt: z.ZodNumber;
|
|
226
|
+
lastUsedAt: z.ZodOptional<z.ZodNumber>;
|
|
227
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
228
|
+
isValid: z.ZodDefault<z.ZodBoolean>;
|
|
229
|
+
invalidReason: z.ZodOptional<z.ZodString>;
|
|
230
|
+
userInfo: z.ZodOptional<z.ZodObject<{
|
|
231
|
+
sub: z.ZodOptional<z.ZodString>;
|
|
232
|
+
email: z.ZodOptional<z.ZodString>;
|
|
233
|
+
name: z.ZodOptional<z.ZodString>;
|
|
234
|
+
}, z.core.$strip>>;
|
|
235
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
236
|
+
}, z.core.$strip>;
|
|
237
|
+
export type AppCredential = z.infer<typeof appCredentialSchema>;
|
|
238
|
+
/**
|
|
239
|
+
* Consent record stored in vault
|
|
240
|
+
*/
|
|
241
|
+
export declare const vaultConsentRecordSchema: z.ZodObject<{
|
|
242
|
+
enabled: z.ZodBoolean;
|
|
243
|
+
selectedToolIds: z.ZodArray<z.ZodString>;
|
|
244
|
+
availableToolIds: z.ZodArray<z.ZodString>;
|
|
245
|
+
consentedAt: z.ZodNumber;
|
|
246
|
+
version: z.ZodDefault<z.ZodString>;
|
|
247
|
+
}, z.core.$strip>;
|
|
248
|
+
/**
|
|
249
|
+
* Federated login record stored in vault
|
|
250
|
+
*/
|
|
251
|
+
export declare const vaultFederatedRecordSchema: z.ZodObject<{
|
|
252
|
+
selectedProviderIds: z.ZodArray<z.ZodString>;
|
|
253
|
+
skippedProviderIds: z.ZodArray<z.ZodString>;
|
|
254
|
+
primaryProviderId: z.ZodOptional<z.ZodString>;
|
|
255
|
+
completedAt: z.ZodNumber;
|
|
256
|
+
}, z.core.$strip>;
|
|
257
|
+
/**
|
|
258
|
+
* Pending incremental authorization request
|
|
259
|
+
*/
|
|
260
|
+
export declare const pendingIncrementalAuthSchema: z.ZodObject<{
|
|
261
|
+
id: z.ZodString;
|
|
262
|
+
appId: z.ZodString;
|
|
263
|
+
toolId: z.ZodOptional<z.ZodString>;
|
|
264
|
+
authUrl: z.ZodString;
|
|
265
|
+
requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
266
|
+
elicitId: z.ZodOptional<z.ZodString>;
|
|
267
|
+
createdAt: z.ZodNumber;
|
|
268
|
+
expiresAt: z.ZodNumber;
|
|
269
|
+
status: z.ZodEnum<{
|
|
270
|
+
pending: "pending";
|
|
271
|
+
completed: "completed";
|
|
272
|
+
cancelled: "cancelled";
|
|
273
|
+
expired: "expired";
|
|
274
|
+
}>;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
/**
|
|
277
|
+
* Authorization vault entry (the full session state)
|
|
278
|
+
*/
|
|
279
|
+
export declare const authorizationVaultEntrySchema: z.ZodObject<{
|
|
280
|
+
id: z.ZodString;
|
|
281
|
+
userSub: z.ZodString;
|
|
282
|
+
userEmail: z.ZodOptional<z.ZodString>;
|
|
283
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
284
|
+
clientId: z.ZodString;
|
|
285
|
+
createdAt: z.ZodNumber;
|
|
286
|
+
lastAccessAt: z.ZodNumber;
|
|
287
|
+
appCredentials: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
288
|
+
appId: z.ZodString;
|
|
289
|
+
providerId: z.ZodString;
|
|
290
|
+
credential: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
291
|
+
type: z.ZodLiteral<"oauth">;
|
|
292
|
+
accessToken: z.ZodString;
|
|
293
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
294
|
+
tokenType: z.ZodDefault<z.ZodString>;
|
|
295
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
296
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
297
|
+
idToken: z.ZodOptional<z.ZodString>;
|
|
298
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
299
|
+
type: z.ZodLiteral<"api_key">;
|
|
300
|
+
key: z.ZodString;
|
|
301
|
+
headerName: z.ZodDefault<z.ZodString>;
|
|
302
|
+
headerPrefix: z.ZodOptional<z.ZodString>;
|
|
303
|
+
queryParam: z.ZodOptional<z.ZodString>;
|
|
304
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
305
|
+
type: z.ZodLiteral<"basic">;
|
|
306
|
+
username: z.ZodString;
|
|
307
|
+
password: z.ZodString;
|
|
308
|
+
encodedValue: z.ZodOptional<z.ZodString>;
|
|
309
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
310
|
+
type: z.ZodLiteral<"bearer">;
|
|
311
|
+
token: z.ZodString;
|
|
312
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
313
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
314
|
+
type: z.ZodLiteral<"private_key">;
|
|
315
|
+
format: z.ZodEnum<{
|
|
316
|
+
pem: "pem";
|
|
317
|
+
jwk: "jwk";
|
|
318
|
+
pkcs8: "pkcs8";
|
|
319
|
+
pkcs12: "pkcs12";
|
|
320
|
+
}>;
|
|
321
|
+
keyData: z.ZodString;
|
|
322
|
+
keyId: z.ZodOptional<z.ZodString>;
|
|
323
|
+
algorithm: z.ZodOptional<z.ZodString>;
|
|
324
|
+
passphrase: z.ZodOptional<z.ZodString>;
|
|
325
|
+
certificate: z.ZodOptional<z.ZodString>;
|
|
326
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
327
|
+
type: z.ZodLiteral<"mtls">;
|
|
328
|
+
certificate: z.ZodString;
|
|
329
|
+
privateKey: z.ZodString;
|
|
330
|
+
passphrase: z.ZodOptional<z.ZodString>;
|
|
331
|
+
caCertificate: z.ZodOptional<z.ZodString>;
|
|
332
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
333
|
+
type: z.ZodLiteral<"custom">;
|
|
334
|
+
customType: z.ZodString;
|
|
335
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
336
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
337
|
+
}, z.core.$strip>], "type">;
|
|
338
|
+
acquiredAt: z.ZodNumber;
|
|
339
|
+
lastUsedAt: z.ZodOptional<z.ZodNumber>;
|
|
340
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
341
|
+
isValid: z.ZodDefault<z.ZodBoolean>;
|
|
342
|
+
invalidReason: z.ZodOptional<z.ZodString>;
|
|
343
|
+
userInfo: z.ZodOptional<z.ZodObject<{
|
|
344
|
+
sub: z.ZodOptional<z.ZodString>;
|
|
345
|
+
email: z.ZodOptional<z.ZodString>;
|
|
346
|
+
name: z.ZodOptional<z.ZodString>;
|
|
347
|
+
}, z.core.$strip>>;
|
|
348
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
349
|
+
}, z.core.$strip>>>;
|
|
350
|
+
consent: z.ZodOptional<z.ZodObject<{
|
|
351
|
+
enabled: z.ZodBoolean;
|
|
352
|
+
selectedToolIds: z.ZodArray<z.ZodString>;
|
|
353
|
+
availableToolIds: z.ZodArray<z.ZodString>;
|
|
354
|
+
consentedAt: z.ZodNumber;
|
|
355
|
+
version: z.ZodDefault<z.ZodString>;
|
|
356
|
+
}, z.core.$strip>>;
|
|
357
|
+
federated: z.ZodOptional<z.ZodObject<{
|
|
358
|
+
selectedProviderIds: z.ZodArray<z.ZodString>;
|
|
359
|
+
skippedProviderIds: z.ZodArray<z.ZodString>;
|
|
360
|
+
primaryProviderId: z.ZodOptional<z.ZodString>;
|
|
361
|
+
completedAt: z.ZodNumber;
|
|
362
|
+
}, z.core.$strip>>;
|
|
363
|
+
pendingAuths: z.ZodArray<z.ZodObject<{
|
|
364
|
+
id: z.ZodString;
|
|
365
|
+
appId: z.ZodString;
|
|
366
|
+
toolId: z.ZodOptional<z.ZodString>;
|
|
367
|
+
authUrl: z.ZodString;
|
|
368
|
+
requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
369
|
+
elicitId: z.ZodOptional<z.ZodString>;
|
|
370
|
+
createdAt: z.ZodNumber;
|
|
371
|
+
expiresAt: z.ZodNumber;
|
|
372
|
+
status: z.ZodEnum<{
|
|
373
|
+
pending: "pending";
|
|
374
|
+
completed: "completed";
|
|
375
|
+
cancelled: "cancelled";
|
|
376
|
+
expired: "expired";
|
|
377
|
+
}>;
|
|
378
|
+
}, z.core.$strip>>;
|
|
379
|
+
authorizedAppIds: z.ZodArray<z.ZodString>;
|
|
380
|
+
skippedAppIds: z.ZodArray<z.ZodString>;
|
|
381
|
+
}, z.core.$strip>;
|
|
382
|
+
export type VaultConsentRecord = z.infer<typeof vaultConsentRecordSchema>;
|
|
383
|
+
export type VaultFederatedRecord = z.infer<typeof vaultFederatedRecordSchema>;
|
|
384
|
+
export type PendingIncrementalAuth = z.infer<typeof pendingIncrementalAuthSchema>;
|
|
385
|
+
export type AuthorizationVaultEntry = z.infer<typeof authorizationVaultEntrySchema>;
|
|
386
|
+
export interface AuthorizationVault {
|
|
387
|
+
/**
|
|
388
|
+
* Create a new vault entry
|
|
389
|
+
*/
|
|
390
|
+
create(params: {
|
|
391
|
+
userSub: string;
|
|
392
|
+
userEmail?: string;
|
|
393
|
+
userName?: string;
|
|
394
|
+
clientId: string;
|
|
395
|
+
consent?: VaultConsentRecord;
|
|
396
|
+
federated?: VaultFederatedRecord;
|
|
397
|
+
authorizedAppIds?: string[];
|
|
398
|
+
skippedAppIds?: string[];
|
|
399
|
+
}): Promise<AuthorizationVaultEntry>;
|
|
400
|
+
/**
|
|
401
|
+
* Get vault entry by ID
|
|
402
|
+
*/
|
|
403
|
+
get(id: string): Promise<AuthorizationVaultEntry | null>;
|
|
404
|
+
/**
|
|
405
|
+
* Update vault entry
|
|
406
|
+
*/
|
|
407
|
+
update(id: string, updates: Partial<AuthorizationVaultEntry>): Promise<void>;
|
|
408
|
+
/**
|
|
409
|
+
* Delete vault entry
|
|
410
|
+
*/
|
|
411
|
+
delete(id: string): Promise<void>;
|
|
412
|
+
/**
|
|
413
|
+
* Update consent in the vault
|
|
414
|
+
*/
|
|
415
|
+
updateConsent(vaultId: string, consent: VaultConsentRecord): Promise<void>;
|
|
416
|
+
/**
|
|
417
|
+
* Add app to authorized list (for incremental auth)
|
|
418
|
+
*/
|
|
419
|
+
authorizeApp(vaultId: string, appId: string): Promise<void>;
|
|
420
|
+
/**
|
|
421
|
+
* Create a pending incremental auth request
|
|
422
|
+
*/
|
|
423
|
+
createPendingAuth(vaultId: string, params: {
|
|
424
|
+
appId: string;
|
|
425
|
+
toolId?: string;
|
|
426
|
+
authUrl: string;
|
|
427
|
+
requiredScopes?: string[];
|
|
428
|
+
elicitId?: string;
|
|
429
|
+
ttlMs?: number;
|
|
430
|
+
}): Promise<PendingIncrementalAuth>;
|
|
431
|
+
/**
|
|
432
|
+
* Get pending auth by ID
|
|
433
|
+
*/
|
|
434
|
+
getPendingAuth(vaultId: string, pendingAuthId: string): Promise<PendingIncrementalAuth | null>;
|
|
435
|
+
/**
|
|
436
|
+
* Complete a pending incremental auth
|
|
437
|
+
*/
|
|
438
|
+
completePendingAuth(vaultId: string, pendingAuthId: string): Promise<void>;
|
|
439
|
+
/**
|
|
440
|
+
* Cancel a pending incremental auth
|
|
441
|
+
*/
|
|
442
|
+
cancelPendingAuth(vaultId: string, pendingAuthId: string): Promise<void>;
|
|
443
|
+
/**
|
|
444
|
+
* Check if app is authorized
|
|
445
|
+
*/
|
|
446
|
+
isAppAuthorized(vaultId: string, appId: string): Promise<boolean>;
|
|
447
|
+
/**
|
|
448
|
+
* Get all pending auths for a vault
|
|
449
|
+
*/
|
|
450
|
+
getPendingAuths(vaultId: string): Promise<PendingIncrementalAuth[]>;
|
|
451
|
+
/**
|
|
452
|
+
* Add an app credential to the vault
|
|
453
|
+
* Only stores if app is authorized AND (consent disabled OR app tools in consent)
|
|
454
|
+
*/
|
|
455
|
+
addAppCredential(vaultId: string, credential: AppCredential): Promise<void>;
|
|
456
|
+
/**
|
|
457
|
+
* Remove an app credential from the vault
|
|
458
|
+
*/
|
|
459
|
+
removeAppCredential(vaultId: string, appId: string, providerId: string): Promise<void>;
|
|
460
|
+
/**
|
|
461
|
+
* Get all credentials for a specific app
|
|
462
|
+
*/
|
|
463
|
+
getAppCredentials(vaultId: string, appId: string): Promise<AppCredential[]>;
|
|
464
|
+
/**
|
|
465
|
+
* Get a specific credential for an app and provider
|
|
466
|
+
*/
|
|
467
|
+
getCredential(vaultId: string, appId: string, providerId: string): Promise<AppCredential | null>;
|
|
468
|
+
/**
|
|
469
|
+
* Get all credentials in the vault (filtered by consent if enabled)
|
|
470
|
+
* @param filterByConsent If true, only returns credentials for apps with consented tools
|
|
471
|
+
*/
|
|
472
|
+
getAllCredentials(vaultId: string, filterByConsent?: boolean): Promise<AppCredential[]>;
|
|
473
|
+
/**
|
|
474
|
+
* Update credential metadata (last used, validity, etc.)
|
|
475
|
+
*/
|
|
476
|
+
updateCredential(vaultId: string, appId: string, providerId: string, updates: Partial<Pick<AppCredential, 'lastUsedAt' | 'isValid' | 'invalidReason' | 'expiresAt' | 'metadata'>>): Promise<void>;
|
|
477
|
+
/**
|
|
478
|
+
* Check if a credential should be stored based on consent
|
|
479
|
+
* Returns true if:
|
|
480
|
+
* - Consent is disabled, OR
|
|
481
|
+
* - The app has at least one tool in the consent selection
|
|
482
|
+
*/
|
|
483
|
+
shouldStoreCredential(vaultId: string, appId: string, toolIds?: string[]): Promise<boolean>;
|
|
484
|
+
/**
|
|
485
|
+
* Invalidate a credential (mark as invalid without removing)
|
|
486
|
+
*/
|
|
487
|
+
invalidateCredential(vaultId: string, appId: string, providerId: string, reason: string): Promise<void>;
|
|
488
|
+
/**
|
|
489
|
+
* Refresh an OAuth credential (update tokens)
|
|
490
|
+
*/
|
|
491
|
+
refreshOAuthCredential(vaultId: string, appId: string, providerId: string, tokens: {
|
|
492
|
+
accessToken: string;
|
|
493
|
+
refreshToken?: string;
|
|
494
|
+
expiresAt?: number;
|
|
495
|
+
}): Promise<void>;
|
|
496
|
+
/**
|
|
497
|
+
* Cleanup expired entries and pending auths
|
|
498
|
+
*/
|
|
499
|
+
cleanup(): Promise<void>;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* In-Memory Authorization Vault
|
|
503
|
+
*
|
|
504
|
+
* Development/testing implementation. Data is lost on restart.
|
|
505
|
+
* For production, use RedisAuthorizationVault.
|
|
506
|
+
*/
|
|
507
|
+
export declare class InMemoryAuthorizationVault implements AuthorizationVault {
|
|
508
|
+
private vaults;
|
|
509
|
+
/** Default TTL for pending auth requests (10 minutes) */
|
|
510
|
+
private readonly pendingAuthTtlMs;
|
|
511
|
+
create(params: {
|
|
512
|
+
userSub: string;
|
|
513
|
+
userEmail?: string;
|
|
514
|
+
userName?: string;
|
|
515
|
+
clientId: string;
|
|
516
|
+
consent?: VaultConsentRecord;
|
|
517
|
+
federated?: VaultFederatedRecord;
|
|
518
|
+
authorizedAppIds?: string[];
|
|
519
|
+
skippedAppIds?: string[];
|
|
520
|
+
}): Promise<AuthorizationVaultEntry>;
|
|
521
|
+
get(id: string): Promise<AuthorizationVaultEntry | null>;
|
|
522
|
+
update(id: string, updates: Partial<AuthorizationVaultEntry>): Promise<void>;
|
|
523
|
+
delete(id: string): Promise<void>;
|
|
524
|
+
updateConsent(vaultId: string, consent: VaultConsentRecord): Promise<void>;
|
|
525
|
+
authorizeApp(vaultId: string, appId: string): Promise<void>;
|
|
526
|
+
createPendingAuth(vaultId: string, params: {
|
|
527
|
+
appId: string;
|
|
528
|
+
toolId?: string;
|
|
529
|
+
authUrl: string;
|
|
530
|
+
requiredScopes?: string[];
|
|
531
|
+
elicitId?: string;
|
|
532
|
+
ttlMs?: number;
|
|
533
|
+
}): Promise<PendingIncrementalAuth>;
|
|
534
|
+
getPendingAuth(vaultId: string, pendingAuthId: string): Promise<PendingIncrementalAuth | null>;
|
|
535
|
+
completePendingAuth(vaultId: string, pendingAuthId: string): Promise<void>;
|
|
536
|
+
cancelPendingAuth(vaultId: string, pendingAuthId: string): Promise<void>;
|
|
537
|
+
isAppAuthorized(vaultId: string, appId: string): Promise<boolean>;
|
|
538
|
+
getPendingAuths(vaultId: string): Promise<PendingIncrementalAuth[]>;
|
|
539
|
+
cleanup(): Promise<void>;
|
|
540
|
+
/** Create a credential key from appId and providerId */
|
|
541
|
+
private credentialKey;
|
|
542
|
+
addAppCredential(vaultId: string, credential: AppCredential): Promise<void>;
|
|
543
|
+
removeAppCredential(vaultId: string, appId: string, providerId: string): Promise<void>;
|
|
544
|
+
getAppCredentials(vaultId: string, appId: string): Promise<AppCredential[]>;
|
|
545
|
+
getCredential(vaultId: string, appId: string, providerId: string): Promise<AppCredential | null>;
|
|
546
|
+
getAllCredentials(vaultId: string, filterByConsent?: boolean): Promise<AppCredential[]>;
|
|
547
|
+
updateCredential(vaultId: string, appId: string, providerId: string, updates: Partial<Pick<AppCredential, 'lastUsedAt' | 'isValid' | 'invalidReason' | 'expiresAt' | 'metadata'>>): Promise<void>;
|
|
548
|
+
shouldStoreCredential(vaultId: string, appId: string, toolIds?: string[]): Promise<boolean>;
|
|
549
|
+
invalidateCredential(vaultId: string, appId: string, providerId: string, reason: string): Promise<void>;
|
|
550
|
+
refreshOAuthCredential(vaultId: string, appId: string, providerId: string, tokens: {
|
|
551
|
+
accessToken: string;
|
|
552
|
+
refreshToken?: string;
|
|
553
|
+
expiresAt?: number;
|
|
554
|
+
}): Promise<void>;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Redis Authorization Vault (placeholder)
|
|
558
|
+
*
|
|
559
|
+
* Production implementation using Redis for distributed storage.
|
|
560
|
+
* TODO: Implement after in-memory vault is validated.
|
|
561
|
+
*/
|
|
562
|
+
export declare class RedisAuthorizationVault implements AuthorizationVault {
|
|
563
|
+
private readonly redis;
|
|
564
|
+
private readonly namespace;
|
|
565
|
+
constructor(redis: any, namespace?: string);
|
|
566
|
+
private key;
|
|
567
|
+
/** Create a credential key from appId and providerId */
|
|
568
|
+
private credentialKey;
|
|
569
|
+
create(params: {
|
|
570
|
+
userSub: string;
|
|
571
|
+
userEmail?: string;
|
|
572
|
+
userName?: string;
|
|
573
|
+
clientId: string;
|
|
574
|
+
consent?: VaultConsentRecord;
|
|
575
|
+
federated?: VaultFederatedRecord;
|
|
576
|
+
authorizedAppIds?: string[];
|
|
577
|
+
skippedAppIds?: string[];
|
|
578
|
+
}): Promise<AuthorizationVaultEntry>;
|
|
579
|
+
get(id: string): Promise<AuthorizationVaultEntry | null>;
|
|
580
|
+
update(id: string, updates: Partial<AuthorizationVaultEntry>): Promise<void>;
|
|
581
|
+
delete(id: string): Promise<void>;
|
|
582
|
+
updateConsent(vaultId: string, consent: VaultConsentRecord): Promise<void>;
|
|
583
|
+
authorizeApp(vaultId: string, appId: string): Promise<void>;
|
|
584
|
+
createPendingAuth(vaultId: string, params: {
|
|
585
|
+
appId: string;
|
|
586
|
+
toolId?: string;
|
|
587
|
+
authUrl: string;
|
|
588
|
+
requiredScopes?: string[];
|
|
589
|
+
elicitId?: string;
|
|
590
|
+
ttlMs?: number;
|
|
591
|
+
}): Promise<PendingIncrementalAuth>;
|
|
592
|
+
getPendingAuth(vaultId: string, pendingAuthId: string): Promise<PendingIncrementalAuth | null>;
|
|
593
|
+
completePendingAuth(vaultId: string, pendingAuthId: string): Promise<void>;
|
|
594
|
+
cancelPendingAuth(vaultId: string, pendingAuthId: string): Promise<void>;
|
|
595
|
+
isAppAuthorized(vaultId: string, appId: string): Promise<boolean>;
|
|
596
|
+
getPendingAuths(vaultId: string): Promise<PendingIncrementalAuth[]>;
|
|
597
|
+
cleanup(): Promise<void>;
|
|
598
|
+
addAppCredential(vaultId: string, credential: AppCredential): Promise<void>;
|
|
599
|
+
removeAppCredential(vaultId: string, appId: string, providerId: string): Promise<void>;
|
|
600
|
+
getAppCredentials(vaultId: string, appId: string): Promise<AppCredential[]>;
|
|
601
|
+
getCredential(vaultId: string, appId: string, providerId: string): Promise<AppCredential | null>;
|
|
602
|
+
getAllCredentials(vaultId: string, filterByConsent?: boolean): Promise<AppCredential[]>;
|
|
603
|
+
updateCredential(vaultId: string, appId: string, providerId: string, updates: Partial<Pick<AppCredential, 'lastUsedAt' | 'isValid' | 'invalidReason' | 'expiresAt' | 'metadata'>>): Promise<void>;
|
|
604
|
+
shouldStoreCredential(vaultId: string, appId: string, toolIds?: string[]): Promise<boolean>;
|
|
605
|
+
invalidateCredential(vaultId: string, appId: string, providerId: string, reason: string): Promise<void>;
|
|
606
|
+
refreshOAuthCredential(vaultId: string, appId: string, providerId: string, tokens: {
|
|
607
|
+
accessToken: string;
|
|
608
|
+
refreshToken?: string;
|
|
609
|
+
expiresAt?: number;
|
|
610
|
+
}): Promise<void>;
|
|
611
|
+
}
|