@frontmcp/sdk 0.6.0 → 0.6.2
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/{src/auth → auth}/instances/instance.local-primary-auth.d.ts +1 -1
- package/{src/auth → auth}/instances/instance.remote-primary-auth.d.ts +1 -1
- package/{src/auth → auth}/session/index.d.ts +1 -0
- package/auth/session/vercel-kv-session.store.d.ts +96 -0
- package/{src/common → common}/interfaces/internal/primary-auth-provider.interface.d.ts +1 -4
- package/{src/common → common}/metadata/front-mcp.metadata.d.ts +1779 -67
- package/{src/common → common}/metadata/prompt.metadata.d.ts +4 -0
- package/{src/common → common}/metadata/resource.metadata.d.ts +8 -0
- package/{src/common → common}/metadata/tool-ui.metadata.d.ts +2 -2
- package/{src/common → common}/metadata/tool.metadata.d.ts +4 -0
- package/{src/common → common}/schemas/http-output.schema.d.ts +24 -6
- package/common/types/options/auth/app-auth.schema.d.ts +275 -0
- package/common/types/options/auth/auth.interfaces.d.ts +461 -0
- package/common/types/options/auth/auth.schema.d.ts +284 -0
- package/common/types/options/auth/auth.utils.d.ts +32 -0
- package/common/types/options/auth/index.d.ts +16 -0
- package/common/types/options/auth/orchestrated.schema.d.ts +381 -0
- package/common/types/options/auth/public.schema.d.ts +42 -0
- package/common/types/options/auth/shared.schemas.d.ts +120 -0
- package/common/types/options/auth/transparent.schema.d.ts +56 -0
- package/common/types/options/auth/transport.deprecated.d.ts +63 -0
- package/{src/common → common}/types/options/index.d.ts +1 -1
- package/common/types/options/redis.options.d.ts +190 -0
- package/{src/common → common}/types/options/server-info.options.d.ts +4 -0
- package/{src/common → common}/types/options/transport.options.d.ts +74 -5
- package/{src/common → common}/utils/decide-request-intent.utils.d.ts +6 -7
- package/common/utils/global-config.utils.d.ts +36 -0
- package/{src/common → common}/utils/index.d.ts +1 -0
- package/{src/completion → completion}/flows/complete.flow.d.ts +6 -8
- package/{src/errors → errors}/index.d.ts +1 -1
- package/{src/errors → errors}/mcp.error.d.ts +9 -0
- package/esm/index.mjs +22664 -0
- package/esm/mcp-apps/index.mjs +723 -0
- package/esm/package.json +81 -0
- package/{src/front-mcp → front-mcp}/front-mcp.providers.d.ts +246 -38
- package/front-mcp/index.d.ts +2 -0
- package/{src/index.d.ts → index.d.ts} +1 -1
- package/index.js +22957 -0
- package/logger/logger.tokens.d.ts +1 -0
- package/{src/logging → logging}/flows/set-level.flow.d.ts +6 -8
- package/mcp-apps/index.js +799 -0
- package/package.json +37 -17
- package/{src/prompt → prompt}/flows/get-prompt.flow.d.ts +14 -8
- package/{src/prompt → prompt}/flows/prompts-list.flow.d.ts +8 -7
- package/{src/resource → resource}/flows/read-resource.flow.d.ts +8 -9
- package/{src/resource → resource}/flows/resource-templates-list.flow.d.ts +8 -7
- package/{src/resource → resource}/flows/resources-list.flow.d.ts +8 -7
- package/{src/resource → resource}/flows/subscribe-resource.flow.d.ts +6 -8
- package/{src/resource → resource}/flows/unsubscribe-resource.flow.d.ts +6 -8
- package/store/adapters/store.vercel-kv.adapter.d.ts +86 -0
- package/{src/store → store}/index.d.ts +2 -0
- package/store/store.factory.d.ts +86 -0
- package/{src/tool → tool}/flows/call-tool.flow.d.ts +18 -9
- package/{src/tool → tool}/flows/tools-list.flow.d.ts +9 -8
- package/{src/tool → tool}/ui/index.d.ts +4 -4
- package/{src/tool → tool}/ui/platform-adapters.d.ts +2 -2
- package/{src/tool → tool}/ui/template-helpers.d.ts +5 -7
- package/{src/tool → tool}/ui/ui-resource.handler.d.ts +1 -1
- package/{src/transport → transport}/mcp-handlers/complete-request.handler.d.ts +4 -15
- package/{src/transport → transport}/mcp-handlers/get-prompt-request.handler.d.ts +5 -15
- package/{src/transport → transport}/mcp-handlers/index.d.ts +67 -195
- package/{src/transport → transport}/mcp-handlers/list-prompts-request.handler.d.ts +5 -15
- package/{src/transport → transport}/mcp-handlers/list-resource-templates-request.handler.d.ts +5 -15
- package/{src/transport → transport}/mcp-handlers/list-resources-request.handler.d.ts +5 -15
- package/{src/transport → transport}/mcp-handlers/list-tools-request.handler.d.ts +5 -15
- package/{src/transport → transport}/mcp-handlers/logging-set-level-request.handler.d.ts +3 -14
- package/{src/transport → transport}/mcp-handlers/read-resource-request.handler.d.ts +4 -15
- package/{src/transport → transport}/mcp-handlers/subscribe-request.handler.d.ts +3 -14
- package/{src/transport → transport}/mcp-handlers/unsubscribe-request.handler.d.ts +3 -14
- package/{src/transport → transport}/transport.registry.d.ts +5 -1
- package/README.md +0 -460
- package/src/adapter/adapter.instance.js +0 -70
- package/src/adapter/adapter.instance.js.map +0 -1
- package/src/adapter/adapter.regsitry.js +0 -54
- package/src/adapter/adapter.regsitry.js.map +0 -1
- package/src/adapter/adapter.utils.js +0 -83
- package/src/adapter/adapter.utils.js.map +0 -1
- package/src/app/app.registry.js +0 -66
- package/src/app/app.registry.js.map +0 -1
- package/src/app/app.utils.js +0 -58
- package/src/app/app.utils.js.map +0 -1
- package/src/app/instances/app.local.instance.js +0 -67
- package/src/app/instances/app.local.instance.js.map +0 -1
- package/src/app/instances/app.remote.instance.js +0 -36
- package/src/app/instances/app.remote.instance.js.map +0 -1
- package/src/app/instances/index.js +0 -6
- package/src/app/instances/index.js.map +0 -1
- package/src/auth/auth.registry.js +0 -219
- package/src/auth/auth.registry.js.map +0 -1
- package/src/auth/auth.utils.js +0 -84
- package/src/auth/auth.utils.js.map +0 -1
- package/src/auth/authorization/authorization.class.js +0 -217
- package/src/auth/authorization/authorization.class.js.map +0 -1
- package/src/auth/authorization/authorization.types.js +0 -79
- package/src/auth/authorization/authorization.types.js.map +0 -1
- package/src/auth/authorization/index.js +0 -19
- package/src/auth/authorization/index.js.map +0 -1
- package/src/auth/authorization/orchestrated.authorization.js +0 -306
- package/src/auth/authorization/orchestrated.authorization.js.map +0 -1
- package/src/auth/authorization/public.authorization.js +0 -132
- package/src/auth/authorization/public.authorization.js.map +0 -1
- package/src/auth/authorization/transparent.authorization.js +0 -147
- package/src/auth/authorization/transparent.authorization.js.map +0 -1
- package/src/auth/consent/consent.types.js +0 -119
- package/src/auth/consent/consent.types.js.map +0 -1
- package/src/auth/consent/index.js +0 -13
- package/src/auth/consent/index.js.map +0 -1
- package/src/auth/detection/auth-provider-detection.js +0 -230
- package/src/auth/detection/auth-provider-detection.js.map +0 -1
- package/src/auth/detection/index.js +0 -15
- package/src/auth/detection/index.js.map +0 -1
- package/src/auth/flows/auth.verify.flow.js +0 -379
- package/src/auth/flows/auth.verify.flow.js.map +0 -1
- package/src/auth/flows/oauth.authorize.flow.js +0 -822
- package/src/auth/flows/oauth.authorize.flow.js.map +0 -1
- package/src/auth/flows/oauth.callback.flow.js +0 -357
- package/src/auth/flows/oauth.callback.flow.js.map +0 -1
- package/src/auth/flows/oauth.register.flow.js +0 -201
- package/src/auth/flows/oauth.register.flow.js.map +0 -1
- package/src/auth/flows/oauth.token.flow.js +0 -319
- package/src/auth/flows/oauth.token.flow.js.map +0 -1
- package/src/auth/flows/session.verify.flow.js +0 -304
- package/src/auth/flows/session.verify.flow.js.map +0 -1
- package/src/auth/flows/well-known.jwks.flow.js +0 -89
- package/src/auth/flows/well-known.jwks.flow.js.map +0 -1
- package/src/auth/flows/well-known.oauth-authorization-server.flow.js +0 -122
- package/src/auth/flows/well-known.oauth-authorization-server.flow.js.map +0 -1
- package/src/auth/flows/well-known.prm.flow.js +0 -106
- package/src/auth/flows/well-known.prm.flow.js.map +0 -1
- package/src/auth/instances/instance.local-primary-auth.js +0 -308
- package/src/auth/instances/instance.local-primary-auth.js.map +0 -1
- package/src/auth/instances/instance.remote-primary-auth.js +0 -49
- package/src/auth/instances/instance.remote-primary-auth.js.map +0 -1
- package/src/auth/jwks/dev-key-persistence.js +0 -219
- package/src/auth/jwks/dev-key-persistence.js.map +0 -1
- package/src/auth/jwks/index.js +0 -7
- package/src/auth/jwks/index.js.map +0 -1
- package/src/auth/jwks/jwks.service.js +0 -303
- package/src/auth/jwks/jwks.service.js.map +0 -1
- package/src/auth/jwks/jwks.types.js +0 -3
- package/src/auth/jwks/jwks.types.js.map +0 -1
- package/src/auth/jwks/jwks.utils.js +0 -32
- package/src/auth/jwks/jwks.utils.js.map +0 -1
- package/src/auth/machine-id.js +0 -32
- package/src/auth/machine-id.js.map +0 -1
- package/src/auth/oauth/flows/oauth.authorize.flow.js +0 -33
- package/src/auth/oauth/flows/oauth.authorize.flow.js.map +0 -1
- package/src/auth/oauth/flows/oauth.device-authorization.flow.js +0 -48
- package/src/auth/oauth/flows/oauth.device-authorization.flow.js.map +0 -1
- package/src/auth/oauth/flows/oauth.introspect.flow.js +0 -28
- package/src/auth/oauth/flows/oauth.introspect.flow.js.map +0 -1
- package/src/auth/oauth/flows/oauth.par.flow.js +0 -29
- package/src/auth/oauth/flows/oauth.par.flow.js.map +0 -1
- package/src/auth/oauth/flows/oauth.revoke.flow.js +0 -27
- package/src/auth/oauth/flows/oauth.revoke.flow.js.map +0 -1
- package/src/auth/oauth/flows/oauth.token.flow.js +0 -59
- package/src/auth/oauth/flows/oauth.token.flow.js.map +0 -1
- package/src/auth/oauth/flows/oauth.userinfo.flow.js +0 -24
- package/src/auth/oauth/flows/oauth.userinfo.flow.js.map +0 -1
- package/src/auth/oauth/flows/oidc.logout.flow.js +0 -20
- package/src/auth/oauth/flows/oidc.logout.flow.js.map +0 -1
- package/src/auth/session/authorization-vault.js +0 -817
- package/src/auth/session/authorization-vault.js.map +0 -1
- package/src/auth/session/authorization.store.js +0 -323
- package/src/auth/session/authorization.store.js.map +0 -1
- package/src/auth/session/encrypted-authorization-vault.js +0 -493
- package/src/auth/session/encrypted-authorization-vault.js.map +0 -1
- package/src/auth/session/index.js +0 -16
- package/src/auth/session/index.js.map +0 -1
- package/src/auth/session/record/session.base.js +0 -125
- package/src/auth/session/record/session.base.js.map +0 -1
- package/src/auth/session/record/session.stateful.js +0 -55
- package/src/auth/session/record/session.stateful.js.map +0 -1
- package/src/auth/session/record/session.stateless.js +0 -32
- package/src/auth/session/record/session.stateless.js.map +0 -1
- package/src/auth/session/record/session.transparent.js +0 -22
- package/src/auth/session/record/session.transparent.js.map +0 -1
- package/src/auth/session/redis-session.store.js +0 -204
- package/src/auth/session/redis-session.store.js.map +0 -1
- package/src/auth/session/session.crypto.js +0 -47
- package/src/auth/session/session.crypto.js.map +0 -1
- package/src/auth/session/session.schema.js +0 -13
- package/src/auth/session/session.schema.js.map +0 -1
- package/src/auth/session/session.service.js +0 -105
- package/src/auth/session/session.service.js.map +0 -1
- package/src/auth/session/session.transport.js +0 -20
- package/src/auth/session/session.transport.js.map +0 -1
- package/src/auth/session/session.types.js +0 -4
- package/src/auth/session/session.types.js.map +0 -1
- package/src/auth/session/token.refresh.js +0 -63
- package/src/auth/session/token.refresh.js.map +0 -1
- package/src/auth/session/token.store.js +0 -53
- package/src/auth/session/token.store.js.map +0 -1
- package/src/auth/session/token.vault.js +0 -54
- package/src/auth/session/token.vault.js.map +0 -1
- package/src/auth/session/transport-session.manager.js +0 -298
- package/src/auth/session/transport-session.manager.js.map +0 -1
- package/src/auth/session/transport-session.types.js +0 -111
- package/src/auth/session/transport-session.types.js.map +0 -1
- package/src/auth/session/utils/auth-token.utils.js +0 -57
- package/src/auth/session/utils/auth-token.utils.js.map +0 -1
- package/src/auth/session/utils/session-id.utils.js +0 -217
- package/src/auth/session/utils/session-id.utils.js.map +0 -1
- package/src/auth/session/utils/tiny-ttl-cache.js +0 -26
- package/src/auth/session/utils/tiny-ttl-cache.js.map +0 -1
- package/src/auth/session/vault-encryption.js +0 -263
- package/src/auth/session/vault-encryption.js.map +0 -1
- package/src/auth/ui/base-layout.js +0 -279
- package/src/auth/ui/base-layout.js.map +0 -1
- package/src/auth/ui/index.js +0 -34
- package/src/auth/ui/index.js.map +0 -1
- package/src/auth/ui/templates.js +0 -426
- package/src/auth/ui/templates.js.map +0 -1
- package/src/auth/utils/audience.validator.js +0 -196
- package/src/auth/utils/audience.validator.js.map +0 -1
- package/src/auth/utils/index.js +0 -7
- package/src/auth/utils/index.js.map +0 -1
- package/src/auth/utils/www-authenticate.utils.js +0 -183
- package/src/auth/utils/www-authenticate.utils.js.map +0 -1
- package/src/common/common.schema.js +0 -35
- package/src/common/common.schema.js.map +0 -1
- package/src/common/constants.js +0 -13
- package/src/common/constants.js.map +0 -1
- package/src/common/decorators/adapter.decorator.js +0 -20
- package/src/common/decorators/adapter.decorator.js.map +0 -1
- package/src/common/decorators/app.decorator.js +0 -44
- package/src/common/decorators/app.decorator.js.map +0 -1
- package/src/common/decorators/auth-provider.decorator.js +0 -20
- package/src/common/decorators/auth-provider.decorator.js.map +0 -1
- package/src/common/decorators/decorator-utils.js +0 -195
- package/src/common/decorators/decorator-utils.js.map +0 -1
- package/src/common/decorators/flow.decorator.js +0 -19
- package/src/common/decorators/flow.decorator.js.map +0 -1
- package/src/common/decorators/front-mcp.decorator.js +0 -67
- package/src/common/decorators/front-mcp.decorator.js.map +0 -1
- package/src/common/decorators/hook.decorator.js +0 -178
- package/src/common/decorators/hook.decorator.js.map +0 -1
- package/src/common/decorators/index.js +0 -16
- package/src/common/decorators/index.js.map +0 -1
- package/src/common/decorators/logger.decorator.js +0 -20
- package/src/common/decorators/logger.decorator.js.map +0 -1
- package/src/common/decorators/plugin.decorator.js +0 -39
- package/src/common/decorators/plugin.decorator.js.map +0 -1
- package/src/common/decorators/prompt.decorator.js +0 -38
- package/src/common/decorators/prompt.decorator.js.map +0 -1
- package/src/common/decorators/provider.decorator.js +0 -20
- package/src/common/decorators/provider.decorator.js.map +0 -1
- package/src/common/decorators/resource.decorator.js +0 -94
- package/src/common/decorators/resource.decorator.js.map +0 -1
- package/src/common/decorators/tool.decorator.js +0 -45
- package/src/common/decorators/tool.decorator.js.map +0 -1
- package/src/common/dynamic/dynamic.adapter.js +0 -28
- package/src/common/dynamic/dynamic.adapter.js.map +0 -1
- package/src/common/dynamic/dynamic.plugin.js +0 -42
- package/src/common/dynamic/dynamic.plugin.js.map +0 -1
- package/src/common/dynamic/dynamic.utils.js +0 -27
- package/src/common/dynamic/dynamic.utils.js.map +0 -1
- package/src/common/dynamic/index.js +0 -6
- package/src/common/dynamic/index.js.map +0 -1
- package/src/common/entries/adapter.entry.js +0 -8
- package/src/common/entries/adapter.entry.js.map +0 -1
- package/src/common/entries/app.entry.js +0 -9
- package/src/common/entries/app.entry.js.map +0 -1
- package/src/common/entries/auth-provider.entry.js +0 -8
- package/src/common/entries/auth-provider.entry.js.map +0 -1
- package/src/common/entries/base.entry.js +0 -17
- package/src/common/entries/base.entry.js.map +0 -1
- package/src/common/entries/flow.entry.js +0 -21
- package/src/common/entries/flow.entry.js.map +0 -1
- package/src/common/entries/hook.entry.js +0 -20
- package/src/common/entries/hook.entry.js.map +0 -1
- package/src/common/entries/index.js +0 -17
- package/src/common/entries/index.js.map +0 -1
- package/src/common/entries/logger.entry.js +0 -8
- package/src/common/entries/logger.entry.js.map +0 -1
- package/src/common/entries/plugin.entry.js +0 -8
- package/src/common/entries/plugin.entry.js.map +0 -1
- package/src/common/entries/prompt.entry.js +0 -18
- package/src/common/entries/prompt.entry.js.map +0 -1
- package/src/common/entries/provider.entry.js +0 -8
- package/src/common/entries/provider.entry.js.map +0 -1
- package/src/common/entries/resource.entry.js +0 -35
- package/src/common/entries/resource.entry.js.map +0 -1
- package/src/common/entries/scope.entry.js +0 -14
- package/src/common/entries/scope.entry.js.map +0 -1
- package/src/common/entries/tool.entry.js +0 -31
- package/src/common/entries/tool.entry.js.map +0 -1
- package/src/common/flow/flow.utils.js +0 -96
- package/src/common/flow/flow.utils.js.map +0 -1
- package/src/common/index.js +0 -20
- package/src/common/index.js.map +0 -1
- package/src/common/interfaces/adapter.interface.js +0 -3
- package/src/common/interfaces/adapter.interface.js.map +0 -1
- package/src/common/interfaces/app.interface.js +0 -3
- package/src/common/interfaces/app.interface.js.map +0 -1
- package/src/common/interfaces/auth-hook.interface.js +0 -135
- package/src/common/interfaces/auth-hook.interface.js.map +0 -1
- package/src/common/interfaces/auth-provider.interface.js +0 -18
- package/src/common/interfaces/auth-provider.interface.js.map +0 -1
- package/src/common/interfaces/base.interface.js +0 -3
- package/src/common/interfaces/base.interface.js.map +0 -1
- package/src/common/interfaces/execution-context.interface.js +0 -166
- package/src/common/interfaces/execution-context.interface.js.map +0 -1
- package/src/common/interfaces/flow.interface.js +0 -95
- package/src/common/interfaces/flow.interface.js.map +0 -1
- package/src/common/interfaces/front-mcp.interface.js +0 -3
- package/src/common/interfaces/front-mcp.interface.js.map +0 -1
- package/src/common/interfaces/hook.interface.js +0 -3
- package/src/common/interfaces/hook.interface.js.map +0 -1
- package/src/common/interfaces/index.js +0 -21
- package/src/common/interfaces/index.js.map +0 -1
- package/src/common/interfaces/internal/flow.utils.js +0 -83
- package/src/common/interfaces/internal/flow.utils.js.map +0 -1
- package/src/common/interfaces/internal/index.js +0 -7
- package/src/common/interfaces/internal/index.js.map +0 -1
- package/src/common/interfaces/internal/primary-auth-provider.interface.js +0 -81
- package/src/common/interfaces/internal/primary-auth-provider.interface.js.map +0 -1
- package/src/common/interfaces/internal/registry.interface.js +0 -3
- package/src/common/interfaces/internal/registry.interface.js.map +0 -1
- package/src/common/interfaces/logger.interface.js +0 -10
- package/src/common/interfaces/logger.interface.js.map +0 -1
- package/src/common/interfaces/plugin.interface.js +0 -3
- package/src/common/interfaces/plugin.interface.js.map +0 -1
- package/src/common/interfaces/prompt.interface.js +0 -81
- package/src/common/interfaces/prompt.interface.js.map +0 -1
- package/src/common/interfaces/provider.interface.js +0 -18
- package/src/common/interfaces/provider.interface.js.map +0 -1
- package/src/common/interfaces/resource.interface.js +0 -56
- package/src/common/interfaces/resource.interface.js.map +0 -1
- package/src/common/interfaces/scope.interface.js +0 -3
- package/src/common/interfaces/scope.interface.js.map +0 -1
- package/src/common/interfaces/server.interface.js +0 -18
- package/src/common/interfaces/server.interface.js.map +0 -1
- package/src/common/interfaces/session-hook.interface.js +0 -140
- package/src/common/interfaces/session-hook.interface.js.map +0 -1
- package/src/common/interfaces/tool-hook.interface.js +0 -92
- package/src/common/interfaces/tool-hook.interface.js.map +0 -1
- package/src/common/interfaces/tool.interface.js +0 -117
- package/src/common/interfaces/tool.interface.js.map +0 -1
- package/src/common/metadata/adapter.metadata.js +0 -10
- package/src/common/metadata/adapter.metadata.js.map +0 -1
- package/src/common/metadata/app.metadata.js +0 -30
- package/src/common/metadata/app.metadata.js.map +0 -1
- package/src/common/metadata/auth-provider.metadata.js +0 -19
- package/src/common/metadata/auth-provider.metadata.js.map +0 -1
- package/src/common/metadata/flow.metadata.js +0 -15
- package/src/common/metadata/flow.metadata.js.map +0 -1
- package/src/common/metadata/front-mcp.metadata.js +0 -29
- package/src/common/metadata/front-mcp.metadata.js.map +0 -1
- package/src/common/metadata/hook.metadata.js +0 -3
- package/src/common/metadata/hook.metadata.js.map +0 -1
- package/src/common/metadata/index.js +0 -17
- package/src/common/metadata/index.js.map +0 -1
- package/src/common/metadata/logger.metadata.js +0 -10
- package/src/common/metadata/logger.metadata.js.map +0 -1
- package/src/common/metadata/plugin.metadata.js +0 -18
- package/src/common/metadata/plugin.metadata.js.map +0 -1
- package/src/common/metadata/prompt.metadata.js +0 -27
- package/src/common/metadata/prompt.metadata.js.map +0 -1
- package/src/common/metadata/provider.metadata.js +0 -36
- package/src/common/metadata/provider.metadata.js.map +0 -1
- package/src/common/metadata/resource.metadata.js +0 -31
- package/src/common/metadata/resource.metadata.js.map +0 -1
- package/src/common/metadata/tool-ui.metadata.js +0 -12
- package/src/common/metadata/tool-ui.metadata.js.map +0 -1
- package/src/common/metadata/tool.metadata.js +0 -55
- package/src/common/metadata/tool.metadata.js.map +0 -1
- package/src/common/migrate/auth-transport.migrate.js +0 -140
- package/src/common/migrate/auth-transport.migrate.js.map +0 -1
- package/src/common/migrate/index.js +0 -6
- package/src/common/migrate/index.js.map +0 -1
- package/src/common/providers/base-config.provider.js +0 -128
- package/src/common/providers/base-config.provider.js.map +0 -1
- package/src/common/records/adapter.record.js +0 -11
- package/src/common/records/adapter.record.js.map +0 -1
- package/src/common/records/app.record.js +0 -9
- package/src/common/records/app.record.js.map +0 -1
- package/src/common/records/auth-provider.record.js +0 -12
- package/src/common/records/auth-provider.record.js.map +0 -1
- package/src/common/records/flow.record.js +0 -8
- package/src/common/records/flow.record.js.map +0 -1
- package/src/common/records/hook.record.js +0 -8
- package/src/common/records/hook.record.js.map +0 -1
- package/src/common/records/index.js +0 -16
- package/src/common/records/index.js.map +0 -1
- package/src/common/records/logger.record.js +0 -8
- package/src/common/records/logger.record.js.map +0 -1
- package/src/common/records/plugin.record.js +0 -11
- package/src/common/records/plugin.record.js.map +0 -1
- package/src/common/records/prompt.record.js +0 -9
- package/src/common/records/prompt.record.js.map +0 -1
- package/src/common/records/provider.record.js +0 -14
- package/src/common/records/provider.record.js.map +0 -1
- package/src/common/records/resource.record.js +0 -20
- package/src/common/records/resource.record.js.map +0 -1
- package/src/common/records/scope.record.js +0 -9
- package/src/common/records/scope.record.js.map +0 -1
- package/src/common/records/tool.record.js +0 -9
- package/src/common/records/tool.record.js.map +0 -1
- package/src/common/schemas/annotated-class.schema.js +0 -109
- package/src/common/schemas/annotated-class.schema.js.map +0 -1
- package/src/common/schemas/http-input.schema.js +0 -13
- package/src/common/schemas/http-input.schema.js.map +0 -1
- package/src/common/schemas/http-output.schema.js +0 -321
- package/src/common/schemas/http-output.schema.js.map +0 -1
- package/src/common/schemas/index.js +0 -8
- package/src/common/schemas/index.js.map +0 -1
- package/src/common/schemas/session-header.schema.js +0 -42
- package/src/common/schemas/session-header.schema.js.map +0 -1
- package/src/common/tokens/adapter.tokens.js +0 -11
- package/src/common/tokens/adapter.tokens.js.map +0 -1
- package/src/common/tokens/app.tokens.js +0 -30
- package/src/common/tokens/app.tokens.js.map +0 -1
- package/src/common/tokens/auth-provider.tokens.js +0 -12
- package/src/common/tokens/auth-provider.tokens.js.map +0 -1
- package/src/common/tokens/base.tokens.js +0 -9
- package/src/common/tokens/base.tokens.js.map +0 -1
- package/src/common/tokens/flow-hook.tokens.js +0 -9
- package/src/common/tokens/flow-hook.tokens.js.map +0 -1
- package/src/common/tokens/flow.tokens.js +0 -16
- package/src/common/tokens/flow.tokens.js.map +0 -1
- package/src/common/tokens/front-mcp.tokens.js +0 -24
- package/src/common/tokens/front-mcp.tokens.js.map +0 -1
- package/src/common/tokens/index.js +0 -17
- package/src/common/tokens/index.js.map +0 -1
- package/src/common/tokens/logger.tokens.js +0 -11
- package/src/common/tokens/logger.tokens.js.map +0 -1
- package/src/common/tokens/plugin.tokens.js +0 -18
- package/src/common/tokens/plugin.tokens.js.map +0 -1
- package/src/common/tokens/prompt.tokens.js +0 -14
- package/src/common/tokens/prompt.tokens.js.map +0 -1
- package/src/common/tokens/provider.tokens.js +0 -12
- package/src/common/tokens/provider.tokens.js.map +0 -1
- package/src/common/tokens/resource.tokens.js +0 -28
- package/src/common/tokens/resource.tokens.js.map +0 -1
- package/src/common/tokens/server.tokens.js +0 -11
- package/src/common/tokens/server.tokens.js.map +0 -1
- package/src/common/tokens/tool.tokens.js +0 -21
- package/src/common/tokens/tool.tokens.js.map +0 -1
- package/src/common/types/auth/index.js +0 -6
- package/src/common/types/auth/index.js.map +0 -1
- package/src/common/types/auth/jwt.types.js +0 -36
- package/src/common/types/auth/jwt.types.js.map +0 -1
- package/src/common/types/auth/session.types.js +0 -53
- package/src/common/types/auth/session.types.js.map +0 -1
- package/src/common/types/common.types.js +0 -3
- package/src/common/types/common.types.js.map +0 -1
- package/src/common/types/index.js +0 -7
- package/src/common/types/index.js.map +0 -1
- package/src/common/types/options/auth.options.d.ts +0 -1266
- package/src/common/types/options/auth.options.js +0 -560
- package/src/common/types/options/auth.options.js.map +0 -1
- package/src/common/types/options/http.options.js +0 -10
- package/src/common/types/options/http.options.js.map +0 -1
- package/src/common/types/options/index.js +0 -11
- package/src/common/types/options/index.js.map +0 -1
- package/src/common/types/options/logging.options.js +0 -33
- package/src/common/types/options/logging.options.js.map +0 -1
- package/src/common/types/options/redis.options.d.ts +0 -22
- package/src/common/types/options/redis.options.js +0 -45
- package/src/common/types/options/redis.options.js.map +0 -1
- package/src/common/types/options/server-info.options.js +0 -13
- package/src/common/types/options/server-info.options.js.map +0 -1
- package/src/common/types/options/session.options.js +0 -32
- package/src/common/types/options/session.options.js.map +0 -1
- package/src/common/types/options/transport.options.js +0 -121
- package/src/common/types/options/transport.options.js.map +0 -1
- package/src/common/utils/decide-request-intent.utils.js +0 -391
- package/src/common/utils/decide-request-intent.utils.js.map +0 -1
- package/src/common/utils/index.js +0 -6
- package/src/common/utils/index.js.map +0 -1
- package/src/common/utils/path.utils.js +0 -66
- package/src/common/utils/path.utils.js.map +0 -1
- package/src/completion/flows/complete.flow.js +0 -199
- package/src/completion/flows/complete.flow.js.map +0 -1
- package/src/context/frontmcp-context-storage.js +0 -183
- package/src/context/frontmcp-context-storage.js.map +0 -1
- package/src/context/frontmcp-context.js +0 -360
- package/src/context/frontmcp-context.js.map +0 -1
- package/src/context/frontmcp-context.provider.js +0 -61
- package/src/context/frontmcp-context.provider.js.map +0 -1
- package/src/context/index.js +0 -64
- package/src/context/index.js.map +0 -1
- package/src/context/request-context-storage.js +0 -183
- package/src/context/request-context-storage.js.map +0 -1
- package/src/context/request-context.js +0 -209
- package/src/context/request-context.js.map +0 -1
- package/src/context/request-context.provider.js +0 -51
- package/src/context/request-context.provider.js.map +0 -1
- package/src/context/session-key.provider.js +0 -65
- package/src/context/session-key.provider.js.map +0 -1
- package/src/context/trace-context.js +0 -142
- package/src/context/trace-context.js.map +0 -1
- package/src/errors/authorization-required.error.js +0 -274
- package/src/errors/authorization-required.error.js.map +0 -1
- package/src/errors/error-handler.js +0 -107
- package/src/errors/error-handler.js.map +0 -1
- package/src/errors/index.js +0 -44
- package/src/errors/index.js.map +0 -1
- package/src/errors/mcp.error.js +0 -398
- package/src/errors/mcp.error.js.map +0 -1
- package/src/exceptions/mcp-exceptions/session-missing.exception.js +0 -11
- package/src/exceptions/mcp-exceptions/session-missing.exception.js.map +0 -1
- package/src/exceptions/mcp-exceptions/unsupported-client-version.exception.js +0 -15
- package/src/exceptions/mcp-exceptions/unsupported-client-version.exception.js.map +0 -1
- package/src/flows/flow.instance.js +0 -420
- package/src/flows/flow.instance.js.map +0 -1
- package/src/flows/flow.registry.js +0 -121
- package/src/flows/flow.registry.js.map +0 -1
- package/src/flows/flow.stages.js +0 -113
- package/src/flows/flow.stages.js.map +0 -1
- package/src/flows/flow.utils.js +0 -36
- package/src/flows/flow.utils.js.map +0 -1
- package/src/front-mcp/front-mcp.js +0 -63
- package/src/front-mcp/front-mcp.js.map +0 -1
- package/src/front-mcp/front-mcp.providers.js +0 -29
- package/src/front-mcp/front-mcp.providers.js.map +0 -1
- package/src/front-mcp/front-mcp.tokens.js +0 -5
- package/src/front-mcp/front-mcp.tokens.js.map +0 -1
- package/src/front-mcp/index.d.ts +0 -1
- package/src/front-mcp/index.js +0 -5
- package/src/front-mcp/index.js.map +0 -1
- package/src/front-mcp/serverless-handler.js +0 -61
- package/src/front-mcp/serverless-handler.js.map +0 -1
- package/src/hooks/hook.instance.js +0 -26
- package/src/hooks/hook.instance.js.map +0 -1
- package/src/hooks/hook.registry.js +0 -152
- package/src/hooks/hook.registry.js.map +0 -1
- package/src/hooks/hooks.utils.js +0 -34
- package/src/hooks/hooks.utils.js.map +0 -1
- package/src/index.js +0 -36
- package/src/index.js.map +0 -1
- package/src/logger/instances/instance.console-logger.js +0 -75
- package/src/logger/instances/instance.console-logger.js.map +0 -1
- package/src/logger/instances/instance.logger.js +0 -77
- package/src/logger/instances/instance.logger.js.map +0 -1
- package/src/logger/logger.registry.js +0 -96
- package/src/logger/logger.registry.js.map +0 -1
- package/src/logger/logger.tokens.js +0 -3
- package/src/logger/logger.tokens.js.map +0 -1
- package/src/logger/logger.types.js +0 -8
- package/src/logger/logger.types.js.map +0 -1
- package/src/logger/logger.utils.js +0 -42
- package/src/logger/logger.utils.js.map +0 -1
- package/src/logging/flows/set-level.flow.js +0 -108
- package/src/logging/flows/set-level.flow.js.map +0 -1
- package/src/mcp-apps/csp.js +0 -267
- package/src/mcp-apps/csp.js.map +0 -1
- package/src/mcp-apps/index.js +0 -91
- package/src/mcp-apps/index.js.map +0 -1
- package/src/mcp-apps/schemas.js +0 -345
- package/src/mcp-apps/schemas.js.map +0 -1
- package/src/mcp-apps/template.js +0 -419
- package/src/mcp-apps/template.js.map +0 -1
- package/src/mcp-apps/types.js +0 -59
- package/src/mcp-apps/types.js.map +0 -1
- package/src/notification/index.js +0 -13
- package/src/notification/index.js.map +0 -1
- package/src/notification/notification.service.js +0 -731
- package/src/notification/notification.service.js.map +0 -1
- package/src/plugin/plugin.registry.js +0 -152
- package/src/plugin/plugin.registry.js.map +0 -1
- package/src/plugin/plugin.utils.js +0 -88
- package/src/plugin/plugin.utils.js.map +0 -1
- package/src/prompt/flows/get-prompt.flow.js +0 -214
- package/src/prompt/flows/get-prompt.flow.js.map +0 -1
- package/src/prompt/flows/prompts-list.flow.js +0 -176
- package/src/prompt/flows/prompts-list.flow.js.map +0 -1
- package/src/prompt/index.js +0 -17
- package/src/prompt/index.js.map +0 -1
- package/src/prompt/prompt.events.js +0 -25
- package/src/prompt/prompt.events.js.map +0 -1
- package/src/prompt/prompt.instance.js +0 -120
- package/src/prompt/prompt.instance.js.map +0 -1
- package/src/prompt/prompt.registry.js +0 -380
- package/src/prompt/prompt.registry.js.map +0 -1
- package/src/prompt/prompt.types.js +0 -11
- package/src/prompt/prompt.types.js.map +0 -1
- package/src/prompt/prompt.utils.js +0 -136
- package/src/prompt/prompt.utils.js.map +0 -1
- package/src/provider/provider.registry.js +0 -868
- package/src/provider/provider.registry.js.map +0 -1
- package/src/provider/provider.types.js +0 -3
- package/src/provider/provider.types.js.map +0 -1
- package/src/provider/provider.utils.js +0 -103
- package/src/provider/provider.utils.js.map +0 -1
- package/src/regsitry/index.js +0 -5
- package/src/regsitry/index.js.map +0 -1
- package/src/regsitry/registry.base.js +0 -32
- package/src/regsitry/registry.base.js.map +0 -1
- package/src/resource/flows/read-resource.flow.js +0 -270
- package/src/resource/flows/read-resource.flow.js.map +0 -1
- package/src/resource/flows/resource-templates-list.flow.js +0 -191
- package/src/resource/flows/resource-templates-list.flow.js.map +0 -1
- package/src/resource/flows/resources-list.flow.js +0 -196
- package/src/resource/flows/resources-list.flow.js.map +0 -1
- package/src/resource/flows/subscribe-resource.flow.js +0 -123
- package/src/resource/flows/subscribe-resource.flow.js.map +0 -1
- package/src/resource/flows/unsubscribe-resource.flow.js +0 -107
- package/src/resource/flows/unsubscribe-resource.flow.js.map +0 -1
- package/src/resource/index.js +0 -20
- package/src/resource/index.js.map +0 -1
- package/src/resource/resource.events.js +0 -17
- package/src/resource/resource.events.js.map +0 -1
- package/src/resource/resource.instance.js +0 -163
- package/src/resource/resource.instance.js.map +0 -1
- package/src/resource/resource.registry.js +0 -468
- package/src/resource/resource.registry.js.map +0 -1
- package/src/resource/resource.types.js +0 -11
- package/src/resource/resource.types.js.map +0 -1
- package/src/resource/resource.utils.js +0 -151
- package/src/resource/resource.utils.js.map +0 -1
- package/src/scope/flows/http.request.flow.js +0 -474
- package/src/scope/flows/http.request.flow.js.map +0 -1
- package/src/scope/index.js +0 -6
- package/src/scope/index.js.map +0 -1
- package/src/scope/scope.instance.js +0 -263
- package/src/scope/scope.instance.js.map +0 -1
- package/src/scope/scope.registry.js +0 -94
- package/src/scope/scope.registry.js.map +0 -1
- package/src/scope/scope.utils.js +0 -61
- package/src/scope/scope.utils.js.map +0 -1
- package/src/server/adapters/base.host.adapter.js +0 -8
- package/src/server/adapters/base.host.adapter.js.map +0 -1
- package/src/server/adapters/express.host.adapter.js +0 -70
- package/src/server/adapters/express.host.adapter.js.map +0 -1
- package/src/server/server.instance.js +0 -54
- package/src/server/server.instance.js.map +0 -1
- package/src/server/server.types.js +0 -3
- package/src/server/server.types.js.map +0 -1
- package/src/server/server.validation.js +0 -192
- package/src/server/server.validation.js.map +0 -1
- package/src/store/adapters/store.base.adapter.js +0 -16
- package/src/store/adapters/store.base.adapter.js.map +0 -1
- package/src/store/adapters/store.memory.adapter.js +0 -89
- package/src/store/adapters/store.memory.adapter.js.map +0 -1
- package/src/store/adapters/store.redis.adapter.js +0 -104
- package/src/store/adapters/store.redis.adapter.js.map +0 -1
- package/src/store/index.js +0 -12
- package/src/store/index.js.map +0 -1
- package/src/store/store.helpers.js +0 -67
- package/src/store/store.helpers.js.map +0 -1
- package/src/store/store.registry.js +0 -37
- package/src/store/store.registry.js.map +0 -1
- package/src/store/store.tokens.js +0 -7
- package/src/store/store.tokens.js.map +0 -1
- package/src/store/store.types.js +0 -11
- package/src/store/store.types.js.map +0 -1
- package/src/store/store.utils.js +0 -18
- package/src/store/store.utils.js.map +0 -1
- package/src/tool/flows/call-tool.flow.js +0 -616
- package/src/tool/flows/call-tool.flow.js.map +0 -1
- package/src/tool/flows/tools-list.flow.js +0 -328
- package/src/tool/flows/tools-list.flow.js.map +0 -1
- package/src/tool/tool.events.js +0 -16
- package/src/tool/tool.events.js.map +0 -1
- package/src/tool/tool.instance.js +0 -117
- package/src/tool/tool.instance.js.map +0 -1
- package/src/tool/tool.registry.js +0 -353
- package/src/tool/tool.registry.js.map +0 -1
- package/src/tool/tool.types.js +0 -10
- package/src/tool/tool.types.js.map +0 -1
- package/src/tool/tool.utils.js +0 -366
- package/src/tool/tool.utils.js.map +0 -1
- package/src/tool/ui/index.js +0 -63
- package/src/tool/ui/index.js.map +0 -1
- package/src/tool/ui/platform-adapters.js +0 -18
- package/src/tool/ui/platform-adapters.js.map +0 -1
- package/src/tool/ui/template-helpers.js +0 -112
- package/src/tool/ui/template-helpers.js.map +0 -1
- package/src/tool/ui/ui-resource-template.js +0 -64
- package/src/tool/ui/ui-resource-template.js.map +0 -1
- package/src/tool/ui/ui-resource.handler.js +0 -129
- package/src/tool/ui/ui-resource.handler.js.map +0 -1
- package/src/transport/adapters/transport.local.adapter.js +0 -148
- package/src/transport/adapters/transport.local.adapter.js.map +0 -1
- package/src/transport/adapters/transport.sse.adapter.js +0 -65
- package/src/transport/adapters/transport.sse.adapter.js.map +0 -1
- package/src/transport/adapters/transport.streamable-http.adapter.js +0 -112
- package/src/transport/adapters/transport.streamable-http.adapter.js.map +0 -1
- package/src/transport/flows/handle.sse.flow.js +0 -197
- package/src/transport/flows/handle.sse.flow.js.map +0 -1
- package/src/transport/flows/handle.stateless-http.flow.js +0 -102
- package/src/transport/flows/handle.stateless-http.flow.js.map +0 -1
- package/src/transport/flows/handle.streamable-http.flow.js +0 -315
- package/src/transport/flows/handle.streamable-http.flow.js.map +0 -1
- package/src/transport/legacy/legacy.sse.tranporter.js +0 -185
- package/src/transport/legacy/legacy.sse.tranporter.js.map +0 -1
- package/src/transport/mcp-handlers/Initialized-notification.hanlder.js +0 -14
- package/src/transport/mcp-handlers/Initialized-notification.hanlder.js.map +0 -1
- package/src/transport/mcp-handlers/call-tool-request.handler.js +0 -46
- package/src/transport/mcp-handlers/call-tool-request.handler.js.map +0 -1
- package/src/transport/mcp-handlers/complete-request.handler.js +0 -11
- package/src/transport/mcp-handlers/complete-request.handler.js.map +0 -1
- package/src/transport/mcp-handlers/get-prompt-request.handler.js +0 -11
- package/src/transport/mcp-handlers/get-prompt-request.handler.js.map +0 -1
- package/src/transport/mcp-handlers/index.js +0 -57
- package/src/transport/mcp-handlers/index.js.map +0 -1
- package/src/transport/mcp-handlers/initialize-request.handler.js +0 -109
- package/src/transport/mcp-handlers/initialize-request.handler.js.map +0 -1
- package/src/transport/mcp-handlers/list-prompts-request.handler.js +0 -11
- package/src/transport/mcp-handlers/list-prompts-request.handler.js.map +0 -1
- package/src/transport/mcp-handlers/list-resource-templates-request.handler.js +0 -12
- package/src/transport/mcp-handlers/list-resource-templates-request.handler.js.map +0 -1
- package/src/transport/mcp-handlers/list-resources-request.handler.js +0 -12
- package/src/transport/mcp-handlers/list-resources-request.handler.js.map +0 -1
- package/src/transport/mcp-handlers/list-tools-request.handler.js +0 -11
- package/src/transport/mcp-handlers/list-tools-request.handler.js.map +0 -1
- package/src/transport/mcp-handlers/logging-set-level-request.handler.js +0 -34
- package/src/transport/mcp-handlers/logging-set-level-request.handler.js.map +0 -1
- package/src/transport/mcp-handlers/mcp-handlers.types.js +0 -3
- package/src/transport/mcp-handlers/mcp-handlers.types.js.map +0 -1
- package/src/transport/mcp-handlers/read-resource-request.handler.js +0 -12
- package/src/transport/mcp-handlers/read-resource-request.handler.js.map +0 -1
- package/src/transport/mcp-handlers/roots-list-changed-notification.handler.js +0 -26
- package/src/transport/mcp-handlers/roots-list-changed-notification.handler.js.map +0 -1
- package/src/transport/mcp-handlers/subscribe-request.handler.js +0 -34
- package/src/transport/mcp-handlers/subscribe-request.handler.js.map +0 -1
- package/src/transport/mcp-handlers/unsubscribe-request.handler.js +0 -34
- package/src/transport/mcp-handlers/unsubscribe-request.handler.js.map +0 -1
- package/src/transport/transport.error.js +0 -25
- package/src/transport/transport.error.js.map +0 -1
- package/src/transport/transport.event-store.js +0 -36
- package/src/transport/transport.event-store.js.map +0 -1
- package/src/transport/transport.local.js +0 -71
- package/src/transport/transport.local.js.map +0 -1
- package/src/transport/transport.registry.js +0 -523
- package/src/transport/transport.registry.js.map +0 -1
- package/src/transport/transport.remote.js +0 -31
- package/src/transport/transport.remote.js.map +0 -1
- package/src/transport/transport.types.js +0 -3
- package/src/transport/transport.types.js.map +0 -1
- package/src/types/drinen-hooks.types.js +0 -3
- package/src/types/drinen-hooks.types.js.map +0 -1
- package/src/types/invoke.type.js +0 -34
- package/src/types/invoke.type.js.map +0 -1
- package/src/types/token.types.js +0 -3
- package/src/types/token.types.js.map +0 -1
- package/src/utils/content.utils.js +0 -194
- package/src/utils/content.utils.js.map +0 -1
- package/src/utils/index.js +0 -55
- package/src/utils/index.js.map +0 -1
- package/src/utils/lineage.utils.js +0 -82
- package/src/utils/lineage.utils.js.map +0 -1
- package/src/utils/metadata.utils.js +0 -26
- package/src/utils/metadata.utils.js.map +0 -1
- package/src/utils/naming.utils.js +0 -136
- package/src/utils/naming.utils.js.map +0 -1
- package/src/utils/server.utils.js +0 -59
- package/src/utils/server.utils.js.map +0 -1
- package/src/utils/string.utils.js +0 -10
- package/src/utils/string.utils.js.map +0 -1
- package/src/utils/token.utils.js +0 -65
- package/src/utils/token.utils.js.map +0 -1
- package/src/utils/types.utils.js +0 -3
- package/src/utils/types.utils.js.map +0 -1
- package/src/utils/uri-template.utils.js +0 -113
- package/src/utils/uri-template.utils.js.map +0 -1
- package/src/utils/uri-validation.utils.js +0 -76
- package/src/utils/uri-validation.utils.js.map +0 -1
- package/{src/adapter → adapter}/adapter.instance.d.ts +0 -0
- package/{src/adapter → adapter}/adapter.regsitry.d.ts +0 -0
- package/{src/adapter → adapter}/adapter.utils.d.ts +0 -0
- package/{src/app → app}/app.registry.d.ts +0 -0
- package/{src/app → app}/app.utils.d.ts +0 -0
- package/{src/app → app}/instances/app.local.instance.d.ts +0 -0
- package/{src/app → app}/instances/app.remote.instance.d.ts +0 -0
- package/{src/app → app}/instances/index.d.ts +0 -0
- package/{src/auth → auth}/auth.registry.d.ts +0 -0
- package/{src/auth → auth}/auth.utils.d.ts +0 -0
- package/{src/auth → auth}/authorization/authorization.class.d.ts +0 -0
- package/{src/auth → auth}/authorization/authorization.types.d.ts +0 -0
- package/{src/auth → auth}/authorization/index.d.ts +0 -0
- package/{src/auth → auth}/authorization/orchestrated.authorization.d.ts +0 -0
- package/{src/auth → auth}/authorization/public.authorization.d.ts +0 -0
- package/{src/auth → auth}/authorization/transparent.authorization.d.ts +0 -0
- package/{src/auth → auth}/consent/consent.types.d.ts +0 -0
- package/{src/auth → auth}/consent/index.d.ts +0 -0
- package/{src/auth → auth}/detection/auth-provider-detection.d.ts +0 -0
- package/{src/auth → auth}/detection/index.d.ts +0 -0
- package/{src/auth → auth}/flows/auth.verify.flow.d.ts +0 -0
- package/{src/auth → auth}/flows/oauth.authorize.flow.d.ts +0 -0
- package/{src/auth → auth}/flows/oauth.callback.flow.d.ts +0 -0
- package/{src/auth → auth}/flows/oauth.register.flow.d.ts +0 -0
- package/{src/auth → auth}/flows/oauth.token.flow.d.ts +0 -0
- package/{src/auth → auth}/flows/session.verify.flow.d.ts +0 -0
- package/{src/auth → auth}/flows/well-known.jwks.flow.d.ts +0 -0
- package/{src/auth → auth}/flows/well-known.oauth-authorization-server.flow.d.ts +0 -0
- package/{src/auth → auth}/flows/well-known.prm.flow.d.ts +0 -0
- package/{src/auth → auth}/jwks/dev-key-persistence.d.ts +0 -0
- package/{src/auth → auth}/jwks/index.d.ts +0 -0
- package/{src/auth → auth}/jwks/jwks.service.d.ts +0 -0
- package/{src/auth → auth}/jwks/jwks.types.d.ts +0 -0
- package/{src/auth → auth}/jwks/jwks.utils.d.ts +0 -0
- package/{src/auth → auth}/machine-id.d.ts +0 -0
- package/{src/auth → auth}/oauth/flows/oauth.authorize.flow.d.ts +0 -0
- package/{src/auth → auth}/oauth/flows/oauth.device-authorization.flow.d.ts +0 -0
- package/{src/auth → auth}/oauth/flows/oauth.introspect.flow.d.ts +0 -0
- package/{src/auth → auth}/oauth/flows/oauth.par.flow.d.ts +0 -0
- package/{src/auth → auth}/oauth/flows/oauth.revoke.flow.d.ts +0 -0
- package/{src/auth → auth}/oauth/flows/oauth.token.flow.d.ts +0 -0
- package/{src/auth → auth}/oauth/flows/oauth.userinfo.flow.d.ts +0 -0
- package/{src/auth → auth}/oauth/flows/oidc.logout.flow.d.ts +0 -0
- package/{src/auth → auth}/session/authorization-vault.d.ts +0 -0
- package/{src/auth → auth}/session/authorization.store.d.ts +0 -0
- package/{src/auth → auth}/session/encrypted-authorization-vault.d.ts +0 -0
- package/{src/auth → auth}/session/record/session.base.d.ts +0 -0
- package/{src/auth → auth}/session/record/session.stateful.d.ts +0 -0
- package/{src/auth → auth}/session/record/session.stateless.d.ts +0 -0
- package/{src/auth → auth}/session/record/session.transparent.d.ts +0 -0
- package/{src/auth → auth}/session/redis-session.store.d.ts +0 -0
- package/{src/auth → auth}/session/session.crypto.d.ts +0 -0
- package/{src/auth → auth}/session/session.schema.d.ts +0 -0
- package/{src/auth → auth}/session/session.service.d.ts +0 -0
- package/{src/auth → auth}/session/session.transport.d.ts +0 -0
- package/{src/auth → auth}/session/session.types.d.ts +0 -0
- package/{src/auth → auth}/session/token.refresh.d.ts +0 -0
- package/{src/auth → auth}/session/token.store.d.ts +0 -0
- package/{src/auth → auth}/session/token.vault.d.ts +0 -0
- package/{src/auth → auth}/session/transport-session.manager.d.ts +0 -0
- package/{src/auth → auth}/session/transport-session.types.d.ts +0 -0
- package/{src/auth → auth}/session/utils/auth-token.utils.d.ts +0 -0
- package/{src/auth → auth}/session/utils/session-id.utils.d.ts +0 -0
- package/{src/auth → auth}/session/utils/tiny-ttl-cache.d.ts +0 -0
- package/{src/auth → auth}/session/vault-encryption.d.ts +0 -0
- package/{src/auth → auth}/ui/base-layout.d.ts +0 -0
- package/{src/auth → auth}/ui/index.d.ts +0 -0
- package/{src/auth → auth}/ui/templates.d.ts +0 -0
- package/{src/auth → auth}/utils/audience.validator.d.ts +0 -0
- package/{src/auth → auth}/utils/index.d.ts +0 -0
- package/{src/auth → auth}/utils/www-authenticate.utils.d.ts +0 -0
- package/{src/common → common}/common.schema.d.ts +0 -0
- package/{src/common → common}/constants.d.ts +0 -0
- package/{src/common → common}/decorators/adapter.decorator.d.ts +0 -0
- package/{src/common → common}/decorators/app.decorator.d.ts +0 -0
- package/{src/common → common}/decorators/auth-provider.decorator.d.ts +0 -0
- package/{src/common → common}/decorators/decorator-utils.d.ts +0 -0
- package/{src/common → common}/decorators/flow.decorator.d.ts +0 -0
- package/{src/common → common}/decorators/front-mcp.decorator.d.ts +0 -0
- package/{src/common → common}/decorators/hook.decorator.d.ts +0 -0
- package/{src/common → common}/decorators/index.d.ts +0 -0
- package/{src/common → common}/decorators/logger.decorator.d.ts +0 -0
- package/{src/common → common}/decorators/plugin.decorator.d.ts +0 -0
- package/{src/common → common}/decorators/prompt.decorator.d.ts +0 -0
- package/{src/common → common}/decorators/provider.decorator.d.ts +0 -0
- package/{src/common → common}/decorators/resource.decorator.d.ts +0 -0
- package/{src/common → common}/decorators/tool.decorator.d.ts +0 -0
- package/{src/common → common}/dynamic/dynamic.adapter.d.ts +0 -0
- package/{src/common → common}/dynamic/dynamic.plugin.d.ts +0 -0
- package/{src/common → common}/dynamic/dynamic.utils.d.ts +0 -0
- package/{src/common → common}/dynamic/index.d.ts +0 -0
- package/{src/common → common}/entries/adapter.entry.d.ts +0 -0
- package/{src/common → common}/entries/app.entry.d.ts +0 -0
- package/{src/common → common}/entries/auth-provider.entry.d.ts +0 -0
- package/{src/common → common}/entries/base.entry.d.ts +0 -0
- package/{src/common → common}/entries/flow.entry.d.ts +0 -0
- package/{src/common → common}/entries/hook.entry.d.ts +0 -0
- package/{src/common → common}/entries/index.d.ts +0 -0
- package/{src/common → common}/entries/logger.entry.d.ts +0 -0
- package/{src/common → common}/entries/plugin.entry.d.ts +0 -0
- package/{src/common → common}/entries/prompt.entry.d.ts +0 -0
- package/{src/common → common}/entries/provider.entry.d.ts +0 -0
- package/{src/common → common}/entries/resource.entry.d.ts +0 -0
- package/{src/common → common}/entries/scope.entry.d.ts +0 -0
- package/{src/common → common}/entries/tool.entry.d.ts +0 -0
- package/{src/common → common}/flow/flow.utils.d.ts +0 -0
- package/{src/common → common}/index.d.ts +0 -0
- package/{src/common → common}/interfaces/adapter.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/app.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/auth-hook.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/auth-provider.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/base.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/execution-context.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/flow.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/front-mcp.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/hook.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/index.d.ts +0 -0
- package/{src/common → common}/interfaces/internal/flow.utils.d.ts +0 -0
- package/{src/common → common}/interfaces/internal/index.d.ts +0 -0
- package/{src/common → common}/interfaces/internal/registry.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/logger.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/plugin.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/prompt.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/provider.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/resource.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/scope.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/server.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/session-hook.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/tool-hook.interface.d.ts +0 -0
- package/{src/common → common}/interfaces/tool.interface.d.ts +0 -0
- package/{src/common → common}/metadata/adapter.metadata.d.ts +0 -0
- package/{src/common → common}/metadata/app.metadata.d.ts +42 -42
- /package/{src/common → common}/metadata/auth-provider.metadata.d.ts +0 -0
- /package/{src/common → common}/metadata/flow.metadata.d.ts +0 -0
- /package/{src/common → common}/metadata/hook.metadata.d.ts +0 -0
- /package/{src/common → common}/metadata/index.d.ts +0 -0
- /package/{src/common → common}/metadata/logger.metadata.d.ts +0 -0
- /package/{src/common → common}/metadata/plugin.metadata.d.ts +0 -0
- /package/{src/common → common}/metadata/provider.metadata.d.ts +0 -0
- /package/{src/common → common}/migrate/auth-transport.migrate.d.ts +0 -0
- /package/{src/common → common}/migrate/index.d.ts +0 -0
- /package/{src/common → common}/providers/base-config.provider.d.ts +0 -0
- /package/{src/common → common}/records/adapter.record.d.ts +0 -0
- /package/{src/common → common}/records/app.record.d.ts +0 -0
- /package/{src/common → common}/records/auth-provider.record.d.ts +0 -0
- /package/{src/common → common}/records/flow.record.d.ts +0 -0
- /package/{src/common → common}/records/hook.record.d.ts +0 -0
- /package/{src/common → common}/records/index.d.ts +0 -0
- /package/{src/common → common}/records/logger.record.d.ts +0 -0
- /package/{src/common → common}/records/plugin.record.d.ts +0 -0
- /package/{src/common → common}/records/prompt.record.d.ts +0 -0
- /package/{src/common → common}/records/provider.record.d.ts +0 -0
- /package/{src/common → common}/records/resource.record.d.ts +0 -0
- /package/{src/common → common}/records/scope.record.d.ts +0 -0
- /package/{src/common → common}/records/tool.record.d.ts +0 -0
- /package/{src/common → common}/schemas/annotated-class.schema.d.ts +0 -0
- /package/{src/common → common}/schemas/http-input.schema.d.ts +0 -0
- /package/{src/common → common}/schemas/index.d.ts +0 -0
- /package/{src/common → common}/schemas/session-header.schema.d.ts +0 -0
- /package/{src/common → common}/tokens/adapter.tokens.d.ts +0 -0
- /package/{src/common → common}/tokens/app.tokens.d.ts +0 -0
- /package/{src/common → common}/tokens/auth-provider.tokens.d.ts +0 -0
- /package/{src/common → common}/tokens/base.tokens.d.ts +0 -0
- /package/{src/common → common}/tokens/flow-hook.tokens.d.ts +0 -0
- /package/{src/common → common}/tokens/flow.tokens.d.ts +0 -0
- /package/{src/common → common}/tokens/front-mcp.tokens.d.ts +0 -0
- /package/{src/common → common}/tokens/index.d.ts +0 -0
- /package/{src/common → common}/tokens/logger.tokens.d.ts +0 -0
- /package/{src/common → common}/tokens/plugin.tokens.d.ts +0 -0
- /package/{src/common → common}/tokens/prompt.tokens.d.ts +0 -0
- /package/{src/common → common}/tokens/provider.tokens.d.ts +0 -0
- /package/{src/common → common}/tokens/resource.tokens.d.ts +0 -0
- /package/{src/common → common}/tokens/server.tokens.d.ts +0 -0
- /package/{src/common → common}/tokens/tool.tokens.d.ts +0 -0
- /package/{src/common → common}/types/auth/index.d.ts +0 -0
- /package/{src/common → common}/types/auth/jwt.types.d.ts +0 -0
- /package/{src/common → common}/types/auth/session.types.d.ts +0 -0
- /package/{src/common → common}/types/common.types.d.ts +0 -0
- /package/{src/common → common}/types/index.d.ts +0 -0
- /package/{src/logger/logger.tokens.d.ts → common/types/options/auth/auth.typecheck.d.ts} +0 -0
- /package/{src/common → common}/types/options/http.options.d.ts +0 -0
- /package/{src/common → common}/types/options/logging.options.d.ts +0 -0
- /package/{src/common → common}/types/options/session.options.d.ts +0 -0
- /package/{src/common → common}/utils/path.utils.d.ts +0 -0
- /package/{src/context → context}/frontmcp-context-storage.d.ts +0 -0
- /package/{src/context → context}/frontmcp-context.d.ts +0 -0
- /package/{src/context → context}/frontmcp-context.provider.d.ts +0 -0
- /package/{src/context → context}/index.d.ts +0 -0
- /package/{src/context → context}/request-context-storage.d.ts +0 -0
- /package/{src/context → context}/request-context.d.ts +0 -0
- /package/{src/context → context}/request-context.provider.d.ts +0 -0
- /package/{src/context → context}/session-key.provider.d.ts +0 -0
- /package/{src/context → context}/trace-context.d.ts +0 -0
- /package/{src/errors → errors}/authorization-required.error.d.ts +0 -0
- /package/{src/errors → errors}/error-handler.d.ts +0 -0
- /package/{src/exceptions → exceptions}/mcp-exceptions/session-missing.exception.d.ts +0 -0
- /package/{src/exceptions → exceptions}/mcp-exceptions/unsupported-client-version.exception.d.ts +0 -0
- /package/{src/flows → flows}/flow.instance.d.ts +0 -0
- /package/{src/flows → flows}/flow.registry.d.ts +0 -0
- /package/{src/flows → flows}/flow.stages.d.ts +0 -0
- /package/{src/flows → flows}/flow.utils.d.ts +0 -0
- /package/{src/front-mcp → front-mcp}/front-mcp.d.ts +0 -0
- /package/{src/front-mcp → front-mcp}/front-mcp.tokens.d.ts +0 -0
- /package/{src/front-mcp → front-mcp}/serverless-handler.d.ts +0 -0
- /package/{src/hooks → hooks}/hook.instance.d.ts +0 -0
- /package/{src/hooks → hooks}/hook.registry.d.ts +0 -0
- /package/{src/hooks → hooks}/hooks.utils.d.ts +0 -0
- /package/{src/logger → logger}/instances/instance.console-logger.d.ts +0 -0
- /package/{src/logger → logger}/instances/instance.logger.d.ts +0 -0
- /package/{src/logger → logger}/logger.registry.d.ts +0 -0
- /package/{src/logger → logger}/logger.types.d.ts +0 -0
- /package/{src/logger → logger}/logger.utils.d.ts +0 -0
- /package/{src/mcp-apps → mcp-apps}/csp.d.ts +0 -0
- /package/{src/mcp-apps → mcp-apps}/index.d.ts +0 -0
- /package/{src/mcp-apps → mcp-apps}/schemas.d.ts +0 -0
- /package/{src/mcp-apps → mcp-apps}/template.d.ts +0 -0
- /package/{src/mcp-apps → mcp-apps}/types.d.ts +0 -0
- /package/{src/notification → notification}/index.d.ts +0 -0
- /package/{src/notification → notification}/notification.service.d.ts +0 -0
- /package/{src/plugin → plugin}/plugin.registry.d.ts +0 -0
- /package/{src/plugin → plugin}/plugin.utils.d.ts +0 -0
- /package/{src/prompt → prompt}/index.d.ts +0 -0
- /package/{src/prompt → prompt}/prompt.events.d.ts +0 -0
- /package/{src/prompt → prompt}/prompt.instance.d.ts +0 -0
- /package/{src/prompt → prompt}/prompt.registry.d.ts +0 -0
- /package/{src/prompt → prompt}/prompt.types.d.ts +0 -0
- /package/{src/prompt → prompt}/prompt.utils.d.ts +0 -0
- /package/{src/provider → provider}/provider.registry.d.ts +0 -0
- /package/{src/provider → provider}/provider.types.d.ts +0 -0
- /package/{src/provider → provider}/provider.utils.d.ts +0 -0
- /package/{src/regsitry → regsitry}/index.d.ts +0 -0
- /package/{src/regsitry → regsitry}/registry.base.d.ts +0 -0
- /package/{src/resource → resource}/index.d.ts +0 -0
- /package/{src/resource → resource}/resource.events.d.ts +0 -0
- /package/{src/resource → resource}/resource.instance.d.ts +0 -0
- /package/{src/resource → resource}/resource.registry.d.ts +0 -0
- /package/{src/resource → resource}/resource.types.d.ts +0 -0
- /package/{src/resource → resource}/resource.utils.d.ts +0 -0
- /package/{src/scope → scope}/flows/http.request.flow.d.ts +0 -0
- /package/{src/scope → scope}/index.d.ts +0 -0
- /package/{src/scope → scope}/scope.instance.d.ts +0 -0
- /package/{src/scope → scope}/scope.registry.d.ts +0 -0
- /package/{src/scope → scope}/scope.utils.d.ts +0 -0
- /package/{src/server → server}/adapters/base.host.adapter.d.ts +0 -0
- /package/{src/server → server}/adapters/express.host.adapter.d.ts +0 -0
- /package/{src/server → server}/server.instance.d.ts +0 -0
- /package/{src/server → server}/server.types.d.ts +0 -0
- /package/{src/server → server}/server.validation.d.ts +0 -0
- /package/{src/store → store}/adapters/store.base.adapter.d.ts +0 -0
- /package/{src/store → store}/adapters/store.memory.adapter.d.ts +0 -0
- /package/{src/store → store}/adapters/store.redis.adapter.d.ts +0 -0
- /package/{src/store → store}/store.helpers.d.ts +0 -0
- /package/{src/store → store}/store.registry.d.ts +0 -0
- /package/{src/store → store}/store.tokens.d.ts +0 -0
- /package/{src/store → store}/store.types.d.ts +0 -0
- /package/{src/store → store}/store.utils.d.ts +0 -0
- /package/{src/tool → tool}/tool.events.d.ts +0 -0
- /package/{src/tool → tool}/tool.instance.d.ts +0 -0
- /package/{src/tool → tool}/tool.registry.d.ts +0 -0
- /package/{src/tool → tool}/tool.types.d.ts +0 -0
- /package/{src/tool → tool}/tool.utils.d.ts +0 -0
- /package/{src/tool → tool}/ui/ui-resource-template.d.ts +0 -0
- /package/{src/transport → transport}/adapters/transport.local.adapter.d.ts +0 -0
- /package/{src/transport → transport}/adapters/transport.sse.adapter.d.ts +0 -0
- /package/{src/transport → transport}/adapters/transport.streamable-http.adapter.d.ts +0 -0
- /package/{src/transport → transport}/flows/handle.sse.flow.d.ts +0 -0
- /package/{src/transport → transport}/flows/handle.stateless-http.flow.d.ts +0 -0
- /package/{src/transport → transport}/flows/handle.streamable-http.flow.d.ts +0 -0
- /package/{src/transport → transport}/legacy/legacy.sse.tranporter.d.ts +0 -0
- /package/{src/transport → transport}/mcp-handlers/Initialized-notification.hanlder.d.ts +0 -0
- /package/{src/transport → transport}/mcp-handlers/call-tool-request.handler.d.ts +0 -0
- /package/{src/transport → transport}/mcp-handlers/initialize-request.handler.d.ts +0 -0
- /package/{src/transport → transport}/mcp-handlers/mcp-handlers.types.d.ts +0 -0
- /package/{src/transport → transport}/mcp-handlers/roots-list-changed-notification.handler.d.ts +0 -0
- /package/{src/transport → transport}/transport.error.d.ts +0 -0
- /package/{src/transport → transport}/transport.event-store.d.ts +0 -0
- /package/{src/transport → transport}/transport.local.d.ts +0 -0
- /package/{src/transport → transport}/transport.remote.d.ts +0 -0
- /package/{src/transport → transport}/transport.types.d.ts +0 -0
- /package/{src/types → types}/drinen-hooks.types.d.ts +0 -0
- /package/{src/types → types}/invoke.type.d.ts +0 -0
- /package/{src/types → types}/token.types.d.ts +0 -0
- /package/{src/utils → utils}/content.utils.d.ts +0 -0
- /package/{src/utils → utils}/index.d.ts +0 -0
- /package/{src/utils → utils}/lineage.utils.d.ts +0 -0
- /package/{src/utils → utils}/metadata.utils.d.ts +0 -0
- /package/{src/utils → utils}/naming.utils.d.ts +0 -0
- /package/{src/utils → utils}/server.utils.d.ts +0 -0
- /package/{src/utils → utils}/string.utils.d.ts +0 -0
- /package/{src/utils → utils}/token.utils.d.ts +0 -0
- /package/{src/utils → utils}/types.utils.d.ts +0 -0
- /package/{src/utils → utils}/uri-template.utils.d.ts +0 -0
- /package/{src/utils → utils}/uri-validation.utils.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scope.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/scope.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { Type } from './base.interface';\n\nexport interface ScopeInterface {\n\n}\n\nexport type ScopeType = Type<ScopeInterface>\n\n\nexport {\n ScopeInterface as FrontMcpScopeInterface,\n ScopeType as FrontMcpScopeType,\n}"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FrontMcpServer = exports.ServerResponse = exports.ServerRequest = void 0;
|
|
4
|
-
const http_1 = require("http");
|
|
5
|
-
class ServerRequest extends http_1.IncomingMessage {
|
|
6
|
-
path;
|
|
7
|
-
query;
|
|
8
|
-
body;
|
|
9
|
-
authSession;
|
|
10
|
-
}
|
|
11
|
-
exports.ServerRequest = ServerRequest;
|
|
12
|
-
class ServerResponse extends http_1.ServerResponse {
|
|
13
|
-
}
|
|
14
|
-
exports.ServerResponse = ServerResponse;
|
|
15
|
-
class FrontMcpServer {
|
|
16
|
-
}
|
|
17
|
-
exports.FrontMcpServer = FrontMcpServer;
|
|
18
|
-
//# sourceMappingURL=server.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/server.interface.ts"],"names":[],"mappings":";;;AAAA,+BAA6E;AAK7E,MAAa,aAAc,SAAQ,sBAAe;IAEhD,IAAI,CAAS;IAGb,KAAK,CAAoC;IACzC,IAAI,CAAO;IACX,WAAW,CAAiB;CAC7B;AARD,sCAQC;AAED,MAAsB,cAAe,SAAQ,qBAAkB;CAU9D;AAVD,wCAUC;AAMD,MAAsB,cAAc;CAwCnC;AAxCD,wCAwCC","sourcesContent":["import { IncomingMessage, ServerResponse as HttpServerResponse } from 'http';\nimport { Authorization } from '../types'; // TODO: move to internal\n\nexport type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';\n\nexport class ServerRequest extends IncomingMessage {\n declare method: HttpMethod;\n path: string;\n declare url: string;\n declare headers: Record<string, string>;\n query: Record<string, string | string[]>;\n body?: any;\n authSession?: Authorization;\n}\n\nexport abstract class ServerResponse extends HttpServerResponse {\n abstract status(code: number): ServerResponse;\n\n abstract json(payload: any): void;\n\n abstract send(payload: any): void;\n\n abstract redirect(url: string): void;\n\n abstract redirect(status: number, url: string): void;\n}\n\nexport type NextFn = () => Promise<void> | void;\n\nexport type ServerRequestHandler = (req: ServerRequest, res: ServerResponse, next: NextFn) => Promise<void> | void;\n\nexport abstract class FrontMcpServer {\n /**\n * Register a middleware handler for a specific entry path.\n * @param entryPath - e.g. '' or '/mcp'\n * @param handler - (req, res, next) => {// middleware // next()}\n */\n abstract registerMiddleware(entryPath: string, handler: ServerRequestHandler): Promise<void> | void;\n\n /**\n * Register a route handler for a specific path.\n * @param method - e.g. 'GET' or 'POST'\n * @param path - e.g. '/mcp/invoke'\n * @param handler - (req, res) => {// route handler // res.end() }\n */\n abstract registerRoute(method: HttpMethod, path: string, handler: ServerRequestHandler): Promise<void> | void;\n\n /**\n * Enhance a request handler with request/response processing and error handling.\n * This handle will be stored as the first middleware in the chain to align adapter handler\n * with the gateway's request/response processing.\n */\n abstract enhancedHandler(\n handler: ServerRequestHandler,\n ): (req: any, res: any, next: () => any) => Promise<void> | void;\n\n /**\n * Prepares the server routes without starting the HTTP listener.\n * Used for serverless deployments (Vercel, AWS Lambda, etc.)\n */\n abstract prepare(): void;\n\n /**\n * Returns the underlying HTTP handler for serverless exports.\n */\n abstract getHandler(): unknown;\n\n /**\n * Start the server on the specified port\n */\n abstract start(port?: number): Promise<void> | void;\n}\n"]}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SessionHookStage = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Lifecycle stages for session invocation.
|
|
6
|
-
*
|
|
7
|
-
* Ordering notes:
|
|
8
|
-
* - "will*" stages run before the action; "did*" stages run after.
|
|
9
|
-
* - Higher `priority()` runs earlier for "will*" (outermost), and later for "did*".
|
|
10
|
-
* - Finalization stages (`willFinalize`, `willAudit`, `didAudit`, `onMetrics`) should be placed
|
|
11
|
-
* in your plan’s `finalize` array to run on both success and error paths.
|
|
12
|
-
*
|
|
13
|
-
* Control flow:
|
|
14
|
-
* - Hooks may call `ctx.respond(value)` to short-circuit with a return value.
|
|
15
|
-
* - Hooks may call `ctx.abort(reason, code?, httpStatus?)` to stop with an error.
|
|
16
|
-
*
|
|
17
|
-
* Common context fields:
|
|
18
|
-
* - `ctx.sessionId` SecureMcp session id (== secureJwt) once created/validated.
|
|
19
|
-
* - `ctx.input`/`output` Arbitrary payloads for the current flow.
|
|
20
|
-
* - `ctx.data` Shared bag for cross-hook state.
|
|
21
|
-
* - `ctx.providers` Optional provider views if needed for UI/selection.
|
|
22
|
-
*/
|
|
23
|
-
var SessionHookStage;
|
|
24
|
-
(function (SessionHookStage) {
|
|
25
|
-
/** Prepare a new session (or re-register an incoming secureJwt).
|
|
26
|
-
* Responsibilities:
|
|
27
|
-
* - Validate incoming token (if any); compute defaults; attach user hints.
|
|
28
|
-
* - Initialize per-session resources and attach to `ctx.data`.
|
|
29
|
-
* Failure modes:
|
|
30
|
-
* - `ctx.abort('invalid jwt', 'INVALID_SESSION', 401)`.
|
|
31
|
-
*/
|
|
32
|
-
SessionHookStage["willCreateSession"] = "willCreateSession";
|
|
33
|
-
/** Session created and registered.
|
|
34
|
-
* Responsibilities:
|
|
35
|
-
* - Announce readiness (mount handlers/streams), emit side-effects if needed.
|
|
36
|
-
* - Optionally shape `ctx.output` with a `SessionContextView`.
|
|
37
|
-
*/
|
|
38
|
-
SessionHookStage["didCreateSession"] = "didCreateSession";
|
|
39
|
-
/** Bind DI providers needed for this session/request.
|
|
40
|
-
* Responsibilities:
|
|
41
|
-
* - Resolve and bind providers so later hooks can `ctx.get(...)`.
|
|
42
|
-
* - May set `ctx.bindProvider/bindProviders` helpers.
|
|
43
|
-
*/
|
|
44
|
-
SessionHookStage["willBindProviders"] = "willBindProviders";
|
|
45
|
-
// ---------- Auth (within a session) ----------
|
|
46
|
-
/** Signal the beginning of an auth sequence in the scope of this session.
|
|
47
|
-
* Responsibilities:
|
|
48
|
-
* - Initialize auth-related state (PKCE/state, CSRF, telemetry).
|
|
49
|
-
* - Decide transport (SSE/StreamableHTTP) for status/URL events if applicable.
|
|
50
|
-
*/
|
|
51
|
-
SessionHookStage["willBeginAuth"] = "willBeginAuth";
|
|
52
|
-
/** Streamable authorization progress within the session.
|
|
53
|
-
* Responsibilities:
|
|
54
|
-
* - Emit URL/status events (e.g., “authorize_url”, “awaiting_callback”).
|
|
55
|
-
* - Optionally `ctx.respond({event: ...})` for push-style transports.
|
|
56
|
-
*/
|
|
57
|
-
SessionHookStage["willAuthorize"] = "willAuthorize";
|
|
58
|
-
/** Prepare and gate the token exchange with the provider.
|
|
59
|
-
* Responsibilities:
|
|
60
|
-
* - Verify callback params; ensure prerequisites (sessionId present).
|
|
61
|
-
* - Compute exchange request; rate-limit/anti-replay checks.
|
|
62
|
-
* Failure modes:
|
|
63
|
-
* - `ctx.abort('invalid state/pkce', 'OAUTH_CALLBACK_ERROR', 400)`.
|
|
64
|
-
*/
|
|
65
|
-
SessionHookStage["willExchangeToken"] = "willExchangeToken";
|
|
66
|
-
/** SecureMcp JWT has been minted/confirmed for this session.
|
|
67
|
-
* Responsibilities:
|
|
68
|
-
* - React to issuance (e.g., persist session claims, notify listeners).
|
|
69
|
-
* Notes:
|
|
70
|
-
* - Fired once the session’s secureJwt is known; avoid logging secrets.
|
|
71
|
-
*/
|
|
72
|
-
SessionHookStage["didIssueSecureJwt"] = "didIssueSecureJwt";
|
|
73
|
-
/** Encrypt and store provider tokens for this session.
|
|
74
|
-
* Responsibilities:
|
|
75
|
-
* - Write encrypted blobs to the session record (per provider).
|
|
76
|
-
* - Derive minimal metadata (scopes/expiry) for later claims-only exposure.
|
|
77
|
-
*/
|
|
78
|
-
SessionHookStage["willStoreTokens"] = "willStoreTokens";
|
|
79
|
-
// ---------- Access (read path) ----------
|
|
80
|
-
/** Authorize and prepare a session read.
|
|
81
|
-
* Responsibilities:
|
|
82
|
-
* - Validate access to the session; attach read-scoped providers if required.
|
|
83
|
-
* - Optionally shape a partial view before execute.
|
|
84
|
-
*/
|
|
85
|
-
SessionHookStage["willGetSession"] = "willGetSession";
|
|
86
|
-
/** Post-process the session view.
|
|
87
|
-
* Responsibilities:
|
|
88
|
-
* - Redact/transform/derive fields for the final response.
|
|
89
|
-
* - Set `ctx.output` to a `SessionContextView`.
|
|
90
|
-
*/
|
|
91
|
-
SessionHookStage["didGetSession"] = "didGetSession";
|
|
92
|
-
// ---------- Disposal ----------
|
|
93
|
-
/** Announce shutdown and allow flush/cleanup.
|
|
94
|
-
* Responsibilities:
|
|
95
|
-
* - Close streams, unsubscribe listeners, schedule disposers.
|
|
96
|
-
*/
|
|
97
|
-
SessionHookStage["willDisposeSession"] = "willDisposeSession";
|
|
98
|
-
/** Confirm teardown and emit metrics.
|
|
99
|
-
* Responsibilities:
|
|
100
|
-
* - Final confirmation of resource release; summarize outcome.
|
|
101
|
-
*/
|
|
102
|
-
SessionHookStage["didDisposeSession"] = "didDisposeSession";
|
|
103
|
-
// ---------- Finalize / audit / metrics / errors ----------
|
|
104
|
-
/** Optional “late finally” hook if you need a single place before audit/metrics.
|
|
105
|
-
* Responsibilities:
|
|
106
|
-
* - Last-chance cleanup across success/error paths (idempotent, non-throwing).
|
|
107
|
-
* Notes:
|
|
108
|
-
* - Include this stage in your plan’s `finalize` array to activate.
|
|
109
|
-
*/
|
|
110
|
-
SessionHookStage["willFinalize"] = "willFinalize";
|
|
111
|
-
/** Centralized error handler.
|
|
112
|
-
* Responsibilities:
|
|
113
|
-
* - Redact sensitive data; map internal errors to public codes.
|
|
114
|
-
* - Optionally `ctx.respond({ error })` or `ctx.abort(...)`.
|
|
115
|
-
* Notes:
|
|
116
|
-
* - Should not throw; runs before audit/metrics finalize.
|
|
117
|
-
*/
|
|
118
|
-
SessionHookStage["onError"] = "onError";
|
|
119
|
-
/** Pre-audit collection on both success and error paths.
|
|
120
|
-
* Responsibilities:
|
|
121
|
-
* - Build audit envelope (actor, sessionId, providers touched).
|
|
122
|
-
* - Normalize and strip secrets (no raw tokens).
|
|
123
|
-
*/
|
|
124
|
-
SessionHookStage["willAudit"] = "willAudit";
|
|
125
|
-
/** Persist/emit the audit record.
|
|
126
|
-
* Responsibilities:
|
|
127
|
-
* - Write to audit sink(s) with outcome and timings.
|
|
128
|
-
* - Correlate via `ctx.requestId`/`ctx.sessionId`.
|
|
129
|
-
*/
|
|
130
|
-
SessionHookStage["didAudit"] = "didAudit";
|
|
131
|
-
/** Telemetry/metrics emission for both success and errors.
|
|
132
|
-
* Responsibilities:
|
|
133
|
-
* - Counters & timings (create/get/dispose/auth/exchange/store).
|
|
134
|
-
* - Error code/tag cardinality kept small for SLOs/alerts.
|
|
135
|
-
* Constraints:
|
|
136
|
-
* - Non-throwing; must not alter control flow.
|
|
137
|
-
*/
|
|
138
|
-
SessionHookStage["onMetrics"] = "onMetrics";
|
|
139
|
-
})(SessionHookStage || (exports.SessionHookStage = SessionHookStage = {}));
|
|
140
|
-
//# sourceMappingURL=session-hook.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session-hook.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/session-hook.interface.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,IAAY,gBAuIX;AAvID,WAAY,gBAAgB;IAC1B;;;;;;OAMG;IACH,2DAAuC,CAAA;IAEvC;;;;OAIG;IACH,yDAAqC,CAAA;IAErC;;;;OAIG;IACH,2DAAuC,CAAA;IAEvC,gDAAgD;IAEhD;;;;OAIG;IACH,mDAA+B,CAAA;IAE/B;;;;OAIG;IACH,mDAA+B,CAAA;IAE/B;;;;;;OAMG;IACH,2DAAuC,CAAA;IAEvC;;;;;OAKG;IACH,2DAAuC,CAAA;IAEvC;;;;OAIG;IACH,uDAAmC,CAAA;IAEnC,2CAA2C;IAE3C;;;;OAIG;IACH,qDAAiC,CAAA;IAEjC;;;;OAIG;IACH,mDAA+B,CAAA;IAE/B,iCAAiC;IAEjC;;;OAGG;IACH,6DAAyC,CAAA;IAEzC;;;OAGG;IACH,2DAAuC,CAAA;IAEvC,4DAA4D;IAE5D;;;;;OAKG;IACH,iDAA6B,CAAA;IAE7B;;;;;;OAMG;IACH,uCAAmB,CAAA;IAEnB;;;;OAIG;IACH,2CAAuB,CAAA;IAEvB;;;;OAIG;IACH,yCAAqB,CAAA;IAErB;;;;;;OAMG;IACH,2CAAuB,CAAA;AACzB,CAAC,EAvIW,gBAAgB,gCAAhB,gBAAgB,QAuI3B","sourcesContent":["/**\n * Lifecycle stages for session invocation.\n *\n * Ordering notes:\n * - \"will*\" stages run before the action; \"did*\" stages run after.\n * - Higher `priority()` runs earlier for \"will*\" (outermost), and later for \"did*\".\n * - Finalization stages (`willFinalize`, `willAudit`, `didAudit`, `onMetrics`) should be placed\n * in your plan’s `finalize` array to run on both success and error paths.\n *\n * Control flow:\n * - Hooks may call `ctx.respond(value)` to short-circuit with a return value.\n * - Hooks may call `ctx.abort(reason, code?, httpStatus?)` to stop with an error.\n *\n * Common context fields:\n * - `ctx.sessionId` SecureMcp session id (== secureJwt) once created/validated.\n * - `ctx.input`/`output` Arbitrary payloads for the current flow.\n * - `ctx.data` Shared bag for cross-hook state.\n * - `ctx.providers` Optional provider views if needed for UI/selection.\n */\nexport enum SessionHookStage {\n /** Prepare a new session (or re-register an incoming secureJwt).\n * Responsibilities:\n * - Validate incoming token (if any); compute defaults; attach user hints.\n * - Initialize per-session resources and attach to `ctx.data`.\n * Failure modes:\n * - `ctx.abort('invalid jwt', 'INVALID_SESSION', 401)`.\n */\n willCreateSession = 'willCreateSession',\n\n /** Session created and registered.\n * Responsibilities:\n * - Announce readiness (mount handlers/streams), emit side-effects if needed.\n * - Optionally shape `ctx.output` with a `SessionContextView`.\n */\n didCreateSession = 'didCreateSession',\n\n /** Bind DI providers needed for this session/request.\n * Responsibilities:\n * - Resolve and bind providers so later hooks can `ctx.get(...)`.\n * - May set `ctx.bindProvider/bindProviders` helpers.\n */\n willBindProviders = 'willBindProviders',\n\n // ---------- Auth (within a session) ----------\n\n /** Signal the beginning of an auth sequence in the scope of this session.\n * Responsibilities:\n * - Initialize auth-related state (PKCE/state, CSRF, telemetry).\n * - Decide transport (SSE/StreamableHTTP) for status/URL events if applicable.\n */\n willBeginAuth = 'willBeginAuth',\n\n /** Streamable authorization progress within the session.\n * Responsibilities:\n * - Emit URL/status events (e.g., “authorize_url”, “awaiting_callback”).\n * - Optionally `ctx.respond({event: ...})` for push-style transports.\n */\n willAuthorize = 'willAuthorize', // stream-able events (URL/status)\n\n /** Prepare and gate the token exchange with the provider.\n * Responsibilities:\n * - Verify callback params; ensure prerequisites (sessionId present).\n * - Compute exchange request; rate-limit/anti-replay checks.\n * Failure modes:\n * - `ctx.abort('invalid state/pkce', 'OAUTH_CALLBACK_ERROR', 400)`.\n */\n willExchangeToken = 'willExchangeToken',\n\n /** SecureMcp JWT has been minted/confirmed for this session.\n * Responsibilities:\n * - React to issuance (e.g., persist session claims, notify listeners).\n * Notes:\n * - Fired once the session’s secureJwt is known; avoid logging secrets.\n */\n didIssueSecureJwt = 'didIssueSecureJwt',\n\n /** Encrypt and store provider tokens for this session.\n * Responsibilities:\n * - Write encrypted blobs to the session record (per provider).\n * - Derive minimal metadata (scopes/expiry) for later claims-only exposure.\n */\n willStoreTokens = 'willStoreTokens',\n\n // ---------- Access (read path) ----------\n\n /** Authorize and prepare a session read.\n * Responsibilities:\n * - Validate access to the session; attach read-scoped providers if required.\n * - Optionally shape a partial view before execute.\n */\n willGetSession = 'willGetSession',\n\n /** Post-process the session view.\n * Responsibilities:\n * - Redact/transform/derive fields for the final response.\n * - Set `ctx.output` to a `SessionContextView`.\n */\n didGetSession = 'didGetSession',\n\n // ---------- Disposal ----------\n\n /** Announce shutdown and allow flush/cleanup.\n * Responsibilities:\n * - Close streams, unsubscribe listeners, schedule disposers.\n */\n willDisposeSession = 'willDisposeSession',\n\n /** Confirm teardown and emit metrics.\n * Responsibilities:\n * - Final confirmation of resource release; summarize outcome.\n */\n didDisposeSession = 'didDisposeSession',\n\n // ---------- Finalize / audit / metrics / errors ----------\n\n /** Optional “late finally” hook if you need a single place before audit/metrics.\n * Responsibilities:\n * - Last-chance cleanup across success/error paths (idempotent, non-throwing).\n * Notes:\n * - Include this stage in your plan’s `finalize` array to activate.\n */\n willFinalize = 'willFinalize',\n\n /** Centralized error handler.\n * Responsibilities:\n * - Redact sensitive data; map internal errors to public codes.\n * - Optionally `ctx.respond({ error })` or `ctx.abort(...)`.\n * Notes:\n * - Should not throw; runs before audit/metrics finalize.\n */\n onError = 'onError',\n\n /** Pre-audit collection on both success and error paths.\n * Responsibilities:\n * - Build audit envelope (actor, sessionId, providers touched).\n * - Normalize and strip secrets (no raw tokens).\n */\n willAudit = 'willAudit',\n\n /** Persist/emit the audit record.\n * Responsibilities:\n * - Write to audit sink(s) with outcome and timings.\n * - Correlate via `ctx.requestId`/`ctx.sessionId`.\n */\n didAudit = 'didAudit',\n\n /** Telemetry/metrics emission for both success and errors.\n * Responsibilities:\n * - Counters & timings (create/get/dispose/auth/exchange/store).\n * - Error code/tag cardinality kept small for SLOs/alerts.\n * Constraints:\n * - Non-throwing; must not alter control flow.\n */\n onMetrics = 'onMetrics',\n}\n"]}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToolHookStage = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Lifecycle stages for tool invocation.
|
|
6
|
-
*
|
|
7
|
-
* Ordering notes:
|
|
8
|
-
* - "will*" stages run before the action; "did*" run after.
|
|
9
|
-
* - Higher `priority()` runs earlier for "will*" (outermost for wrappers), and later for "did*".
|
|
10
|
-
* - `aroundExecute` wraps the actual execution block (including will/didExecute inside).
|
|
11
|
-
*
|
|
12
|
-
* Control flow:
|
|
13
|
-
* - Hooks may call `ctx.respond(value)` to short-circuit with a value.
|
|
14
|
-
* - Hooks may call `ctx.abort(reason, code?, httpStatus?)` to deny/stop.
|
|
15
|
-
* - Hooks may call `ctx.retryAfter(ms, reason?)` to signal backoff.
|
|
16
|
-
*/
|
|
17
|
-
var ToolHookStage;
|
|
18
|
-
(function (ToolHookStage) {
|
|
19
|
-
/** Bind DI providers needed for this invocation (from ctor tokens + hook/tool `provide()`).
|
|
20
|
-
* Runs very early so later hooks can use `ctx.get(...)`. */
|
|
21
|
-
ToolHookStage["willBindProviders"] = "willBindProviders";
|
|
22
|
-
/** Last chance to populate/shape the invocation context (user, tenant, attrs, ids). */
|
|
23
|
-
ToolHookStage["willCreateInvokeContext"] = "willCreateInvokeContext";
|
|
24
|
-
/** Post-context creation; good for sanity checks, tracing decorations. */
|
|
25
|
-
ToolHookStage["didCreateInvokeContext"] = "didCreateInvokeContext";
|
|
26
|
-
/** Authorization gate (roles/scopes/RBAC/ABAC). May `abort()` if unauthorized. */
|
|
27
|
-
ToolHookStage["willAuthorize"] = "willAuthorize";
|
|
28
|
-
/** Consent gate. May `respond()` with a consent challenge or `abort()` if missing consent. */
|
|
29
|
-
ToolHookStage["willCheckConsent"] = "willCheckConsent";
|
|
30
|
-
/** Feature-flag gate (enable/disable per user/tenant/experiment). May `abort()`. */
|
|
31
|
-
ToolHookStage["willCheckFeatureFlags"] = "willCheckFeatureFlags";
|
|
32
|
-
// ---------------- Capacity & Resilience ----------------
|
|
33
|
-
/** Acquire rate-limit quota. May `retryAfter()` or `abort()` on exhaustion. */
|
|
34
|
-
ToolHookStage["willAcquireQuota"] = "willAcquireQuota";
|
|
35
|
-
/** Release rate-limit quota (best-effort; typically run in `finally`). */
|
|
36
|
-
ToolHookStage["didReleaseQuota"] = "didReleaseQuota";
|
|
37
|
-
/** Acquire concurrency slot/semaphore. May `retryAfter()` or `abort()`. */
|
|
38
|
-
ToolHookStage["willAcquireSemaphore"] = "willAcquireSemaphore";
|
|
39
|
-
/** Release concurrency slot/semaphore (best-effort). */
|
|
40
|
-
ToolHookStage["didReleaseSemaphore"] = "didReleaseSemaphore";
|
|
41
|
-
// ---------------- Input shaping ----------------
|
|
42
|
-
/** Parse/coerce raw input (types, defaults). Mutate `ctx.input` as needed. */
|
|
43
|
-
ToolHookStage["willParseInput"] = "willParseInput";
|
|
44
|
-
/** Validate business rules for input. May `abort()` on violations. */
|
|
45
|
-
ToolHookStage["willValidateInput"] = "willValidateInput";
|
|
46
|
-
/** Normalize/canonicalize input (ids → uuids, trim, sort fields, etc.). */
|
|
47
|
-
ToolHookStage["willNormalizeInput"] = "willNormalizeInput";
|
|
48
|
-
/** Apply DLP/minimization to input (mask/drop/hash fields). */
|
|
49
|
-
ToolHookStage["willRedactInput"] = "willRedactInput";
|
|
50
|
-
/** Inject credentials/secrets (tokens, API keys) into context or input. */
|
|
51
|
-
ToolHookStage["willInjectSecrets"] = "willInjectSecrets";
|
|
52
|
-
// ---------------- Caching ----------------
|
|
53
|
-
/** Attempt to serve from cache. May `respond(cachedValue)` to short-circuit. */
|
|
54
|
-
ToolHookStage["willReadCache"] = "willReadCache";
|
|
55
|
-
/** Metrics/telemetry for cache hit; typically emitted by cache plugin. */
|
|
56
|
-
ToolHookStage["didCacheHit"] = "didCacheHit";
|
|
57
|
-
/** Metrics/telemetry for cache miss; typically emitted by cache plugin. */
|
|
58
|
-
ToolHookStage["didCacheMiss"] = "didCacheMiss";
|
|
59
|
-
/** Write result to cache after successful execution. */
|
|
60
|
-
ToolHookStage["willWriteCache"] = "willWriteCache";
|
|
61
|
-
// ---------------- Execution ----------------
|
|
62
|
-
/** Around wrapper for execution (timeouts/retries/circuit/tracing). Must call `next()` unless short-circuiting. */
|
|
63
|
-
ToolHookStage["aroundExecute"] = "aroundExecute";
|
|
64
|
-
/** Right before calling the tool implementation; may mutate `ctx.input`. */
|
|
65
|
-
ToolHookStage["willExecute"] = "willExecute";
|
|
66
|
-
/** Right after tool returns; `ctx.output` is available for downstream hooks. */
|
|
67
|
-
ToolHookStage["didExecute"] = "didExecute";
|
|
68
|
-
// ---------------- Output shaping ----------------
|
|
69
|
-
/** Apply DLP/minimization to output (mask/drop/truncate sensitive fields). */
|
|
70
|
-
ToolHookStage["willRedactOutput"] = "willRedactOutput";
|
|
71
|
-
/** Validate output against business/schema rules. May `abort()` or fix. */
|
|
72
|
-
ToolHookStage["willValidateOutput"] = "willValidateOutput";
|
|
73
|
-
/** Transform output shape (projection/mapping/pagination). Mutate `ctx.output`. */
|
|
74
|
-
ToolHookStage["willTransformOutput"] = "willTransformOutput";
|
|
75
|
-
// ---------------- Retry & Observability ----------------
|
|
76
|
-
/** Called on each retry attempt by a retry wrapper (emit metrics/backoff hints). */
|
|
77
|
-
ToolHookStage["onRetry"] = "onRetry";
|
|
78
|
-
/** Called when retries are exhausted and execution gives up. */
|
|
79
|
-
ToolHookStage["onGiveUp"] = "onGiveUp";
|
|
80
|
-
/** Prepare audit payload (apply redaction) and/or write audit logs. */
|
|
81
|
-
ToolHookStage["willAudit"] = "willAudit";
|
|
82
|
-
/** Post-audit hook (confirm persistence, forward to sinks). */
|
|
83
|
-
ToolHookStage["didAudit"] = "didAudit";
|
|
84
|
-
/** Emit metrics (counters, histograms, traces). */
|
|
85
|
-
ToolHookStage["onMetrics"] = "onMetrics";
|
|
86
|
-
// ---------------- Error & Finalization ----------------
|
|
87
|
-
/** Error handler for unexpected failures or control errors. Can map/normalize errors. */
|
|
88
|
-
ToolHookStage["onError"] = "onError";
|
|
89
|
-
/** Always runs at the very end (success or error). Cleanup/releases here. */
|
|
90
|
-
ToolHookStage["willFinalizeInvoke"] = "willFinalizeInvoke";
|
|
91
|
-
})(ToolHookStage || (exports.ToolHookStage = ToolHookStage = {}));
|
|
92
|
-
//# sourceMappingURL=tool-hook.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-hook.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/tool-hook.interface.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,IAAY,aA+GX;AA/GD,WAAY,aAAa;IACvB;gEAC4D;IAC5D,wDAAuC,CAAA;IAEvC,uFAAuF;IACvF,oEAAmD,CAAA;IAEnD,0EAA0E;IAC1E,kEAAiD,CAAA;IAEjD,kFAAkF;IAClF,gDAA+B,CAAA;IAE/B,8FAA8F;IAC9F,sDAAqC,CAAA;IAErC,oFAAoF;IACpF,gEAA+C,CAAA;IAE/C,0DAA0D;IAE1D,+EAA+E;IAC/E,sDAAqC,CAAA;IAErC,0EAA0E;IAC1E,oDAAmC,CAAA;IAEnC,2EAA2E;IAC3E,8DAA6C,CAAA;IAE7C,wDAAwD;IACxD,4DAA2C,CAAA;IAE3C,kDAAkD;IAElD,8EAA8E;IAC9E,kDAAiC,CAAA;IAEjC,sEAAsE;IACtE,wDAAuC,CAAA;IAEvC,2EAA2E;IAC3E,0DAAyC,CAAA;IAEzC,+DAA+D;IAC/D,oDAAmC,CAAA;IAEnC,2EAA2E;IAC3E,wDAAuC,CAAA;IAEvC,4CAA4C;IAE5C,gFAAgF;IAChF,gDAA+B,CAAA;IAE/B,0EAA0E;IAC1E,4CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,8CAA6B,CAAA;IAE7B,wDAAwD;IACxD,kDAAiC,CAAA;IAEjC,8CAA8C;IAE9C,mHAAmH;IACnH,gDAA+B,CAAA;IAE/B,4EAA4E;IAC5E,4CAA2B,CAAA;IAE3B,gFAAgF;IAChF,0CAAyB,CAAA;IAEzB,mDAAmD;IAEnD,8EAA8E;IAC9E,sDAAqC,CAAA;IAErC,2EAA2E;IAC3E,0DAAyC,CAAA;IAEzC,mFAAmF;IACnF,4DAA2C,CAAA;IAE3C,0DAA0D;IAE1D,oFAAoF;IACpF,oCAAmB,CAAA;IAEnB,gEAAgE;IAChE,sCAAqB,CAAA;IAErB,uEAAuE;IACvE,wCAAuB,CAAA;IAEvB,+DAA+D;IAC/D,sCAAqB,CAAA;IAErB,mDAAmD;IACnD,wCAAuB,CAAA;IAEvB,yDAAyD;IAEzD,yFAAyF;IACzF,oCAAmB,CAAA;IAEnB,6EAA6E;IAC7E,0DAAyC,CAAA;AAC3C,CAAC,EA/GW,aAAa,6BAAb,aAAa,QA+GxB","sourcesContent":["/**\n * Lifecycle stages for tool invocation.\n *\n * Ordering notes:\n * - \"will*\" stages run before the action; \"did*\" run after.\n * - Higher `priority()` runs earlier for \"will*\" (outermost for wrappers), and later for \"did*\".\n * - `aroundExecute` wraps the actual execution block (including will/didExecute inside).\n *\n * Control flow:\n * - Hooks may call `ctx.respond(value)` to short-circuit with a value.\n * - Hooks may call `ctx.abort(reason, code?, httpStatus?)` to deny/stop.\n * - Hooks may call `ctx.retryAfter(ms, reason?)` to signal backoff.\n */\nexport enum ToolHookStage {\n /** Bind DI providers needed for this invocation (from ctor tokens + hook/tool `provide()`).\n * Runs very early so later hooks can use `ctx.get(...)`. */\n willBindProviders = 'willBindProviders',\n\n /** Last chance to populate/shape the invocation context (user, tenant, attrs, ids). */\n willCreateInvokeContext = 'willCreateInvokeContext',\n\n /** Post-context creation; good for sanity checks, tracing decorations. */\n didCreateInvokeContext = 'didCreateInvokeContext',\n\n /** Authorization gate (roles/scopes/RBAC/ABAC). May `abort()` if unauthorized. */\n willAuthorize = 'willAuthorize',\n\n /** Consent gate. May `respond()` with a consent challenge or `abort()` if missing consent. */\n willCheckConsent = 'willCheckConsent',\n\n /** Feature-flag gate (enable/disable per user/tenant/experiment). May `abort()`. */\n willCheckFeatureFlags = 'willCheckFeatureFlags',\n\n // ---------------- Capacity & Resilience ----------------\n\n /** Acquire rate-limit quota. May `retryAfter()` or `abort()` on exhaustion. */\n willAcquireQuota = 'willAcquireQuota',\n\n /** Release rate-limit quota (best-effort; typically run in `finally`). */\n didReleaseQuota = 'didReleaseQuota',\n\n /** Acquire concurrency slot/semaphore. May `retryAfter()` or `abort()`. */\n willAcquireSemaphore = 'willAcquireSemaphore',\n\n /** Release concurrency slot/semaphore (best-effort). */\n didReleaseSemaphore = 'didReleaseSemaphore',\n\n // ---------------- Input shaping ----------------\n\n /** Parse/coerce raw input (types, defaults). Mutate `ctx.input` as needed. */\n willParseInput = 'willParseInput',\n\n /** Validate business rules for input. May `abort()` on violations. */\n willValidateInput = 'willValidateInput',\n\n /** Normalize/canonicalize input (ids → uuids, trim, sort fields, etc.). */\n willNormalizeInput = 'willNormalizeInput',\n\n /** Apply DLP/minimization to input (mask/drop/hash fields). */\n willRedactInput = 'willRedactInput',\n\n /** Inject credentials/secrets (tokens, API keys) into context or input. */\n willInjectSecrets = 'willInjectSecrets',\n\n // ---------------- Caching ----------------\n\n /** Attempt to serve from cache. May `respond(cachedValue)` to short-circuit. */\n willReadCache = 'willReadCache',\n\n /** Metrics/telemetry for cache hit; typically emitted by cache plugin. */\n didCacheHit = 'didCacheHit',\n\n /** Metrics/telemetry for cache miss; typically emitted by cache plugin. */\n didCacheMiss = 'didCacheMiss',\n\n /** Write result to cache after successful execution. */\n willWriteCache = 'willWriteCache',\n\n // ---------------- Execution ----------------\n\n /** Around wrapper for execution (timeouts/retries/circuit/tracing). Must call `next()` unless short-circuiting. */\n aroundExecute = 'aroundExecute',\n\n /** Right before calling the tool implementation; may mutate `ctx.input`. */\n willExecute = 'willExecute',\n\n /** Right after tool returns; `ctx.output` is available for downstream hooks. */\n didExecute = 'didExecute',\n\n // ---------------- Output shaping ----------------\n\n /** Apply DLP/minimization to output (mask/drop/truncate sensitive fields). */\n willRedactOutput = 'willRedactOutput',\n\n /** Validate output against business/schema rules. May `abort()` or fix. */\n willValidateOutput = 'willValidateOutput',\n\n /** Transform output shape (projection/mapping/pagination). Mutate `ctx.output`. */\n willTransformOutput = 'willTransformOutput',\n\n // ---------------- Retry & Observability ----------------\n\n /** Called on each retry attempt by a retry wrapper (emit metrics/backoff hints). */\n onRetry = 'onRetry',\n\n /** Called when retries are exhausted and execution gives up. */\n onGiveUp = 'onGiveUp',\n\n /** Prepare audit payload (apply redaction) and/or write audit logs. */\n willAudit = 'willAudit',\n\n /** Post-audit hook (confirm persistence, forward to sinks). */\n didAudit = 'didAudit',\n\n /** Emit metrics (counters, histograms, traces). */\n onMetrics = 'onMetrics',\n\n // ---------------- Error & Finalization ----------------\n\n /** Error handler for unexpected failures or control errors. Can map/normalize errors. */\n onError = 'onError',\n\n /** Always runs at the very end (success or error). Cleanup/releases here. */\n willFinalizeInvoke = 'willFinalizeInvoke',\n}\n"]}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToolContext = void 0;
|
|
4
|
-
const flow_interface_1 = require("./flow.interface");
|
|
5
|
-
const execution_context_interface_1 = require("./execution-context.interface");
|
|
6
|
-
class ToolContext extends execution_context_interface_1.ExecutionContextBase {
|
|
7
|
-
toolId;
|
|
8
|
-
toolName;
|
|
9
|
-
metadata;
|
|
10
|
-
// ---- INPUT storages (backing fields)
|
|
11
|
-
_rawInput;
|
|
12
|
-
_input;
|
|
13
|
-
// ---- OUTPUT storages (backing fields)
|
|
14
|
-
_outputDraft;
|
|
15
|
-
_output;
|
|
16
|
-
// ---- histories
|
|
17
|
-
_inputHistory = [];
|
|
18
|
-
_outputHistory = [];
|
|
19
|
-
constructor(args) {
|
|
20
|
-
const { metadata, input, providers, logger } = args;
|
|
21
|
-
super({
|
|
22
|
-
providers,
|
|
23
|
-
logger: logger.child(`tool:${metadata.id ?? metadata.name}`),
|
|
24
|
-
authInfo: args.authInfo,
|
|
25
|
-
});
|
|
26
|
-
this.toolName = metadata.name;
|
|
27
|
-
this.toolId = metadata.id ?? metadata.name;
|
|
28
|
-
this.metadata = metadata;
|
|
29
|
-
this._input = input;
|
|
30
|
-
}
|
|
31
|
-
get input() {
|
|
32
|
-
return this._input;
|
|
33
|
-
}
|
|
34
|
-
set input(v) {
|
|
35
|
-
this._input = v;
|
|
36
|
-
this._inputHistory.push({
|
|
37
|
-
at: Date.now(),
|
|
38
|
-
stage: this.activeStage,
|
|
39
|
-
value: v,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
get inputHistory() {
|
|
43
|
-
return this._inputHistory;
|
|
44
|
-
}
|
|
45
|
-
get output() {
|
|
46
|
-
return this._output;
|
|
47
|
-
}
|
|
48
|
-
set output(v) {
|
|
49
|
-
this._output = v;
|
|
50
|
-
this._outputHistory.push({ at: Date.now(), stage: this.activeStage, value: v });
|
|
51
|
-
}
|
|
52
|
-
get outputHistory() {
|
|
53
|
-
return this._outputHistory;
|
|
54
|
-
}
|
|
55
|
-
respond(value) {
|
|
56
|
-
// record validated output and surface the value via control flow
|
|
57
|
-
this.output = value;
|
|
58
|
-
flow_interface_1.FlowControl.respond(value);
|
|
59
|
-
}
|
|
60
|
-
// ============================================
|
|
61
|
-
// Platform Detection API
|
|
62
|
-
// ============================================
|
|
63
|
-
/**
|
|
64
|
-
* Get the detected AI platform type for the current session.
|
|
65
|
-
* This is auto-detected from the client info during MCP initialization.
|
|
66
|
-
*
|
|
67
|
-
* Use this to customize tool responses (e.g., UI format) based on the calling platform.
|
|
68
|
-
*
|
|
69
|
-
* @returns The detected platform type, or 'unknown' if not detected
|
|
70
|
-
* @example
|
|
71
|
-
* ```typescript
|
|
72
|
-
* async execute(input: Input): Promise<Output> {
|
|
73
|
-
* const platform = this.platform;
|
|
74
|
-
* if (platform === 'openai') {
|
|
75
|
-
* // Return OpenAI-specific response format
|
|
76
|
-
* }
|
|
77
|
-
* // ...
|
|
78
|
-
* }
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
get platform() {
|
|
82
|
-
// First check sessionIdPayload (detected from user-agent during session creation)
|
|
83
|
-
const payloadPlatform = this.authInfo.sessionIdPayload?.platformType;
|
|
84
|
-
if (payloadPlatform && payloadPlatform !== 'unknown') {
|
|
85
|
-
return payloadPlatform;
|
|
86
|
-
}
|
|
87
|
-
// Fall back to notification service (detected from MCP clientInfo during initialize)
|
|
88
|
-
const sessionId = this.authInfo.sessionId;
|
|
89
|
-
if (!sessionId) {
|
|
90
|
-
return 'unknown';
|
|
91
|
-
}
|
|
92
|
-
return this.scope.notifications.getPlatformType(sessionId);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Get the client info (name and version) for the current session.
|
|
96
|
-
* This is captured from the MCP initialize request.
|
|
97
|
-
*
|
|
98
|
-
* @returns The client info, or undefined if not available
|
|
99
|
-
* @example
|
|
100
|
-
* ```typescript
|
|
101
|
-
* async execute(input: Input): Promise<Output> {
|
|
102
|
-
* const client = this.clientInfo;
|
|
103
|
-
* console.log(`Called by: ${client?.name} v${client?.version}`);
|
|
104
|
-
* // ...
|
|
105
|
-
* }
|
|
106
|
-
* ```
|
|
107
|
-
*/
|
|
108
|
-
get clientInfo() {
|
|
109
|
-
const sessionId = this.authInfo.sessionId;
|
|
110
|
-
if (!sessionId) {
|
|
111
|
-
return undefined;
|
|
112
|
-
}
|
|
113
|
-
return this.scope.notifications.getClientInfo(sessionId);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
exports.ToolContext = ToolContext;
|
|
117
|
-
//# sourceMappingURL=tool.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/tool.interface.ts"],"names":[],"mappings":";;;AAIA,qDAA+C;AAG/C,+EAA+F;AAiB/F,MAAsB,WAKpB,SAAQ,kDAAyB;IACd,MAAM,CAAS;IACf,QAAQ,CAAS;IAC3B,QAAQ,CAAe;IAEhC,uCAAuC;IAC/B,SAAS,CAAqB;IAC9B,MAAM,CAAM;IAEpB,wCAAwC;IAChC,YAAY,CAAsB;IAClC,OAAO,CAAO;IAEtB,iBAAiB;IACA,aAAa,GAAuB,EAAE,CAAC;IACvC,cAAc,GAAwB,EAAE,CAAC;IAE1D,YAAY,IAAsB;QAChC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACpD,KAAK,CAAC;YACJ,SAAS;YACT,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,QAAQ,CAAC,EAAE,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC5D,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAID,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAY,CAAC;IAC3B,CAAC;IAED,IAAW,KAAK,CAAC,CAAiB;QAChC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YACtB,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,KAAK,EAAE,IAAI,CAAC,WAAW;YACvB,KAAK,EAAE,CAAC;SACT,CAAC,CAAC;IACL,CAAC;IAED,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAW,MAAM,CAAC,CAAkB;QAClC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,OAAO,CAAC,KAAU;QAChB,iEAAiE;QACjE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,4BAAW,CAAC,OAAO,CAAM,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,+CAA+C;IAC/C,yBAAyB;IACzB,+CAA+C;IAE/C;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAI,QAAQ;QACV,kFAAkF;QAClF,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC;QACrE,IAAI,eAAe,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YACrD,OAAO,eAAe,CAAC;QACzB,CAAC;QAED,qFAAqF;QACrF,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC1C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,UAAU;QACZ,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC1C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;CACF;AAnID,kCAmIC","sourcesContent":["import { FuncType, Type } from './base.interface';\nimport { ProviderRegistryInterface } from './internal';\nimport { ToolInputType, ToolMetadata, ToolOutputType } from '../metadata';\nimport { FrontMcpLogger } from './logger.interface';\nimport { FlowControl } from './flow.interface';\nimport { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';\nimport { ToolInputOf, ToolOutputOf } from '../decorators';\nimport { ExecutionContextBase, ExecutionContextBaseArgs } from './execution-context.interface';\nimport type { AIPlatformType, ClientInfo } from '../../notification';\n\nexport type ToolType<T = any> = Type<T> | FuncType<T>;\n\ntype HistoryEntry<T> = {\n at: number;\n stage?: string;\n value: T | undefined;\n note?: string;\n};\n\nexport type ToolCtorArgs<In> = ExecutionContextBaseArgs & {\n metadata: ToolMetadata;\n input: In;\n};\n\nexport abstract class ToolContext<\n InSchema extends ToolInputType = ToolInputType,\n OutSchema extends ToolOutputType = ToolOutputType,\n In = ToolInputOf<{ inputSchema: InSchema }>,\n Out = ToolOutputOf<{ outputSchema: OutSchema }>,\n> extends ExecutionContextBase<Out> {\n protected readonly toolId: string;\n protected readonly toolName: string;\n readonly metadata: ToolMetadata;\n\n // ---- INPUT storages (backing fields)\n private _rawInput?: Partial<In> | any;\n private _input?: In;\n\n // ---- OUTPUT storages (backing fields)\n private _outputDraft?: Partial<Out> | any;\n private _output?: Out;\n\n // ---- histories\n private readonly _inputHistory: HistoryEntry<In>[] = [];\n private readonly _outputHistory: HistoryEntry<Out>[] = [];\n\n constructor(args: ToolCtorArgs<In>) {\n const { metadata, input, providers, logger } = args;\n super({\n providers,\n logger: logger.child(`tool:${metadata.id ?? metadata.name}`),\n authInfo: args.authInfo,\n });\n this.toolName = metadata.name;\n this.toolId = metadata.id ?? metadata.name;\n this.metadata = metadata;\n this._input = input;\n }\n\n abstract execute(input: In): Promise<Out>;\n\n public get input(): In {\n return this._input as In;\n }\n\n public set input(v: In | undefined) {\n this._input = v;\n this._inputHistory.push({\n at: Date.now(),\n stage: this.activeStage,\n value: v,\n });\n }\n\n public get inputHistory(): ReadonlyArray<HistoryEntry<In>> {\n return this._inputHistory;\n }\n\n public get output(): Out | undefined {\n return this._output;\n }\n\n public set output(v: Out | undefined) {\n this._output = v;\n this._outputHistory.push({ at: Date.now(), stage: this.activeStage, value: v });\n }\n\n public get outputHistory(): ReadonlyArray<HistoryEntry<Out>> {\n return this._outputHistory;\n }\n\n respond(value: Out): never {\n // record validated output and surface the value via control flow\n this.output = value;\n FlowControl.respond<Out>(value);\n }\n\n // ============================================\n // Platform Detection API\n // ============================================\n\n /**\n * Get the detected AI platform type for the current session.\n * This is auto-detected from the client info during MCP initialization.\n *\n * Use this to customize tool responses (e.g., UI format) based on the calling platform.\n *\n * @returns The detected platform type, or 'unknown' if not detected\n * @example\n * ```typescript\n * async execute(input: Input): Promise<Output> {\n * const platform = this.platform;\n * if (platform === 'openai') {\n * // Return OpenAI-specific response format\n * }\n * // ...\n * }\n * ```\n */\n get platform(): AIPlatformType {\n // First check sessionIdPayload (detected from user-agent during session creation)\n const payloadPlatform = this.authInfo.sessionIdPayload?.platformType;\n if (payloadPlatform && payloadPlatform !== 'unknown') {\n return payloadPlatform;\n }\n\n // Fall back to notification service (detected from MCP clientInfo during initialize)\n const sessionId = this.authInfo.sessionId;\n if (!sessionId) {\n return 'unknown';\n }\n return this.scope.notifications.getPlatformType(sessionId);\n }\n\n /**\n * Get the client info (name and version) for the current session.\n * This is captured from the MCP initialize request.\n *\n * @returns The client info, or undefined if not available\n * @example\n * ```typescript\n * async execute(input: Input): Promise<Output> {\n * const client = this.clientInfo;\n * console.log(`Called by: ${client?.name} v${client?.version}`);\n * // ...\n * }\n * ```\n */\n get clientInfo(): ClientInfo | undefined {\n const sessionId = this.authInfo.sessionId;\n if (!sessionId) {\n return undefined;\n }\n return this.scope.notifications.getClientInfo(sessionId);\n }\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.frontMcpAdapterMetadataSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.frontMcpAdapterMetadataSchema = zod_1.z.object({
|
|
6
|
-
id: zod_1.z.string().optional(),
|
|
7
|
-
name: zod_1.z.string().min(1),
|
|
8
|
-
description: zod_1.z.string().optional(),
|
|
9
|
-
}).passthrough();
|
|
10
|
-
//# sourceMappingURL=adapter.metadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.metadata.js","sourceRoot":"","sources":["../../../../src/common/metadata/adapter.metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAcX,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACI,CAAC,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport { RawZodShape } from '../types';\n\n\n/**\n * Declarative metadata describing what a FrontMcpAdapter contributes at app scope.\n */\nexport interface AdapterMetadata {\n id?: string;\n name: string;\n description?: string;\n}\n\n\nexport const frontMcpAdapterMetadataSchema = z.object({\n id: z.string().optional(),\n name: z.string().min(1),\n description: z.string().optional(),\n} satisfies RawZodShape<AdapterMetadata>).passthrough();\n"]}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.frontMcpRemoteAppMetadataSchema = exports.frontMcpLocalAppMetadataSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
const schemas_1 = require("../schemas");
|
|
7
|
-
exports.frontMcpLocalAppMetadataSchema = zod_1.z.object({
|
|
8
|
-
id: zod_1.z.string().optional(),
|
|
9
|
-
name: zod_1.z.string().min(1),
|
|
10
|
-
description: zod_1.z.string().optional(),
|
|
11
|
-
providers: zod_1.z.array(schemas_1.annotatedFrontMcpProvidersSchema).optional().default([]),
|
|
12
|
-
authProviders: zod_1.z.array(schemas_1.annotatedFrontMcpAuthProvidersSchema).optional().default([]),
|
|
13
|
-
plugins: zod_1.z.array(schemas_1.annotatedFrontMcpPluginsSchema).optional(),
|
|
14
|
-
adapters: zod_1.z.array(schemas_1.annotatedFrontMcpAdaptersSchema).optional(),
|
|
15
|
-
tools: zod_1.z.array(schemas_1.annotatedFrontMcpToolsSchema).optional(),
|
|
16
|
-
resources: zod_1.z.array(schemas_1.annotatedFrontMcpResourcesSchema).optional(),
|
|
17
|
-
prompts: zod_1.z.array(schemas_1.annotatedFrontMcpPromptsSchema).optional(),
|
|
18
|
-
auth: types_1.authOptionsSchema.optional(),
|
|
19
|
-
standalone: zod_1.z.union([zod_1.z.literal('includeInParent'), zod_1.z.boolean()]).optional().default(false),
|
|
20
|
-
}).passthrough();
|
|
21
|
-
exports.frontMcpRemoteAppMetadataSchema = zod_1.z.object({
|
|
22
|
-
id: zod_1.z.string().optional(),
|
|
23
|
-
name: zod_1.z.string().min(1),
|
|
24
|
-
description: zod_1.z.string().optional(),
|
|
25
|
-
urlType: zod_1.z.enum(['worker', 'url']),
|
|
26
|
-
url: zod_1.z.string().url(),
|
|
27
|
-
auth: types_1.authOptionsSchema.optional(),
|
|
28
|
-
standalone: zod_1.z.union([zod_1.z.literal('includeInParent'), zod_1.z.boolean()]).optional().default(false),
|
|
29
|
-
}).passthrough();
|
|
30
|
-
//# sourceMappingURL=app.metadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.metadata.js","sourceRoot":"","sources":["../../../../src/common/metadata/app.metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAAuE;AAUvE,wCAIoB;AA0FP,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,0CAAgC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3E,aAAa,EAAE,OAAC,CAAC,KAAK,CAAC,8CAAoC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACnF,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,wCAA8B,CAAC,CAAC,QAAQ,EAAE;IAC3D,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,yCAA+B,CAAC,CAAC,QAAQ,EAAE;IAC7D,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,sCAA4B,CAAC,CAAC,QAAQ,EAAE;IACvD,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,0CAAgC,CAAC,CAAC,QAAQ,EAAE;IAC/D,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,wCAA8B,CAAC,CAAC,QAAQ,EAAE;IAC3D,IAAI,EAAE,yBAAiB,CAAC,QAAQ,EAAE;IAClC,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACnD,CAAC,CAAC,WAAW,EAAE,CAAC;AAmD5C,QAAA,+BAA+B,GAAG,OAAC,CAAC,MAAM,CAAC;IACtD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAClC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACrB,IAAI,EAAE,yBAAiB,CAAC,QAAQ,EAAE;IAClC,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CAClD,CAAC,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport { RawZodShape, AuthOptions, authOptionsSchema } from '../types';\nimport {\n ProviderType,\n PromptType,\n ResourceType,\n ToolType,\n AuthProviderType,\n PluginType,\n AdapterType,\n} from '../interfaces';\nimport {\n annotatedFrontMcpAdaptersSchema, annotatedFrontMcpAuthProvidersSchema,\n annotatedFrontMcpPluginsSchema, annotatedFrontMcpPromptsSchema,\n annotatedFrontMcpProvidersSchema, annotatedFrontMcpResourcesSchema, annotatedFrontMcpToolsSchema,\n} from '../schemas';\n\n\n/**\n * Declarative metadata describing what a local mcp app contributes at app scope.\n *\n * Includes dependency providers, app-scoped plugins, adapters (that can\n * generate tools/resources/prompts from external definitions), and any\n * inline tools authored in the app. Adapter-generated items inherit the\n * app’s plugins and policies and are tagged with provenance.\n */\nexport interface LocalAppMetadata {\n /**\n * Human-friendly name for this app as shown in UIs, logs, and describe reports.\n * Keep it short, stable, and unique within a gateway (consider prefixes).\n */\n id?: string;\n /**\n * Human-friendly name for this app as shown in UIs, logs, and describe reports.\n * Keep it short, stable, and unique within a gateway (consider prefixes).\n */\n name: string;\n\n /**\n * Optional longer explanation of what the app does and what it exposes.\n * Used for documentation, describe reports, and UIs. Avoid secrets/PII.\n */\n description?: string;\n\n /**\n * Named singleton (or scoped-singleton) dependencies used by tools/plugins at runtime\n * — e.g., config, database pools, Redis clients, queues, KMS.\n *\n * Resolution is hierarchical (tool → app → gateway). Providers may depend on\n * other providers and are usually initialized lazily on first use.\n */\n providers?: ProviderType[];\n\n /**\n * Named singleton / session auth provider to be used by tools/plugins at runtime\n * — e.g., GithubAuthProvider, GoogleAuthProvider, etc.\n *\n * Note: this is different from providers, which are used for calling fetch request\n * with specific auth context headers.\n *\n * Resolution is hierarchical (tool → app → gateway). Providers may depend on\n * other providers and are usually initialized lazily on first use.\n */\n authProviders?: AuthProviderType[];\n\n /**\n * App-scoped plugins that participate in lifecycle events and can contribute\n * additional capabilities (tools, resources, prompts, providers, adapters).\n * Use plugins to enforce policy, auth, PII reduction, tracing, etc.\n */\n plugins?: PluginType[];\n\n /**\n * Adapters attached to this app that convert external definitions or sources\n * (e.g., OpenAPI, Lambda, Custom) into generated tools/resources/prompts.\n * Common options include include/exclude filters, name prefixes, base URLs,\n * and authentication (often provided by plugins).\n */\n adapters?: AdapterType[];\n\n /**\n * Inline tools authored by this app (via builder or class). These are active\n * actions with input/output schemas that the model can call. Tools generated\n * by adapters do not need to be listed here.\n */\n tools?: ToolType[];\n resources?: ResourceType[];\n prompts?: PromptType[];\n\n\n /**\n * Configures the app's default authentication provider.\n * If not provided, the app will use the gateway's default auth provider.\n */\n auth?: AuthOptions;\n\n /**\n * If true, the app will NOT be included and will act as a separated scope.\n * If false, the app will be included in MultiApp frontmcp server.\n * If 'includeInParent', the app will be included in the gateway's\n * standalone app list and will act as a separated scope under the appName prefix\n */\n standalone?: 'includeInParent' | boolean;\n}\n\nexport const frontMcpLocalAppMetadataSchema = z.object({\n id: z.string().optional(),\n name: z.string().min(1),\n description: z.string().optional(),\n providers: z.array(annotatedFrontMcpProvidersSchema).optional().default([]),\n authProviders: z.array(annotatedFrontMcpAuthProvidersSchema).optional().default([]),\n plugins: z.array(annotatedFrontMcpPluginsSchema).optional(),\n adapters: z.array(annotatedFrontMcpAdaptersSchema).optional(),\n tools: z.array(annotatedFrontMcpToolsSchema).optional(),\n resources: z.array(annotatedFrontMcpResourcesSchema).optional(),\n prompts: z.array(annotatedFrontMcpPromptsSchema).optional(),\n auth: authOptionsSchema.optional(),\n standalone: z.union([z.literal('includeInParent'), z.boolean()]).optional().default(false),\n} satisfies RawZodShape<LocalAppMetadata>).passthrough();\n\n\n/**\n * Declarative metadata describing what a remote encapsulated mcp app.\n */\nexport interface RemoteAppMetadata {\n /**\n * Human-friendly name for this app as shown in UIs, logs, and describe reports.\n * Keep it short, stable, and unique within a gateway (consider prefixes).\n */\n id?: string;\n /**\n * Human-friendly name for this app as shown in UIs, logs, and describe reports.\n * Keep it short, stable, and unique within a gateway (consider prefixes).\n */\n name: string;\n\n /**\n * Optional longer explanation of what the app does and what it exposes.\n * Used for documentation, describe reports, and UIs. Avoid secrets/PII.\n */\n description?: string;\n\n /**\n * The type of the remote app.\n * - 'worker': The remote app is a worker file.\n * - 'url': The remote app is a remote URL.\n */\n urlType: 'worker' | 'url';\n /**\n * The URL of the remote app. This can be a local worker file or a remote URL.\n */\n url: string;\n\n /**\n * Configures the app's default authentication provider.\n * If not provided, the app will use the gateway's default auth provider.\n */\n auth?: AuthOptions;\n\n /**\n * If true, the app will NOT be included and will act as a separated scope.\n * If false, the app will be included in MultiApp frontmcp server.\n * If 'includeInParent', the app will be included in the gateway's\n * standalone app list and will act as a separated scope under the appName prefix\n */\n standalone: 'includeInParent' | boolean;\n\n}\n\nexport const frontMcpRemoteAppMetadataSchema = z.object({\n id: z.string().optional(),\n name: z.string().min(1),\n description: z.string().optional(),\n urlType: z.enum(['worker', 'url']),\n url: z.string().url(),\n auth: authOptionsSchema.optional(),\n standalone: z.union([z.literal('includeInParent'), z.boolean()]).optional().default(false),\n} satisfies RawZodShape<RemoteAppMetadata>).passthrough();\n\n\nexport type AppMetadata = LocalAppMetadata | RemoteAppMetadata;\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.frontMcpAuthProviderMetadataSchema = exports.AuthProviderScope = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
/**
|
|
6
|
-
* Provider lifetime scope semantics.
|
|
7
|
-
*/
|
|
8
|
-
var AuthProviderScope;
|
|
9
|
-
(function (AuthProviderScope) {
|
|
10
|
-
AuthProviderScope["GLOBAL"] = "global";
|
|
11
|
-
AuthProviderScope["SESSION"] = "session";
|
|
12
|
-
})(AuthProviderScope || (exports.AuthProviderScope = AuthProviderScope = {}));
|
|
13
|
-
exports.frontMcpAuthProviderMetadataSchema = zod_1.z.object({
|
|
14
|
-
id: zod_1.z.string().optional(),
|
|
15
|
-
name: zod_1.z.string().min(1),
|
|
16
|
-
description: zod_1.z.string().optional(),
|
|
17
|
-
scope: zod_1.z.nativeEnum(AuthProviderScope).optional().default(AuthProviderScope.GLOBAL),
|
|
18
|
-
}).passthrough();
|
|
19
|
-
//# sourceMappingURL=auth-provider.metadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth-provider.metadata.js","sourceRoot":"","sources":["../../../../src/common/metadata/auth-provider.metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAaxB;;GAEG;AACH,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;AACrB,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAEY,QAAA,kCAAkC,GAAG,OAAC,CAAC,MAAM,CAAC;IACzD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,KAAK,EAAE,OAAC,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC;CACxC,CAAC,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport { RawZodShape } from '../types';\n\n/**\n * Declarative metadata describing what a FrontMcpProvider contributes at app scope.\n */\nexport interface AuthProviderMetadata {\n id?: string;\n name: string;\n description?: string;\n scope?: AuthProviderScope;\n}\n\n/**\n * Provider lifetime scope semantics.\n */\nexport enum AuthProviderScope {\n GLOBAL = 'global',\n SESSION = 'session',\n}\n\nexport const frontMcpAuthProviderMetadataSchema = z.object({\n id: z.string().optional(),\n name: z.string().min(1),\n description: z.string().optional(),\n scope: z.nativeEnum(AuthProviderScope).optional().default(AuthProviderScope.GLOBAL),\n} satisfies RawZodShape<AuthProviderMetadata>).passthrough();\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.frontMcpFlowMetadataSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.frontMcpFlowMetadataSchema = zod_1.z.object({
|
|
6
|
-
name: zod_1.z.string().min(1),
|
|
7
|
-
description: zod_1.z.string().optional(),
|
|
8
|
-
access: zod_1.z.enum(['public', 'authorized']).optional().default('public'),
|
|
9
|
-
inputSchema: zod_1.z.instanceof(Object),
|
|
10
|
-
outputSchema: zod_1.z.instanceof(Object).optional(),
|
|
11
|
-
plan: zod_1.z.instanceof(Object),
|
|
12
|
-
dependsOn: zod_1.z.array(zod_1.z.any()).optional(),
|
|
13
|
-
middleware: zod_1.z.instanceof(Object).optional(),
|
|
14
|
-
}).passthrough();
|
|
15
|
-
//# sourceMappingURL=flow.metadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flow.metadata.js","sourceRoot":"","sources":["../../../../src/common/metadata/flow.metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AA4DT,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC;IACrE,WAAW,EAAE,OAAC,CAAC,UAAU,CAAC,MAAM,CAAC;IACjC,YAAY,EAAE,OAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;IAC7C,IAAI,EAAE,OAAC,CAAC,UAAU,CAAC,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtC,UAAU,EAAE,OAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;CACD,CAAC,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import {z} from 'zod';\nimport {RawZodShape} from '../types';\nimport {HttpMethod, ServerRequest, Token} from '../interfaces';\nimport {ScopeEntry} from '../entries';\n\ndeclare module '@frontmcp/sdk' {\n // eslint-disable-next-line\n export interface ExtendFlows {\n\n }\n}\n\nexport type FlowName = keyof ExtendFlows;\n\nexport type CanActivateFlow = (request: ServerRequest, scope: ScopeEntry) => Promise<boolean>;\n\nexport interface FlowMiddlewareOptions {\n path?: RegExp | string; // string can be \"/test/**\" or \"/test/*/asds\", default to all paths\n method?: HttpMethod; // default to all methods\n canActivate?: CanActivateFlow[];\n}\n\nexport type FlowRunOptions<Ctx, Plan extends FlowPlan<string>, Input, Output extends (z.ZodObject<any> | z.ZodUnion<any> | z.ZodDiscriminatedUnion<any, any>), State extends z.ZodObject<any>> = {\n ctx: Ctx;\n plan: Plan;\n input: Input;\n output: Output;\n state: State;\n stage: StagesFromPlan<Plan>;\n executeStage: ExecuteStagesFromPlan<Plan>;\n}\n\n/**\n * Declarative metadata describing what a FrontMcpFlow contributes at app scope.\n */\nexport interface FlowMetadata<Name extends FlowName> {\n name: Name;\n description?: string;\n plan: FlowPlan<ExtendFlows[Name]['stage']>;\n inputSchema: ExtendFlows[Name]['input'];\n outputSchema: ExtendFlows[Name]['output'];\n access: 'public' | 'authorized';\n dependsOn?: Token[];\n middleware?: FlowMiddlewareOptions;\n}\n\n\nexport type StepInfo = string | { title?: string; description?: string; };\nexport type FlowPhase = 'pre' | 'execute' | 'post' | 'finalize' | 'error';\ntype Values<T> = T[keyof T];\ntype ArrayElem<T> = T extends ReadonlyArray<infer U> ? U : never;\n\nexport type StagesFromPlan<P extends FlowPlan<string>> = ArrayElem<Values<Required<P>>>;\nexport type ExecuteStagesFromPlan<P extends FlowPlan<string>> = ArrayElem<Required<P['execute']>>;\n\nexport type FlowPlan<Base extends string> = {\n steps?: Record<Base, StepInfo>;\n} & Partial<Record<FlowPhase, Base[]>>;\n\n\nexport const frontMcpFlowMetadataSchema = z.object({\n name: z.string().min(1),\n description: z.string().optional(),\n access: z.enum(['public', 'authorized']).optional().default('public'),\n inputSchema: z.instanceof(Object),\n outputSchema: z.instanceof(Object).optional(),\n plan: z.instanceof(Object),\n dependsOn: z.array(z.any()).optional(),\n middleware: z.instanceof(Object).optional(),\n} satisfies RawZodShape<FlowMetadata<never>>).passthrough();\n"]}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.frontMcpMetadataSchema = exports.frontMcpBaseSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
const schemas_1 = require("../schemas");
|
|
7
|
-
exports.frontMcpBaseSchema = zod_1.z.object({
|
|
8
|
-
info: types_1.serverInfoOptionsSchema,
|
|
9
|
-
providers: zod_1.z.array(schemas_1.annotatedFrontMcpProvidersSchema).optional().default([]),
|
|
10
|
-
tools: zod_1.z.array(schemas_1.annotatedFrontMcpToolsSchema).optional().default([]),
|
|
11
|
-
resources: zod_1.z.array(schemas_1.annotatedFrontMcpResourcesSchema).optional().default([]),
|
|
12
|
-
apps: zod_1.z.array(schemas_1.annotatedFrontMcpAppSchema),
|
|
13
|
-
serve: zod_1.z.boolean().optional().default(true),
|
|
14
|
-
http: types_1.httpOptionsSchema.optional(),
|
|
15
|
-
redis: types_1.redisOptionsSchema.optional(),
|
|
16
|
-
transport: types_1.transportOptionsSchema.optional().transform((val) => val ?? types_1.transportOptionsSchema.parse({})),
|
|
17
|
-
session: types_1.sessionOptionsSchema.optional(), // @deprecated - kept for backward compatibility
|
|
18
|
-
logging: types_1.loggingOptionsSchema.optional(),
|
|
19
|
-
});
|
|
20
|
-
const frontMcpMultiAppSchema = exports.frontMcpBaseSchema.extend({
|
|
21
|
-
splitByApp: zod_1.z.literal(false).default(false).describe('If true, each app gets its own scope & basePath.'),
|
|
22
|
-
auth: types_1.authOptionsSchema.optional().describe("Configures the server's default authentication provider."),
|
|
23
|
-
});
|
|
24
|
-
const frontMcpSplitByAppSchema = exports.frontMcpBaseSchema.extend({
|
|
25
|
-
splitByApp: zod_1.z.literal(true).describe('If false, apps are grouped under the same scope & basePath.'),
|
|
26
|
-
auth: zod_1.z.never().optional(),
|
|
27
|
-
});
|
|
28
|
-
exports.frontMcpMetadataSchema = frontMcpMultiAppSchema.or(frontMcpSplitByAppSchema);
|
|
29
|
-
//# sourceMappingURL=front-mcp.metadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"front-mcp.metadata.js","sourceRoot":"","sources":["../../../../src/common/metadata/front-mcp.metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAiBkB;AAClB,wCAKoB;AA+CP,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,+BAAuB;IAC7B,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,0CAAgC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3E,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,sCAA4B,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACnE,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,0CAAgC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3E,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,oCAA0B,CAAC;IACzC,KAAK,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3C,IAAI,EAAE,yBAAiB,CAAC,QAAQ,EAAE;IAClC,KAAK,EAAE,0BAAkB,CAAC,QAAQ,EAAE;IACpC,SAAS,EAAE,8BAAsB,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,8BAAsB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACxG,OAAO,EAAE,4BAAoB,CAAC,QAAQ,EAAE,EAAE,gDAAgD;IAC1F,OAAO,EAAE,4BAAoB,CAAC,QAAQ,EAAE;CACG,CAAC,CAAC;AAO/C,MAAM,sBAAsB,GAAG,0BAAkB,CAAC,MAAM,CAAC;IACvD,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,kDAAkD,CAAC;IACxG,IAAI,EAAE,yBAAiB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;CAClC,CAAC,CAAC;AAOzE,MAAM,wBAAwB,GAAG,0BAAkB,CAAC,MAAM,CAAC;IACzD,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,6DAA6D,CAAC;IACnG,IAAI,EAAE,OAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;CAC6C,CAAC,CAAC;AAI9D,QAAA,sBAAsB,GAAG,sBAAsB,CAAC,EAAE,CAAC,wBAAwB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n AuthOptions,\n authOptionsSchema,\n SessionOptions,\n sessionOptionsSchema,\n ServerInfoOptions,\n serverInfoOptionsSchema,\n HttpOptions,\n httpOptionsSchema,\n LoggingOptions,\n loggingOptionsSchema,\n RawZodShape,\n AuthOptionsInput,\n RedisOptionsInput,\n redisOptionsSchema,\n TransportOptionsInput,\n transportOptionsSchema,\n} from '../types';\nimport {\n annotatedFrontMcpAppSchema,\n annotatedFrontMcpProvidersSchema,\n annotatedFrontMcpResourcesSchema,\n annotatedFrontMcpToolsSchema,\n} from '../schemas';\nimport { AppType, ProviderType, ResourceType, ToolType } from '../interfaces';\n\nexport interface FrontMcpBaseMetadata {\n info: ServerInfoOptions;\n apps: AppType[];\n http?: HttpOptions;\n logging?: LoggingOptions;\n\n serve?: boolean; // default to true\n\n /**\n * Shared Redis configuration\n * Used by transport persistence and auth token storage\n */\n redis?: RedisOptionsInput;\n\n /**\n * Transport and session lifecycle configuration\n * Controls transport protocols, session management, and persistence\n * @default {} (all transport options use their schema defaults)\n */\n transport?: TransportOptionsInput; // Optional in input, but always defined in output\n\n /**\n * @deprecated Use `transport` instead. Session config has been merged into transport.\n */\n session?: SessionOptions;\n\n /**\n * Additional providers that are available to all apps.\n */\n providers?: ProviderType[];\n\n /**\n * Shared tools that are available to all apps.\n * These are merged (additively) with app-specific tools.\n */\n tools?: ToolType[];\n\n /**\n * Shared resources that are available to all apps.\n * These are merged (additively) with app-specific resources.\n */\n resources?: ResourceType[];\n}\n\nexport const frontMcpBaseSchema = z.object({\n info: serverInfoOptionsSchema,\n providers: z.array(annotatedFrontMcpProvidersSchema).optional().default([]),\n tools: z.array(annotatedFrontMcpToolsSchema).optional().default([]),\n resources: z.array(annotatedFrontMcpResourcesSchema).optional().default([]),\n apps: z.array(annotatedFrontMcpAppSchema),\n serve: z.boolean().optional().default(true),\n http: httpOptionsSchema.optional(),\n redis: redisOptionsSchema.optional(),\n transport: transportOptionsSchema.optional().transform((val) => val ?? transportOptionsSchema.parse({})),\n session: sessionOptionsSchema.optional(), // @deprecated - kept for backward compatibility\n logging: loggingOptionsSchema.optional(),\n} satisfies RawZodShape<FrontMcpBaseMetadata>);\n\nexport interface FrontMcpMultiAppMetadata extends FrontMcpBaseMetadata {\n splitByApp?: false;\n auth?: AuthOptionsInput;\n}\n\nconst frontMcpMultiAppSchema = frontMcpBaseSchema.extend({\n splitByApp: z.literal(false).default(false).describe('If true, each app gets its own scope & basePath.'),\n auth: authOptionsSchema.optional().describe(\"Configures the server's default authentication provider.\"),\n} satisfies RawZodShape<FrontMcpMultiAppMetadata, FrontMcpBaseMetadata>);\n\nexport interface FrontMcpSplitByAppMetadata extends FrontMcpBaseMetadata {\n splitByApp: true;\n auth?: never;\n}\n\nconst frontMcpSplitByAppSchema = frontMcpBaseSchema.extend({\n splitByApp: z.literal(true).describe('If false, apps are grouped under the same scope & basePath.'),\n auth: z.never().optional(),\n} satisfies RawZodShape<FrontMcpSplitByAppMetadata, FrontMcpBaseMetadata>);\n\nexport type FrontMcpMetadata = FrontMcpMultiAppMetadata | FrontMcpSplitByAppMetadata;\n\nexport const frontMcpMetadataSchema = frontMcpMultiAppSchema.or(frontMcpSplitByAppSchema);\n\nexport type FrontMcpMultiAppConfig = z.infer<typeof frontMcpMultiAppSchema>;\nexport type FrontMcpSplitByAppConfig = z.infer<typeof frontMcpSplitByAppSchema>;\n\nexport type FrontMcpConfigType = z.infer<typeof frontMcpMetadataSchema>;\n\nexport interface AppScopeMetadata extends Omit<FrontMcpSplitByAppMetadata, 'auth' | 'splitByApp'> {\n id: string;\n apps: [AppType];\n auth?: AuthOptions;\n}\n\nexport interface MultiAppScopeMetadata extends FrontMcpMultiAppMetadata {\n id: string;\n apps: AppType[];\n}\n\nexport type ScopeMetadata = AppScopeMetadata | MultiAppScopeMetadata;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hook.metadata.js","sourceRoot":"","sources":["../../../../src/common/metadata/hook.metadata.ts"],"names":[],"mappings":"","sourcesContent":["import { Token } from '../interfaces';\nimport { FlowName } from './flow.metadata';\nimport { EntryOwnerRef } from '../entries/base.entry';\n\nexport type HookStageType = 'stage' | 'will' | 'did' | 'around';\nexport type HookPriority = number;\n\nexport interface HookOptions<Ctx> {\n priority?: HookPriority;\n filter?: (ctx: Ctx) => boolean | Promise<boolean>;\n}\n\nexport interface TokenHookMetadata {\n hooks: HookMetadata[];\n}\n\nexport interface HookMetadata<Name extends FlowName = FlowName, Stage = string, Ctx = any> extends HookOptions<Ctx> {\n type: HookStageType;\n flow: Name;\n stage: Stage;\n target: Token | null; // null for TC39 decorators until resolved at execution time\n method: string;\n static?: boolean;\n owner?: EntryOwnerRef;\n}\n"]}
|