@frontmcp/sdk 1.11.2 → 1.12.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/agent/adapters/anthropic.adapter.d.ts +4 -4
- package/agent/adapters/anthropic.adapter.d.ts.map +1 -1
- package/agent/adapters/base.adapter.d.ts +12 -2
- package/agent/adapters/base.adapter.d.ts.map +1 -1
- package/agent/adapters/index.d.ts +1 -1
- package/agent/adapters/index.d.ts.map +1 -1
- package/agent/adapters/openai.adapter.d.ts +7 -7
- package/agent/adapters/openai.adapter.d.ts.map +1 -1
- package/agent/agent-execution-loop.d.ts +27 -14
- package/agent/agent-execution-loop.d.ts.map +1 -1
- package/agent/agent.registry.d.ts +9 -0
- package/agent/agent.registry.d.ts.map +1 -1
- package/agent/flows/call-agent.flow.d.ts.map +1 -1
- package/answer/answer-meter.d.ts +2 -0
- package/answer/answer-meter.d.ts.map +1 -1
- package/app/instances/app.esm.instance.d.ts +29 -5
- package/app/instances/app.esm.instance.d.ts.map +1 -1
- package/app/instances/app.lazy.instance.d.ts.map +1 -1
- package/app/instances/app.remote.instance.d.ts.map +1 -1
- package/app/instances/esm-normalize.utils.d.ts +3 -1
- package/app/instances/esm-normalize.utils.d.ts.map +1 -1
- package/app/instances/esm-package-version.d.ts +48 -0
- package/app/instances/esm-package-version.d.ts.map +1 -0
- package/app/lazy/lazy-app.rules.d.ts +4 -0
- package/app/lazy/lazy-app.rules.d.ts.map +1 -1
- package/auth/auth-ui/auth-ui.contract.d.ts +27 -0
- package/auth/auth-ui/auth-ui.contract.d.ts.map +1 -1
- package/auth/auth-ui/auth-ui.state.d.ts +2 -1
- package/auth/auth-ui/auth-ui.state.d.ts.map +1 -1
- package/auth/auth-ui/index.d.ts +1 -1
- package/auth/auth-ui/index.d.ts.map +1 -1
- package/auth/authorization/orchestrated.context-extension.d.ts +1 -1
- package/auth/authorization/orchestrated.context-extension.d.ts.map +1 -1
- package/auth/authorized-apps.utils.d.ts +22 -0
- package/auth/authorized-apps.utils.d.ts.map +1 -1
- package/auth/federated-steps.d.ts +66 -0
- package/auth/federated-steps.d.ts.map +1 -0
- package/auth/flows/oauth.authorize.flow.d.ts +2 -2
- package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts +17 -6
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.provider-callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.register.flow.d.ts +1 -1
- package/auth/flows/oauth.register.flow.d.ts.map +1 -1
- package/auth/flows/oauth.token.flow.d.ts +9 -0
- package/auth/flows/oauth.token.flow.d.ts.map +1 -1
- package/auth/flows/oauth.userinfo.flow.d.ts +1 -1
- package/auth/flows/well-known.oauth-authorization-server.flow.d.ts +3 -0
- package/auth/flows/well-known.oauth-authorization-server.flow.d.ts.map +1 -1
- package/auth/flows/well-known.prm.flow.d.ts.map +1 -1
- package/auth/instances/instance.local-primary-auth.d.ts +38 -7
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/auth/required-providers.utils.d.ts +19 -0
- package/auth/required-providers.utils.d.ts.map +1 -0
- package/browser/agent/adapters/anthropic.adapter.mjs +14 -10
- package/browser/agent/adapters/base.adapter.mjs +10 -3
- package/browser/agent/adapters/openai.adapter.mjs +39 -25
- package/browser/agent/agent-execution-loop.mjs +102 -70
- package/browser/agent/agent.registry.mjs +56 -20
- package/browser/agent/flows/call-agent.flow.mjs +2 -1
- package/browser/agent/index.mjs +1 -1
- package/browser/answer/answer-meter.mjs +1 -0
- package/browser/app/instances/app.esm.instance.mjs +128 -154
- package/browser/app/instances/app.lazy.instance.mjs +7 -3
- package/browser/app/instances/app.remote.instance.mjs +3 -4
- package/browser/app/instances/esm-normalize.utils.mjs +10 -5
- package/browser/app/instances/esm-package-version.mjs +118 -0
- package/browser/app/lazy/lazy-app.rules.mjs +4 -1
- package/browser/auth/auth-ui/auth-ui.state.mjs +1 -1
- package/browser/auth/authorization/orchestrated.context-extension.mjs +2 -2
- package/browser/auth/authorized-apps.utils.mjs +24 -2
- package/browser/auth/federated-steps.mjs +199 -0
- package/browser/auth/flows/oauth.authorize.flow.mjs +61 -76
- package/browser/auth/flows/oauth.callback.flow.mjs +112 -42
- package/browser/auth/flows/oauth.provider-callback.flow.mjs +14 -2
- package/browser/auth/flows/oauth.register.flow.mjs +3 -3
- package/browser/auth/flows/oauth.token.flow.mjs +33 -3
- package/browser/auth/flows/session.verify.flow.mjs +1 -1
- package/browser/auth/flows/well-known.oauth-authorization-server.flow.mjs +11 -6
- package/browser/auth/flows/well-known.prm.flow.mjs +2 -1
- package/browser/auth/instances/instance.local-primary-auth.mjs +131 -37
- package/browser/auth/required-providers.utils.mjs +16 -0
- package/browser/channel/channel-notification.service.mjs +20 -8
- package/browser/channel/channel-scope.helper.mjs +2 -2
- package/browser/channel/channel.instance.mjs +10 -1
- package/browser/channel/channel.utils.mjs +22 -1
- package/browser/channel/flows/send-channel-notification.flow.mjs +1 -1
- package/browser/channel/sources/app-event.source.mjs +5 -2
- package/browser/channel/sources/file-watcher.source.mjs +66 -0
- package/browser/common/decorators/duty.decorator.mjs +3 -4
- package/browser/common/decorators/event.decorator.mjs +49 -0
- package/browser/common/decorators/index.mjs +2 -0
- package/browser/common/decorators/worker.decorator.mjs +23 -0
- package/browser/common/entries/event.entry.mjs +59 -0
- package/browser/common/entries/index.mjs +1 -0
- package/browser/common/entries/tool.entry.mjs +21 -4
- package/browser/common/index.mjs +8 -8
- package/browser/common/interfaces/agent.interface.mjs +25 -4
- package/browser/common/interfaces/event.interface.mjs +17 -0
- package/browser/common/interfaces/execution-context.interface.mjs +8 -0
- package/browser/common/interfaces/index.mjs +2 -0
- package/browser/common/interfaces/tool.interface.mjs +31 -5
- package/browser/common/interfaces/worker.interface.mjs +0 -0
- package/browser/common/metadata/app.metadata.mjs +10 -2
- package/browser/common/metadata/duty.metadata.mjs +28 -13
- package/browser/common/metadata/duty.resolved.mjs +13 -0
- package/browser/common/metadata/event.metadata.mjs +137 -0
- package/browser/common/metadata/front-mcp.metadata.mjs +3 -0
- package/browser/common/metadata/index.mjs +6 -2
- package/browser/common/metadata/output-policy.mjs +4 -0
- package/browser/common/metadata/worker.metadata.mjs +44 -0
- package/browser/common/metadata/worker.resolved.mjs +13 -0
- package/browser/common/metadata/workflow.metadata.mjs +10 -2
- package/browser/common/records/event.record.mjs +9 -0
- package/browser/common/records/index.mjs +1 -0
- package/browser/common/schemas/annotated-class.schema.mjs +10 -0
- package/browser/common/schemas/index.mjs +1 -1
- package/browser/common/tokens/app.tokens.mjs +1 -0
- package/browser/common/tokens/event.tokens.mjs +11 -0
- package/browser/common/tokens/front-mcp.tokens.mjs +2 -0
- package/browser/common/tokens/index.mjs +1 -0
- package/browser/common/tokens/workflow.tokens.mjs +2 -0
- package/browser/common/types/options/transport/schema.mjs +3 -0
- package/browser/common/utils/auth-info.utils.mjs +1 -2
- package/browser/common/utils/index.mjs +1 -1
- package/browser/common/utils/offset-cursor.utils.mjs +23 -0
- package/browser/common/utils/principal.utils.mjs +25 -1
- package/browser/common/utils/time-zone.utils.mjs +12 -0
- package/browser/context/frontmcp-context-storage.mjs +14 -3
- package/browser/context/frontmcp-context.mjs +24 -2
- package/browser/direct/create.mjs +3 -1
- package/browser/direct/direct-client.mjs +16 -2
- package/browser/direct/direct-events-transport.mjs +47 -0
- package/browser/direct/direct-server.mjs +5 -1
- package/browser/duty/cron-schedule.mjs +62 -0
- package/browser/duty/describe-thrown.mjs +12 -0
- package/browser/duty/duty.lifecycle.mjs +102 -97
- package/browser/duty/duty.runner.mjs +117 -115
- package/browser/duty/lazy-lease-store.mjs +60 -0
- package/browser/duty/lease-holder.mjs +132 -0
- package/browser/duty/lease-store.mjs +125 -0
- package/browser/elicitation/helpers/checked-elicit-answer.mjs +18 -0
- package/browser/elicitation/helpers/elicit.helper.mjs +5 -21
- package/browser/elicitation/questions/question-subject.mjs +8 -2
- package/browser/elicitation/store/elicitation-encryption.mjs +6 -6
- package/browser/elicitation/store/encrypted-elicitation.store.mjs +2 -2
- package/browser/elicitation/store/storage-elicitation.store.mjs +1 -2
- package/browser/errors/auth-internal.errors.mjs +2 -0
- package/browser/errors/duty.errors.mjs +20 -0
- package/browser/errors/event.errors.mjs +128 -0
- package/browser/errors/index.mjs +42 -2
- package/browser/errors/mcp.error.mjs +22 -3
- package/browser/errors/misconfiguration.mjs +2 -0
- package/browser/errors/remote.errors.mjs +1 -1
- package/browser/errors/tool-ui.errors.mjs +22 -0
- package/browser/errors/worker.errors.mjs +14 -0
- package/browser/errors/workflow.errors.mjs +7 -1
- package/browser/esm-loader/esm-cache.mjs +2 -2
- package/browser/esm-loader/esm-entries.mjs +15 -1
- package/browser/esm-loader/esm-manifest.mjs +32 -25
- package/browser/esm-loader/esm-module-loader.mjs +22 -4
- package/browser/esm-loader/factories/esm-context-factories.mjs +3 -3
- package/browser/esm-loader/factories/esm-instance-factories.mjs +7 -3
- package/browser/esm-loader/factories/esm-record-builders.mjs +27 -2
- package/browser/esm-loader/semver.utils.mjs +3 -5
- package/browser/esm-loader/version-poller.mjs +1 -1
- package/browser/esm-loader/version-resolver.mjs +5 -1
- package/browser/event/delivery/event-metrics.mjs +37 -0
- package/browser/event/delivery/event-outbox.mjs +251 -0
- package/browser/event/event-channel.mjs +30 -0
- package/browser/event/event-dialect.mjs +23 -0
- package/browser/event/event-gates.mjs +72 -0
- package/browser/event/event-outbound.mjs +8 -0
- package/browser/event/event-publisher.mjs +55 -0
- package/browser/event/event-reauthorization.mjs +48 -0
- package/browser/event/event-scope.helper.mjs +266 -0
- package/browser/event/event-subscriber.mjs +31 -0
- package/browser/event/event.instance.mjs +44 -0
- package/browser/event/event.registry.mjs +145 -0
- package/browser/event/event.utils.mjs +31 -0
- package/browser/event/flows/event-deliver.flow.mjs +175 -0
- package/browser/event/flows/event-poll.flow.mjs +308 -0
- package/browser/event/flows/event-publish-http.flow.mjs +288 -0
- package/browser/event/flows/event-publish.flow.mjs +371 -0
- package/browser/event/flows/event-stream.flow.mjs +222 -0
- package/browser/event/flows/event-subscribe.flow.mjs +351 -0
- package/browser/event/flows/event-unsubscribe.flow.mjs +120 -0
- package/browser/event/flows/list-events.flow.mjs +145 -0
- package/browser/event/index.mjs +104 -0
- package/browser/event/poll/event-buffer.mjs +77 -0
- package/browser/event/poll/event-poll-leases.mjs +118 -0
- package/browser/event/publish-endpoint/event-publish-endpoint.mjs +75 -0
- package/browser/event/publish-endpoint/event-publish-idempotency.mjs +54 -0
- package/browser/event/replay/event-replays.mjs +298 -0
- package/browser/event/stream/event-stream.mjs +279 -0
- package/browser/event/stream/event-streams.mjs +122 -0
- package/browser/event/subscription/event-callback-verifier.mjs +165 -0
- package/browser/event/subscription/event-subscription-store.factory.mjs +59 -0
- package/browser/event/subscription/event-subscription-termination.mjs +34 -0
- package/browser/event/subscription/event-subscription.store.mjs +167 -0
- package/browser/event/subscription/event-subscriptions.mjs +126 -0
- package/browser/event-client/event-client.errors.mjs +50 -0
- package/browser/event-client/event-webhook-receiver.mjs +155 -0
- package/browser/event-client/events-client.mjs +471 -0
- package/browser/event-client/index.mjs +28 -0
- package/browser/ext-apps/ext-apps.handler.mjs +6 -1
- package/browser/flows/flow.http-path.mjs +5 -1
- package/browser/flows/flow.instance.mjs +42 -9
- package/browser/front-mcp/authorities-rules.check.mjs +15 -1
- package/browser/front-mcp/front-mcp.mjs +23 -8
- package/browser/front-mcp/session-secret.check.mjs +22 -0
- package/browser/http-route/http-route.table.mjs +23 -3
- package/browser/index.cjs +35274 -25258
- package/browser/index.mjs +43 -4
- package/browser/job/execution/job-execution.manager.mjs +58 -21
- package/browser/job/flows/execute-job.flow.mjs +5 -3
- package/browser/job/index.mjs +2 -2
- package/browser/job/job-attempt.mjs +15 -10
- package/browser/job/job-context-providers.mjs +2 -1
- package/browser/job/job-scope.helper.mjs +97 -4
- package/browser/job/job.registry.mjs +30 -0
- package/browser/job/store/memory-job-state.store.mjs +5 -0
- package/browser/job/store/redis-job-state.store.mjs +11 -0
- package/browser/job/store/storage-job-state.store.mjs +18 -2
- package/browser/job/tools/index.mjs +3 -1
- package/browser/job/tools/list-jobs.tool.mjs +7 -5
- package/browser/job/tools/update-job.tool.mjs +75 -0
- package/browser/logger/instances/instance.logger.mjs +31 -6
- package/browser/notification/notification.service.mjs +62 -11
- package/browser/prompt/flows/get-prompt.flow.mjs +3 -3
- package/browser/prompt/flows/prompts-list.flow.mjs +11 -4
- package/browser/provider/create-container.mjs +20 -9
- package/browser/provider/provider.lifecycle.mjs +4 -0
- package/browser/provider/provider.registry.mjs +56 -12
- package/browser/remote-mcp/factories/instance-factories.mjs +4 -4
- package/browser/remote-mcp/factories/record-builders.mjs +5 -0
- package/browser/remote-mcp/mcp-client.service.mjs +113 -68
- package/browser/remote-mcp/mcp-stateless-client.adapter.mjs +2 -2
- package/browser/remote-mcp/remote-entries.mjs +2 -1
- package/browser/remote-mcp/remote-oauth.mjs +102 -0
- package/browser/remote-mcp/remote-request-headers.mjs +42 -12
- package/browser/remote-mcp/resilience/circuit-breaker.mjs +3 -2
- package/browser/resource/flows/read-resource.flow.mjs +6 -4
- package/browser/resource/flows/resource-templates-list.flow.mjs +24 -9
- package/browser/resource/flows/resources-list.flow.mjs +11 -4
- package/browser/scope/event-publisher.providers.mjs +32 -0
- package/browser/scope/flows/http.request.flow.mjs +1 -1
- package/browser/scope/observability-scope.helper.mjs +6 -1
- package/browser/scope/scope.instance.mjs +312 -96
- package/browser/skill/errors/tool-not-allowed.error.mjs +2 -2
- package/browser/skill/flows/filter-skills.flow.mjs +1 -1
- package/browser/skill/flows/load-skill.flow.mjs +27 -15
- package/browser/skill/guards/tool-authorization.guard.mjs +1 -1
- package/browser/skill/hooks/skill-tool.hook.mjs +32 -24
- package/browser/skill/providers/external-skill.provider.mjs +4 -2
- package/browser/skill/session/skill-session-store.interface.mjs +10 -0
- package/browser/skill/session/skill-session.manager.mjs +8 -0
- package/browser/skill/skill-authorities.helper.mjs +9 -3
- package/browser/skill/skill-instructions.helper.mjs +12 -6
- package/browser/skill/skill-scope.helper.mjs +7 -2
- package/browser/skill/skill.registry.mjs +21 -2
- package/browser/subsystems.mjs +9 -2
- package/browser/surface/entry-authorized.mjs +15 -0
- package/browser/tool/flows/call-tool.flow.mjs +59 -13
- package/browser/tool/flows/tools-list.flow.mjs +14 -37
- package/browser/tool/tool.utils.mjs +46 -61
- package/browser/tool/ui/serving-mode-default.mjs +11 -2
- package/browser/tool/ui/template-detection.mjs +1 -1
- package/browser/tool/ui/ui-option-warnings.mjs +1 -28
- package/browser/tool/ui/ui-render.mjs +6 -0
- package/browser/tool/ui/ui-resource.handler.mjs +50 -6
- package/browser/tool/ui/ui-shared.mjs +61 -7
- package/browser/tool/ui/widget-routes.mjs +73 -0
- package/browser/tool/ui/widget-serving.mjs +112 -0
- package/browser/transport/adapters/transport.local.adapter.mjs +9 -2
- package/browser/transport/build-scoped-server-options.mjs +5 -1
- package/browser/transport/flows/handle.mcp-20260728.flow.mjs +77 -4
- package/browser/transport/flows/handle.stateless-http.flow.mjs +1 -2
- package/browser/transport/in-memory-server.mjs +3 -0
- package/browser/transport/mcp-20260728/client/index.mjs +1 -1
- package/browser/transport/mcp-20260728/client/mcp-stateless.client.mjs +2 -1
- package/browser/transport/mcp-20260728/discover.mjs +1 -0
- package/browser/transport/mcp-20260728/event-stream-response.mjs +44 -0
- package/browser/transport/mcp-20260728/index.mjs +3 -2
- package/browser/transport/mcp-20260728/protocol-20260728.constants.mjs +8 -1
- package/browser/transport/mcp-20260728/request-validation.mjs +9 -5
- package/browser/transport/mcp-handlers/events-list-request.handler.mjs +23 -0
- package/browser/transport/mcp-handlers/events-poll-request.handler.mjs +23 -0
- package/browser/transport/mcp-handlers/events-stream-request.handler.mjs +44 -0
- package/browser/transport/mcp-handlers/events-subscribe-request.handler.mjs +23 -0
- package/browser/transport/mcp-handlers/events-unsubscribe-request.handler.mjs +25 -0
- package/browser/transport/mcp-handlers/index.mjs +13 -0
- package/browser/transport/mcp-handlers/initialize-request.handler.mjs +3 -1
- package/browser/transport/stdio-revision-router.mjs +29 -2
- package/browser/transport/web-fetch-handler.mjs +5 -1
- package/browser/utils/abort.utils.mjs +7 -2
- package/browser/utils/content.utils.mjs +1 -1
- package/browser/worker/worker.lifecycle.mjs +199 -0
- package/browser/worker/worker.supervisor.mjs +111 -0
- package/browser/workflow/engine/workflow-step.executor.mjs +1 -1
- package/browser/workflow/engine/workflow.engine.mjs +13 -10
- package/browser/workflow/index.mjs +2 -2
- package/browser/workflow/tools/execute-workflow.tool.mjs +1 -1
- package/browser/workflow/tools/index.mjs +3 -1
- package/browser/workflow/tools/list-workflows.tool.mjs +4 -2
- package/browser/workflow/tools/register-workflow.tool.mjs +11 -2
- package/browser/workflow/tools/update-workflow.tool.mjs +80 -0
- package/browser/workflow/trigger/workflow-events.mjs +41 -0
- package/browser/workflow/trigger/workflow-schedules.mjs +173 -0
- package/browser/workflow/trigger/workflow-triggers.mjs +111 -0
- package/browser/workflow/trigger/workflow-webhook.routes.mjs +104 -0
- package/browser/workflow/trigger/workflow-webhook.signature.mjs +59 -0
- package/browser/workflow/workflow.registry.mjs +27 -0
- package/browser/workflow/workflow.utils.mjs +13 -2
- package/builtin/authorities/authorities.plugin.d.ts +1 -1
- package/builtin/authorities/authorities.plugin.d.ts.map +1 -1
- package/builtin/authorities/authorities.plugin.options.d.ts +1 -1
- package/builtin/authorities/authorities.plugin.options.d.ts.map +1 -1
- package/builtin/config/config-resolver.d.ts.map +1 -1
- package/channel/channel-notification.service.d.ts +5 -2
- package/channel/channel-notification.service.d.ts.map +1 -1
- package/channel/channel-scope.helper.d.ts +6 -1
- package/channel/channel-scope.helper.d.ts.map +1 -1
- package/channel/channel.instance.d.ts +7 -1
- package/channel/channel.instance.d.ts.map +1 -1
- package/channel/channel.types.d.ts +1 -1
- package/channel/channel.types.d.ts.map +1 -1
- package/channel/channel.utils.d.ts +20 -0
- package/channel/channel.utils.d.ts.map +1 -1
- package/channel/sources/agent-completion.source.d.ts +1 -1
- package/channel/sources/agent-completion.source.d.ts.map +1 -1
- package/channel/sources/app-event.source.d.ts +11 -2
- package/channel/sources/app-event.source.d.ts.map +1 -1
- package/channel/sources/file-watcher.source.d.ts +21 -0
- package/channel/sources/file-watcher.source.d.ts.map +1 -0
- package/channel/sources/index.d.ts +1 -0
- package/channel/sources/index.d.ts.map +1 -1
- package/common/decorators/app.decorator.d.ts +1 -1
- package/common/decorators/app.decorator.d.ts.map +1 -1
- package/common/decorators/duty.decorator.d.ts +3 -2
- package/common/decorators/duty.decorator.d.ts.map +1 -1
- package/common/decorators/event.decorator.d.ts +38 -0
- package/common/decorators/event.decorator.d.ts.map +1 -0
- package/common/decorators/index.d.ts +2 -0
- package/common/decorators/index.d.ts.map +1 -1
- package/common/decorators/worker.decorator.d.ts +13 -0
- package/common/decorators/worker.decorator.d.ts.map +1 -0
- package/common/entries/event.entry.d.ts +34 -0
- package/common/entries/event.entry.d.ts.map +1 -0
- package/common/entries/index.d.ts +1 -0
- package/common/entries/index.d.ts.map +1 -1
- package/common/entries/provider.entry.d.ts +2 -2
- package/common/entries/provider.entry.d.ts.map +1 -1
- package/common/entries/scope.entry.d.ts +28 -3
- package/common/entries/scope.entry.d.ts.map +1 -1
- package/common/entries/tool.entry.d.ts +5 -3
- package/common/entries/tool.entry.d.ts.map +1 -1
- package/common/interfaces/agent.interface.d.ts +4 -2
- package/common/interfaces/agent.interface.d.ts.map +1 -1
- package/common/interfaces/event.interface.d.ts +124 -0
- package/common/interfaces/event.interface.d.ts.map +1 -0
- package/common/interfaces/execution-context.interface.d.ts +3 -0
- package/common/interfaces/execution-context.interface.d.ts.map +1 -1
- package/common/interfaces/index.d.ts +2 -0
- package/common/interfaces/index.d.ts.map +1 -1
- package/common/interfaces/internal/registry.interface.d.ts +3 -1
- package/common/interfaces/internal/registry.interface.d.ts.map +1 -1
- package/common/interfaces/llm-adapter.interface.d.ts +5 -0
- package/common/interfaces/llm-adapter.interface.d.ts.map +1 -1
- package/common/interfaces/logger.interface.d.ts +2 -1
- package/common/interfaces/logger.interface.d.ts.map +1 -1
- package/common/interfaces/tool.interface.d.ts +12 -2
- package/common/interfaces/tool.interface.d.ts.map +1 -1
- package/common/interfaces/worker.interface.d.ts +13 -0
- package/common/interfaces/worker.interface.d.ts.map +1 -0
- package/common/metadata/agent.metadata.d.ts +8 -3
- package/common/metadata/agent.metadata.d.ts.map +1 -1
- package/common/metadata/app.metadata.d.ts +39 -12
- package/common/metadata/app.metadata.d.ts.map +1 -1
- package/common/metadata/channel.metadata.d.ts +40 -8
- package/common/metadata/channel.metadata.d.ts.map +1 -1
- package/common/metadata/duty.metadata.d.ts +67 -13
- package/common/metadata/duty.metadata.d.ts.map +1 -1
- package/common/metadata/duty.resolved.d.ts +4 -0
- package/common/metadata/duty.resolved.d.ts.map +1 -0
- package/common/metadata/event.metadata.d.ts +451 -0
- package/common/metadata/event.metadata.d.ts.map +1 -0
- package/common/metadata/flow.metadata.d.ts +14 -0
- package/common/metadata/flow.metadata.d.ts.map +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +1654 -17
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/metadata/index.d.ts +4 -0
- package/common/metadata/index.d.ts.map +1 -1
- package/common/metadata/job.metadata.d.ts +12 -1
- package/common/metadata/job.metadata.d.ts.map +1 -1
- package/common/metadata/output-policy.d.ts +2 -0
- package/common/metadata/output-policy.d.ts.map +1 -1
- package/common/metadata/prompt.metadata.d.ts +1 -1
- package/common/metadata/remote-primitive.metadata.d.ts +6 -3
- package/common/metadata/remote-primitive.metadata.d.ts.map +1 -1
- package/common/metadata/resource.metadata.d.ts +3 -3
- package/common/metadata/skill.metadata.d.ts +1 -1
- package/common/metadata/tool.metadata.d.ts +1 -1
- package/common/metadata/worker.metadata.d.ts +69 -0
- package/common/metadata/worker.metadata.d.ts.map +1 -0
- package/common/metadata/worker.resolved.d.ts +4 -0
- package/common/metadata/worker.resolved.d.ts.map +1 -0
- package/common/metadata/workflow.metadata.d.ts +80 -16
- package/common/metadata/workflow.metadata.d.ts.map +1 -1
- package/common/records/event.record.d.ts +21 -0
- package/common/records/event.record.d.ts.map +1 -0
- package/common/records/index.d.ts +1 -0
- package/common/records/index.d.ts.map +1 -1
- package/common/schemas/annotated-class.schema.d.ts +1 -0
- package/common/schemas/annotated-class.schema.d.ts.map +1 -1
- package/common/tokens/app.tokens.d.ts.map +1 -1
- package/common/tokens/event.tokens.d.ts +9 -0
- package/common/tokens/event.tokens.d.ts.map +1 -0
- package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
- package/common/tokens/index.d.ts +1 -0
- package/common/tokens/index.d.ts.map +1 -1
- package/common/tokens/workflow.tokens.d.ts +2 -0
- package/common/tokens/workflow.tokens.d.ts.map +1 -1
- package/common/types/options/logging/interfaces.d.ts +3 -1
- package/common/types/options/logging/interfaces.d.ts.map +1 -1
- package/common/types/options/observability/interfaces.d.ts +4 -2
- package/common/types/options/observability/interfaces.d.ts.map +1 -1
- package/common/types/options/transport/interfaces.d.ts +3 -0
- package/common/types/options/transport/interfaces.d.ts.map +1 -1
- package/common/types/options/transport/schema.d.ts.map +1 -1
- package/common/utils/auth-info.utils.d.ts +1 -0
- package/common/utils/auth-info.utils.d.ts.map +1 -1
- package/common/utils/global-config.utils.d.ts.map +1 -1
- package/common/utils/offset-cursor.utils.d.ts +5 -0
- package/common/utils/offset-cursor.utils.d.ts.map +1 -0
- package/common/utils/principal.utils.d.ts +26 -0
- package/common/utils/principal.utils.d.ts.map +1 -1
- package/common/utils/time-zone.utils.d.ts +3 -0
- package/common/utils/time-zone.utils.d.ts.map +1 -0
- package/context/frontmcp-context-storage.d.ts +3 -1
- package/context/frontmcp-context-storage.d.ts.map +1 -1
- package/context/frontmcp-context.d.ts +9 -1
- package/context/frontmcp-context.d.ts.map +1 -1
- package/direct/client.types.d.ts +8 -0
- package/direct/client.types.d.ts.map +1 -1
- package/direct/create.d.ts.map +1 -1
- package/direct/create.types.d.ts +3 -1
- package/direct/create.types.d.ts.map +1 -1
- package/direct/direct-events-transport.d.ts +20 -0
- package/direct/direct-events-transport.d.ts.map +1 -0
- package/direct/direct-server.d.ts +3 -0
- package/direct/direct-server.d.ts.map +1 -1
- package/direct/direct.types.d.ts +6 -0
- package/direct/direct.types.d.ts.map +1 -1
- package/duty/cron-schedule.d.ts +51 -0
- package/duty/cron-schedule.d.ts.map +1 -0
- package/duty/describe-thrown.d.ts +3 -0
- package/duty/describe-thrown.d.ts.map +1 -0
- package/duty/duty.lifecycle.d.ts +33 -4
- package/duty/duty.lifecycle.d.ts.map +1 -1
- package/duty/duty.runner.d.ts +49 -31
- package/duty/duty.runner.d.ts.map +1 -1
- package/duty/lazy-lease-store.d.ts +29 -0
- package/duty/lazy-lease-store.d.ts.map +1 -0
- package/duty/lease-holder.d.ts +73 -0
- package/duty/lease-holder.d.ts.map +1 -0
- package/duty/lease-store.d.ts +40 -0
- package/duty/lease-store.d.ts.map +1 -0
- package/elicitation/helpers/checked-elicit-answer.d.ts +10 -0
- package/elicitation/helpers/checked-elicit-answer.d.ts.map +1 -0
- package/elicitation/helpers/elicit.helper.d.ts.map +1 -1
- package/elicitation/hooks/elicitation.hooks.d.ts +5 -5
- package/elicitation/questions/question-subject.d.ts +8 -3
- package/elicitation/questions/question-subject.d.ts.map +1 -1
- package/elicitation/store/elicitation-encryption.d.ts.map +1 -1
- package/elicitation/store/encrypted-elicitation.store.d.ts +2 -2
- package/elicitation/store/encrypted-elicitation.store.d.ts.map +1 -1
- package/elicitation/store/storage-elicitation.store.d.ts +3 -3
- package/elicitation/store/storage-elicitation.store.d.ts.map +1 -1
- package/errors/auth-internal.errors.d.ts +1 -1
- package/errors/auth-internal.errors.d.ts.map +1 -1
- package/errors/duty.errors.d.ts +10 -0
- package/errors/duty.errors.d.ts.map +1 -1
- package/errors/error-handler.d.ts.map +1 -1
- package/errors/event.errors.d.ts +73 -0
- package/errors/event.errors.d.ts.map +1 -0
- package/errors/index.d.ts +7 -3
- package/errors/index.d.ts.map +1 -1
- package/errors/mcp.error.d.ts +6 -1
- package/errors/mcp.error.d.ts.map +1 -1
- package/errors/misconfiguration.d.ts.map +1 -1
- package/errors/remote.errors.d.ts +1 -1
- package/errors/remote.errors.d.ts.map +1 -1
- package/errors/tool-ui.errors.d.ts +13 -0
- package/errors/tool-ui.errors.d.ts.map +1 -0
- package/errors/worker.errors.d.ts +7 -0
- package/errors/worker.errors.d.ts.map +1 -0
- package/errors/workflow.errors.d.ts +4 -0
- package/errors/workflow.errors.d.ts.map +1 -1
- package/esm/index.mjs +52 -47
- package/esm/job/tools/index.mjs +3 -2
- package/esm/workflow/tools/index.mjs +3 -2
- package/esm-loader/app-helpers.d.ts +4 -4
- package/esm-loader/app-helpers.d.ts.map +1 -1
- package/esm-loader/esm-entries.d.ts +11 -1
- package/esm-loader/esm-entries.d.ts.map +1 -1
- package/esm-loader/esm-manifest.d.ts +11 -8
- package/esm-loader/esm-manifest.d.ts.map +1 -1
- package/esm-loader/esm-module-loader.d.ts +6 -1
- package/esm-loader/esm-module-loader.d.ts.map +1 -1
- package/esm-loader/factories/esm-context-factories.d.ts +6 -3
- package/esm-loader/factories/esm-context-factories.d.ts.map +1 -1
- package/esm-loader/factories/esm-instance-factories.d.ts +3 -3
- package/esm-loader/factories/esm-instance-factories.d.ts.map +1 -1
- package/esm-loader/factories/esm-record-builders.d.ts.map +1 -1
- package/esm-loader/semver.utils.d.ts +8 -0
- package/esm-loader/semver.utils.d.ts.map +1 -1
- package/esm-loader/version-resolver.d.ts.map +1 -1
- package/event/delivery/event-metrics.d.ts +25 -0
- package/event/delivery/event-metrics.d.ts.map +1 -0
- package/event/delivery/event-outbox.d.ts +129 -0
- package/event/delivery/event-outbox.d.ts.map +1 -0
- package/event/event-channel.d.ts +21 -0
- package/event/event-channel.d.ts.map +1 -0
- package/event/event-dialect.d.ts +20 -0
- package/event/event-dialect.d.ts.map +1 -0
- package/event/event-gates.d.ts +23 -0
- package/event/event-gates.d.ts.map +1 -0
- package/event/event-outbound.d.ts +9 -0
- package/event/event-outbound.d.ts.map +1 -0
- package/event/event-publisher.d.ts +14 -0
- package/event/event-publisher.d.ts.map +1 -0
- package/event/event-reauthorization.d.ts +35 -0
- package/event/event-reauthorization.d.ts.map +1 -0
- package/event/event-scope.helper.d.ts +23 -0
- package/event/event-scope.helper.d.ts.map +1 -0
- package/event/event-subscriber.d.ts +12 -0
- package/event/event-subscriber.d.ts.map +1 -0
- package/event/event.instance.d.ts +15 -0
- package/event/event.instance.d.ts.map +1 -0
- package/event/event.registry.d.ts +97 -0
- package/event/event.registry.d.ts.map +1 -0
- package/event/event.utils.d.ts +6 -0
- package/event/event.utils.d.ts.map +1 -0
- package/event/flows/event-deliver.flow.d.ts +73 -0
- package/event/flows/event-deliver.flow.d.ts.map +1 -0
- package/event/flows/event-poll.flow.d.ts +105 -0
- package/event/flows/event-poll.flow.d.ts.map +1 -0
- package/event/flows/event-publish-http.flow.d.ts +114 -0
- package/event/flows/event-publish-http.flow.d.ts.map +1 -0
- package/event/flows/event-publish.flow.d.ts +109 -0
- package/event/flows/event-publish.flow.d.ts.map +1 -0
- package/event/flows/event-stream.flow.d.ts +78 -0
- package/event/flows/event-stream.flow.d.ts.map +1 -0
- package/event/flows/event-subscribe.flow.d.ts +132 -0
- package/event/flows/event-subscribe.flow.d.ts.map +1 -0
- package/event/flows/event-unsubscribe.flow.d.ts +71 -0
- package/event/flows/event-unsubscribe.flow.d.ts.map +1 -0
- package/event/flows/list-events.flow.d.ts +75 -0
- package/event/flows/list-events.flow.d.ts.map +1 -0
- package/event/index.d.ts +46 -0
- package/event/index.d.ts.map +1 -0
- package/event/poll/event-buffer.d.ts +54 -0
- package/event/poll/event-buffer.d.ts.map +1 -0
- package/event/poll/event-poll-leases.d.ts +63 -0
- package/event/poll/event-poll-leases.d.ts.map +1 -0
- package/event/publish-endpoint/event-publish-endpoint.d.ts +29 -0
- package/event/publish-endpoint/event-publish-endpoint.d.ts.map +1 -0
- package/event/publish-endpoint/event-publish-idempotency.d.ts +35 -0
- package/event/publish-endpoint/event-publish-idempotency.d.ts.map +1 -0
- package/event/replay/event-replays.d.ts +116 -0
- package/event/replay/event-replays.d.ts.map +1 -0
- package/event/stream/event-stream.d.ts +116 -0
- package/event/stream/event-stream.d.ts.map +1 -0
- package/event/stream/event-streams.d.ts +52 -0
- package/event/stream/event-streams.d.ts.map +1 -0
- package/event/subscription/event-callback-verifier.d.ts +58 -0
- package/event/subscription/event-callback-verifier.d.ts.map +1 -0
- package/event/subscription/event-subscription-store.factory.d.ts +31 -0
- package/event/subscription/event-subscription-store.factory.d.ts.map +1 -0
- package/event/subscription/event-subscription-termination.d.ts +25 -0
- package/event/subscription/event-subscription-termination.d.ts.map +1 -0
- package/event/subscription/event-subscription.store.d.ts +131 -0
- package/event/subscription/event-subscription.store.d.ts.map +1 -0
- package/event/subscription/event-subscriptions.d.ts +66 -0
- package/event/subscription/event-subscriptions.d.ts.map +1 -0
- package/event-client/event-client.errors.d.ts +35 -0
- package/event-client/event-client.errors.d.ts.map +1 -0
- package/event-client/event-webhook-receiver.d.ts +75 -0
- package/event-client/event-webhook-receiver.d.ts.map +1 -0
- package/event-client/events-client.d.ts +33 -0
- package/event-client/events-client.d.ts.map +1 -0
- package/event-client/events-client.types.d.ts +74 -0
- package/event-client/events-client.types.d.ts.map +1 -0
- package/event-client/index.d.ts +6 -0
- package/event-client/index.d.ts.map +1 -0
- package/ext-apps/ext-apps.handler.d.ts +2 -1
- package/ext-apps/ext-apps.handler.d.ts.map +1 -1
- package/flows/flow.http-path.d.ts +8 -0
- package/flows/flow.http-path.d.ts.map +1 -1
- package/flows/flow.instance.d.ts +9 -0
- package/flows/flow.instance.d.ts.map +1 -1
- package/front-mcp/authorities-rules.check.d.ts +5 -0
- package/front-mcp/authorities-rules.check.d.ts.map +1 -1
- package/front-mcp/front-mcp.d.ts +2 -0
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/front-mcp/session-secret.check.d.ts +19 -0
- package/front-mcp/session-secret.check.d.ts.map +1 -0
- package/http-route/http-route.table.d.ts.map +1 -1
- package/index.d.ts +74 -4
- package/index.d.ts.map +1 -1
- package/index.js +59 -54
- package/job/execution/job-execution.manager.d.ts +16 -4
- package/job/execution/job-execution.manager.d.ts.map +1 -1
- package/job/flows/execute-job.flow.d.ts +1 -0
- package/job/flows/execute-job.flow.d.ts.map +1 -1
- package/job/job-attempt.d.ts +7 -2
- package/job/job-attempt.d.ts.map +1 -1
- package/job/job-context-providers.d.ts +2 -2
- package/job/job-context-providers.d.ts.map +1 -1
- package/job/job-scope.helper.d.ts +26 -0
- package/job/job-scope.helper.d.ts.map +1 -1
- package/job/job.registry.d.ts +11 -0
- package/job/job.registry.d.ts.map +1 -1
- package/job/store/job-state.interface.d.ts +2 -0
- package/job/store/job-state.interface.d.ts.map +1 -1
- package/job/store/memory-job-state.store.d.ts +1 -0
- package/job/store/memory-job-state.store.d.ts.map +1 -1
- package/job/store/redis-job-state.store.d.ts +3 -0
- package/job/store/redis-job-state.store.d.ts.map +1 -1
- package/job/store/storage-job-state.store.d.ts +1 -0
- package/job/store/storage-job-state.store.d.ts.map +1 -1
- package/job/tools/index.d.ts +1 -0
- package/job/tools/index.d.ts.map +1 -1
- package/job/tools/index.js +4 -2
- package/job/tools/list-jobs.tool.d.ts +3 -3
- package/job/tools/list-jobs.tool.d.ts.map +1 -1
- package/job/tools/update-job.tool.d.ts +16 -0
- package/job/tools/update-job.tool.d.ts.map +1 -0
- package/logger/instances/instance.logger.d.ts +1 -0
- package/logger/instances/instance.logger.d.ts.map +1 -1
- package/notification/index.d.ts +1 -1
- package/notification/index.d.ts.map +1 -1
- package/notification/notification.service.d.ts +40 -4
- package/notification/notification.service.d.ts.map +1 -1
- package/package.json +11 -10
- package/prompt/flows/prompts-list.flow.d.ts.map +1 -1
- package/provider/create-container.d.ts +14 -4
- package/provider/create-container.d.ts.map +1 -1
- package/provider/provider.lifecycle.d.ts +11 -1
- package/provider/provider.lifecycle.d.ts.map +1 -1
- package/provider/provider.registry.d.ts +18 -4
- package/provider/provider.registry.d.ts.map +1 -1
- package/remote-mcp/factories/instance-factories.d.ts +4 -4
- package/remote-mcp/factories/instance-factories.d.ts.map +1 -1
- package/remote-mcp/factories/record-builders.d.ts.map +1 -1
- package/remote-mcp/mcp-client.service.d.ts +11 -0
- package/remote-mcp/mcp-client.service.d.ts.map +1 -1
- package/remote-mcp/mcp-client.types.d.ts +15 -2
- package/remote-mcp/mcp-client.types.d.ts.map +1 -1
- package/remote-mcp/mcp-stateless-client.adapter.d.ts +1 -1
- package/remote-mcp/mcp-stateless-client.adapter.d.ts.map +1 -1
- package/remote-mcp/remote-entries.d.ts +2 -1
- package/remote-mcp/remote-entries.d.ts.map +1 -1
- package/remote-mcp/remote-oauth.d.ts +27 -0
- package/remote-mcp/remote-oauth.d.ts.map +1 -0
- package/remote-mcp/remote-request-headers.d.ts +8 -2
- package/remote-mcp/remote-request-headers.d.ts.map +1 -1
- package/remote-mcp/resilience/circuit-breaker.d.ts +3 -2
- package/remote-mcp/resilience/circuit-breaker.d.ts.map +1 -1
- package/resource/flows/read-resource.flow.d.ts.map +1 -1
- package/resource/flows/resource-templates-list.flow.d.ts.map +1 -1
- package/resource/flows/resources-list.flow.d.ts.map +1 -1
- package/scope/event-publisher.providers.d.ts +17 -0
- package/scope/event-publisher.providers.d.ts.map +1 -0
- package/scope/observability-scope.helper.d.ts.map +1 -1
- package/scope/scope.instance.d.ts +41 -2
- package/scope/scope.instance.d.ts.map +1 -1
- package/shared/shared-attach.d.ts +3 -1
- package/shared/shared-attach.d.ts.map +1 -1
- package/shared/shared-server.lifecycle.d.ts +14 -5
- package/shared/shared-server.lifecycle.d.ts.map +1 -1
- package/skill/errors/tool-not-allowed.error.d.ts.map +1 -1
- package/skill/flows/load-skill.flow.d.ts.map +1 -1
- package/skill/guards/tool-authorization.guard.d.ts +1 -1
- package/skill/guards/tool-authorization.guard.d.ts.map +1 -1
- package/skill/hooks/skill-tool.hook.d.ts +2 -0
- package/skill/hooks/skill-tool.hook.d.ts.map +1 -1
- package/skill/providers/external-skill.provider.d.ts +2 -2
- package/skill/providers/external-skill.provider.d.ts.map +1 -1
- package/skill/session/skill-session-store.interface.d.ts +5 -0
- package/skill/session/skill-session-store.interface.d.ts.map +1 -1
- package/skill/session/skill-session.manager.d.ts +4 -0
- package/skill/session/skill-session.manager.d.ts.map +1 -1
- package/skill/session/skill-session.types.d.ts +1 -1
- package/skill/skill-authorities.helper.d.ts +6 -3
- package/skill/skill-authorities.helper.d.ts.map +1 -1
- package/skill/skill-instructions.helper.d.ts +10 -4
- package/skill/skill-instructions.helper.d.ts.map +1 -1
- package/skill/skill-scope.helper.d.ts +5 -0
- package/skill/skill-scope.helper.d.ts.map +1 -1
- package/skill/skill.registry.d.ts +7 -0
- package/skill/skill.registry.d.ts.map +1 -1
- package/subsystems.d.ts +3 -2
- package/subsystems.d.ts.map +1 -1
- package/surface/entry-authorized.d.ts +5 -0
- package/surface/entry-authorized.d.ts.map +1 -0
- package/tool/flows/call-tool.flow.d.ts +6 -0
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tools-list.flow.d.ts +1 -12
- package/tool/flows/tools-list.flow.d.ts.map +1 -1
- package/tool/tool.utils.d.ts.map +1 -1
- package/tool/ui/serving-mode-default.d.ts +6 -2
- package/tool/ui/serving-mode-default.d.ts.map +1 -1
- package/tool/ui/ui-option-warnings.d.ts.map +1 -1
- package/tool/ui/ui-render.d.ts +2 -2
- package/tool/ui/ui-render.d.ts.map +1 -1
- package/tool/ui/ui-resource.handler.d.ts +10 -2
- package/tool/ui/ui-resource.handler.d.ts.map +1 -1
- package/tool/ui/ui-shared.d.ts +31 -5
- package/tool/ui/ui-shared.d.ts.map +1 -1
- package/tool/ui/widget-routes.d.ts +38 -0
- package/tool/ui/widget-routes.d.ts.map +1 -0
- package/tool/ui/widget-serving.d.ts +37 -0
- package/tool/ui/widget-serving.d.ts.map +1 -0
- package/transport/adapters/transport.local.adapter.d.ts.map +1 -1
- package/transport/build-scoped-server-options.d.ts.map +1 -1
- package/transport/flows/handle.mcp-20260728.flow.d.ts +8 -2
- package/transport/flows/handle.mcp-20260728.flow.d.ts.map +1 -1
- package/transport/in-memory-server.d.ts.map +1 -1
- package/transport/mcp-20260728/client/mcp-stateless.client.d.ts +2 -0
- package/transport/mcp-20260728/client/mcp-stateless.client.d.ts.map +1 -1
- package/transport/mcp-20260728/discover.d.ts.map +1 -1
- package/transport/mcp-20260728/event-stream-response.d.ts +12 -0
- package/transport/mcp-20260728/event-stream-response.d.ts.map +1 -0
- package/transport/mcp-20260728/index.d.ts +1 -0
- package/transport/mcp-20260728/index.d.ts.map +1 -1
- package/transport/mcp-20260728/protocol-20260728.constants.d.ts.map +1 -1
- package/transport/mcp-20260728/request-validation.d.ts +2 -0
- package/transport/mcp-20260728/request-validation.d.ts.map +1 -1
- package/transport/mcp-handlers/events-list-request.handler.d.ts +5 -0
- package/transport/mcp-handlers/events-list-request.handler.d.ts.map +1 -0
- package/transport/mcp-handlers/events-poll-request.handler.d.ts +5 -0
- package/transport/mcp-handlers/events-poll-request.handler.d.ts.map +1 -0
- package/transport/mcp-handlers/events-stream-request.handler.d.ts +8 -0
- package/transport/mcp-handlers/events-stream-request.handler.d.ts.map +1 -0
- package/transport/mcp-handlers/events-subscribe-request.handler.d.ts +5 -0
- package/transport/mcp-handlers/events-subscribe-request.handler.d.ts.map +1 -0
- package/transport/mcp-handlers/events-unsubscribe-request.handler.d.ts +5 -0
- package/transport/mcp-handlers/events-unsubscribe-request.handler.d.ts.map +1 -0
- package/transport/mcp-handlers/index.d.ts +162 -3
- package/transport/mcp-handlers/index.d.ts.map +1 -1
- package/transport/mcp-handlers/initialize-request.handler.d.ts.map +1 -1
- package/transport/stdio-revision-router.d.ts +2 -0
- package/transport/stdio-revision-router.d.ts.map +1 -1
- package/transport/web-fetch-handler.d.ts.map +1 -1
- package/utils/abort.utils.d.ts +5 -0
- package/utils/abort.utils.d.ts.map +1 -1
- package/worker/worker.lifecycle.d.ts +63 -0
- package/worker/worker.lifecycle.d.ts.map +1 -0
- package/worker/worker.supervisor.d.ts +62 -0
- package/worker/worker.supervisor.d.ts.map +1 -0
- package/workflow/engine/workflow.engine.d.ts +8 -1
- package/workflow/engine/workflow.engine.d.ts.map +1 -1
- package/workflow/tools/execute-workflow.tool.d.ts.map +1 -1
- package/workflow/tools/index.d.ts +1 -0
- package/workflow/tools/index.d.ts.map +1 -1
- package/workflow/tools/index.js +4 -2
- package/workflow/tools/list-workflows.tool.d.ts.map +1 -1
- package/workflow/tools/register-workflow.tool.d.ts +2 -1
- package/workflow/tools/register-workflow.tool.d.ts.map +1 -1
- package/workflow/tools/update-workflow.tool.d.ts +21 -0
- package/workflow/tools/update-workflow.tool.d.ts.map +1 -0
- package/workflow/trigger/workflow-events.d.ts +22 -0
- package/workflow/trigger/workflow-events.d.ts.map +1 -0
- package/workflow/trigger/workflow-schedules.d.ts +76 -0
- package/workflow/trigger/workflow-schedules.d.ts.map +1 -0
- package/workflow/trigger/workflow-triggers.d.ts +49 -0
- package/workflow/trigger/workflow-triggers.d.ts.map +1 -0
- package/workflow/trigger/workflow-webhook.routes.d.ts +16 -0
- package/workflow/trigger/workflow-webhook.routes.d.ts.map +1 -0
- package/workflow/trigger/workflow-webhook.signature.d.ts +41 -0
- package/workflow/trigger/workflow-webhook.signature.d.ts.map +1 -0
- package/workflow/workflow.registry.d.ts +11 -0
- package/workflow/workflow.registry.d.ts.map +1 -1
- package/workflow/workflow.utils.d.ts +7 -0
- package/workflow/workflow.utils.d.ts.map +1 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { EventDeliveryErrorCategory } from '@frontmcp/protocol';
|
|
2
|
+
import { type NamespacedStorage } from '@frontmcp/utils';
|
|
3
|
+
import { type EventSubscriber } from '../../common';
|
|
4
|
+
import { type EventDialect } from '../event-dialect';
|
|
5
|
+
/** Where a webhook subscription is delivered, and the secrets its deliveries are signed with. */
|
|
6
|
+
export interface EventWebhookDelivery {
|
|
7
|
+
mode: 'webhook';
|
|
8
|
+
url: string;
|
|
9
|
+
secret: string;
|
|
10
|
+
/** The secret a refresh replaced: deliveries are also signed with it until `previousSecretUntil`. */
|
|
11
|
+
previousSecret?: string;
|
|
12
|
+
previousSecretUntil?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface EventSubscriptionStatus {
|
|
15
|
+
lastDeliveryAt?: number;
|
|
16
|
+
lastError?: EventDeliveryErrorCategory;
|
|
17
|
+
failedSince?: number;
|
|
18
|
+
/** Failed delivery attempts in a row; a delivery the callback acknowledges ends the count. */
|
|
19
|
+
failures?: number;
|
|
20
|
+
/** When delivery was suspended. */
|
|
21
|
+
suspendedSince?: number;
|
|
22
|
+
}
|
|
23
|
+
/** The deliveries one `check()` produced, and the position after them. */
|
|
24
|
+
export interface EventReplayBatch {
|
|
25
|
+
cursor: string | null;
|
|
26
|
+
deliveryIds: string[];
|
|
27
|
+
}
|
|
28
|
+
/** Where the webhook subscription of an event with `check()` stands in its upstream. */
|
|
29
|
+
export interface EventReplayState {
|
|
30
|
+
/** The position the next `check()` reads from. */
|
|
31
|
+
cursor: string | null;
|
|
32
|
+
/** The position a client may persist: everything at or before it was acknowledged or abandoned. */
|
|
33
|
+
watermark: string | null;
|
|
34
|
+
/** The batches whose deliveries are not all done, oldest first. */
|
|
35
|
+
pending: EventReplayBatch[];
|
|
36
|
+
/** A gap the client has not been told about yet: its next refresh answers `truncated`. */
|
|
37
|
+
truncated?: boolean;
|
|
38
|
+
/** How many of the items `check()` returns from `cursor` are already queued: a turn that failed part-way. */
|
|
39
|
+
queuedAtCursor?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface EventSubscriptionRecord {
|
|
42
|
+
/** `sub_` and 32 hex characters, derived from the owner, the callback, the event and its arguments. */
|
|
43
|
+
id: string;
|
|
44
|
+
principalKey: string;
|
|
45
|
+
/** The owner as the server knew them at the last `events/subscribe`. */
|
|
46
|
+
subscriber: EventSubscriber;
|
|
47
|
+
eventName: string;
|
|
48
|
+
arguments: Record<string, unknown>;
|
|
49
|
+
/** The canonical JSON of `arguments`. */
|
|
50
|
+
argumentsKey: string;
|
|
51
|
+
delivery: EventWebhookDelivery;
|
|
52
|
+
dialect: EventDialect;
|
|
53
|
+
createdAt: number;
|
|
54
|
+
updatedAt: number;
|
|
55
|
+
/** When the subscription ends, in Unix milliseconds; `null` for one that never expires. */
|
|
56
|
+
expiresAt: number | null;
|
|
57
|
+
verifiedAt: number | null;
|
|
58
|
+
lastAuthorizedAt: number;
|
|
59
|
+
/** `false` while delivery is suspended; the next `events/subscribe` sets it again. */
|
|
60
|
+
active: boolean;
|
|
61
|
+
status: EventSubscriptionStatus;
|
|
62
|
+
/** Set for an event with `check()`: the position of the loop that feeds this subscription. */
|
|
63
|
+
replay?: EventReplayState;
|
|
64
|
+
}
|
|
65
|
+
/** What `update` may change; identity and lifetime change through `upsert` alone. */
|
|
66
|
+
export type EventSubscriptionChanges = Partial<Pick<EventSubscriptionRecord, 'active' | 'status' | 'verifiedAt' | 'lastAuthorizedAt' | 'subscriber' | 'delivery' | 'replay'>>;
|
|
67
|
+
export type EventSubscriptionPatch = EventSubscriptionChanges | ((current: EventSubscriptionRecord) => EventSubscriptionChanges);
|
|
68
|
+
/** Stored subscriptions, shared by every node of a server. Reads leave out a subscription whose lifetime is over. */
|
|
69
|
+
export interface EventSubscriptionStore {
|
|
70
|
+
/** Create the subscription, or replace the one with the same id. */
|
|
71
|
+
upsert(record: EventSubscriptionRecord): Promise<void>;
|
|
72
|
+
get(id: string): Promise<EventSubscriptionRecord | undefined>;
|
|
73
|
+
/** Remove a subscription, expired or not; resolves to it for the one caller that removed it. */
|
|
74
|
+
delete(id: string): Promise<EventSubscriptionRecord | undefined>;
|
|
75
|
+
/** Remove a subscription whose lifetime ended at or before `now`; resolves to it for the caller that removed it. */
|
|
76
|
+
deleteExpired(id: string, now: number): Promise<EventSubscriptionRecord | undefined>;
|
|
77
|
+
listByEvent(eventName: string): Promise<EventSubscriptionRecord[]>;
|
|
78
|
+
countByPrincipal(principalKey: string): Promise<number>;
|
|
79
|
+
/** Change a subscription in place; undefined when it is gone. */
|
|
80
|
+
update(id: string, patch: EventSubscriptionPatch): Promise<EventSubscriptionRecord | undefined>;
|
|
81
|
+
/** The subscriptions whose lifetime ended at or before `now` and that are still stored. */
|
|
82
|
+
listExpired(now: number): Promise<EventSubscriptionRecord[]>;
|
|
83
|
+
close(): Promise<void>;
|
|
84
|
+
}
|
|
85
|
+
export interface StorageEventSubscriptionStoreOptions {
|
|
86
|
+
/** Owned by the store: it is disconnected on `close()`. */
|
|
87
|
+
storage: NamespacedStorage;
|
|
88
|
+
/** Encrypts each record and keys the indexes by HMACs. Required for a store that outlives the process. */
|
|
89
|
+
secret?: string;
|
|
90
|
+
}
|
|
91
|
+
/** Subscriptions in a storage with atomic compare-and-set (memory, Redis, SQLite), indexed by event and by owner. */
|
|
92
|
+
export declare class StorageEventSubscriptionStore implements EventSubscriptionStore {
|
|
93
|
+
private readonly options;
|
|
94
|
+
/** Takes the storage it owns and the secret, if any, that encrypts the records and keys the indexes. */
|
|
95
|
+
constructor(options: StorageEventSubscriptionStoreOptions);
|
|
96
|
+
/** Write the record and its index keys, with a storage TTL that outlasts a finite lifetime. */
|
|
97
|
+
upsert(record: EventSubscriptionRecord): Promise<void>;
|
|
98
|
+
/** The live subscription of an id. */
|
|
99
|
+
get(id: string): Promise<EventSubscriptionRecord | undefined>;
|
|
100
|
+
/** Remove a subscription, expired or not. */
|
|
101
|
+
delete(id: string): Promise<EventSubscriptionRecord | undefined>;
|
|
102
|
+
/** Remove a subscription only when its lifetime is over. */
|
|
103
|
+
deleteExpired(id: string, now: number): Promise<EventSubscriptionRecord | undefined>;
|
|
104
|
+
/** The live subscriptions of an event, through its index. */
|
|
105
|
+
listByEvent(eventName: string): Promise<EventSubscriptionRecord[]>;
|
|
106
|
+
/** How many live subscriptions an owner holds, through its index. */
|
|
107
|
+
countByPrincipal(principalKey: string): Promise<number>;
|
|
108
|
+
/** Apply a patch with compare-and-set, on top of whatever another writer stored first. */
|
|
109
|
+
update(id: string, patch: EventSubscriptionPatch): Promise<EventSubscriptionRecord | undefined>;
|
|
110
|
+
/** The expired subscriptions the expiry index names, dropping index keys that no longer apply. */
|
|
111
|
+
listExpired(now: number): Promise<EventSubscriptionRecord[]>;
|
|
112
|
+
/** Disconnect the storage. */
|
|
113
|
+
close(): Promise<void>;
|
|
114
|
+
/** Remove the stored subscription when `shouldRemove` accepts it, once across every node. */
|
|
115
|
+
private remove;
|
|
116
|
+
/** The live subscriptions an index pattern names. */
|
|
117
|
+
private liveRecordsOf;
|
|
118
|
+
/** The stored subscription, expired or not, with the exact value a compare-and-set needs. */
|
|
119
|
+
private read;
|
|
120
|
+
/** The record as stored: encrypted under a key of its own when the store has a secret. */
|
|
121
|
+
private encode;
|
|
122
|
+
/** The record a stored value holds; undefined for one that cannot be read or belongs to another id. */
|
|
123
|
+
private decode;
|
|
124
|
+
/** The index key that lists the subscription under its event. */
|
|
125
|
+
private eventIndexKey;
|
|
126
|
+
/** The index key that lists the subscription under its owner. */
|
|
127
|
+
private principalIndexKey;
|
|
128
|
+
/** A key part that names `value` without showing it: an HMAC with the secret, else a SHA-256. */
|
|
129
|
+
private digest;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=event-subscription.store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-subscription.store.d.ts","sourceRoot":"","sources":["../../../src/event/subscription/event-subscription.store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAqC,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAE5F,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,iGAAiG;AACjG,MAAM,WAA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iBrG,kGAAkG;IAC5F,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAgBlE,8BAA8B;IACxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,6FAA6F;YAC/E,MAAM;IAepB,qDAAqD;YACvC,aAAa;IAgB3B,6FAA6F;YAC/E,IAAI;IAOlB,0FAA0F;YAC5E,MAAM;IAKpB,uGAAuG;YACzF,MAAM;IAapB,iEAAiE;IACjE,OAAO,CAAC,aAAa;IAIrB,iEAAiE;IACjE,OAAO,CAAC,iBAAiB;IAIzB,iGAAiG;IACjG,OAAO,CAAC,MAAM;CAMf"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { AuthInfo, EventDeliveryStatus } from '@frontmcp/protocol';
|
|
2
|
+
import { type EventEntry, type EventSubscriptionRef, type EventUnsubscribeReason, type FrontMcpLogger } from '../../common';
|
|
3
|
+
import { type EventsConfig } from '../../common/metadata/event.metadata';
|
|
4
|
+
import { type EventCallbackVerifier } from './event-callback-verifier';
|
|
5
|
+
import { type EventSubscriptionRecord, type EventSubscriptionStore, type EventWebhookDelivery } from './event-subscription.store';
|
|
6
|
+
export interface EventSubscriptionsOptions {
|
|
7
|
+
/** The registered events, by name. */
|
|
8
|
+
events: {
|
|
9
|
+
findByName(name: string): EventEntry | undefined;
|
|
10
|
+
};
|
|
11
|
+
store: EventSubscriptionStore;
|
|
12
|
+
/** Whether the store outlives the process; a subscription without expiry needs one that does. */
|
|
13
|
+
durable: boolean;
|
|
14
|
+
verifier: EventCallbackVerifier;
|
|
15
|
+
settings: EventsConfig['subscriptions'];
|
|
16
|
+
/** `events.webhook.rotationGraceMs`. */
|
|
17
|
+
rotationGraceMs: number;
|
|
18
|
+
logger: FrontMcpLogger;
|
|
19
|
+
}
|
|
20
|
+
export interface EventSubscriptionIdentity {
|
|
21
|
+
id: string;
|
|
22
|
+
/** The canonical JSON of the arguments. */
|
|
23
|
+
argumentsKey: string;
|
|
24
|
+
}
|
|
25
|
+
/** How often expired subscriptions are looked for. */
|
|
26
|
+
export declare const SUBSCRIPTION_SWEEP_INTERVAL_MS = 60000;
|
|
27
|
+
/** The subscription as an event's lifecycle methods see it. */
|
|
28
|
+
export declare function subscriptionRefOf(record: EventSubscriptionRecord): EventSubscriptionRef;
|
|
29
|
+
/** The delivery status a client reads on a refresh. */
|
|
30
|
+
export declare function deliveryStatusOf(record: EventSubscriptionRecord): EventDeliveryStatus;
|
|
31
|
+
/** The stored subscriptions of a server: their identity, their lifetime, and the event methods their life calls. */
|
|
32
|
+
export declare class EventSubscriptions {
|
|
33
|
+
private readonly options;
|
|
34
|
+
readonly store: EventSubscriptionStore;
|
|
35
|
+
readonly verifier: EventCallbackVerifier;
|
|
36
|
+
private readonly logger;
|
|
37
|
+
private sweepTimer?;
|
|
38
|
+
private lastSweepAt;
|
|
39
|
+
/** Takes the store, the verifier and the lifetime rules of the scope's subscriptions. */
|
|
40
|
+
constructor(options: EventSubscriptionsOptions);
|
|
41
|
+
/** The limits of `events.subscriptions`, with their defaults. */
|
|
42
|
+
get settings(): EventsConfig['subscriptions'];
|
|
43
|
+
/** The identity of a subscription: the same owner, callback, event and arguments always give the same id. */
|
|
44
|
+
identityOf(principalKey: string, url: string, eventName: string, args: Record<string, unknown>): EventSubscriptionIdentity;
|
|
45
|
+
/** When a subscription that asks for `requestedTtlMs` ends: `null` only for a granted request for no expiry. */
|
|
46
|
+
grantExpiry(event: EventEntry, requestedTtlMs: number | null | undefined, now: number): number | null;
|
|
47
|
+
/** The delivery of a subscription after a refresh: a replaced secret keeps signing until the grace ends. */
|
|
48
|
+
rotatedDelivery(current: EventWebhookDelivery | undefined, url: string, secret: string, now: number): EventWebhookDelivery;
|
|
49
|
+
/** Call the event's `onSubscribe` for a subscription that was just created. */
|
|
50
|
+
notifySubscribed(event: EventEntry, record: EventSubscriptionRecord, authInfo: Partial<AuthInfo>): Promise<void>;
|
|
51
|
+
/** Call the event's `onUnsubscribe` for a removed subscription; a failure there is logged, never thrown. */
|
|
52
|
+
notifyUnsubscribed(record: EventSubscriptionRecord, reason: EventUnsubscribeReason, authInfo?: Partial<AuthInfo>): Promise<void>;
|
|
53
|
+
/** End one subscription whose lifetime is over, telling its event once across every node. */
|
|
54
|
+
expire(id: string, now?: number): Promise<void>;
|
|
55
|
+
/** End every subscription whose lifetime is over. */
|
|
56
|
+
sweep(now?: number): Promise<void>;
|
|
57
|
+
/** Sweep in the background when the last sweep is old enough: the only sweep on serverless and edge runtimes. */
|
|
58
|
+
sweepIfDue(now?: number): void;
|
|
59
|
+
/** Sweep on a timer, where the process is long-lived. */
|
|
60
|
+
start(): void;
|
|
61
|
+
/** Stop the timer and close the store. */
|
|
62
|
+
close(): Promise<void>;
|
|
63
|
+
/** Run a sweep nobody waits for; its failure is logged. */
|
|
64
|
+
private sweepInBackground;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=event-subscriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-subscriptions.d.ts","sourceRoot":"","sources":["../../../src/event/subscription/event-subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGxE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EAC1B,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,yBAAyB;IACxC,sCAAsC;IACtC,MAAM,EAAE;QAAE,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAA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AAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAgBrG,4GAA4G;IAC5G,eAAe,CACb,OAAO,EAAE,oBAAoB,GAAG,SAAS,EACzC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,oBAAoB;IAWvB,+EAA+E;IACzE,gBAAgB,CACpB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,uBAAuB,EAC/B,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAC1B,OAAO,CAAC,IAAI,CAAC;IAIhB,4GAA4G;IACtG,kBAAkB,CACtB,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,sBAAsB,EAC9B,QAAQ,GAAE,OAAO,CAAC,QAAQ,CAAM,GAC/B,OAAO,CAAC,IAAI,CAAC;IAUhB,6FAA6F;IACvF,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,SAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzD,qDAAqD;IAC/C,KAAK,CAAC,GAAG,SAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ5C,iHAAiH;IACjH,UAAU,CAAC,GAAG,SAAa,GAAG,IAAI;IAKlC,yDAAyD;IACzD,KAAK,IAAI,IAAI;IAOb,0CAA0C;IACpC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B,2DAA2D;IAC3D,OAAO,CAAC,iBAAiB;CAG1B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PublicMcpError } from '../errors/mcp.error';
|
|
2
|
+
/** The JSON-RPC error a server answered an events request of the client with. */
|
|
3
|
+
export declare class EventRequestError extends PublicMcpError {
|
|
4
|
+
readonly method: string;
|
|
5
|
+
readonly rpcCode: number;
|
|
6
|
+
readonly data?: unknown | undefined;
|
|
7
|
+
/** The error of `method`, with the JSON-RPC code and data the server sent. */
|
|
8
|
+
constructor(method: string, rpcCode: number, message: string, data?: unknown | undefined);
|
|
9
|
+
}
|
|
10
|
+
/** None of the delivery modes the event offers is one this client can use. */
|
|
11
|
+
export declare class NoCompatibleDeliveryModeError extends PublicMcpError {
|
|
12
|
+
/** Names the modes the event offers and the modes the client can use. */
|
|
13
|
+
constructor(eventName: string, offered: readonly string[], usable: readonly string[]);
|
|
14
|
+
}
|
|
15
|
+
/** The server ended a subscription of the client, for example because its access was revoked. */
|
|
16
|
+
export declare class EventSubscriptionTerminatedError extends PublicMcpError {
|
|
17
|
+
readonly eventName: string;
|
|
18
|
+
readonly error: {
|
|
19
|
+
code: number;
|
|
20
|
+
message: string;
|
|
21
|
+
data?: Record<string, unknown>;
|
|
22
|
+
};
|
|
23
|
+
/** Carries the error the server ended the subscription with. */
|
|
24
|
+
constructor(eventName: string, error: {
|
|
25
|
+
code: number;
|
|
26
|
+
message: string;
|
|
27
|
+
data?: Record<string, unknown>;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/** The client already holds a webhook subscription that the server knows by the same id. */
|
|
31
|
+
export declare class DuplicateEventSubscriptionError extends PublicMcpError {
|
|
32
|
+
/** Names the event and the callback URL the existing subscription delivers to. */
|
|
33
|
+
constructor(eventName: string, url: string);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=event-client.errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-client.errors.d.ts","sourceRoot":"","sources":["../../src/event-client/event-client.errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,iFAAiF;AACjF,qBAAa,iBAAkB,SAAQ,cAAc;IAGjD,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM;IAExB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO;IALzB,8EAA8E;gBAEnE,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACxB,OAAO,EAAE,MAAM,EACN,IAAI,CAAC,EAAE,OAAO,YAAA;CAI1B;AAED,8EAA8E;AAC9E,qBAAa,6BAA8B,SAAQ,cAAc;IAC/D,yEAAyE;gBAC7D,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE;CAQrF;AAED,iGAAiG;AACjG,qBAAa,gCAAiC,SAAQ,cAAc;IAGhE,QAAQ,CAAC,SAAS,EAAE,MAAM;IAC1B,QAAQ,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE;IAHnF,gEAAgE;gBAErD,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE;CAIpF;AAED,4FAA4F;AAC5F,qBAAa,+BAAgC,SAAQ,cAAc;IACjE,kFAAkF;gBACtE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;CAQ3C"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type EventError, type EventOccurrence } from '@frontmcp/protocol';
|
|
2
|
+
import { type WebhookSignatureCheck } from '@frontmcp/utils';
|
|
3
|
+
/** The deliveries remembered for deduplication, by subscription and `webhook-id`; the oldest is forgotten first. */
|
|
4
|
+
export declare const WEBHOOK_DEDUPE_WINDOW = 10000;
|
|
5
|
+
/** What a delivery is known by when it reaches a listener. */
|
|
6
|
+
export interface EventWebhookDeliveryInfo {
|
|
7
|
+
/** The `X-MCP-Subscription-Id` header: the id the server derived for the subscription. */
|
|
8
|
+
subscriptionId: string;
|
|
9
|
+
/** The `webhook-id` header, kept across the retries of one message. */
|
|
10
|
+
webhookId: string;
|
|
11
|
+
}
|
|
12
|
+
/** Receives what the deliveries of one subscription, or of every subscription, carry. */
|
|
13
|
+
export interface EventWebhookListener {
|
|
14
|
+
/** An event occurrence. The delivery is acknowledged once this settles; a throw answers 500 so it is retried. */
|
|
15
|
+
onEvent?(occurrence: EventOccurrence, delivery: EventWebhookDeliveryInfo): void | Promise<void>;
|
|
16
|
+
/** A `gap` envelope: events were skipped and `cursor` is where delivery goes on from. */
|
|
17
|
+
onGap?(cursor: string | null, delivery: EventWebhookDeliveryInfo): void | Promise<void>;
|
|
18
|
+
/** A `terminated` envelope: the server ended the subscription. */
|
|
19
|
+
onTerminated?(error: EventError, delivery: EventWebhookDeliveryInfo): void | Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export interface EventWebhookReceiverOptions extends EventWebhookListener {
|
|
22
|
+
/** Secrets that sign the deliveries of any subscription, for a receiver with one fixed secret. */
|
|
23
|
+
secrets?: string[];
|
|
24
|
+
}
|
|
25
|
+
/** A secret the receiver checks deliveries with, bound to a subscription id once it is known. */
|
|
26
|
+
export interface EventWebhookRegistration {
|
|
27
|
+
/** The subscription id the secret is bound to; undefined until it is. */
|
|
28
|
+
readonly subscriptionId: string | undefined;
|
|
29
|
+
/** Route the deliveries of `subscriptionId` to this registration. */
|
|
30
|
+
bind(subscriptionId: string): void;
|
|
31
|
+
/** Accept one more secret, as after a rotation, keeping the earlier ones. */
|
|
32
|
+
addSecret(secret: string): void;
|
|
33
|
+
/** Stop accepting deliveries for this registration. */
|
|
34
|
+
release(): void;
|
|
35
|
+
}
|
|
36
|
+
export interface EventWebhookRegistrationOptions {
|
|
37
|
+
secret: string;
|
|
38
|
+
/** The subscription id, when it is already known. */
|
|
39
|
+
subscriptionId?: string;
|
|
40
|
+
/** Where this subscription's deliveries go; the receiver's own callbacks get the rest. */
|
|
41
|
+
listener?: EventWebhookListener;
|
|
42
|
+
}
|
|
43
|
+
/** One request as it arrived: the headers and the exact body bytes the signature covers. */
|
|
44
|
+
export interface EventWebhookRequest {
|
|
45
|
+
headers: Headers | Record<string, string | string[] | undefined>;
|
|
46
|
+
rawBody: string;
|
|
47
|
+
}
|
|
48
|
+
/** The answer to give the server. */
|
|
49
|
+
export interface EventWebhookResponse {
|
|
50
|
+
status: number;
|
|
51
|
+
/** A JSON body to send, when there is one. */
|
|
52
|
+
body?: Record<string, unknown>;
|
|
53
|
+
/** How the signature checked, when it was checked. */
|
|
54
|
+
signature?: WebhookSignatureCheck;
|
|
55
|
+
}
|
|
56
|
+
/** A framework-neutral receiver of MCP Events webhook deliveries. */
|
|
57
|
+
export interface EventWebhookReceiver {
|
|
58
|
+
/** Check, deduplicate and route one request, and say what to answer. */
|
|
59
|
+
handle(request: EventWebhookRequest): Promise<EventWebhookResponse>;
|
|
60
|
+
/** How a request's signature checks against the secrets of its subscription, without acting on it; undefined when none is known. */
|
|
61
|
+
verify(request: EventWebhookRequest): WebhookSignatureCheck | undefined;
|
|
62
|
+
/** Register a secret, usually one generated for a new subscription. */
|
|
63
|
+
register(options: EventWebhookRegistrationOptions): EventWebhookRegistration;
|
|
64
|
+
/** Accept one more secret for every subscription. */
|
|
65
|
+
addSecret(secret: string): void;
|
|
66
|
+
/** Whether any secret is configured or registered. */
|
|
67
|
+
hasSecrets(): boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Create a receiver of MCP Events webhooks: it selects the secret by `X-MCP-Subscription-Id`, verifies the Standard
|
|
71
|
+
* Webhooks signature and its freshness, deduplicates on `webhook-id`, answers verification challenges, and hands
|
|
72
|
+
* occurrences and `gap` / `terminated` envelopes to the listener of the subscription.
|
|
73
|
+
*/
|
|
74
|
+
export declare function createEventWebhookReceiver(options?: EventWebhookReceiverOptions): EventWebhookReceiver;
|
|
75
|
+
//# sourceMappingURL=event-webhook-receiver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-webhook-receiver.d.ts","sourceRoot":"","sources":["../../src/event-client/event-webhook-receiver.ts"],"names":[],"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EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC;AAED,4FAA4F;AAC5F,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IACjE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qCAAqC;AACrC,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,sDAAsD;IACtD,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC;AAED,qEAAqE;AACrE,MAAM,WAAW,oBAAoB;IACnC,wEAAwE;IACxE,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACpE,oIAAoI;IACpI,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,qBAAqB,GAAG,SAAS,CAAC;IACxE,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,+BAA+B,GAAG,wBAAwB,CAAC;IAC7E,qDAAqD;IACrD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,sDAAsD;IACtD,UAAU,IAAI,OAAO,CAAC;CACvB;AA+BD;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,2BAAgC,GAAG,oBAAoB,CAkJ1G"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type EventDefinition } from '@frontmcp/protocol';
|
|
2
|
+
import type { EventsClientOptions, EventsClientTransport, EventSubscribeOptions, EventSubscription } from './events-client.types';
|
|
3
|
+
export declare const DEFAULT_POLL_FLOOR_MS = 1000;
|
|
4
|
+
export declare const DEFAULT_HEARTBEAT_TIMEOUT_MS = 60000;
|
|
5
|
+
/** How often a subscription granted no expiry is refreshed anyway, to read its cursor and delivery status. */
|
|
6
|
+
export declare const NO_EXPIRY_REFRESH_MS = 3600000;
|
|
7
|
+
/** The longest wait between two retries of a failed request. */
|
|
8
|
+
export declare const MAX_RETRY_DELAY_MS = 60000;
|
|
9
|
+
/**
|
|
10
|
+
* The events API of an MCP client (MCP Events, SEP-3415): list the event types, and subscribe to one. A subscription
|
|
11
|
+
* picks its delivery mode (webhook when a receiver is configured, else push when the transport streams, else poll)
|
|
12
|
+
* and yields the occurrences it receives, deduplicated by `eventId`.
|
|
13
|
+
*/
|
|
14
|
+
export declare class EventsClient {
|
|
15
|
+
private readonly transport;
|
|
16
|
+
private readonly options;
|
|
17
|
+
private readonly cursorStore;
|
|
18
|
+
private definitions?;
|
|
19
|
+
private readonly subscriptions;
|
|
20
|
+
/** A client sending its requests through `transport`. */
|
|
21
|
+
constructor(transport: EventsClientTransport, options?: EventsClientOptions);
|
|
22
|
+
/** Every event type the server lists to this caller, all pages. */
|
|
23
|
+
list(): Promise<EventDefinition[]>;
|
|
24
|
+
/** Subscribe to an event; resolves once the server accepted the subscription, rejects when it refuses it. */
|
|
25
|
+
subscribe(name: string, args?: Record<string, unknown>, options?: EventSubscribeOptions): Promise<EventSubscription>;
|
|
26
|
+
/** The live webhook subscription of this client that `matches`, if any. */
|
|
27
|
+
private webhookHolderOf;
|
|
28
|
+
/** Cancel every subscription the client holds, as before its connection closes. */
|
|
29
|
+
close(): Promise<void>;
|
|
30
|
+
/** The delivery mode of a new subscription: the forced one, or the first the event offers and this client can use. */
|
|
31
|
+
private modeFor;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=events-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-client.d.ts","sourceRoot":"","sources":["../../src/event-client/events-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,eAAe,EAKrB,MAAM,oBAAoB,CAAC;AAW5B,OAAO,KAAK,EAEV,mBAAmB,EACnB,qBAAqB,EAErB,qBAAqB,EACrB,iBAAiB,EAElB,MAAM,uBAAuB,CAAC;AAE/B,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAC1C,eAAO,MAAM,4BAA4B,QAAQ,CAAC;AAClD,8GAA8G;AAC9G,eAAO,MAAM,oBAAoB,UAAY,CAAC;AAQ9C,gEAAgE;AAChE,eAAO,MAAM,kBAAkB,QAAS,CAAC;AA8azC;;;;GAIG;AACH,qBAAa,YAAY;IAOrB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAP1B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;IAC/C,OAAO,CAAC,WAAW,CAAC,CAA+B;IACnD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsC;IAEpE,yDAAyD;gBAEtC,SAAS,EAAE,qBAAqB,EAChC,OAAO,GAAE,mBAAwB;IAKpD,mEAAmE;IAC7D,IAAI,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAWxC,6GAA6G;IACvG,SAAS,CACb,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EAClC,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,iBAAiB,CAAC;IAqC7B,2EAA2E;IAC3E,OAAO,CAAC,eAAe;IAIvB,mFAAmF;IAC7E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,sHAAsH;YACxG,OAAO;CAatB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { EventDeliveryMode, EventDeliveryStatus, EventError, EventOccurrence } from '@frontmcp/protocol';
|
|
2
|
+
import type { EventWebhookReceiver } from './event-webhook-receiver';
|
|
3
|
+
/** A notification of an `events/stream`, as the transport received it. */
|
|
4
|
+
export interface EventsStreamNotification {
|
|
5
|
+
method: string;
|
|
6
|
+
params?: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
/** How the events client reaches a server: JSON-RPC requests, and optionally a long-lived `events/stream`. */
|
|
9
|
+
export interface EventsClientTransport {
|
|
10
|
+
/** Send one request; resolve with its result, or reject with an `EventRequestError` for a JSON-RPC error. */
|
|
11
|
+
request(method: string, params: Record<string, unknown>): Promise<unknown>;
|
|
12
|
+
/**
|
|
13
|
+
* Hold an `events/stream` request open and hand each of its notifications to `onNotification`. Resolves when the
|
|
14
|
+
* stream ends or `signal` aborts it; rejects with an `EventRequestError` when the server refuses it. Absent when the
|
|
15
|
+
* transport cannot hold a stream.
|
|
16
|
+
*/
|
|
17
|
+
openStream?(params: Record<string, unknown>, onNotification: (notification: EventsStreamNotification) => void, signal: AbortSignal): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
/** Where the cursor of each subscription is kept between runs. Nothing is persisted by default. */
|
|
20
|
+
export interface EventCursorStore {
|
|
21
|
+
/** The cursor last kept under `key`; undefined when none was. */
|
|
22
|
+
get(key: string): Promise<string | null | undefined> | string | null | undefined;
|
|
23
|
+
/** Keep the latest cursor under `key`. */
|
|
24
|
+
set(key: string, cursor: string | null): Promise<void> | void;
|
|
25
|
+
}
|
|
26
|
+
/** Where webhook deliveries arrive: a callback URL and the receiver that answers it. */
|
|
27
|
+
export interface EventsWebhookConfig {
|
|
28
|
+
/** The `https` callback URL the server POSTs to. */
|
|
29
|
+
url: string;
|
|
30
|
+
/** The receiver behind that URL; each subscription registers the secret it generates with it. */
|
|
31
|
+
receiver: EventWebhookReceiver;
|
|
32
|
+
/** The lifetime suggested on subscribe; omitted asks for the server default, `null` for no expiry. */
|
|
33
|
+
ttlMs?: number | null;
|
|
34
|
+
}
|
|
35
|
+
export interface EventsClientOptions {
|
|
36
|
+
/** Enables webhook delivery, which is then preferred where the event offers it. */
|
|
37
|
+
webhook?: EventsWebhookConfig;
|
|
38
|
+
/** Keeps cursors across runs. @default an in-memory store */
|
|
39
|
+
cursorStore?: EventCursorStore;
|
|
40
|
+
/** The shortest wait between two polls, and between two reconnections. @default 1000 */
|
|
41
|
+
pollFloorMs?: number;
|
|
42
|
+
/** A push stream silent for this long is treated as dead and reopened from its cursor. @default 60000 */
|
|
43
|
+
heartbeatTimeoutMs?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface EventSubscribeOptions {
|
|
46
|
+
/** Force a delivery mode instead of choosing one. */
|
|
47
|
+
delivery?: EventDeliveryMode;
|
|
48
|
+
/** Where to start; `null` is "from now". @default the cursor store's, else `null` */
|
|
49
|
+
cursor?: string | null;
|
|
50
|
+
/** Do not replay events older than this, in milliseconds. */
|
|
51
|
+
maxAgeMs?: number;
|
|
52
|
+
/** The most events one poll returns. */
|
|
53
|
+
maxEvents?: number;
|
|
54
|
+
/** Told when the server skipped events and delivery goes on from `cursor`. */
|
|
55
|
+
onTruncated?: (cursor: string | null) => void;
|
|
56
|
+
/** Told of a recoverable failure the server reported; the subscription stays open. */
|
|
57
|
+
onError?: (error: EventError) => void;
|
|
58
|
+
}
|
|
59
|
+
/** A live subscription: an async iterable of the occurrences it receives, until it is cancelled or terminated. */
|
|
60
|
+
export interface EventSubscription extends AsyncIterable<EventOccurrence> {
|
|
61
|
+
readonly name: string;
|
|
62
|
+
readonly arguments: Record<string, unknown>;
|
|
63
|
+
/** The delivery mode in use. */
|
|
64
|
+
readonly mode: EventDeliveryMode;
|
|
65
|
+
/** The latest cursor received. */
|
|
66
|
+
readonly cursor: string | null;
|
|
67
|
+
/** The id the server derived, for a webhook subscription. */
|
|
68
|
+
readonly id: string | undefined;
|
|
69
|
+
/** What the last subscribe or refresh said about webhook delivery. */
|
|
70
|
+
readonly deliveryStatus: EventDeliveryStatus | undefined;
|
|
71
|
+
/** End the subscription: the iteration completes and the server is told where the mode allows it. */
|
|
72
|
+
cancel(): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=events-client.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-client.types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C,IAAI,CAAC,CAAC;CACzB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { EventsClient, DEFAULT_HEARTBEAT_TIMEOUT_MS, DEFAULT_POLL_FLOOR_MS, NO_EXPIRY_REFRESH_MS, MAX_RETRY_DELAY_MS, } from './events-client';
|
|
2
|
+
export type { EventCursorStore, EventsClientOptions, EventsClientTransport, EventSubscribeOptions, EventSubscription, EventsStreamNotification, EventsWebhookConfig, } from './events-client.types';
|
|
3
|
+
export { createEventWebhookReceiver, WEBHOOK_DEDUPE_WINDOW } from './event-webhook-receiver';
|
|
4
|
+
export type { EventWebhookDeliveryInfo, EventWebhookListener, EventWebhookReceiver, EventWebhookReceiverOptions, EventWebhookRegistration, EventWebhookRegistrationOptions, EventWebhookRequest, EventWebhookResponse, } from './event-webhook-receiver';
|
|
5
|
+
export { EventRequestError, EventSubscriptionTerminatedError, DuplicateEventSubscriptionError, NoCompatibleDeliveryModeError, } from './event-client.errors';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/event-client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,4BAA4B,EAC5B,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAC7F,YAAY,EACV,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,2BAA2B,EAC3B,wBAAwB,EACxB,+BAA+B,EAC/B,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,iBAAiB,EACjB,gCAAgC,EAChC,+BAA+B,EAC/B,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC"}
|
|
@@ -99,7 +99,8 @@ export declare class ExtAppsMessageHandler {
|
|
|
99
99
|
/**
|
|
100
100
|
* Handle a JSON-RPC notification from a widget (`notifications/message`,
|
|
101
101
|
* `ui/notifications/request-teardown`). A notification gets no answer, so a failure is only
|
|
102
|
-
* logged, and a notification this handler does not know is ignored
|
|
102
|
+
* logged, and a notification this handler does not know is ignored, as is a
|
|
103
|
+
* `ui/notifications/request-teardown` when the context has no `close` callback.
|
|
103
104
|
*
|
|
104
105
|
* @param notification - The JSON-RPC notification
|
|
105
106
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ext-apps.handler.d.ts","sourceRoot":"","sources":["../../src/ext-apps/ext-apps.handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAIL,KAAK,uBAAuB,EAG5B,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAW5B,MAAM,kBAAkB,CAAC;AAc1B;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,MAAM,EAAE,cAAc,CAAC;IACvB,0BAA0B;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5E,6DAA6D;IAC7D,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,oDAAoD;IACpD,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAA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a,wBAAyB,SAAQ,YAAY;gBAC5C,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,4BAA4B,GAAG,qBAAqB,CAExG"}
|
|
@@ -26,4 +26,12 @@ export declare function matchMountedPath(pattern: string, path: string): Record<
|
|
|
26
26
|
* @returns the captured parameters, or `undefined` when the path does not match
|
|
27
27
|
*/
|
|
28
28
|
export declare function matchRoutePath(pattern: string, path: string): Record<string, string> | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The path a scope serves its `/oauth/*` endpoints under: an app's own scope (`splitByApp` or `standalone`) under its
|
|
31
|
+
* path, so each app's authorization server is its own; the server's scope at the root.
|
|
32
|
+
*/
|
|
33
|
+
export declare function oauthBasePath(scope: {
|
|
34
|
+
fullPath?: string;
|
|
35
|
+
routeBase?: string;
|
|
36
|
+
}): string;
|
|
29
37
|
//# sourceMappingURL=flow.http-path.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.http-path.d.ts","sourceRoot":"","sources":["../../src/flows/flow.http-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAWlG;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAKhG"}
|
|
1
|
+
{"version":3,"file":"flow.http-path.d.ts","sourceRoot":"","sources":["../../src/flows/flow.http-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAWlG;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAKhG;AA0BD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEtF"}
|
package/flows/flow.instance.d.ts
CHANGED
|
@@ -42,6 +42,8 @@ export declare class FlowInstance<Name extends FlowName> extends FlowEntry<Name>
|
|
|
42
42
|
* oauth endpoints through the real flow pipeline.
|
|
43
43
|
*/
|
|
44
44
|
matchHttp(request: ServerRequest): Promise<boolean>;
|
|
45
|
+
/** The path the flow is mounted at: its `middleware.path`, with an `/oauth/*` path under the scope's OAuth base. */
|
|
46
|
+
private mountPath;
|
|
45
47
|
/**
|
|
46
48
|
* Get FrontMcpContextStorage from providers (with fallback).
|
|
47
49
|
* Returns undefined if not available (backward compatibility).
|
|
@@ -59,6 +61,13 @@ export declare class FlowInstance<Name extends FlowName> extends FlowEntry<Name>
|
|
|
59
61
|
*/
|
|
60
62
|
private runWithContext;
|
|
61
63
|
run(input: FlowInputOf<Name>, deps: Map<Token, Type>): Promise<FlowOutputOf<Name> | undefined>;
|
|
64
|
+
/**
|
|
65
|
+
* `access: 'authorized'`: the flow runs only for a caller the server's auth admitted. The context of an HTTP request
|
|
66
|
+
* that no flow has verified yet holds that request: it is verified here with `session:verify`, without minting a
|
|
67
|
+
* session, and the caller it admits is recorded in the context for the run and the flows it runs. Every other
|
|
68
|
+
* context's caller is authorized: an MCP client `http:request` verified, or the server process itself.
|
|
69
|
+
*/
|
|
70
|
+
private authorizeCaller;
|
|
62
71
|
/**
|
|
63
72
|
* Run the stages of a route whose every response carries `headers`, whichever stage, hook or guard
|
|
64
73
|
* responded. A failure is answered here, with the headers, rather than by the adapter.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.instance.d.ts","sourceRoot":"","sources":["../../src/flows/flow.instance.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAK1B,OAAO,
|
|
1
|
+
{"version":3,"file":"flow.instance.d.ts","sourceRoot":"","sources":["../../src/flows/flow.instance.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAK1B,OAAO,EAGL,SAAS,EAIT,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,YAAY,EAGjB,KAAK,UAAU,EAOf,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,KAAK,EACV,KAAK,IAAI,EACV,MAAM,WAAW,CAAC;AAiBnB,OAAO,KAAK,gBAAgB,MAAM,+BAA+B,CAAC;AAmDlE,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAA;CAAE,CASvG;AAoBD,kHAAkH;AAClH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAgB/D;AAwBD,qBAAa,YAAY,CAAC,IAAI,SAAS,QAAQ,CAAE,SAAQ,SAAS,CAAC,IAAI,CAAC;IACtE,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,gBAAgB,CAAC;IAC3C,OAAO,CAAC,IAAI,CAAkB;IAC9B,OAAO,CAAC,SAAS,CAAW;IAC5B,OAAO,CAAC,aAAa,CAAC,CAAgB;IACtC,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,iBAAiB,CAAC,CAAS;IACnC,wHAAwH;IACxH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CACkE;IACnG,mHAAmH;IACnH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAU;IACtC,8DAA8D;IAC9D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA+B;gBAEnD,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,eAAe,EAAE,gBAAgB;cAc1F,UAAU;IA6F1B,yGAAyG;IACzG,OAAO,CAAC,aAAa;IAYf,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IAmB3D;;;;;;;;;;;;OAYG;IACG,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IAyBzD,oHAAoH;IACpH,OAAO,CAAC,SAAS;IAKjB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IASzB;;;;;;;;;OASG;YACW,cAAc;IAoBtB,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IA+BpG;;;;;OAKG;YACW,eAAe;IAoB7B;;;OAGG;YACW,kBAAkB;YAmBlB,SAAS;IAgZvB,4GAA4G;IAC5G,OAAO,CAAC,kBAAkB;IAS1B,kHAAkH;IAClH,OAAO,CAAC,gBAAgB;CAmCzB"}
|
|
@@ -9,4 +9,9 @@ export interface EntryAuthorities {
|
|
|
9
9
|
* names a profile the engine does not have.
|
|
10
10
|
*/
|
|
11
11
|
export declare function assertAuthoritiesRules(engine: AuthoritiesEngine, entries: readonly EntryAuthorities[]): void;
|
|
12
|
+
/**
|
|
13
|
+
* Fail-fast at startup, so an entry never looks protected while anyone can use it: throw `AuthConfigurationError`
|
|
14
|
+
* when entries declare `authorities` that no engine enforces, or when a rule is malformed (`assertAuthoritiesRules`).
|
|
15
|
+
*/
|
|
16
|
+
export declare function assertEntryAuthorities(engine: AuthoritiesEngine | undefined, contextBuilder: unknown, entries: readonly EntryAuthorities[]): void;
|
|
12
17
|
//# sourceMappingURL=authorities-rules.check.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorities-rules.check.d.ts","sourceRoot":"","sources":["../../src/front-mcp/authorities-rules.check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIxD,yEAAyE;AACzE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,SAAS,gBAAgB,EAAE,GAAG,IAAI,CAiB5G"}
|
|
1
|
+
{"version":3,"file":"authorities-rules.check.d.ts","sourceRoot":"","sources":["../../src/front-mcp/authorities-rules.check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIxD,yEAAyE;AACzE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,SAAS,gBAAgB,EAAE,GAAG,IAAI,CAiB5G;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,SAAS,gBAAgB,EAAE,GACnC,IAAI,CAkBN"}
|
package/front-mcp/front-mcp.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export declare class FrontMcpInstance implements FrontMcpInterface {
|
|
|
28
28
|
start(): Promise<void>;
|
|
29
29
|
/** Start, or shut down what was built when the start fails (a refused socket, a port in use), then rethrow. */
|
|
30
30
|
private startOrRelease;
|
|
31
|
+
/** A production server that serves MCP over HTTP and starts without `MCP_SESSION_SECRET` says so, and on `/readyz`. */
|
|
32
|
+
private reportMissingSessionSecret;
|
|
31
33
|
/** Where this server serves MCP, as reported to the `frontmcp dev --stdio` bridge. */
|
|
32
34
|
private devListenerInfo;
|
|
33
35
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"front-mcp.d.ts","sourceRoot":"","sources":["../../src/front-mcp/front-mcp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"front-mcp.d.ts","sourceRoot":"","sources":["../../src/front-mcp/front-mcp.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EAChB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAuB,KAAK,eAAe,EAAE,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAUhG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAI3E,OAAO,KAAK,EAAmB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAcvF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,GAAG,CAAC,QAAQ,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,CAAC;AA0ErG,qBAAa,gBAAiB,YAAW,iBAAiB;IACxD,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9B,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,MAAM,CAA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O,CAAC,gBAAgB,CAAC;IAiB3F;;;;;;;;OAQG;WACiB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAkBzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;WACiB,YAAY,CAC9B,OAAO,EAAE,mBAAmB,GAAG,mBAAmB,EAClD,QAAQ,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1B,OAAO,CAAC,eAAe,CAAC;IAkC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;WACiB,aAAa,CAC/B,OAAO,EAAE,CAAC,mBAAmB,GAAG,kBAAkB,CAAC,GAAG;QACpD,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,kBAAkB,CAAC;KAC7B,GACA,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC;IAiD1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6CG;WACiB,QAAQ,CAAC,cAAc,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IA4NhF;;;;;;;;;;;;;;OAcG;WACiB,SAAS,CAAC,cAAc,EAAE,mBAAmB,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;CAM/G"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type FrontMcpConfigType } from '../common';
|
|
2
|
+
import type { HealthProbeDefinition } from '../common/types/options/health';
|
|
3
|
+
/** What a request that names no MCP revision gets: the session pipeline (`'legacy'`) or stateless MCP 2026-07-28. */
|
|
4
|
+
export type ProtocolFallback = 'legacy' | '2026-07-28';
|
|
5
|
+
export declare const MISSING_SESSION_SECRET_WARNING: string;
|
|
6
|
+
/** The `/readyz` check of a server that starts without `MCP_SESSION_SECRET`: degraded, so the server stays ready. */
|
|
7
|
+
export declare const missingSessionSecretProbe: HealthProbeDefinition;
|
|
8
|
+
/**
|
|
9
|
+
* In production the session ids of MCP clients before 2026-07-28 are encrypted with `MCP_SESSION_SECRET`. A server
|
|
10
|
+
* that serves MCP over HTTP and falls back to the session pipeline needs it for every client that doesn't name
|
|
11
|
+
* 2026-07-28, so it refuses to start without it. A server that falls back to 2026-07-28 starts: only clients that
|
|
12
|
+
* name an older revision need the secret.
|
|
13
|
+
*
|
|
14
|
+
* @param entryFallback The entry point's fallback when `transport.defaultProtocolVersion` is unset.
|
|
15
|
+
* @returns Whether the secret is missing from a production server that starts anyway, for the caller to report.
|
|
16
|
+
* @throws SessionSecretRequiredError when the server falls back to the session pipeline.
|
|
17
|
+
*/
|
|
18
|
+
export declare function checkSessionSecret(config: Pick<FrontMcpConfigType, 'transport'>, entryFallback: ProtocolFallback): boolean;
|
|
19
|
+
//# sourceMappingURL=session-secret.check.d.ts.map
|