@frontmcp/sdk 1.11.3 → 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/answer/answer-meter.d.ts +2 -0
- package/answer/answer-meter.d.ts.map +1 -1
- package/app/instances/app.esm.instance.d.ts +4 -2
- package/app/instances/app.esm.instance.d.ts.map +1 -1
- package/app/instances/app.lazy.instance.d.ts.map +1 -1
- package/app/lazy/lazy-app.rules.d.ts +4 -0
- package/app/lazy/lazy-app.rules.d.ts.map +1 -1
- package/browser/answer/answer-meter.mjs +1 -0
- package/browser/app/instances/app.esm.instance.mjs +11 -3
- package/browser/app/instances/app.lazy.instance.mjs +7 -3
- package/browser/app/lazy/lazy-app.rules.mjs +4 -1
- package/browser/channel/channel-notification.service.mjs +20 -8
- package/browser/channel/channel.instance.mjs +10 -1
- package/browser/channel/channel.utils.mjs +22 -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/index.mjs +7 -7
- 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/worker.interface.mjs +0 -0
- package/browser/common/metadata/app.metadata.mjs +2 -0
- 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 +5 -1
- 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 +7 -1
- 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 +1 -0
- package/browser/common/utils/offset-cursor.utils.mjs +23 -0
- package/browser/common/utils/principal.utils.mjs +1 -1
- package/browser/common/utils/time-zone.utils.mjs +12 -0
- 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/questions/question-subject.mjs +8 -2
- package/browser/errors/duty.errors.mjs +20 -0
- package/browser/errors/event.errors.mjs +128 -0
- package/browser/errors/index.mjs +36 -1
- package/browser/errors/worker.errors.mjs +14 -0
- 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/front-mcp/authorities-rules.check.mjs +15 -1
- package/browser/front-mcp/front-mcp.mjs +4 -6
- package/browser/index.cjs +23640 -16042
- package/browser/index.mjs +37 -2
- package/browser/job/execution/job-execution.manager.mjs +39 -5
- package/browser/job/job-scope.helper.mjs +21 -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/notification/notification.service.mjs +36 -6
- package/browser/provider/create-container.mjs +20 -9
- package/browser/provider/provider.lifecycle.mjs +4 -0
- package/browser/provider/provider.registry.mjs +55 -11
- package/browser/scope/event-publisher.providers.mjs +32 -0
- package/browser/scope/scope.instance.mjs +34 -21
- package/browser/skill/skill-instructions.helper.mjs +12 -6
- package/browser/subsystems.mjs +3 -0
- package/browser/tool/flows/tools-list.flow.mjs +3 -33
- 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 +76 -3
- package/browser/transport/in-memory-server.mjs +3 -0
- 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 +2 -1
- 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/worker/worker.lifecycle.mjs +199 -0
- package/browser/worker/worker.supervisor.mjs +111 -0
- package/browser/workflow/tools/register-workflow.tool.mjs +3 -3
- package/browser/workflow/trigger/workflow-events.mjs +3 -1
- package/browser/workflow/trigger/workflow-schedules.mjs +173 -0
- package/browser/workflow/trigger/workflow-triggers.mjs +31 -0
- 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 +4 -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.utils.d.ts +20 -0
- package/channel/channel.utils.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/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/scope.entry.d.ts +3 -0
- package/common/entries/scope.entry.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/worker.interface.d.ts +13 -0
- package/common/interfaces/worker.interface.d.ts.map +1 -0
- package/common/metadata/agent.metadata.d.ts +1 -1
- package/common/metadata/app.metadata.d.ts +4 -1
- 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/front-mcp.metadata.d.ts +1652 -16
- 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 +1 -1
- package/common/metadata/prompt.metadata.d.ts +1 -1
- package/common/metadata/resource.metadata.d.ts +2 -2
- 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 +31 -3
- 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 +1 -0
- package/common/tokens/workflow.tokens.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 +11 -9
- 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/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/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/errors/duty.errors.d.ts +10 -0
- package/errors/duty.errors.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 +4 -1
- package/errors/index.d.ts.map +1 -1
- package/errors/worker.errors.d.ts +7 -0
- package/errors/worker.errors.d.ts.map +1 -0
- package/esm/index.mjs +38 -34
- 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/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.map +1 -1
- package/index.d.ts +70 -0
- package/index.d.ts.map +1 -1
- package/index.js +46 -42
- package/job/execution/job-execution.manager.d.ts +7 -0
- package/job/execution/job-execution.manager.d.ts.map +1 -1
- package/job/job-scope.helper.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/notification/index.d.ts +1 -1
- package/notification/index.d.ts.map +1 -1
- package/notification/notification.service.d.ts +31 -2
- package/notification/notification.service.d.ts.map +1 -1
- package/package.json +11 -10
- 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/scope/event-publisher.providers.d.ts +17 -0
- package/scope/event-publisher.providers.d.ts.map +1 -0
- package/scope/scope.instance.d.ts +6 -1
- 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/skill-instructions.helper.d.ts +10 -4
- package/skill/skill-instructions.helper.d.ts.map +1 -1
- package/subsystems.d.ts +1 -0
- package/subsystems.d.ts.map +1 -1
- package/tool/flows/tools-list.flow.d.ts +0 -11
- package/tool/flows/tools-list.flow.d.ts.map +1 -1
- 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/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/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/tools/register-workflow.tool.d.ts +2 -1
- package/workflow/tools/register-workflow.tool.d.ts.map +1 -1
- package/workflow/trigger/workflow-events.d.ts.map +1 -1
- 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 +16 -1
- package/workflow/trigger/workflow-triggers.d.ts.map +1 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { internalZ as z } from '@frontmcp/lazy-zod';
|
|
2
|
+
import { type AuthInfo, type PollEventsResult } from '@frontmcp/protocol';
|
|
3
|
+
import { EventEntry, FlowBase, type EventContext, type EventSubscriptionRef, type FlowRunOptions } from '../../common';
|
|
4
|
+
import { type EventReader } from '../event-gates';
|
|
5
|
+
declare const inputSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
6
|
+
request: import("@frontmcp/lazy-zod").ZodObject<{
|
|
7
|
+
method: import("@frontmcp/lazy-zod").ZodLiteral<"events/poll">;
|
|
8
|
+
params: import("@frontmcp/lazy-zod").ZodObject<{
|
|
9
|
+
cursor: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNullable<import("@frontmcp/lazy-zod").ZodString>>;
|
|
10
|
+
maxAgeMs: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
11
|
+
maxEvents: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
12
|
+
_meta: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
13
|
+
name: import("@frontmcp/lazy-zod").ZodString;
|
|
14
|
+
arguments: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
15
|
+
}, import("zod/v4/core").$strip>;
|
|
16
|
+
}, import("zod/v4/core").$strip>;
|
|
17
|
+
ctx: import("@frontmcp/lazy-zod").ZodUnknown;
|
|
18
|
+
}, import("zod/v4/core").$strip>;
|
|
19
|
+
declare const outputSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
20
|
+
events: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodObject<{
|
|
21
|
+
eventId: import("@frontmcp/lazy-zod").ZodString;
|
|
22
|
+
name: import("@frontmcp/lazy-zod").ZodString;
|
|
23
|
+
timestamp: import("@frontmcp/lazy-zod").ZodString;
|
|
24
|
+
data: import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>;
|
|
25
|
+
cursor: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNullable<import("@frontmcp/lazy-zod").ZodString>>;
|
|
26
|
+
_meta: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
27
|
+
}, import("zod/v4/core").$strip>>;
|
|
28
|
+
cursor: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNullable<import("@frontmcp/lazy-zod").ZodString>>;
|
|
29
|
+
truncated: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
30
|
+
hasMore: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
31
|
+
nextPollMs: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
32
|
+
_meta: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
33
|
+
resultType: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
34
|
+
}, import("zod/v4/core").$strip>;
|
|
35
|
+
declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
36
|
+
authInfo: z.ZodType<Partial<AuthInfo>>;
|
|
37
|
+
dialect: import("@frontmcp/lazy-zod").ZodEnum<{
|
|
38
|
+
"sep-3415": "sep-3415";
|
|
39
|
+
sketch: "sketch";
|
|
40
|
+
}>;
|
|
41
|
+
event: import("zod").ZodInstanceOf<EventEntry>;
|
|
42
|
+
reader: z.ZodType<EventReader>;
|
|
43
|
+
arguments: import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>;
|
|
44
|
+
context: z.ZodType<EventContext>;
|
|
45
|
+
subscription: z.ZodType<EventSubscriptionRef>;
|
|
46
|
+
result: z.ZodType<PollEventsResult>;
|
|
47
|
+
}, import("zod/v4/core").$strip>;
|
|
48
|
+
declare const plan: {
|
|
49
|
+
readonly pre: ["parseInput", "resolveDialect", "findEvent", "resolveReader", "checkEntryAuthorities", "validateArguments", "authorize"];
|
|
50
|
+
readonly execute: ["renewLease", "readEvents"];
|
|
51
|
+
readonly post: ["buildResult"];
|
|
52
|
+
readonly finalize: ["finalize"];
|
|
53
|
+
};
|
|
54
|
+
declare global {
|
|
55
|
+
interface ExtendFlows {
|
|
56
|
+
'events:poll': FlowRunOptions<EventPollFlow, typeof plan, typeof inputSchema, typeof outputSchema, typeof stateSchema>;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
declare const name: "events:poll";
|
|
60
|
+
/** `events/poll`: the occurrences of one event since a cursor, for the caller and its arguments. */
|
|
61
|
+
export default class EventPollFlow extends FlowBase<typeof name> {
|
|
62
|
+
logger: import("../../common").FrontMcpLogger;
|
|
63
|
+
/** The event registry of a scope that performs the poll mode. */
|
|
64
|
+
private get events();
|
|
65
|
+
/** The JSON-RPC codes of the caller's dialect. */
|
|
66
|
+
private get codes();
|
|
67
|
+
/** Read the caller's auth from the request context. */
|
|
68
|
+
parseInput(): Promise<void>;
|
|
69
|
+
/** Pick the dialect a refusal is answered in. */
|
|
70
|
+
resolveDialect(): Promise<void>;
|
|
71
|
+
/** Find the event, offered to the caller's surface in the poll mode. */
|
|
72
|
+
findEvent(): Promise<void>;
|
|
73
|
+
/** Name the reader: a signed-in caller, or the anonymous callers of a public server together. */
|
|
74
|
+
resolveReader(): Promise<void>;
|
|
75
|
+
/** Evaluate the event's `authorities` with the request's arguments as input, on every poll. */
|
|
76
|
+
checkEntryAuthorities(): Promise<void>;
|
|
77
|
+
/** Parse the arguments with the event's input schema, and name the subscription this poll stands for. */
|
|
78
|
+
validateArguments(): Promise<void>;
|
|
79
|
+
/** Run the event's own `authorize()` on the context its other methods run on. */
|
|
80
|
+
authorize(): Promise<void>;
|
|
81
|
+
/** Keep the poll subscription alive for an event with lifecycle methods: its first poll calls `onSubscribe`. */
|
|
82
|
+
renewLease(): Promise<void>;
|
|
83
|
+
/** Read from the event's `check()` when it has one, else from the buffer of published occurrences. */
|
|
84
|
+
readEvents(): Promise<void>;
|
|
85
|
+
/** Answer with the occurrences, the cursor to poll from next, and when to poll again. */
|
|
86
|
+
buildResult(): Promise<void>;
|
|
87
|
+
/** Runs however the poll ended, answered or refused, so a hook on it sees every poll. */
|
|
88
|
+
finalize(): Promise<void>;
|
|
89
|
+
/** The most occurrences this poll returns: the request's `maxEvents`, within the server's. */
|
|
90
|
+
private get limit();
|
|
91
|
+
/** The oldest time this poll replays from, when the request bounds it and names a cursor. */
|
|
92
|
+
private replayFloor;
|
|
93
|
+
/** Start or renew the lease of this poll's subscription, within the limit of leases a caller may hold. */
|
|
94
|
+
private renewLeaseFor;
|
|
95
|
+
/** Ask the event's `check()` for what happened since the cursor, and shape its answer as occurrences. */
|
|
96
|
+
private readFromCheck;
|
|
97
|
+
/** The `data` a `check()` returned, validated against the payload schema: a mismatch is the event's mistake. */
|
|
98
|
+
private checkedPayload;
|
|
99
|
+
/** Read the published occurrences after the cursor that this reader may receive, up to the limit. */
|
|
100
|
+
private readFromBuffer;
|
|
101
|
+
/** A buffered occurrence as this reader receives it; undefined when it is not for this reader. */
|
|
102
|
+
private occurrenceFor;
|
|
103
|
+
}
|
|
104
|
+
export {};
|
|
105
|
+
//# sourceMappingURL=event-poll.flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-poll.flow.d.ts","sourceRoot":"","sources":["../../../src/event/flows/event-poll.flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAIL,KAAK,QAAQ,EAEb,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,UAAU,EAEV,QAAQ,EAGR,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAEzB,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAOL,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AAOxB,QAAA,MAAM,WAAW;;;;;;;;;;;;;gCAGf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;gCAAyB,CAAC;AAE5C,QAAA,MAAM,WAAW;cACM,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;;;;;;YAG9B,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;;aAErB,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;kBAClB,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;YACrC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;gCAC9C,CAAC;AAEH,QAAA,MAAM,IAAI;;;;;CAa2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,aAAa,EAAE,cAAc,CAC3B,aAAa,EACb,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,aAAsB,CAAC;AAGpC,oGAAoG;AAQpG,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IAC9D,MAAM,wCAA2C;IAEjD,iEAAiE;IACjE,OAAO,KAAK,MAAM,GAEjB;IAED,kDAAkD;IAClD,OAAO,KAAK,KAAK,GAEhB;IAED,uDAAuD;IAEjD,UAAU;IAKhB,iDAAiD;IAE3C,cAAc;IAKpB,wEAAwE;IAElE,SAAS;IAKf,iGAAiG;IAE3F,aAAa;IAKnB,+FAA+F;IAEzF,qBAAqB;IAM3B,yGAAyG;IAEnG,iBAAiB;IASvB,iFAAiF;IAE3E,SAAS;IAOf,gHAAgH;IAE1G,UAAU;IAIhB,sGAAsG;IAEhG,UAAU;IAShB,yFAAyF;IAEnF,WAAW;IAIjB,yFAAyF;IAEnF,QAAQ;IAId,8FAA8F;IAC9F,OAAO,KAAK,KAAK,GAGhB;IAED,6FAA6F;IAC7F,OAAO,CAAC,WAAW;IAMnB,0GAA0G;YAC5F,aAAa;IAiB3B,yGAAyG;YAC3F,aAAa;IA4C3B,gHAAgH;IAChH,OAAO,CAAC,cAAc;IAatB,qGAAqG;YACvF,cAAc;IA+B5B,kGAAkG;YACpF,aAAa;CAiB5B"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { AuthInfo } from '@frontmcp/protocol';
|
|
2
|
+
import { EventEntry, FlowBase, type FlowRunOptions, type ScopeEntry, type ServerRequest } from '../../common';
|
|
3
|
+
/** The largest body of a publish request, in bytes: what one delivery may carry. */
|
|
4
|
+
export declare const EVENT_PUBLISH_MAX_BODY_BYTES = 262144;
|
|
5
|
+
declare const inputSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
6
|
+
request: import("zod").ZodCustom<Record<string, unknown>, Record<string, unknown>>;
|
|
7
|
+
response: import("zod").ZodCustom<Record<string, unknown>, Record<string, unknown>>;
|
|
8
|
+
next: import("@frontmcp/lazy-zod").ZodOptional<import("zod").ZodFunction<import("zod/v4/core").$ZodFunctionArgs, import("zod/v4/core").$ZodFunctionOut>>;
|
|
9
|
+
}, import("zod/v4/core").$strip>;
|
|
10
|
+
declare const outputSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
11
|
+
kind: import("@frontmcp/lazy-zod").ZodLiteral<"json">;
|
|
12
|
+
status: import("@frontmcp/lazy-zod").ZodNumber;
|
|
13
|
+
body: import("@frontmcp/lazy-zod").ZodUnion<readonly [import("@frontmcp/lazy-zod").ZodObject<{}, import("zod/v4/core").$loose>, import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodAny>, import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodAny>]>;
|
|
14
|
+
contentType: import("@frontmcp/lazy-zod").ZodDefault<import("@frontmcp/lazy-zod").ZodString>;
|
|
15
|
+
headers: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodDefault<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnion<readonly [import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnion<readonly [import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>]>]>>>>;
|
|
16
|
+
cookies: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodDefault<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodObject<{
|
|
17
|
+
name: import("@frontmcp/lazy-zod").ZodString;
|
|
18
|
+
value: import("@frontmcp/lazy-zod").ZodString;
|
|
19
|
+
path: import("@frontmcp/lazy-zod").ZodDefault<import("@frontmcp/lazy-zod").ZodString>;
|
|
20
|
+
domain: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
21
|
+
httpOnly: import("@frontmcp/lazy-zod").ZodDefault<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
22
|
+
secure: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
23
|
+
sameSite: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodEnum<{
|
|
24
|
+
none: "none";
|
|
25
|
+
strict: "strict";
|
|
26
|
+
lax: "lax";
|
|
27
|
+
}>>;
|
|
28
|
+
maxAge: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
29
|
+
expires: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodDate>;
|
|
30
|
+
}, import("zod/v4/core").$strip>>>>;
|
|
31
|
+
}, import("zod/v4/core").$strip>;
|
|
32
|
+
declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
33
|
+
body: import("zod").ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
|
|
34
|
+
caller: import("@frontmcp/lazy-zod").ZodOptional<import("zod").ZodCustom<Partial<AuthInfo>, Partial<AuthInfo>>>;
|
|
35
|
+
publication: import("@frontmcp/lazy-zod").ZodObject<{
|
|
36
|
+
name: import("@frontmcp/lazy-zod").ZodString;
|
|
37
|
+
data: import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>;
|
|
38
|
+
eventId: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
39
|
+
timestamp: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
40
|
+
subscriptionId: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
41
|
+
audience: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodObject<{
|
|
42
|
+
sub: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodUnion<readonly [import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>]>>;
|
|
43
|
+
tenantId: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodUnion<readonly [import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>]>>;
|
|
44
|
+
roles: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodObject<{
|
|
45
|
+
any: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
46
|
+
all: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
47
|
+
}, import("zod/v4/core").$strict>>;
|
|
48
|
+
}, import("zod/v4/core").$strict>>;
|
|
49
|
+
}, import("zod/v4/core").$strict>;
|
|
50
|
+
event: import("zod").ZodInstanceOf<EventEntry>;
|
|
51
|
+
claimedEventId: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
52
|
+
claimToken: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
53
|
+
result: import("@frontmcp/lazy-zod").ZodObject<{
|
|
54
|
+
eventId: import("@frontmcp/lazy-zod").ZodString;
|
|
55
|
+
matched: import("@frontmcp/lazy-zod").ZodNumber;
|
|
56
|
+
}, import("zod/v4/core").$strip>;
|
|
57
|
+
}, import("zod/v4/core").$strip>;
|
|
58
|
+
declare const plan: {
|
|
59
|
+
readonly pre: ["checkIpFilter", "acquireQuota", "readBody", "authenticate", "parseBody", "checkAuthorities", "findEvent", "validatePayload"];
|
|
60
|
+
readonly execute: ["claimEventId", "publish", "rememberResult", "buildResponse"];
|
|
61
|
+
readonly finalize: ["finalize"];
|
|
62
|
+
};
|
|
63
|
+
declare global {
|
|
64
|
+
interface ExtendFlows {
|
|
65
|
+
'events:publish-http': FlowRunOptions<EventPublishHttpFlow, typeof plan, typeof inputSchema, typeof outputSchema, typeof stateSchema>;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
declare const name: "events:publish-http";
|
|
69
|
+
/** `events:publish-http`: publish one event for a `POST` to the server's publish endpoint. */
|
|
70
|
+
export default class EventPublishHttpFlow extends FlowBase<typeof name> {
|
|
71
|
+
logger: import("../../common").FrontMcpLogger;
|
|
72
|
+
/** Whether the request is a `POST` to the publish endpoint of a scope that serves one. */
|
|
73
|
+
static canActivate(request: ServerRequest, scope: ScopeEntry): boolean;
|
|
74
|
+
/** The event registry of the scope: the flow is registered with it. */
|
|
75
|
+
private get events();
|
|
76
|
+
/** The endpoint the flow serves; it is registered only on a scope that has one. */
|
|
77
|
+
private get endpoint();
|
|
78
|
+
/** The publisher of the scope, which the registry has from startup. */
|
|
79
|
+
private get publisher();
|
|
80
|
+
/** The HTTP request the flow answers. */
|
|
81
|
+
private get httpRequest();
|
|
82
|
+
/** Answer the request with an error and end the flow. */
|
|
83
|
+
private refuse;
|
|
84
|
+
/** Refuse a caller `throttle.ipFilter` blocks. */
|
|
85
|
+
checkIpFilter(): Promise<void>;
|
|
86
|
+
/** Count the request against the server's global rate limit. */
|
|
87
|
+
acquireQuota(): Promise<void>;
|
|
88
|
+
/** Take the body's bytes: JSON, no larger than one delivery may be. */
|
|
89
|
+
readBody(): Promise<void>;
|
|
90
|
+
/** Know the caller: by the request's signature when the endpoint has a `secret`, else by bearer credentials. */
|
|
91
|
+
authenticate(): Promise<void>;
|
|
92
|
+
/** Read what to publish from the body. */
|
|
93
|
+
parseBody(): Promise<void>;
|
|
94
|
+
/** Evaluate `events.publishEndpoint.authorities` for the bearer caller, with the request body as input. */
|
|
95
|
+
checkAuthorities(): Promise<void>;
|
|
96
|
+
/** Find the event the request names. */
|
|
97
|
+
findEvent(): Promise<void>;
|
|
98
|
+
/** Check `data` against the event's `payloadSchema`; a mismatch is answered with where and why, never with the data. */
|
|
99
|
+
validatePayload(): Promise<void>;
|
|
100
|
+
/** For a request that names an `eventId`: answer what its first publish got, or claim it for this one. */
|
|
101
|
+
claimEventId(): Promise<void>;
|
|
102
|
+
/** Publish through the server's publisher, as `this.events.publish()` does; a failure gives the `eventId` back. */
|
|
103
|
+
publish(): Promise<void>;
|
|
104
|
+
/** Keep the answer of a claimed `eventId`, for a repeat; the event is published, so a store failure only logs. */
|
|
105
|
+
rememberResult(): Promise<void>;
|
|
106
|
+
/** Answer `202` with the event's id and how many deliveries were queued. */
|
|
107
|
+
buildResponse(): Promise<void>;
|
|
108
|
+
/** Runs however the request ended, answered or failed, so a hook on it sees every request. */
|
|
109
|
+
finalize(): Promise<void>;
|
|
110
|
+
/** The signed-in caller of a bearer request: an unverified or anonymous one is answered 401, a short scope 403. */
|
|
111
|
+
private verifyBearer;
|
|
112
|
+
}
|
|
113
|
+
export {};
|
|
114
|
+
//# sourceMappingURL=event-publish-http.flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-publish-http.flow.d.ts","sourceRoot":"","sources":["../../../src/event/flows/event-publish-http.flow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAKL,UAAU,EAEV,QAAQ,EAQR,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAOtB,oFAAoF;AACpF,eAAO,MAAM,4BAA4B,SAAU,CAAC;AAiCpD,QAAA,MAAM,WAAW;;;;gCAAkB,CAAC;AACpC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;gCAAiB,CAAC;AAEpC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;gCAQf,CAAC;AAGH,QAAA,MAAM,IAAI;;;;CAa2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,qBAAqB,EAAE,cAAc,CACnC,oBAAoB,EACpB,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,qBAA8B,CAAC;AAuB5C,8FAA8F;AAS9F,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IACrE,MAAM,wCAAkD;IAExD,0FAA0F;IAC1F,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO;IAOtE,uEAAuE;IACvE,OAAO,KAAK,MAAM,GAEjB;IAED,mFAAmF;IACnF,OAAO,KAAK,QAAQ,GAEnB;IAED,uEAAuE;IACvE,OAAO,KAAK,SAAS,GAEpB;IAED,yCAAyC;IACzC,OAAO,KAAK,WAAW,GAEtB;IAED,yDAAyD;IACzD,OAAO,CAAC,MAAM;IASd,kDAAkD;IAE5C,aAAa;IAInB,gEAAgE;IAE1D,YAAY;IAIlB,uEAAuE;IAEjE,QAAQ;IAUd,gHAAgH;IAE1G,YAAY;IAclB,0CAA0C;IAEpC,SAAS;IAMf,2GAA2G;IAErG,gBAAgB;IActB,wCAAwC;IAElC,SAAS;IAOf,wHAAwH;IAElH,eAAe;IAYrB,0GAA0G;IAEpG,YAAY;IAWlB,mHAAmH;IAE7G,OAAO;IAcb,kHAAkH;IAE5G,cAAc;IAepB,4EAA4E;IAEtE,aAAa;IAInB,8FAA8F;IAExF,QAAQ;IAId,mHAAmH;YACrG,YAAY;CAe3B"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { internalZ as z } from '@frontmcp/lazy-zod';
|
|
2
|
+
import { type EventOccurrence } from '@frontmcp/protocol';
|
|
3
|
+
import { EventEntry, FlowBase, type EventAudience, type EventContext, type EventSubscriber, type FlowRunOptions } from '../../common';
|
|
4
|
+
import { type BufferedEvent } from '../poll/event-buffer';
|
|
5
|
+
import { type EventSubscriptionRecord } from '../subscription/event-subscription.store';
|
|
6
|
+
/** The largest body of one delivery, in bytes. A larger event is not delivered to that subscription. */
|
|
7
|
+
export declare const EVENT_DELIVERY_MAX_BYTES = 262144;
|
|
8
|
+
/** One subscription a published event goes to, with the event as that subscription receives it. */
|
|
9
|
+
export interface EventDeliveryPlan {
|
|
10
|
+
subscription: EventSubscriptionRecord;
|
|
11
|
+
occurrence: EventOccurrence;
|
|
12
|
+
/** The serialized occurrence, set once it is known to fit. */
|
|
13
|
+
body?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const inputSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
16
|
+
occurrence: import("@frontmcp/lazy-zod").ZodObject<{
|
|
17
|
+
eventId: import("@frontmcp/lazy-zod").ZodString;
|
|
18
|
+
name: import("@frontmcp/lazy-zod").ZodString;
|
|
19
|
+
timestamp: import("@frontmcp/lazy-zod").ZodString;
|
|
20
|
+
data: import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>;
|
|
21
|
+
cursor: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNullable<import("@frontmcp/lazy-zod").ZodString>>;
|
|
22
|
+
_meta: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
23
|
+
}, import("zod/v4/core").$strip>;
|
|
24
|
+
subscriptionId: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
25
|
+
audience: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodObject<{
|
|
26
|
+
sub: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodUnion<readonly [import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>]>>;
|
|
27
|
+
tenantId: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodUnion<readonly [import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>]>>;
|
|
28
|
+
roles: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodObject<{
|
|
29
|
+
any: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
30
|
+
all: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
31
|
+
}, import("zod/v4/core").$strip>>;
|
|
32
|
+
}, import("zod/v4/core").$strip>>;
|
|
33
|
+
}, import("zod/v4/core").$strip>;
|
|
34
|
+
declare const outputSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
35
|
+
eventId: import("@frontmcp/lazy-zod").ZodString;
|
|
36
|
+
matched: import("@frontmcp/lazy-zod").ZodNumber;
|
|
37
|
+
}, import("zod/v4/core").$strip>;
|
|
38
|
+
declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
39
|
+
event: import("zod").ZodInstanceOf<EventEntry>;
|
|
40
|
+
context: z.ZodType<EventContext>;
|
|
41
|
+
subscriptions: import("@frontmcp/lazy-zod").ZodArray<z.ZodType<EventSubscriptionRecord, unknown>>;
|
|
42
|
+
deliveries: import("@frontmcp/lazy-zod").ZodArray<z.ZodType<EventDeliveryPlan, unknown>>;
|
|
43
|
+
buffered: z.ZodType<BufferedEvent | undefined>;
|
|
44
|
+
}, import("zod/v4/core").$strip>;
|
|
45
|
+
declare const plan: {
|
|
46
|
+
readonly pre: ["validate", "bufferOccurrence", "pushToStreams"];
|
|
47
|
+
readonly execute: ["loadSubscriptions", "dropInactive", "filterByAudience", "reauthorize", "match", "transform", "enforceBodyLimit", "enqueue", "bridgeToBus", "notifyChannelSessions"];
|
|
48
|
+
readonly post: ["buildResult"];
|
|
49
|
+
};
|
|
50
|
+
declare global {
|
|
51
|
+
interface ExtendFlows {
|
|
52
|
+
'events:publish': FlowRunOptions<EventPublishFlow, typeof plan, typeof inputSchema, typeof outputSchema, typeof stateSchema>;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** The `webhook-id` of one event on one subscription: a publish the client repeats sends the same one, to deduplicate. */
|
|
56
|
+
export declare function eventWebhookIdOf(subscriptionId: string, eventId: string): string;
|
|
57
|
+
declare const name: "events:publish";
|
|
58
|
+
/** Whether the owner of a subscription is in the audience of a published event. */
|
|
59
|
+
export declare function isInAudience(audience: EventAudience | undefined, subscriber: EventSubscriber): boolean;
|
|
60
|
+
/** `events:publish`: queue one delivery of a published event for each subscription that should receive it. */
|
|
61
|
+
export default class EventPublishFlow extends FlowBase<typeof name> {
|
|
62
|
+
logger: import("../../common").FrontMcpLogger;
|
|
63
|
+
/** The event registry of the scope: the flow is registered with it. */
|
|
64
|
+
private get events();
|
|
65
|
+
/** Find the event and the context its `match` and `transform` run on. */
|
|
66
|
+
validate(): Promise<void>;
|
|
67
|
+
/** Keep the occurrence for `events/poll` and `events/stream`, before any filter; an event neither offers is not kept. */
|
|
68
|
+
bufferOccurrence(): Promise<void>;
|
|
69
|
+
/** Push the occurrence on the open `events/stream` requests of its event: each stream filters for its reader. */
|
|
70
|
+
pushToStreams(): Promise<void>;
|
|
71
|
+
/** Load the subscriptions of the event, or the one a targeted publish names. */
|
|
72
|
+
loadSubscriptions(): Promise<void>;
|
|
73
|
+
/** Leave out suspended subscriptions, and end one without expiry that stayed suspended too long. */
|
|
74
|
+
dropInactive(): Promise<void>;
|
|
75
|
+
/** Keep the subscriptions whose owner the publisher's `audience` names. */
|
|
76
|
+
filterByAudience(): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Check an owner whose last check is old against the event's `authorities`, then its `authorize()`, again. A refusal
|
|
79
|
+
* ends the subscription; a check that could not be made neither delivers nor ends it, and is made again next time.
|
|
80
|
+
*/
|
|
81
|
+
reauthorize(): Promise<void>;
|
|
82
|
+
/** Ask the event's `match()` which subscriptions receive the event; one that throws is left out alone. */
|
|
83
|
+
match(): Promise<void>;
|
|
84
|
+
/** Let the event's `transform()` shape the event for each subscription; one that throws is left out alone. */
|
|
85
|
+
transform(): Promise<void>;
|
|
86
|
+
/** Serialize each delivery once, and drop one whose body is over the limit: an event is never truncated. */
|
|
87
|
+
enforceBodyLimit(): Promise<void>;
|
|
88
|
+
/** Hand one delivery per subscription to the outbox, with the `webhook-id` its dialect uses. */
|
|
89
|
+
enqueue(): Promise<void>;
|
|
90
|
+
/** Emit the occurrence once on the scope's event bus, under its name, for workflows and channels that listen to it. */
|
|
91
|
+
bridgeToBus(): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Send an occurrence of an event with `channel` to each Claude Code session whose caller may see it. One published
|
|
94
|
+
* for a subscription is for no session, and a session that fails is logged and left out alone.
|
|
95
|
+
*/
|
|
96
|
+
notifyChannelSessions(): Promise<void>;
|
|
97
|
+
/** Answer with the event's id and how many deliveries were queued. */
|
|
98
|
+
buildResult(): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Send a channel message to one session, when the event's own rules let the caller of its latest request see the
|
|
101
|
+
* occurrence: the `audience`, then the event's `authorities` and `authorize()`, with no subscription arguments. A
|
|
102
|
+
* session whose caller's credentials have expired is sent nothing.
|
|
103
|
+
*/
|
|
104
|
+
private notifyChannelSession;
|
|
105
|
+
/** End a subscription the server no longer serves: remove it, tell its event, and tell its callback when the dialect does. */
|
|
106
|
+
private terminate;
|
|
107
|
+
}
|
|
108
|
+
export {};
|
|
109
|
+
//# sourceMappingURL=event-publish.flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-publish.flow.d.ts","sourceRoot":"","sources":["../../../src/event/flows/event-publish.flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIjF,OAAO,EACL,UAAU,EAEV,QAAQ,EAER,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EAEpB,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAM1D,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAExF,wGAAwG;AACxG,eAAO,MAAM,wBAAwB,SAAU,CAAC;AAEhD,mGAAmG;AACnG,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,uBAAuB,CAAC;IACtC,UAAU,EAAE,eAAe,CAAC;IAC5B,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAID,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;gCAUf,CAAC;AAEH,QAAA,MAAM,YAAY;;;gCAGhB,CAAC;AAEH,QAAA,MAAM,WAAW;;aAEK,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;;;cAGtB,CAAC,CAAC,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;gCACzD,CAAC;AAEH,QAAA,MAAM,IAAI;;;;CAe2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,gBAAgB,EAAE,cAAc,CAC9B,gBAAgB,EAChB,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,0HAA0H;AAC1H,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhF;AAED,QAAA,MAAM,IAAI,EAAG,gBAAyB,CAAC;AAWvC,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,SAAS,EAAE,UAAU,EAAE,eAAe,GAAG,OAAO,CAQtG;AAED,8GAA8G;AAQ9G,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IACjE,MAAM,wCAA8C;IAEpD,uEAAuE;IACvE,OAAO,KAAK,MAAM,GAEjB;IAED,yEAAyE;IAEnE,QAAQ;IAQd,yHAAyH;IAEnH,gBAAgB;IAOtB,iHAAiH;IAE3G,aAAa;IAKnB,gFAAgF;IAE1E,iBAAiB;IAkBvB,oGAAoG;IAE9F,YAAY;IAsBlB,2EAA2E;IAErE,gBAAgB;IAQtB;;;OAGG;IAEG,WAAW;IAqCjB,0GAA0G;IAEpG,KAAK;IAeX,8GAA8G;IAExG,SAAS;IAgBf,4GAA4G;IAEtG,gBAAgB;IAkBtB,gGAAgG;IAE1F,OAAO;IAkBb,uHAAuH;IAEjH,WAAW;IAOjB;;;OAGG;IAEG,qBAAqB;IAqB3B,sEAAsE;IAEhE,WAAW;IAIjB;;;;OAIG;YACW,oBAAoB;IA0BlC,8HAA8H;YAChH,SAAS;CAIxB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { internalZ as z } from '@frontmcp/lazy-zod';
|
|
2
|
+
import { type AuthInfo } from '@frontmcp/protocol';
|
|
3
|
+
import { EventEntry, FlowBase, type EventContext, type EventSubscriptionRef, type FlowRunOptions } from '../../common';
|
|
4
|
+
import { type EventReader } from '../event-gates';
|
|
5
|
+
import { EventStream } from '../stream/event-stream';
|
|
6
|
+
declare const inputSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
7
|
+
request: import("@frontmcp/lazy-zod").ZodObject<{
|
|
8
|
+
method: import("@frontmcp/lazy-zod").ZodLiteral<"events/stream">;
|
|
9
|
+
params: import("@frontmcp/lazy-zod").ZodObject<{
|
|
10
|
+
cursor: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNullable<import("@frontmcp/lazy-zod").ZodString>>;
|
|
11
|
+
maxAgeMs: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
12
|
+
_meta: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
13
|
+
name: import("@frontmcp/lazy-zod").ZodString;
|
|
14
|
+
arguments: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
15
|
+
}, import("zod/v4/core").$strip>;
|
|
16
|
+
}, import("zod/v4/core").$strip>;
|
|
17
|
+
ctx: import("@frontmcp/lazy-zod").ZodUnknown;
|
|
18
|
+
requestId: import("@frontmcp/lazy-zod").ZodUnion<readonly [import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodNumber]>;
|
|
19
|
+
signal: z.ZodType<AbortSignal | undefined>;
|
|
20
|
+
}, import("zod/v4/core").$strip>;
|
|
21
|
+
declare const outputSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
22
|
+
stream: import("zod").ZodInstanceOf<EventStream>;
|
|
23
|
+
}, import("zod/v4/core").$strip>;
|
|
24
|
+
declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
25
|
+
authInfo: z.ZodType<Partial<AuthInfo>>;
|
|
26
|
+
dialect: import("@frontmcp/lazy-zod").ZodEnum<{
|
|
27
|
+
"sep-3415": "sep-3415";
|
|
28
|
+
sketch: "sketch";
|
|
29
|
+
}>;
|
|
30
|
+
event: import("zod").ZodInstanceOf<EventEntry>;
|
|
31
|
+
reader: z.ZodType<EventReader>;
|
|
32
|
+
arguments: import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>;
|
|
33
|
+
context: z.ZodType<EventContext>;
|
|
34
|
+
subscription: z.ZodType<EventSubscriptionRef>;
|
|
35
|
+
stream: import("zod").ZodInstanceOf<EventStream>;
|
|
36
|
+
}, import("zod/v4/core").$strip>;
|
|
37
|
+
declare const plan: {
|
|
38
|
+
readonly pre: ["parseInput", "resolveDialect", "findEvent", "resolveReader", "checkEntryAuthorities", "validateArguments", "authorize"];
|
|
39
|
+
readonly execute: ["openStream"];
|
|
40
|
+
readonly post: ["buildResult"];
|
|
41
|
+
readonly finalize: ["finalize"];
|
|
42
|
+
};
|
|
43
|
+
declare global {
|
|
44
|
+
interface ExtendFlows {
|
|
45
|
+
'events:stream': FlowRunOptions<EventStreamFlow, typeof plan, typeof inputSchema, typeof outputSchema, typeof stateSchema>;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
declare const name: "events:stream";
|
|
49
|
+
/** `events/stream`: open the stream one subscription is pushed on, for as long as its request lives. */
|
|
50
|
+
export default class EventStreamFlow extends FlowBase<typeof name> {
|
|
51
|
+
logger: import("../../common").FrontMcpLogger;
|
|
52
|
+
/** The event registry of a scope that performs the push mode. */
|
|
53
|
+
private get events();
|
|
54
|
+
/** The JSON-RPC codes of the caller's dialect. */
|
|
55
|
+
private get codes();
|
|
56
|
+
/** Read the caller's auth from the request context. */
|
|
57
|
+
parseInput(): Promise<void>;
|
|
58
|
+
/** Pick the dialect a refusal is answered in. */
|
|
59
|
+
resolveDialect(): Promise<void>;
|
|
60
|
+
/** Find the event, offered to the caller's surface in the push mode. */
|
|
61
|
+
findEvent(): Promise<void>;
|
|
62
|
+
/** Name the reader: a signed-in caller, or an anonymous caller of a public server. */
|
|
63
|
+
resolveReader(): Promise<void>;
|
|
64
|
+
/** Evaluate the event's `authorities` with the request's arguments as input. */
|
|
65
|
+
checkEntryAuthorities(): Promise<void>;
|
|
66
|
+
/** Parse the arguments with the event's input schema, and name the subscription this stream stands for. */
|
|
67
|
+
validateArguments(): Promise<void>;
|
|
68
|
+
/** Run the event's own `authorize()` on the context its other methods run on. */
|
|
69
|
+
authorize(): Promise<void>;
|
|
70
|
+
/** Open the stream within the caller's limit: `onSubscribe` first, `onUnsubscribe(..., 'closed')` when it ends. */
|
|
71
|
+
openStream(): Promise<void>;
|
|
72
|
+
/** Answer with the open stream: the transport sends its notifications, then the final frame. */
|
|
73
|
+
buildResult(): Promise<void>;
|
|
74
|
+
/** Runs however the open ended, answered or refused, so a hook on it sees every stream request. */
|
|
75
|
+
finalize(): Promise<void>;
|
|
76
|
+
}
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=event-stream.flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-stream.flow.d.ts","sourceRoot":"","sources":["../../../src/event/flows/event-stream.flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAA6B,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9E,OAAO,EACL,UAAU,EAEV,QAAQ,EAER,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAEzB,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAOL,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGrD,QAAA,MAAM,WAAW;;;;;;;;;;;;;YAMe,CAAC,CAAC,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;gCAChE,CAAC;AAEH,QAAA,MAAM,YAAY;;gCAEhB,CAAC;AAEH,QAAA,MAAM,WAAW;cACM,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;;;;;;YAG9B,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;;aAErB,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;kBAClB,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;;gCAExD,CAAC;AAEH,QAAA,MAAM,IAAI;;;;;CAa2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,eAAe,EAAE,cAAc,CAC7B,eAAe,EACf,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,eAAwB,CAAC;AAGtC,wGAAwG;AAQxG,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IAChE,MAAM,wCAA6C;IAEnD,iEAAiE;IACjE,OAAO,KAAK,MAAM,GAEjB;IAED,kDAAkD;IAClD,OAAO,KAAK,KAAK,GAEhB;IAED,uDAAuD;IAEjD,UAAU;IAKhB,iDAAiD;IAE3C,cAAc;IAKpB,wEAAwE;IAElE,SAAS;IAKf,sFAAsF;IAEhF,aAAa;IAKnB,gFAAgF;IAE1E,qBAAqB;IAM3B,2GAA2G;IAErG,iBAAiB;IASvB,iFAAiF;IAE3E,SAAS;IAOf,mHAAmH;IAE7G,UAAU;IA+DhB,gGAAgG;IAE1F,WAAW;IAIjB,mGAAmG;IAE7F,QAAQ;CAGf"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { internalZ as z } from '@frontmcp/lazy-zod';
|
|
2
|
+
import { type AuthInfo } from '@frontmcp/protocol';
|
|
3
|
+
import { EventEntry, FlowBase, type FlowRunOptions } from '../../common';
|
|
4
|
+
import { type EventSubscriberIdentity } from '../event-subscriber';
|
|
5
|
+
import { type EventSubscriptionRecord } from '../subscription/event-subscription.store';
|
|
6
|
+
declare const inputSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
7
|
+
request: import("@frontmcp/lazy-zod").ZodObject<{
|
|
8
|
+
method: import("@frontmcp/lazy-zod").ZodLiteral<"events/subscribe">;
|
|
9
|
+
params: import("@frontmcp/lazy-zod").ZodObject<{
|
|
10
|
+
delivery: import("@frontmcp/lazy-zod").ZodObject<{
|
|
11
|
+
mode: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodEnum<{
|
|
12
|
+
poll: "poll";
|
|
13
|
+
push: "push";
|
|
14
|
+
webhook: "webhook";
|
|
15
|
+
}>>;
|
|
16
|
+
url: import("@frontmcp/lazy-zod").ZodString;
|
|
17
|
+
secret: import("@frontmcp/lazy-zod").ZodString;
|
|
18
|
+
}, import("zod/v4/core").$strip>;
|
|
19
|
+
cursor: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNullable<import("@frontmcp/lazy-zod").ZodString>>;
|
|
20
|
+
maxAgeMs: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
21
|
+
ttlMs: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNullable<import("@frontmcp/lazy-zod").ZodNumber>>;
|
|
22
|
+
_meta: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
23
|
+
name: import("@frontmcp/lazy-zod").ZodString;
|
|
24
|
+
arguments: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
25
|
+
}, import("zod/v4/core").$strip>;
|
|
26
|
+
}, import("zod/v4/core").$strip>;
|
|
27
|
+
ctx: import("@frontmcp/lazy-zod").ZodUnknown;
|
|
28
|
+
}, import("zod/v4/core").$strip>;
|
|
29
|
+
declare const outputSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
30
|
+
id: import("@frontmcp/lazy-zod").ZodString;
|
|
31
|
+
refreshBefore: import("@frontmcp/lazy-zod").ZodNullable<import("@frontmcp/lazy-zod").ZodString>;
|
|
32
|
+
cursor: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNullable<import("@frontmcp/lazy-zod").ZodString>>;
|
|
33
|
+
truncated: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
34
|
+
deliveryStatus: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodObject<{
|
|
35
|
+
active: import("@frontmcp/lazy-zod").ZodBoolean;
|
|
36
|
+
lastDeliveryAt: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNullable<import("@frontmcp/lazy-zod").ZodString>>;
|
|
37
|
+
lastError: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNullable<import("@frontmcp/lazy-zod").ZodEnum<{
|
|
38
|
+
connection_refused: "connection_refused";
|
|
39
|
+
timeout: "timeout";
|
|
40
|
+
tls_error: "tls_error";
|
|
41
|
+
http_4xx: "http_4xx";
|
|
42
|
+
http_5xx: "http_5xx";
|
|
43
|
+
challenge_failed: "challenge_failed";
|
|
44
|
+
}>>>;
|
|
45
|
+
failedSince: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNullable<import("@frontmcp/lazy-zod").ZodString>>;
|
|
46
|
+
throttled: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
47
|
+
retryAfterMs: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
48
|
+
}, import("zod/v4/core").$strip>>;
|
|
49
|
+
_meta: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
50
|
+
resultType: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
51
|
+
}, import("zod/v4/core").$strip>;
|
|
52
|
+
declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
53
|
+
authInfo: z.ZodType<Partial<AuthInfo>>;
|
|
54
|
+
dialect: import("@frontmcp/lazy-zod").ZodEnum<{
|
|
55
|
+
"sep-3415": "sep-3415";
|
|
56
|
+
sketch: "sketch";
|
|
57
|
+
}>;
|
|
58
|
+
event: import("zod").ZodInstanceOf<EventEntry>;
|
|
59
|
+
owner: z.ZodType<EventSubscriberIdentity>;
|
|
60
|
+
arguments: import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>;
|
|
61
|
+
subscriptionId: import("@frontmcp/lazy-zod").ZodString;
|
|
62
|
+
argumentsKey: import("@frontmcp/lazy-zod").ZodString;
|
|
63
|
+
existing: z.ZodType<EventSubscriptionRecord | undefined>;
|
|
64
|
+
verifiedAt: import("@frontmcp/lazy-zod").ZodNumber;
|
|
65
|
+
expiresAt: import("@frontmcp/lazy-zod").ZodNullable<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
66
|
+
record: z.ZodType<EventSubscriptionRecord>;
|
|
67
|
+
truncated: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
68
|
+
}, import("zod/v4/core").$strip>;
|
|
69
|
+
declare const plan: {
|
|
70
|
+
readonly pre: ["parseInput", "resolveDialect", "findEvent", "checkAvailability", "requireWebhookMode", "requireSubscriber", "checkEntryAuthorities", "validateArguments", "authorize", "validateDelivery"];
|
|
71
|
+
readonly execute: ["findSubscription", "enforceLimits", "verifyCallback", "grantTtl", "upsertSubscription", "notifySubscribed", "startReplay"];
|
|
72
|
+
readonly post: ["buildResult"];
|
|
73
|
+
readonly finalize: ["finalize"];
|
|
74
|
+
};
|
|
75
|
+
declare global {
|
|
76
|
+
interface ExtendFlows {
|
|
77
|
+
'events:subscribe': FlowRunOptions<EventSubscribeFlow, typeof plan, typeof inputSchema, typeof outputSchema, typeof stateSchema>;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
declare const name: "events:subscribe";
|
|
81
|
+
/** `events/subscribe`: create or refresh the caller's webhook subscription to one event. */
|
|
82
|
+
export default class EventSubscribeFlow extends FlowBase<typeof name> {
|
|
83
|
+
logger: import("../../common").FrontMcpLogger;
|
|
84
|
+
/** The event registry of a scope that serves webhook subscriptions. */
|
|
85
|
+
private get events();
|
|
86
|
+
/** The subscriptions of the scope; the flow is registered only when it has them. */
|
|
87
|
+
private get subscriptions();
|
|
88
|
+
/** The JSON-RPC codes of the caller's dialect. */
|
|
89
|
+
private get codes();
|
|
90
|
+
/** Read the caller's auth from the request context. */
|
|
91
|
+
parseInput(): Promise<void>;
|
|
92
|
+
/** Pick the dialect every error and the stored subscription are answered in. */
|
|
93
|
+
resolveDialect(): Promise<void>;
|
|
94
|
+
/** Find the event the request names. */
|
|
95
|
+
findEvent(): Promise<void>;
|
|
96
|
+
/** An event `availableWhen.surface` keeps from the caller's surface is answered as an unknown one. */
|
|
97
|
+
checkAvailability(): Promise<void>;
|
|
98
|
+
/** Refuse a delivery mode other than webhook, and an event that is not offered by webhook. */
|
|
99
|
+
requireWebhookMode(): Promise<void>;
|
|
100
|
+
/** A webhook subscription has an owner: an anonymous caller cannot create one. */
|
|
101
|
+
requireSubscriber(): Promise<void>;
|
|
102
|
+
/** Evaluate the event's `authorities` with the subscription arguments as input. */
|
|
103
|
+
checkEntryAuthorities(): Promise<void>;
|
|
104
|
+
/** Parse the arguments with the event's input schema. */
|
|
105
|
+
validateArguments(): Promise<void>;
|
|
106
|
+
/** Run the event's own `authorize()`: whatever it throws refuses the subscription. */
|
|
107
|
+
authorize(): Promise<void>;
|
|
108
|
+
/** Refuse a callback URL the server must not call and a secret that is not a Standard Webhooks one. */
|
|
109
|
+
validateDelivery(): Promise<void>;
|
|
110
|
+
/** Derive the subscription's id and load the one stored under it, ending it first when its lifetime is over. */
|
|
111
|
+
findSubscription(): Promise<void>;
|
|
112
|
+
/** A new subscription counts against the caller's limit; a refresh does not. */
|
|
113
|
+
enforceLimits(): Promise<void>;
|
|
114
|
+
/** Prove the callback accepts deliveries before the subscription is stored. */
|
|
115
|
+
verifyCallback(): Promise<void>;
|
|
116
|
+
/** Decide when the subscription ends. */
|
|
117
|
+
grantTtl(): Promise<void>;
|
|
118
|
+
/** Store the subscription; a refresh replaces the secret, the owner snapshot and the lifetime, and reactivates it. */
|
|
119
|
+
upsertSubscription(): Promise<void>;
|
|
120
|
+
/** Call `onSubscribe` for a new subscription only; when it throws, the subscription is taken back. */
|
|
121
|
+
notifySubscribed(): Promise<void>;
|
|
122
|
+
/** For an event with `check()`: read its upstream from the request's cursor, or report where a refresh stands. */
|
|
123
|
+
startReplay(): Promise<void>;
|
|
124
|
+
/** Where the loop stands for a stored subscription now: it may have moved on while the callback was verified. */
|
|
125
|
+
private currentReplayOf;
|
|
126
|
+
/** Answer with the id, the granted lifetime and, on a refresh, the delivery status. */
|
|
127
|
+
buildResult(): Promise<void>;
|
|
128
|
+
/** Runs after a success or a failure, so hooks that must see both attach here. */
|
|
129
|
+
finalize(): Promise<void>;
|
|
130
|
+
}
|
|
131
|
+
export {};
|
|
132
|
+
//# sourceMappingURL=event-subscribe.flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-subscribe.flow.d.ts","sourceRoot":"","sources":["../../../src/event/flows/event-subscribe.flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAA2D,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG5G,OAAO,EAAE,UAAU,EAAQ,QAAQ,EAA8B,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAc3G,OAAO,EAAqB,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEtF,OAAO,EAAE,KAAK,uBAAuB,EAAgC,MAAM,0CAA0C,CAAC;AAGtH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;gCAGf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;gCAA6B,CAAC;AAEhD,QAAA,MAAM,WAAW;cACM,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;;;;;;WAG/B,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC;;;;cAI/B,CAAC,CAAC,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC;;;YAGhD,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC;;gCAGrD,CAAC;AAEH,QAAA,MAAM,IAAI;;;;;CAwB2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,kBAAkB,EAAE,cAAc,CAChC,kBAAkB,EAClB,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,kBAA2B,CAAC;AAgBzC,4FAA4F;AAQ5F,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IACnE,MAAM,wCAAgD;IAEtD,uEAAuE;IACvE,OAAO,KAAK,MAAM,GAEjB;IAED,oFAAoF;IACpF,OAAO,KAAK,aAAa,GAExB;IAED,kDAAkD;IAClD,OAAO,KAAK,KAAK,GAEhB;IAED,uDAAuD;IAEjD,UAAU;IAKhB,gFAAgF;IAE1E,cAAc;IAKpB,wCAAwC;IAElC,SAAS;IAOf,sGAAsG;IAEhG,iBAAiB;IAOvB,8FAA8F;IAExF,kBAAkB;IAUxB,kFAAkF;IAE5E,iBAAiB;IAQvB,mFAAmF;IAE7E,qBAAqB;IAc3B,yDAAyD;IAEnD,iBAAiB;IAWvB,sFAAsF;IAEhF,SAAS;IAWf,uGAAuG;IAEjG,gBAAgB;IAYtB,gHAAgH;IAE1G,gBAAgB;IAWtB,gFAAgF;IAE1E,aAAa;IAOnB,+EAA+E;IAEzE,cAAc;IAoBpB,yCAAyC;IAEnC,QAAQ;IAKd,sHAAsH;IAEhH,kBAAkB;IA8BxB,sGAAsG;IAEhG,gBAAgB;IAYtB,kHAAkH;IAE5G,WAAW;IAWjB,iHAAiH;YACnG,eAAe;IAK7B,uFAAuF;IAEjF,WAAW;IAWjB,kFAAkF;IAE5E,QAAQ;CAGf"}
|