@atolis-hq/wake 0.4.2 → 0.4.8
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/dist/src/activities/agent/agent-activity-definition.d.ts +9 -0
- package/dist/src/activities/agent/agent-activity.d.ts +51 -0
- package/dist/src/activities/agent/agent-result.d.ts +43 -0
- package/dist/src/activities/contracts/activity.d.ts +184 -0
- package/dist/src/activities/contracts/config.d.ts +3 -0
- package/dist/src/activities/contracts/decision-claim-schema.d.ts +35 -0
- package/dist/src/activities/contracts/decision-claim-schema.js +42 -0
- package/dist/src/activities/contracts/event-factory.d.ts +6 -0
- package/dist/src/activities/contracts/event-factory.js +40 -0
- package/dist/src/activities/contracts/event-integrity.d.ts +61 -0
- package/dist/src/activities/contracts/event-integrity.js +50 -0
- package/dist/src/activities/contracts/event-schema.d.ts +2803 -0
- package/dist/src/activities/contracts/event-schema.js +67 -121
- package/dist/src/activities/contracts/events.d.ts +153 -0
- package/dist/src/activities/contracts/events.js +4 -4
- package/dist/src/activities/contracts/identifiers.d.ts +5 -0
- package/dist/src/activities/contracts/registry.d.ts +19 -0
- package/dist/src/activities/contracts/streams.d.ts +13 -0
- package/dist/src/activities/contracts/vocabulary.d.ts +69 -0
- package/dist/src/activities/index.d.ts +23 -0
- package/dist/src/activities/index.js +1 -0
- package/dist/src/activities/issue/complete.d.ts +26 -0
- package/dist/src/activities/issue/complete.js +5 -5
- package/dist/src/activities/pr/activity-support.d.ts +38 -0
- package/dist/src/activities/pr/activity-support.js +1 -1
- package/dist/src/activities/pr/application.d.ts +17 -0
- package/dist/src/activities/pr/application.js +6 -6
- package/dist/src/activities/pr/approve.d.ts +7 -0
- package/dist/src/activities/pr/approve.js +8 -3
- package/dist/src/activities/pr/capability.d.ts +2 -0
- package/dist/src/activities/pr/contracts.d.ts +133 -0
- package/dist/src/activities/pr/decision-claim.d.ts +26 -0
- package/dist/src/activities/pr/decision-claim.js +50 -30
- package/dist/src/activities/pr/event-data.d.ts +21 -0
- package/dist/src/activities/pr/event-data.js +101 -0
- package/dist/src/activities/pr/intent.d.ts +12 -0
- package/dist/src/activities/pr/intent.js +5 -5
- package/dist/src/activities/pr/merge-authority-gate.d.ts +13 -0
- package/dist/src/activities/pr/merge-authority-gate.js +1 -1
- package/dist/src/activities/pr/merge.d.ts +7 -0
- package/dist/src/activities/pr/merge.js +8 -3
- package/dist/src/activities/pr/policy.d.ts +13 -0
- package/dist/src/activities/pr/projection.d.ts +5 -0
- package/dist/src/activities/pr/projection.js +18 -17
- package/dist/src/activities/pr/vocabulary.d.ts +34 -0
- package/dist/src/activities/review/authorization.d.ts +9 -0
- package/dist/src/activities/review/contracts.d.ts +46 -0
- package/dist/src/activities/review/signals.d.ts +2 -0
- package/dist/src/bootstrap/activation-scheduler-serialiser.d.ts +3 -0
- package/dist/src/bootstrap/activation-scheduler-serialiser.js +8 -0
- package/dist/src/bootstrap/activity-registry.d.ts +4 -0
- package/dist/src/bootstrap/analytics-projection.d.ts +12 -0
- package/dist/src/bootstrap/analytics-projection.js +3 -3
- package/dist/src/bootstrap/board-projection.d.ts +56 -0
- package/dist/src/bootstrap/board-projection.js +156 -71
- package/dist/src/bootstrap/composition-root.d.ts +76 -0
- package/dist/src/bootstrap/composition-root.js +20 -13
- package/dist/src/bootstrap/config/load-config.d.ts +6 -0
- package/dist/src/bootstrap/config/root-schema.d.ts +443 -0
- package/dist/src/bootstrap/event-processor-runtime.d.ts +22 -0
- package/dist/src/bootstrap/event-processor-runtime.js +88 -0
- package/dist/src/bootstrap/external-ref.d.ts +3 -0
- package/dist/src/bootstrap/fake-provider-files.d.ts +3 -0
- package/dist/src/bootstrap/fake-scenarios.d.ts +3 -0
- package/dist/src/bootstrap/index.d.ts +27 -0
- package/dist/src/bootstrap/index.js +2 -28
- package/dist/src/bootstrap/initialise.d.ts +4 -0
- package/dist/src/bootstrap/initialise.js +8 -16
- package/dist/src/bootstrap/integration-runtime.d.ts +48 -0
- package/dist/src/bootstrap/integration-runtime.js +36 -54
- package/dist/src/bootstrap/paths.d.ts +12 -0
- package/dist/src/bootstrap/persistence-composition.d.ts +21 -0
- package/dist/src/bootstrap/persistence-composition.js +12 -4
- package/dist/src/bootstrap/projection-runtime.d.ts +16 -0
- package/dist/src/bootstrap/projection-runtime.js +50 -23
- package/dist/src/bootstrap/resource-transition-evidence.d.ts +11 -0
- package/dist/src/bootstrap/runner-quota-reporter.d.ts +6 -0
- package/dist/src/bootstrap/runner-quota-reporter.js +16 -11
- package/dist/src/bootstrap/runner-registry.d.ts +3 -0
- package/dist/src/bootstrap/runner-tick-adapter.d.ts +16 -0
- package/dist/src/bootstrap/runner-tick-adapter.js +57 -0
- package/dist/src/bootstrap/schedule-checkpoint-store.d.ts +9 -0
- package/dist/src/bootstrap/self-update-application.d.ts +54 -0
- package/dist/src/bootstrap/self-update-failure-log.d.ts +17 -0
- package/dist/src/bootstrap/source-update-port.d.ts +8 -0
- package/dist/src/bootstrap/status-publish-activity.d.ts +7 -0
- package/dist/src/bootstrap/status-publish-activity.js +4 -5
- package/dist/src/bootstrap/surface-api-applications.d.ts +18 -0
- package/dist/src/bootstrap/surface-api-applications.js +104 -57
- package/dist/src/bootstrap/surface-api-execution-applications.d.ts +3 -0
- package/dist/src/bootstrap/surface-api-execution-applications.js +3 -3
- package/dist/src/bootstrap/surface-api-metadata.d.ts +4 -0
- package/dist/src/bootstrap/surface-api-metadata.js +1 -1
- package/dist/src/bootstrap/surface-api-projection-pages.d.ts +12 -0
- package/dist/src/bootstrap/surface-api-run-context.d.ts +12 -0
- package/dist/src/bootstrap/surface-api-transcripts.d.ts +10 -0
- package/dist/src/bootstrap/surface-api-work-applications.d.ts +3 -0
- package/dist/src/bootstrap/surface-api-work-applications.js +3 -3
- package/dist/src/bootstrap/surface-api-workflow-diagrams.d.ts +11 -0
- package/dist/src/bootstrap/surface-api-workflow-diagrams.js +2 -2
- package/dist/src/bootstrap/surface-applications.d.ts +10 -0
- package/dist/src/bootstrap/surface-cli-applications.d.ts +33 -0
- package/dist/src/bootstrap/surface-cli-applications.js +151 -65
- package/dist/src/bootstrap/transcript-retention.d.ts +11 -0
- package/dist/src/bootstrap/update-ledger.d.ts +9 -0
- package/dist/src/bootstrap/update-maintenance-lease.d.ts +24 -0
- package/dist/src/bootstrap/update-maintenance-lease.js +1 -1
- package/dist/src/bootstrap/version.d.ts +13 -0
- package/dist/src/bootstrap/version.js +1 -1
- package/dist/src/control-plane/application/activation-scheduler-ports.d.ts +71 -0
- package/dist/src/control-plane/application/activation-scheduler-subscriber.d.ts +42 -0
- package/dist/src/control-plane/application/activation-scheduler-subscriber.js +111 -0
- package/dist/src/control-plane/application/activation-scheduler.d.ts +8 -0
- package/dist/src/control-plane/application/activation-scheduler.js +165 -0
- package/dist/src/control-plane/application/advance-once-dispatch.d.ts +46 -0
- package/dist/src/control-plane/application/advance-once-dispatch.js +6 -7
- package/dist/src/control-plane/application/advance-once.d.ts +5 -0
- package/dist/src/control-plane/application/advance-once.js +4 -158
- package/dist/src/control-plane/application/control-plane-projection.d.ts +21 -0
- package/dist/src/control-plane/application/control-plane-projection.js +27 -5
- package/dist/src/control-plane/application/control-plane-service.d.ts +12 -0
- package/dist/src/control-plane/application/control-plane-service.js +28 -9
- package/dist/src/control-plane/application/execution-reconciliation.d.ts +21 -0
- package/dist/src/control-plane/application/intake-pipeline.d.ts +18 -0
- package/dist/src/control-plane/application/intake-pipeline.js +8 -18
- package/dist/src/control-plane/application/runner-control-service.d.ts +12 -0
- package/dist/src/control-plane/application/runner-control-service.js +35 -13
- package/dist/src/control-plane/application/runner-pipeline.d.ts +24 -0
- package/dist/src/control-plane/application/runner-pipeline.js +23 -41
- package/dist/src/control-plane/application/schedule-service.d.ts +31 -0
- package/dist/src/control-plane/application/schedule-service.js +1 -1
- package/dist/src/control-plane/application/work-cancellation-policy.d.ts +20 -0
- package/dist/src/control-plane/application/work-cancellation-policy.js +1 -1
- package/dist/src/control-plane/contracts/commands.d.ts +20 -0
- package/dist/src/control-plane/contracts/config.d.ts +30 -0
- package/dist/src/control-plane/contracts/config.js +7 -1
- package/dist/src/control-plane/contracts/event-factory.d.ts +6 -0
- package/dist/src/control-plane/contracts/event-factory.js +14 -0
- package/dist/src/control-plane/contracts/events.d.ts +36 -0
- package/dist/src/control-plane/contracts/events.js +42 -47
- package/dist/src/control-plane/contracts/streams.d.ts +6 -0
- package/dist/src/control-plane/contracts/views.d.ts +28 -0
- package/dist/src/control-plane/domain/dispatch-policy.d.ts +18 -0
- package/dist/src/control-plane/domain/quota-policy.d.ts +21 -0
- package/dist/src/control-plane/domain/runner-quota.d.ts +2 -0
- package/dist/src/control-plane/domain/schedule-policy.d.ts +8 -0
- package/dist/src/control-plane/index.d.ts +24 -0
- package/dist/src/control-plane/index.js +3 -0
- package/dist/src/control-plane/infrastructure/intake-host.d.ts +19 -0
- package/dist/src/control-plane/infrastructure/intake-host.js +2 -3
- package/dist/src/control-plane/infrastructure/resident-host.d.ts +16 -0
- package/dist/src/control-plane/infrastructure/resident-host.js +3 -1
- package/dist/src/control-plane/infrastructure/tick-host.d.ts +6 -0
- package/dist/src/control-plane/infrastructure/tick-host.js +2 -2
- package/dist/src/conversations/application/conversation-projection.d.ts +3 -0
- package/dist/src/conversations/application/conversation-repository.d.ts +13 -0
- package/dist/src/conversations/application/conversation-repository.js +1 -1
- package/dist/src/conversations/application/conversation-service.d.ts +16 -0
- package/dist/src/conversations/application/conversation-service.js +32 -27
- package/dist/src/conversations/contracts/commands.d.ts +33 -0
- package/dist/src/conversations/contracts/event-factory.d.ts +6 -0
- package/dist/src/conversations/contracts/event-factory.js +18 -0
- package/dist/src/conversations/contracts/events.d.ts +42 -0
- package/dist/src/conversations/contracts/events.js +37 -24
- package/dist/src/conversations/contracts/identifiers.d.ts +5 -0
- package/dist/src/conversations/contracts/streams.d.ts +7 -0
- package/dist/src/conversations/contracts/views.d.ts +49 -0
- package/dist/src/conversations/contracts/vocabulary.d.ts +5 -0
- package/dist/src/conversations/domain/conversation.d.ts +4 -0
- package/dist/src/conversations/domain/conversation.js +8 -7
- package/dist/src/conversations/index.d.ts +9 -0
- package/dist/src/conversations/index.js +1 -0
- package/dist/src/execution/application/activation-claim.d.ts +23 -0
- package/dist/src/execution/application/activation-claim.js +8 -9
- package/dist/src/execution/application/active-run-cancellation.d.ts +4 -0
- package/dist/src/execution/application/active-run-cancellation.js +2 -2
- package/dist/src/execution/application/execution-activity.d.ts +61 -0
- package/dist/src/execution/application/execution-activity.js +4 -1
- package/dist/src/execution/application/execution-projection.d.ts +11 -0
- package/dist/src/execution/application/execution-projection.js +8 -4
- package/dist/src/execution/application/execution-service.d.ts +33 -0
- package/dist/src/execution/application/execution-service.js +288 -59
- package/dist/src/execution/application/execution-validation.d.ts +8 -0
- package/dist/src/execution/application/execution-validation.js +3 -2
- package/dist/src/execution/application/recovery-service.d.ts +52 -0
- package/dist/src/execution/application/recovery-service.js +32 -17
- package/dist/src/execution/application/run-lifecycle.d.ts +75 -0
- package/dist/src/execution/application/run-lifecycle.js +130 -62
- package/dist/src/execution/application/run-liveness-service.d.ts +14 -0
- package/dist/src/execution/application/run-liveness-service.js +68 -30
- package/dist/src/execution/application/run-repository.d.ts +18 -0
- package/dist/src/execution/application/run-repository.js +2 -2
- package/dist/src/execution/contracts/commands.d.ts +30 -0
- package/dist/src/execution/contracts/config.d.ts +94 -0
- package/dist/src/execution/contracts/control-plane.d.ts +10 -0
- package/dist/src/execution/contracts/event-factory.d.ts +10 -0
- package/dist/src/execution/contracts/event-factory.js +20 -31
- package/dist/src/execution/contracts/events.d.ts +198 -0
- package/dist/src/execution/contracts/events.js +152 -129
- package/dist/src/execution/contracts/identifiers.d.ts +3 -0
- package/dist/src/execution/contracts/liveness.d.ts +17 -0
- package/dist/src/execution/contracts/results.d.ts +23 -0
- package/dist/src/execution/contracts/runner.d.ts +78 -0
- package/dist/src/execution/contracts/streams.d.ts +12 -0
- package/dist/src/execution/contracts/views.d.ts +42 -0
- package/dist/src/execution/contracts/vocabulary.d.ts +50 -0
- package/dist/src/execution/contracts/vocabulary.js +4 -0
- package/dist/src/execution/contracts/workspace.d.ts +48 -0
- package/dist/src/execution/domain/run-result.d.ts +2 -0
- package/dist/src/execution/domain/run.d.ts +3 -0
- package/dist/src/execution/domain/run.js +72 -22
- package/dist/src/execution/index.d.ts +34 -0
- package/dist/src/execution/infrastructure/agent-runner-adapter.d.ts +2 -0
- package/dist/src/execution/infrastructure/codex-stop-hook.d.ts +13 -0
- package/dist/src/execution/infrastructure/process-execution.d.ts +23 -0
- package/dist/src/execution/infrastructure/prompt-templates.d.ts +15 -0
- package/dist/src/execution/infrastructure/runner-memory-profile.d.ts +11 -0
- package/dist/src/execution/infrastructure/runners/claude.d.ts +34 -0
- package/dist/src/execution/infrastructure/runners/codex.d.ts +13 -0
- package/dist/src/execution/infrastructure/runners/command.d.ts +3 -0
- package/dist/src/execution/infrastructure/runners/cursor.d.ts +12 -0
- package/dist/src/execution/infrastructure/runners/fake-scenarios.d.ts +35 -0
- package/dist/src/execution/infrastructure/runners/fake.d.ts +8 -0
- package/dist/src/execution/infrastructure/runners/registry.d.ts +14 -0
- package/dist/src/execution/infrastructure/transcript-store.d.ts +48 -0
- package/dist/src/execution/infrastructure/transcripts.d.ts +1 -0
- package/dist/src/execution/infrastructure/workspace/fake-workspace.d.ts +36 -0
- package/dist/src/execution/infrastructure/workspace/fake-workspace.js +2 -0
- package/dist/src/execution/infrastructure/workspace/git-workspace.d.ts +29 -0
- package/dist/src/execution/infrastructure/workspace/git-workspace.js +21 -11
- package/dist/src/execution/infrastructure/workspace/prepare-workspace.d.ts +3 -0
- package/dist/src/execution/infrastructure/workspace/prepare-workspace.js +4 -2
- package/dist/src/integrations/application/adapter-health-tracker.d.ts +17 -0
- package/dist/src/integrations/application/agent-run-publication-reactor.d.ts +25 -0
- package/dist/src/integrations/application/agent-run-publication-reactor.js +36 -20
- package/dist/src/integrations/application/artifact-registration-reactor.d.ts +32 -0
- package/dist/src/integrations/application/artifact-registration-reactor.js +43 -35
- package/dist/src/integrations/application/poll-service.d.ts +13 -0
- package/dist/src/integrations/application/poll-service.js +2 -2
- package/dist/src/integrations/application/terminal-agent-run-report.d.ts +33 -0
- package/dist/src/integrations/application/work-admission.d.ts +30 -0
- package/dist/src/integrations/application/work-conclusion.d.ts +13 -0
- package/dist/src/integrations/contracts/artifact-event-factory.d.ts +6 -0
- package/dist/src/integrations/contracts/artifact-event-factory.js +8 -0
- package/dist/src/integrations/contracts/artifact-events.d.ts +31 -0
- package/dist/src/integrations/contracts/artifact-events.js +24 -24
- package/dist/src/integrations/contracts/artifact-vocabulary.d.ts +11 -0
- package/dist/src/integrations/contracts/config.d.ts +13 -0
- package/dist/src/integrations/contracts/identifiers.d.ts +3 -0
- package/dist/src/integrations/contracts/intake-rules.d.ts +15 -0
- package/dist/src/integrations/contracts/intake.d.ts +15 -0
- package/dist/src/integrations/contracts/outcome-vocabulary.d.ts +6 -0
- package/dist/src/integrations/contracts/provider.d.ts +105 -0
- package/dist/src/integrations/contracts/reply-routing.d.ts +31 -0
- package/dist/src/integrations/contracts/streams.d.ts +12 -0
- package/dist/src/integrations/delivery/application/delivery-outcome-reactor.d.ts +24 -0
- package/dist/src/integrations/delivery/application/delivery-outcome-reactor.js +151 -73
- package/dist/src/integrations/delivery/application/delivery-projector.d.ts +5 -0
- package/dist/src/integrations/delivery/application/delivery-projector.js +52 -52
- package/dist/src/integrations/delivery/application/delivery-service.d.ts +40 -0
- package/dist/src/integrations/delivery/application/delivery-service.js +15 -16
- package/dist/src/integrations/delivery/contracts/commands.d.ts +7 -0
- package/dist/src/integrations/delivery/contracts/config.d.ts +25 -0
- package/dist/src/integrations/delivery/contracts/event-factory.d.ts +11 -0
- package/dist/src/integrations/delivery/contracts/event-factory.js +20 -9
- package/dist/src/integrations/delivery/contracts/events.d.ts +46 -0
- package/dist/src/integrations/delivery/contracts/events.js +33 -18
- package/dist/src/integrations/delivery/contracts/intents.d.ts +54 -0
- package/dist/src/integrations/delivery/contracts/intents.js +21 -14
- package/dist/src/integrations/delivery/contracts/views.d.ts +47 -0
- package/dist/src/integrations/delivery/contracts/vocabulary.d.ts +25 -0
- package/dist/src/integrations/fake/durable-delivery-provider.d.ts +29 -0
- package/dist/src/integrations/fake/external-sink.d.ts +5 -0
- package/dist/src/integrations/fake/external-source.d.ts +30 -0
- package/dist/src/integrations/fake/external-source.js +1 -3
- package/dist/src/integrations/fake/inbound-translator.d.ts +16 -0
- package/dist/src/integrations/fake/inbound-translator.js +22 -10
- package/dist/src/integrations/fake/provider.d.ts +38 -0
- package/dist/src/integrations/fake/provider.js +3 -1
- package/dist/src/integrations/github/application/agent-context-reader.d.ts +6 -0
- package/dist/src/integrations/github/application/agent-context-reader.js +10 -7
- package/dist/src/integrations/github/application/agent-run-comment.d.ts +22 -0
- package/dist/src/integrations/github/application/comment-history-reader.d.ts +25 -0
- package/dist/src/integrations/github/application/comment-history-reader.js +36 -32
- package/dist/src/integrations/github/application/delivery-marker.d.ts +2 -0
- package/dist/src/integrations/github/application/inbound-comment-syntax.d.ts +8 -0
- package/dist/src/integrations/github/application/inbound-context.d.ts +3 -0
- package/dist/src/integrations/github/application/inbound-context.js +4 -4
- package/dist/src/integrations/github/application/inbound-review-signals.d.ts +21 -0
- package/dist/src/integrations/github/application/inbound-review-signals.js +30 -25
- package/dist/src/integrations/github/application/inbound-translator.d.ts +103 -0
- package/dist/src/integrations/github/application/inbound-translator.js +149 -160
- package/dist/src/integrations/github/application/inbound-watch-gate-signals.d.ts +10 -0
- package/dist/src/integrations/github/application/inbound-watch-gate-signals.js +4 -4
- package/dist/src/integrations/github/application/intake-policy.d.ts +7 -0
- package/dist/src/integrations/github/application/operator-retry-command.d.ts +1 -0
- package/dist/src/integrations/github/application/outbound-translator.d.ts +19 -0
- package/dist/src/integrations/github/application/poll-service.d.ts +11 -0
- package/dist/src/integrations/github/application/poll-service.js +11 -2
- package/dist/src/integrations/github/application/pull-request-translation.d.ts +5 -0
- package/dist/src/integrations/github/application/reply-target-selector.d.ts +8 -0
- package/dist/src/integrations/github/application/resource-links.d.ts +2 -0
- package/dist/src/integrations/github/application/review-command-translator.d.ts +14 -0
- package/dist/src/integrations/github/application/wake-labels.d.ts +29 -0
- package/dist/src/integrations/github/contracts/check-evidence.d.ts +1 -0
- package/dist/src/integrations/github/contracts/config.d.ts +81 -0
- package/dist/src/integrations/github/contracts/event-factory.d.ts +6 -0
- package/dist/src/integrations/github/contracts/event-factory.js +26 -0
- package/dist/src/integrations/github/contracts/events.d.ts +135 -0
- package/dist/src/integrations/github/contracts/events.js +118 -132
- package/dist/src/integrations/github/contracts/external-key.d.ts +8 -0
- package/dist/src/integrations/github/contracts/issue-query.d.ts +5 -0
- package/dist/src/integrations/github/contracts/payloads.d.ts +74 -0
- package/dist/src/integrations/github/contracts/vocabulary.d.ts +64 -0
- package/dist/src/integrations/github/index.d.ts +34 -0
- package/dist/src/integrations/github/index.js +1 -0
- package/dist/src/integrations/github/infrastructure/adapter-health-registry.d.ts +11 -0
- package/dist/src/integrations/github/infrastructure/bounded-fetch.d.ts +10 -0
- package/dist/src/integrations/github/infrastructure/client-reads.d.ts +255 -0
- package/dist/src/integrations/github/infrastructure/client.d.ts +263 -0
- package/dist/src/integrations/github/infrastructure/comment-source.d.ts +7 -0
- package/dist/src/integrations/github/infrastructure/content-fingerprint.d.ts +2 -0
- package/dist/src/integrations/github/infrastructure/delivery.d.ts +6 -0
- package/dist/src/integrations/github/infrastructure/etag-cache.d.ts +29 -0
- package/dist/src/integrations/github/infrastructure/gh-auth.d.ts +4 -0
- package/dist/src/integrations/github/infrastructure/issue-source.d.ts +20 -0
- package/dist/src/integrations/github/infrastructure/issue-source.js +10 -6
- package/dist/src/integrations/github/infrastructure/poll-watermark.d.ts +12 -0
- package/dist/src/integrations/github/infrastructure/pr-source.d.ts +16 -0
- package/dist/src/integrations/github/infrastructure/pr-source.js +6 -4
- package/dist/src/integrations/github/infrastructure/request-coordinator.d.ts +13 -0
- package/dist/src/integrations/github/infrastructure/review-source.d.ts +10 -0
- package/dist/src/integrations/github/infrastructure/review-source.js +29 -25
- package/dist/src/integrations/github/infrastructure/source-contracts.d.ts +22 -0
- package/dist/src/integrations/github/infrastructure/source.d.ts +12 -0
- package/dist/src/integrations/github/infrastructure/source.js +3 -5
- package/dist/src/integrations/github/provider.d.ts +3 -0
- package/dist/src/integrations/github/provider.js +14 -12
- package/dist/src/integrations/index.d.ts +32 -0
- package/dist/src/integrations/index.js +1 -0
- package/dist/src/kernel/contracts/clock.d.ts +3 -0
- package/dist/src/kernel/contracts/id-generator.d.ts +3 -0
- package/dist/src/kernel/contracts/identifiers.d.ts +7 -0
- package/dist/src/kernel/contracts/identifiers.js +1 -8
- package/dist/src/kernel/contracts/relations.d.ts +14 -0
- package/dist/src/kernel/contracts/schema.d.ts +3 -0
- package/dist/src/kernel/contracts/vocabulary.d.ts +7 -0
- package/dist/src/kernel/domain/match-mode.d.ts +2 -0
- package/dist/src/kernel/domain/relation.d.ts +9 -0
- package/dist/src/kernel/index.d.ts +10 -0
- package/dist/src/kernel/index.js +0 -11
- package/dist/src/kernel/infrastructure/system-clock.d.ts +4 -0
- package/dist/src/kernel/infrastructure/ulid-id-generator.d.ts +4 -0
- package/dist/src/main.d.ts +15 -0
- package/dist/src/main.js +8 -2
- package/dist/src/node_modules/@atolis-hq/eventing/LICENSE +201 -0
- package/dist/src/node_modules/@atolis-hq/eventing/README.md +41 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/commands.d.ts +9 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/commands.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-envelope.d.ts +13 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-envelope.d.ts.map +1 -0
- package/dist/src/{kernel/domain → node_modules/@atolis-hq/eventing/dist/contracts}/event-envelope.js +4 -4
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-schema.d.ts +83 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-schema.d.ts.map +1 -0
- package/dist/src/{kernel → node_modules/@atolis-hq/eventing/dist}/contracts/event-schema.js +21 -5
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/events.d.ts +46 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/events.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/events.js +10 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/identifiers.d.ts +11 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/identifiers.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/identifiers.js +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/processor-state-store.d.ts +11 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/processor-state-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/index.d.ts +19 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/index.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/index.js +17 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-checkpoint-store.d.ts +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-checkpoint-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-event-journal.d.ts +19 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-event-journal.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-event-journal.js +82 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-run-serialiser.d.ts +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-run-serialiser.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-run-serialiser.js +26 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-state-store.d.ts +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-state-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-state-store.js +20 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-projection-store.d.ts +9 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-projection-store.d.ts.map +1 -0
- package/dist/src/{persistence → node_modules/@atolis-hq/eventing/dist}/memory/in-memory-projection-store.js +2 -1
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-process-journal-change-signal.d.ts +10 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-process-journal-change-signal.d.ts.map +1 -0
- package/dist/src/{kernel/infrastructure/journal-change-signal.js → node_modules/@atolis-hq/eventing/dist/memory/in-process-journal-change-signal.js} +5 -2
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory.d.ts +7 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory.js +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-processor.d.ts +20 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-processor.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-processor.js +83 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-store.d.ts +22 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/cached-journal-view.d.ts +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/cached-journal-view.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/cached-journal-view.js +24 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/clock.d.ts +4 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/clock.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/event-processor-host.d.ts +39 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/event-processor-host.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/event-processor-host.js +168 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-health.d.ts +43 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-health.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-health.js +66 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-run-serialiser.d.ts +2 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-run-serialiser.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-run-serialiser.js +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-validation.d.ts +7 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-validation.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-validation.js +43 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/checkpoint-store.d.ts +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/checkpoint-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/checkpoint-store.js +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/event-journal.d.ts +14 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/event-journal.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/event-processor.d.ts +49 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/event-processor.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/event-processor.js +17 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/journal-change-signal.d.ts +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/journal-change-signal.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/journal-change-signal.js +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/package.json +42 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/LICENSE +201 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/README.md +40 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/atomic-write.d.ts +23 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/atomic-write.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/atomic-write.js +54 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/event-record-codec.d.ts +4 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/event-record-codec.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/event-record-codec.js +50 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-checkpoint-store.d.ts +17 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-checkpoint-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-checkpoint-store.js +99 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-event-journal.d.ts +51 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-event-journal.d.ts.map +1 -0
- package/dist/src/{persistence/filesystem → node_modules/@atolis-hq/eventing-filesystem/dist}/file-event-journal.js +185 -103
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-lock.d.ts +34 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-lock.d.ts.map +1 -0
- package/dist/src/{persistence/filesystem → node_modules/@atolis-hq/eventing-filesystem/dist}/file-lock.js +10 -1
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-run-serialiser.d.ts +9 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-run-serialiser.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-run-serialiser.js +82 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-state-store.d.ts +12 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-state-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-state-store.js +127 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-projection-store.d.ts +19 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-projection-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-projection-store.js +219 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/index.d.ts +7 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/index.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/index.js +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-paths.d.ts +10 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-paths.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-paths.js +27 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-record.d.ts +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-record.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-record.js +28 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/storage-name.d.ts +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/storage-name.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/storage-name.js +34 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/package.json +38 -0
- package/dist/src/orchestration/application/accept-activity-outcome.d.ts +18 -0
- package/dist/src/orchestration/application/accept-signal.d.ts +14 -0
- package/dist/src/orchestration/application/advance-workflow.d.ts +50 -0
- package/dist/src/orchestration/application/advance-workflow.js +7 -12
- package/dist/src/orchestration/application/coordination-claims.d.ts +17 -0
- package/dist/src/orchestration/application/coordination-claims.js +17 -20
- package/dist/src/orchestration/application/durable-append.d.ts +17 -0
- package/dist/src/orchestration/application/durable-append.js +1 -1
- package/dist/src/orchestration/application/group-budget-recorder.d.ts +9 -0
- package/dist/src/orchestration/application/group-budget-recorder.js +9 -6
- package/dist/src/orchestration/application/orchestration-projection.d.ts +6 -0
- package/dist/src/orchestration/application/orchestration-projection.js +6 -7
- package/dist/src/orchestration/application/orchestration-repository.d.ts +23 -0
- package/dist/src/orchestration/application/orchestration-repository.js +2 -2
- package/dist/src/orchestration/application/orchestration-service.d.ts +93 -0
- package/dist/src/orchestration/application/orchestration-service.js +10 -1
- package/dist/src/orchestration/application/pull-request-transition-evidence.d.ts +3 -0
- package/dist/src/orchestration/application/pull-request-transition-evidence.js +10 -10
- package/dist/src/orchestration/application/reactor-command-context.d.ts +5 -0
- package/dist/src/orchestration/application/reactor-command-context.js +9 -0
- package/dist/src/orchestration/application/request-child.d.ts +29 -0
- package/dist/src/orchestration/application/request-child.js +26 -10
- package/dist/src/orchestration/application/resource-transition-evidence.d.ts +18 -0
- package/dist/src/orchestration/application/resource-transition-matching.d.ts +19 -0
- package/dist/src/orchestration/application/resource-transition-matching.js +9 -3
- package/dist/src/orchestration/application/resource-transition-reactor.d.ts +16 -0
- package/dist/src/orchestration/application/resource-transition-reactor.js +21 -42
- package/dist/src/orchestration/application/signal-reactor.d.ts +11 -0
- package/dist/src/orchestration/application/start-workflow.d.ts +18 -0
- package/dist/src/orchestration/application/start-workflow.js +3 -4
- package/dist/src/orchestration/application/trigger-workflow-instance.d.ts +12 -0
- package/dist/src/orchestration/application/trigger-workflow-instance.js +1 -1
- package/dist/src/orchestration/application/watch-child-transitions.d.ts +2 -0
- package/dist/src/orchestration/application/watch-matching.d.ts +13 -0
- package/dist/src/orchestration/application/watch-matching.js +3 -3
- package/dist/src/orchestration/application/watch-reactor.d.ts +42 -0
- package/dist/src/orchestration/application/watch-reactor.js +36 -35
- package/dist/src/orchestration/application/workflow-definition-registry.d.ts +32 -0
- package/dist/src/orchestration/application/workflow-definition-registry.js +13 -11
- package/dist/src/orchestration/contracts/activity-outcome.d.ts +15 -0
- package/dist/src/orchestration/contracts/commands.d.ts +30 -0
- package/dist/src/orchestration/contracts/config.d.ts +356 -0
- package/dist/src/orchestration/contracts/event-decoder.d.ts +262 -0
- package/dist/src/orchestration/contracts/event-decoder.js +88 -64
- package/dist/src/orchestration/contracts/event-factory.d.ts +6 -0
- package/dist/src/orchestration/contracts/event-factory.js +64 -0
- package/dist/src/orchestration/contracts/events.d.ts +233 -0
- package/dist/src/orchestration/contracts/identifiers.d.ts +15 -0
- package/dist/src/orchestration/contracts/streams.d.ts +28 -0
- package/dist/src/orchestration/contracts/views.d.ts +68 -0
- package/dist/src/orchestration/contracts/vocabulary.d.ts +34 -0
- package/dist/src/orchestration/domain/activation-policy.d.ts +60 -0
- package/dist/src/orchestration/domain/activation-policy.js +34 -19
- package/dist/src/orchestration/domain/approval-defaults.d.ts +8 -0
- package/dist/src/orchestration/domain/child-policy.d.ts +20 -0
- package/dist/src/orchestration/domain/compiler.d.ts +3 -0
- package/dist/src/orchestration/domain/coordination-events.d.ts +18 -0
- package/dist/src/orchestration/domain/coordination-events.js +25 -11
- package/dist/src/orchestration/domain/decision-events.d.ts +33 -0
- package/dist/src/orchestration/domain/decision-events.js +26 -15
- package/dist/src/orchestration/domain/interpreter.d.ts +14 -0
- package/dist/src/orchestration/domain/interpreter.js +4 -1
- package/dist/src/orchestration/domain/operator-retry-policy.d.ts +14 -0
- package/dist/src/orchestration/domain/operator-retry-policy.js +29 -11
- package/dist/src/orchestration/domain/resource-transition-compiler.d.ts +8 -0
- package/dist/src/orchestration/domain/retry-policy.d.ts +7 -0
- package/dist/src/orchestration/domain/retry-policy.js +7 -4
- package/dist/src/orchestration/domain/runner-quota-retry-policy.d.ts +10 -0
- package/dist/src/orchestration/domain/runner-quota-retry-policy.js +21 -15
- package/dist/src/orchestration/domain/signal-policy.d.ts +11 -0
- package/dist/src/orchestration/domain/signal-policy.js +18 -7
- package/dist/src/orchestration/domain/supplemental-policy.d.ts +11 -0
- package/dist/src/orchestration/domain/supplemental-policy.js +29 -14
- package/dist/src/orchestration/domain/transition.d.ts +16 -0
- package/dist/src/orchestration/domain/transition.js +46 -28
- package/dist/src/orchestration/domain/workflow-graph.d.ts +4 -0
- package/dist/src/orchestration/domain/workflow-instance-events.d.ts +44 -0
- package/dist/src/orchestration/domain/workflow-instance.d.ts +7 -0
- package/dist/src/orchestration/domain/workflow-instance.js +29 -9
- package/dist/src/orchestration/domain/workflow-selector.d.ts +15 -0
- package/dist/src/orchestration/index.d.ts +27 -0
- package/dist/src/orchestration/index.js +1 -0
- package/dist/src/resources/application/lookup-projections.d.ts +6 -0
- package/dist/src/resources/application/lookup-projections.js +15 -15
- package/dist/src/resources/application/resource-correlation-retry.d.ts +16 -0
- package/dist/src/resources/application/resource-correlation-retry.js +39 -44
- package/dist/src/resources/application/resource-event-support.d.ts +12 -0
- package/dist/src/resources/application/resource-event-support.js +17 -0
- package/dist/src/resources/application/resource-lookup.d.ts +17 -0
- package/dist/src/resources/application/resource-lookup.js +9 -9
- package/dist/src/resources/application/resource-projections.d.ts +4 -0
- package/dist/src/resources/application/resource-projections.js +32 -24
- package/dist/src/resources/application/resource-repository.d.ts +16 -0
- package/dist/src/resources/application/resource-repository.js +3 -3
- package/dist/src/resources/application/resource-service.d.ts +34 -0
- package/dist/src/resources/application/resource-service.js +73 -52
- package/dist/src/resources/contracts/commands.d.ts +23 -0
- package/dist/src/resources/contracts/config.d.ts +3 -0
- package/dist/src/resources/contracts/event-factory.d.ts +6 -0
- package/dist/src/resources/contracts/event-factory.js +32 -0
- package/dist/src/resources/contracts/events.d.ts +79 -0
- package/dist/src/resources/contracts/events.js +94 -102
- package/dist/src/resources/contracts/identifiers.d.ts +7 -0
- package/dist/src/resources/contracts/streams.d.ts +8 -0
- package/dist/src/resources/contracts/views.d.ts +35 -0
- package/dist/src/resources/contracts/vocabulary.d.ts +50 -0
- package/dist/src/resources/domain/correlation.d.ts +6 -0
- package/dist/src/resources/domain/resource.d.ts +8 -0
- package/dist/src/resources/domain/resource.js +24 -21
- package/dist/src/resources/index.d.ts +15 -0
- package/dist/src/resources/index.js +1 -0
- package/dist/src/surfaces/api/contracts/activities.d.ts +1 -0
- package/dist/src/surfaces/api/contracts/board.d.ts +46 -0
- package/dist/src/surfaces/api/contracts/board.js +1 -1
- package/dist/src/surfaces/api/contracts/common.d.ts +43 -0
- package/dist/src/surfaces/api/contracts/control-plane.d.ts +37 -0
- package/dist/src/surfaces/api/contracts/events.d.ts +13 -0
- package/dist/src/surfaces/api/contracts/execution.d.ts +67 -0
- package/dist/src/surfaces/api/contracts/index.d.ts +14 -0
- package/dist/src/surfaces/api/contracts/observability.d.ts +10 -0
- package/dist/src/surfaces/api/contracts/orchestration.d.ts +16 -0
- package/dist/src/surfaces/api/contracts/resources.d.ts +10 -0
- package/dist/src/surfaces/api/contracts/status.d.ts +4 -0
- package/dist/src/surfaces/api/contracts/system.d.ts +32 -0
- package/dist/src/surfaces/api/contracts/transport-values.d.ts +50 -0
- package/dist/src/surfaces/api/contracts/transport-values.js +6 -0
- package/dist/src/surfaces/api/contracts/work.d.ts +74 -0
- package/dist/src/surfaces/api/contracts/workflow-diagram.d.ts +64 -0
- package/dist/src/surfaces/api/http-server.d.ts +33 -0
- package/dist/src/surfaces/api/http-server.js +2 -2
- package/dist/src/surfaces/api/presenters/activities.d.ts +1 -0
- package/dist/src/surfaces/api/presenters/board.d.ts +2 -0
- package/dist/src/surfaces/api/presenters/control-plane.d.ts +1 -0
- package/dist/src/surfaces/api/presenters/events.d.ts +1 -0
- package/dist/src/surfaces/api/presenters/execution.d.ts +3 -0
- package/dist/src/surfaces/api/presenters/execution.js +5 -2
- package/dist/src/surfaces/api/presenters/observability.d.ts +1 -0
- package/dist/src/surfaces/api/presenters/orchestration.d.ts +3 -0
- package/dist/src/surfaces/api/presenters/resources.d.ts +3 -0
- package/dist/src/surfaces/api/presenters/status.d.ts +2 -0
- package/dist/src/surfaces/api/presenters/system.d.ts +2 -0
- package/dist/src/surfaces/api/presenters/work.d.ts +4 -0
- package/dist/src/surfaces/api/problem-details.d.ts +2 -0
- package/dist/src/surfaces/api/router.d.ts +8 -0
- package/dist/src/surfaces/api/routes/activities.d.ts +1 -0
- package/dist/src/surfaces/api/routes/applications.d.ts +88 -0
- package/dist/src/surfaces/api/routes/commands.d.ts +3 -0
- package/dist/src/surfaces/api/routes/commands.js +1 -3
- package/dist/src/surfaces/api/routes/control-plane.d.ts +1 -0
- package/dist/src/surfaces/api/routes/control-plane.js +0 -1
- package/dist/src/surfaces/api/routes/events.d.ts +1 -0
- package/dist/src/surfaces/api/routes/execution.d.ts +1 -0
- package/dist/src/surfaces/api/routes/index.d.ts +4 -0
- package/dist/src/surfaces/api/routes/observability.d.ts +1 -0
- package/dist/src/surfaces/api/routes/orchestration.d.ts +1 -0
- package/dist/src/surfaces/api/routes/pagination.d.ts +5 -0
- package/dist/src/surfaces/api/routes/read.d.ts +3 -0
- package/dist/src/surfaces/api/routes/resources.d.ts +1 -0
- package/dist/src/surfaces/api/routes/responses.d.ts +15 -0
- package/dist/src/surfaces/api/routes/system.d.ts +1 -0
- package/dist/src/surfaces/api/routes/work.d.ts +1 -0
- package/dist/src/surfaces/auth/credentials.d.ts +22 -0
- package/dist/src/surfaces/auth/credentials.js +8 -12
- package/dist/src/surfaces/auth/vocabulary.d.ts +9 -0
- package/dist/src/surfaces/cli/commands/api.d.ts +4 -0
- package/dist/src/surfaces/cli/commands/audit.d.ts +16 -0
- package/dist/src/surfaces/cli/commands/audit.js +11 -2
- package/dist/src/surfaces/cli/commands/correlate.d.ts +7 -0
- package/dist/src/surfaces/cli/commands/doctor.d.ts +24 -0
- package/dist/src/surfaces/cli/commands/init.d.ts +2 -0
- package/dist/src/surfaces/cli/commands/sandbox-entrypoint.d.ts +43 -0
- package/dist/src/surfaces/cli/commands/sandbox-setup.d.ts +9 -0
- package/dist/src/surfaces/cli/commands/sandbox.d.ts +16 -0
- package/dist/src/surfaces/cli/commands/self-update.d.ts +15 -0
- package/dist/src/surfaces/cli/commands/smoke.d.ts +14 -0
- package/dist/src/surfaces/cli/commands/start.d.ts +5 -0
- package/dist/src/surfaces/cli/commands/stop.d.ts +11 -0
- package/dist/src/surfaces/cli/commands/tick.d.ts +5 -0
- package/dist/src/surfaces/cli/commands/ui.d.ts +5 -0
- package/dist/src/surfaces/cli/commands/validate-state.d.ts +13 -0
- package/dist/src/surfaces/cli/infrastructure/docker-cli.d.ts +66 -0
- package/dist/src/surfaces/cli/infrastructure/docker-invocation.d.ts +14 -0
- package/dist/src/surfaces/cli/infrastructure/process-log.d.ts +35 -0
- package/dist/src/surfaces/cli/infrastructure/resident-start.d.ts +10 -0
- package/dist/src/surfaces/cli/main.d.ts +115 -0
- package/dist/src/surfaces/cli/usage.d.ts +1 -0
- package/dist/src/surfaces/contracts/config.d.ts +51 -0
- package/dist/src/surfaces/index.d.ts +49 -0
- package/dist/src/surfaces/web-assets/assets/index-D9xGa5tD.css +1 -0
- package/dist/src/surfaces/web-assets/assets/index-qai1Ymhv.js +1179 -0
- package/dist/src/surfaces/web-assets/index.html +2 -2
- package/dist/src/surfaces/web-host/asset-source.d.ts +9 -0
- package/dist/src/surfaces/web-host/packaged-assets.d.ts +8 -0
- package/dist/src/work/application/work-projection.d.ts +3 -0
- package/dist/src/work/application/work-projection.js +4 -4
- package/dist/src/work/application/work-repository.d.ts +15 -0
- package/dist/src/work/application/work-repository.js +2 -2
- package/dist/src/work/application/work-service.d.ts +18 -0
- package/dist/src/work/application/work-service.js +70 -31
- package/dist/src/work/contracts/commands.d.ts +15 -0
- package/dist/src/work/contracts/config.d.ts +3 -0
- package/dist/src/work/contracts/event-factory.d.ts +6 -0
- package/dist/src/work/contracts/event-factory.js +26 -0
- package/dist/src/work/contracts/events.d.ts +46 -0
- package/dist/src/work/contracts/events.js +54 -60
- package/dist/src/work/contracts/identifiers.d.ts +3 -0
- package/dist/src/work/contracts/streams.d.ts +8 -0
- package/dist/src/work/contracts/views.d.ts +18 -0
- package/dist/src/work/contracts/vocabulary.d.ts +7 -0
- package/dist/src/work/domain/work-item.d.ts +3 -0
- package/dist/src/work/domain/work-item.js +10 -7
- package/dist/src/work/index.d.ts +12 -0
- package/dist/src/work/index.js +1 -0
- package/docker/Dockerfile +9 -7
- package/docker/Dockerfile.packaged +4 -6
- package/package.json +24 -24
- package/dist/src/activities/pr/event-drafts.js +0 -66
- package/dist/src/kernel/contracts/events.js +0 -11
- package/dist/src/kernel/infrastructure/cached-journal-view.js +0 -27
- package/dist/src/persistence/application/projection-runner.js +0 -128
- package/dist/src/persistence/filesystem/file-checkpoint-store.js +0 -50
- package/dist/src/persistence/filesystem/file-projection-store.js +0 -137
- package/dist/src/persistence/index.js +0 -8
- package/dist/src/persistence/memory/in-memory-event-journal.js +0 -99
- package/dist/src/surfaces/web-assets/assets/index-B0ofn_L5.css +0 -1
- package/dist/src/surfaces/web-assets/assets/index-DFBhpSSX.js +0 -1179
- /package/dist/src/control-plane/application/{advance-once-ports.js → activation-scheduler-ports.js} +0 -0
- /package/dist/src/{kernel → node_modules/@atolis-hq/eventing/dist}/contracts/commands.js +0 -0
- /package/dist/src/{kernel/contracts/checkpoint-store.js → node_modules/@atolis-hq/eventing/dist/contracts/processor-state-store.js} +0 -0
- /package/dist/src/{persistence → node_modules/@atolis-hq/eventing/dist}/memory/in-memory-checkpoint-store.js +0 -0
- /package/dist/src/{kernel/contracts → node_modules/@atolis-hq/eventing/dist/projections}/projection-store.js +0 -0
- /package/dist/src/{kernel/contracts/journal-change-signal.js → node_modules/@atolis-hq/eventing/dist/runtime/clock.js} +0 -0
- /package/dist/src/{kernel/contracts → node_modules/@atolis-hq/eventing/dist/store}/event-journal.js +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActivityOutcomeKind } from '../../activities/index.js';
|
|
2
|
+
import { OrchestrationEventType, WatchGateVerdictSignal } from '../contracts/events.js';
|
|
2
3
|
import { signalName, watchId } from '../contracts/identifiers.js';
|
|
3
4
|
import { childOrchestrationGroupStream } from '../contracts/streams.js';
|
|
4
5
|
import { ApprovalAuthorityKind, WorkflowStatus } from '../contracts/vocabulary.js';
|
|
@@ -51,8 +52,11 @@ export class RequestChild {
|
|
|
51
52
|
return loaded.view;
|
|
52
53
|
const metadata = coordinationMetadata(loaded.view, request);
|
|
53
54
|
await this.repository.append(loaded.view.workflowInstanceId, loaded.sequence, [
|
|
54
|
-
this.coordinationEvent(loaded.view, context, OrchestrationEventType.CausalActivationRejected, metadata, 1),
|
|
55
|
-
stateDraft(loaded.view, { occurredAt: context.occurredAt, causationId: context.commandId },
|
|
55
|
+
this.coordinationEvent(loaded.view, context, { eventType: OrchestrationEventType.CausalActivationRejected, payload: metadata }, 1),
|
|
56
|
+
stateDraft(loaded.view, { occurredAt: context.occurredAt, causationId: context.commandId }, {
|
|
57
|
+
eventType: OrchestrationEventType.InstanceBlocked,
|
|
58
|
+
payload: { reason: 'causal activation rejected' },
|
|
59
|
+
}, 2),
|
|
56
60
|
]);
|
|
57
61
|
return (await this.repository.loadRequired(loaded.view.workflowInstanceId)).view;
|
|
58
62
|
}
|
|
@@ -80,7 +84,7 @@ export class RequestChild {
|
|
|
80
84
|
loaded.view.status === WorkflowStatus.Superseded)
|
|
81
85
|
continue;
|
|
82
86
|
await this.repository.append(child.workflowInstanceId, loaded.sequence, [
|
|
83
|
-
stateDraft(loaded.view, { occurredAt: context.occurredAt, causationId: context.commandId }, OrchestrationEventType.InstanceSuperseded, {}, 1),
|
|
87
|
+
stateDraft(loaded.view, { occurredAt: context.occurredAt, causationId: context.commandId }, { eventType: OrchestrationEventType.InstanceSuperseded, payload: {} }, 1),
|
|
84
88
|
]);
|
|
85
89
|
}
|
|
86
90
|
return children.map((child) => child.workflowInstanceId);
|
|
@@ -94,7 +98,7 @@ export class RequestChild {
|
|
|
94
98
|
return true;
|
|
95
99
|
if (child.view.status !== WorkflowStatus.Superseded)
|
|
96
100
|
await this.repository.append(childWorkflowInstanceId, child.sequence, [
|
|
97
|
-
stateDraft(child.view, { occurredAt: context.occurredAt, causationId: context.commandId }, OrchestrationEventType.InstanceSuperseded, {}, 1),
|
|
101
|
+
stateDraft(child.view, { occurredAt: context.occurredAt, causationId: context.commandId }, { eventType: OrchestrationEventType.InstanceSuperseded, payload: {} }, 1),
|
|
98
102
|
]);
|
|
99
103
|
return false;
|
|
100
104
|
}
|
|
@@ -116,19 +120,23 @@ export class RequestChild {
|
|
|
116
120
|
const childLoaded = await this.repository.loadRequired(child.workflowInstanceId);
|
|
117
121
|
if (!childLoaded.view.childCompletionRecorded)
|
|
118
122
|
await this.repository.append(child.workflowInstanceId, childLoaded.sequence, [
|
|
119
|
-
this.coordinationEvent(child, context, OrchestrationEventType.ChildCompleted, metadata, 1),
|
|
123
|
+
this.coordinationEvent(child, context, { eventType: OrchestrationEventType.ChildCompleted, payload: metadata }, 1),
|
|
120
124
|
]);
|
|
121
125
|
const parent = await this.repository.loadRequired(metadata.parentWorkflowInstanceId);
|
|
122
126
|
if (parent.view.acceptedChildCompletionIds.includes(child.workflowInstanceId))
|
|
123
127
|
return;
|
|
128
|
+
const watchGateOutcome = watchGateVerdictOutcome(parent.view, child);
|
|
124
129
|
const signal = {
|
|
125
|
-
kind:
|
|
130
|
+
kind: watchGateOutcome === undefined
|
|
131
|
+
? signalName(OrchestrationEventType.ChildCompleted)
|
|
132
|
+
: WatchGateVerdictSignal,
|
|
126
133
|
actorId: 'orchestration',
|
|
127
134
|
actorDecision: { authorized: true, evidenceId: child.workflowInstanceId },
|
|
128
135
|
providerEventId: child.workflowInstanceId,
|
|
129
136
|
authority: { kind: ApprovalAuthorityKind.Watch, watch: watchId(child.watchId) },
|
|
130
137
|
childWorkflowInstanceId: child.workflowInstanceId,
|
|
131
138
|
requestId: metadata.requestId,
|
|
139
|
+
...(watchGateOutcome === undefined ? {} : { outcome: watchGateOutcome }),
|
|
132
140
|
};
|
|
133
141
|
const definition = await this.workflows.definitionForOperation(parent.view, parent.sequence, context);
|
|
134
142
|
if (definition === null)
|
|
@@ -142,17 +150,17 @@ export class RequestChild {
|
|
|
142
150
|
return;
|
|
143
151
|
await this.repository.append(parent.view.workflowInstanceId, parent.sequence, [
|
|
144
152
|
...decision.events,
|
|
145
|
-
this.coordinationEvent(parent.view, context, OrchestrationEventType.ChildCompletionConsumed, metadata, 2),
|
|
153
|
+
this.coordinationEvent(parent.view, context, { eventType: OrchestrationEventType.ChildCompletionConsumed, payload: metadata }, 2),
|
|
146
154
|
]);
|
|
147
155
|
}
|
|
148
|
-
coordinationEvent(state, context,
|
|
156
|
+
coordinationEvent(state, context, event, ordinal) {
|
|
149
157
|
return coordinationDraft({
|
|
150
158
|
workflowInstanceId: state.workflowInstanceId,
|
|
151
159
|
eventIdPrefix: context.commandId,
|
|
152
160
|
occurredAt: context.occurredAt,
|
|
153
161
|
correlationId: state.orchestrationGroupId,
|
|
154
162
|
causationId: context.commandId,
|
|
155
|
-
},
|
|
163
|
+
}, event, ordinal);
|
|
156
164
|
}
|
|
157
165
|
}
|
|
158
166
|
function parentWaitsForWatch(parent, watchId) {
|
|
@@ -166,3 +174,11 @@ function watchIdsFor(wait) {
|
|
|
166
174
|
return [];
|
|
167
175
|
return (wait.from ?? []).flatMap((authority) => authority.kind === ApprovalAuthorityKind.Watch ? [authority.watch] : []);
|
|
168
176
|
}
|
|
177
|
+
function watchGateVerdictOutcome(parent, child) {
|
|
178
|
+
if (parent.waitingFor?.signalKind !== WatchGateVerdictSignal)
|
|
179
|
+
return undefined;
|
|
180
|
+
return child.lastOutcome?.kind === ActivityOutcomeKind.Done ||
|
|
181
|
+
child.lastOutcome?.kind === ActivityOutcomeKind.Rejected
|
|
182
|
+
? child.lastOutcome.kind
|
|
183
|
+
: undefined;
|
|
184
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { selectActivityEvent } from '../../activities/index.js';
|
|
2
|
+
import type { WorkItemId } from '../../work/index.js';
|
|
3
|
+
import type { CompiledResourceTransition } from '../contracts/config.js';
|
|
4
|
+
export type ResourceTransitionFact = Parameters<typeof selectActivityEvent>[0];
|
|
5
|
+
export interface ResourceTransitionEvidenceInput {
|
|
6
|
+
readonly workItemId: WorkItemId;
|
|
7
|
+
readonly transitions: readonly CompiledResourceTransition[];
|
|
8
|
+
readonly fact?: ResourceTransitionFact;
|
|
9
|
+
}
|
|
10
|
+
export interface ResourceTransitionEvidenceResolution {
|
|
11
|
+
readonly transition: CompiledResourceTransition;
|
|
12
|
+
readonly evidenceId: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ResourceTransitionEvidence {
|
|
15
|
+
/** Fact types the reactor tails on this policy's behalf. */
|
|
16
|
+
readonly triggers: readonly string[];
|
|
17
|
+
resolve(input: ResourceTransitionEvidenceInput): Promise<ResourceTransitionEvidenceResolution | null>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CommandContext } from '@atolis-hq/eventing';
|
|
2
|
+
import { selectActivityEvent } from '../../activities/index.js';
|
|
3
|
+
import type { WorkItemId } from '../../work/index.js';
|
|
4
|
+
import type { CompiledResourceTransition, TransitionTarget } from '../contracts/config.js';
|
|
5
|
+
import type { WorkflowInstanceId } from '../contracts/identifiers.js';
|
|
6
|
+
import type { WorkflowInstanceView } from '../contracts/views.js';
|
|
7
|
+
import type { OrchestrationRepository } from './orchestration-repository.js';
|
|
8
|
+
import type { StartWorkflow } from './start-workflow.js';
|
|
9
|
+
type PersistedEvent = Parameters<typeof selectActivityEvent>[0];
|
|
10
|
+
export interface ResourceTransitionMatch {
|
|
11
|
+
readonly workflowInstanceId: WorkflowInstanceId;
|
|
12
|
+
readonly workItemId: WorkItemId;
|
|
13
|
+
readonly transitions: readonly CompiledResourceTransition[];
|
|
14
|
+
}
|
|
15
|
+
export declare function matchResourceTransitions(loaded: readonly {
|
|
16
|
+
readonly view: WorkflowInstanceView;
|
|
17
|
+
}[], event: PersistedEvent): Promise<readonly ResourceTransitionMatch[]>;
|
|
18
|
+
export declare function acceptResourceTransition(repository: OrchestrationRepository, workflows: StartWorkflow, id: WorkflowInstanceId, target: TransitionTarget, evidenceId: string, context: CommandContext): Promise<WorkflowInstanceView | null>;
|
|
19
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ActivityEventType, selectActivityEvent } from '../../activities/index.js';
|
|
1
2
|
import { WorkflowStatus } from '../contracts/vocabulary.js';
|
|
2
3
|
import { acceptSignal as decideSignal } from '../domain/interpreter.js';
|
|
3
4
|
import { appendWithIntentRecovery } from './durable-append.js';
|
|
@@ -33,12 +34,17 @@ export async function matchResourceTransitions(loaded, event) {
|
|
|
33
34
|
}
|
|
34
35
|
// Compares the declared predicate key-wise against the event payload.
|
|
35
36
|
function matchesFact(transition, event) {
|
|
36
|
-
|
|
37
|
+
const activity = selectActivityEvent(event);
|
|
38
|
+
if (activity === null || transition.event !== activity.event.eventType)
|
|
37
39
|
return false;
|
|
38
40
|
if (transition.where === undefined)
|
|
39
41
|
return true;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
if (activity.event.eventType === ActivityEventType.PrStateChanged && 'state' in transition.where)
|
|
43
|
+
return activity.event.payload.state === transition.where.state;
|
|
44
|
+
if (activity.event.eventType === ActivityEventType.PrChecksChanged &&
|
|
45
|
+
'checks' in transition.where)
|
|
46
|
+
return activity.event.payload.checks === transition.where.checks;
|
|
47
|
+
return false;
|
|
42
48
|
}
|
|
43
49
|
// Applies a transition the reactor's evidence policy already confirmed. The
|
|
44
50
|
// route target comes from the matched transition, not the wait's own
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type CommandContext } from '@atolis-hq/eventing';
|
|
2
|
+
import type { TransitionTarget } from '../contracts/config.js';
|
|
3
|
+
import { selectOrchestrationEvent } from '../contracts/event-decoder.js';
|
|
4
|
+
import type { WorkflowInstanceId } from '../contracts/identifiers.js';
|
|
5
|
+
import type { ResourceTransitionEvidence } from './resource-transition-evidence.js';
|
|
6
|
+
import type { ResourceTransitionMatch } from './resource-transition-matching.js';
|
|
7
|
+
type PersistedEvent = Parameters<typeof selectOrchestrationEvent>[0];
|
|
8
|
+
interface ResourceTransitionOrchestrationPort {
|
|
9
|
+
listResourceTransitionMatches(event: PersistedEvent): Promise<readonly ResourceTransitionMatch[]>;
|
|
10
|
+
applyResourceTransition(workflowInstanceId: WorkflowInstanceId, target: TransitionTarget, evidenceId: string, context: CommandContext): Promise<unknown>;
|
|
11
|
+
}
|
|
12
|
+
export declare function createResourceTransitionReactor(orchestration: ResourceTransitionOrchestrationPort, evidence: ResourceTransitionEvidence): {
|
|
13
|
+
react: (event: PersistedEvent, context: CommandContext) => Promise<void>;
|
|
14
|
+
processor: import("@atolis-hq/eventing").EventProcessor;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineEventProcessor, EventProcessorCategory, EventProcessorReplayPolicy, } from '@atolis-hq/eventing';
|
|
2
2
|
import { selectOrchestrationEvent } from '../contracts/event-decoder.js';
|
|
3
3
|
import { OrchestrationEventType } from '../contracts/events.js';
|
|
4
|
+
import { reactorCommandContext } from './reactor-command-context.js';
|
|
4
5
|
const checkpoint = 'reactor:orchestration.resource-transition';
|
|
5
6
|
const batchSize = 100;
|
|
6
|
-
export function createResourceTransitionReactor(orchestration, evidence
|
|
7
|
-
let queue = Promise.resolve();
|
|
7
|
+
export function createResourceTransitionReactor(orchestration, evidence) {
|
|
8
8
|
const react = async (event, context) => {
|
|
9
9
|
const orchestrationEvent = selectOrchestrationEvent(event);
|
|
10
|
-
const isWaitStart = orchestrationEvent?.eventType === OrchestrationEventType.SignalWaitStarted;
|
|
11
|
-
if (!isWaitStart && !evidence.triggers.includes(event.eventType))
|
|
10
|
+
const isWaitStart = orchestrationEvent?.event.eventType === OrchestrationEventType.SignalWaitStarted;
|
|
11
|
+
if (!isWaitStart && !evidence.triggers.includes(event.event.eventType))
|
|
12
12
|
return;
|
|
13
13
|
const fact = isWaitStart ? undefined : event;
|
|
14
14
|
for (const match of await orchestration.listResourceTransitionMatches(event)) {
|
|
@@ -22,44 +22,23 @@ export function createResourceTransitionReactor(orchestration, evidence, journal
|
|
|
22
22
|
await orchestration.applyResourceTransition(match.workflowInstanceId, resolved.transition.target, resolved.evidenceId, context);
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const runBatch = async (limit = batchSize) => {
|
|
26
|
-
if (journal === undefined || checkpoints === undefined)
|
|
27
|
-
throw new Error('ResourceTransitionReactor journal and checkpoints are required to run');
|
|
28
|
-
const events = await journal.readAll(await checkpoints.load(checkpoint), limit);
|
|
29
|
-
for (const event of events) {
|
|
30
|
-
await react(event, commandContext(event));
|
|
31
|
-
await checkpoints.save(checkpoint, event.globalPosition);
|
|
32
|
-
}
|
|
33
|
-
return events.length;
|
|
34
|
-
};
|
|
35
|
-
const serialize = (operation) => {
|
|
36
|
-
const result = queue.then(operation);
|
|
37
|
-
queue = result.catch(() => { });
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
25
|
return {
|
|
41
26
|
react,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
function commandContext(event) {
|
|
59
|
-
return {
|
|
60
|
-
commandId: `${event.eventId}:resource-transition`,
|
|
61
|
-
correlationId: correlationId(event.correlationId),
|
|
62
|
-
occurredAt: event.occurredAt,
|
|
63
|
-
actor: { kind: EventActorKind.System, id: 'resource-transition-reactor' },
|
|
27
|
+
processor: defineEventProcessor({
|
|
28
|
+
consumer: checkpoint,
|
|
29
|
+
name: 'resource-transition',
|
|
30
|
+
owner: 'orchestration',
|
|
31
|
+
category: EventProcessorCategory.Reactor,
|
|
32
|
+
replayPolicy: EventProcessorReplayPolicy.Idempotent,
|
|
33
|
+
batchSize,
|
|
34
|
+
select(event) {
|
|
35
|
+
const orchestrationEvent = selectOrchestrationEvent(event);
|
|
36
|
+
return orchestrationEvent?.event.eventType === OrchestrationEventType.SignalWaitStarted ||
|
|
37
|
+
evidence.triggers.includes(event.event.eventType)
|
|
38
|
+
? event
|
|
39
|
+
: null;
|
|
40
|
+
},
|
|
41
|
+
handle: async (event) => react(event, reactorCommandContext(event, 'resource-transition', 'resource-transition-reactor')),
|
|
42
|
+
}),
|
|
64
43
|
};
|
|
65
44
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommandContext } from '@atolis-hq/eventing';
|
|
2
|
+
import type { OrchestrationSignal } from '../contracts/events.js';
|
|
3
|
+
import type { WorkflowInstanceView } from '../contracts/views.js';
|
|
4
|
+
interface SignalOrchestrationPort {
|
|
5
|
+
listWaiting(signalKind?: string): Promise<readonly (WorkflowInstanceView | null)[]>;
|
|
6
|
+
acceptSignal(workflowInstanceId: string, signal: OrchestrationSignal, context: CommandContext): Promise<WorkflowInstanceView>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createSignalReactor(orchestration: SignalOrchestrationPort): {
|
|
9
|
+
accept(signal: OrchestrationSignal, context: CommandContext): Promise<WorkflowInstanceView[]>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type CommandContext } from '@atolis-hq/eventing';
|
|
2
|
+
import { type WorkService } from '../../work/index.js';
|
|
3
|
+
import type { StartWorkflowInstance } from '../contracts/commands.js';
|
|
4
|
+
import type { WorkflowInstanceView } from '../contracts/views.js';
|
|
5
|
+
import type { CoordinationClaims } from './coordination-claims.js';
|
|
6
|
+
import type { OrchestrationRepository } from './orchestration-repository.js';
|
|
7
|
+
import type { WorkflowDefinitionRegistry } from './workflow-definition-registry.js';
|
|
8
|
+
export declare class StartWorkflow {
|
|
9
|
+
private readonly repository;
|
|
10
|
+
private readonly claims;
|
|
11
|
+
private readonly work;
|
|
12
|
+
private readonly definitions;
|
|
13
|
+
constructor(repository: OrchestrationRepository, claims: CoordinationClaims, work: WorkService, definitions: WorkflowDefinitionRegistry);
|
|
14
|
+
execute(command: StartWorkflowInstance, context: CommandContext): Promise<WorkflowInstanceView>;
|
|
15
|
+
isWorkItemOpen(workItemId: StartWorkflowInstance['workItemId']): Promise<boolean>;
|
|
16
|
+
definitionFor(view: Parameters<WorkflowDefinitionRegistry['resolve']>[0]): Promise<import("../index.js").CompiledWorkflow>;
|
|
17
|
+
definitionForOperation(view: WorkflowInstanceView, sequence: number, context: CommandContext): Promise<import("../index.js").CompiledWorkflow | null>;
|
|
18
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EventSourceKind } from '@atolis-hq/eventing';
|
|
2
2
|
import { WorkStatus } from '../../work/index.js';
|
|
3
3
|
import { OrchestrationEventType } from '../contracts/events.js';
|
|
4
|
-
import { workflowInstanceStream } from '../contracts/streams.js';
|
|
5
4
|
import { WorkflowInstanceKind, WorkflowStatus } from '../contracts/vocabulary.js';
|
|
6
5
|
import { validateChildProvenance } from '../domain/child-policy.js';
|
|
6
|
+
import { workflowEventData } from '../domain/decision-events.js';
|
|
7
7
|
import { startInstance } from '../domain/interpreter.js';
|
|
8
8
|
import { WorkflowDefinitionUnavailableError } from './workflow-definition-registry.js';
|
|
9
9
|
const TERMINAL_OR_BLOCKED_STATUSES = new Set([
|
|
@@ -70,7 +70,7 @@ export class StartWorkflow {
|
|
|
70
70
|
throw error;
|
|
71
71
|
if (!TERMINAL_OR_BLOCKED_STATUSES.has(view.status))
|
|
72
72
|
await this.repository.append(view.workflowInstanceId, sequence, [
|
|
73
|
-
|
|
73
|
+
workflowEventData({
|
|
74
74
|
// workflowInstanceId is included because listWatchMatches shares one
|
|
75
75
|
// CommandContext across every matched parent in a batch; commandId
|
|
76
76
|
// alone would collide when two instances block in the same pass.
|
|
@@ -81,7 +81,6 @@ export class StartWorkflow {
|
|
|
81
81
|
causationId: context.commandId,
|
|
82
82
|
actor: context.actor,
|
|
83
83
|
source: { kind: EventSourceKind.Internal, id: 'orchestration-service' },
|
|
84
|
-
stream: workflowInstanceStream(view.workflowInstanceId),
|
|
85
84
|
payload: { reason: 'workflow-definition-unavailable' },
|
|
86
85
|
}),
|
|
87
86
|
]);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type RunRepository } from '../../execution/index.js';
|
|
2
|
+
import type { selectOrchestrationEvent } from '../contracts/event-decoder.js';
|
|
3
|
+
import type { WorkflowInstanceId } from '../contracts/identifiers.js';
|
|
4
|
+
type PersistedEvent = Parameters<typeof selectOrchestrationEvent>[0];
|
|
5
|
+
/**
|
|
6
|
+
* Resolve the one instance an event belongs to, when it has one. Run events
|
|
7
|
+
* inherit their scope from the run. `ChildCompleted` deliberately does not:
|
|
8
|
+
* it is a cross-instance coordination fact and stream-scoping it would hide
|
|
9
|
+
* valid parent/child coordination from other eligible instances.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveTriggerWorkflowInstanceId(event: PersistedEvent, runs: Pick<RunRepository, 'load'> | undefined): Promise<WorkflowInstanceId | undefined>;
|
|
12
|
+
export {};
|
|
@@ -8,7 +8,7 @@ import { isWorkflowInstanceStream } from '../contracts/streams.js';
|
|
|
8
8
|
* valid parent/child coordination from other eligible instances.
|
|
9
9
|
*/
|
|
10
10
|
export async function resolveTriggerWorkflowInstanceId(event, runs) {
|
|
11
|
-
if (event.eventType === OrchestrationEventType.SignalWaitStarted &&
|
|
11
|
+
if (event.event.eventType === OrchestrationEventType.SignalWaitStarted &&
|
|
12
12
|
isWorkflowInstanceStream(event.stream))
|
|
13
13
|
return event.stream.id;
|
|
14
14
|
if (runs === undefined)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CommandContext } from '@atolis-hq/eventing';
|
|
2
|
+
import { selectActivityEvent } from '../../activities/index.js';
|
|
3
|
+
import type { WorkflowInstanceView } from '../contracts/views.js';
|
|
4
|
+
import type { StartWorkflow } from './start-workflow.js';
|
|
5
|
+
type PersistedEvent = Parameters<typeof selectActivityEvent>[0];
|
|
6
|
+
export declare function matchWatches(loaded: readonly {
|
|
7
|
+
readonly view: WorkflowInstanceView;
|
|
8
|
+
readonly sequence: number;
|
|
9
|
+
}[], event: PersistedEvent, workflows: StartWorkflow, context: CommandContext | undefined): Promise<{
|
|
10
|
+
parent: WorkflowInstanceView;
|
|
11
|
+
watch: Readonly<import("../index.js").CompiledWatch>;
|
|
12
|
+
}[]>;
|
|
13
|
+
export {};
|
|
@@ -12,7 +12,7 @@ export async function matchWatches(loaded, event, workflows, context) {
|
|
|
12
12
|
if (definition === null)
|
|
13
13
|
return [];
|
|
14
14
|
return definition.watches
|
|
15
|
-
.filter((watch) => watch.on?.events.includes(event.eventType) === true &&
|
|
15
|
+
.filter((watch) => watch.on?.events.includes(event.event.eventType) === true &&
|
|
16
16
|
watch.while.stages.includes(parent.currentStage) &&
|
|
17
17
|
watch.while.statuses.some((status) => status === parent.status) &&
|
|
18
18
|
matchesWatchPredicate(watch.where, event))
|
|
@@ -24,6 +24,6 @@ function matchesWatchPredicate(predicate, event) {
|
|
|
24
24
|
if (predicate === undefined)
|
|
25
25
|
return true;
|
|
26
26
|
const activityEvent = selectActivityEvent(event);
|
|
27
|
-
return (activityEvent?.eventType === ActivityEventType.PrChecksChanged &&
|
|
28
|
-
activityEvent.payload.checks === PullRequestCheckState.Failing);
|
|
27
|
+
return (activityEvent?.event.eventType === ActivityEventType.PrChecksChanged &&
|
|
28
|
+
activityEvent.event.payload.checks === PullRequestCheckState.Failing);
|
|
29
29
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type CheckpointStore, type CommandContext, type EventJournal } from '@atolis-hq/eventing';
|
|
2
|
+
import { type RunRepository } from '../../execution/index.js';
|
|
3
|
+
import { selectOrchestrationEvent } from '../contracts/event-decoder.js';
|
|
4
|
+
import { type ChildWorkflowRequest } from '../contracts/events.js';
|
|
5
|
+
import { type WorkflowInstanceId, type WorkflowName } from '../contracts/identifiers.js';
|
|
6
|
+
type PersistedEvent = Parameters<typeof selectOrchestrationEvent>[0];
|
|
7
|
+
interface WatchMatch {
|
|
8
|
+
readonly parent: {
|
|
9
|
+
readonly workflowInstanceId: WorkflowInstanceId;
|
|
10
|
+
};
|
|
11
|
+
readonly watch: {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly workflow: WorkflowName;
|
|
14
|
+
readonly maxPerGroup: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface WatchOrchestrationPort {
|
|
18
|
+
listWatchMatches(event: PersistedEvent, context?: CommandContext): Promise<readonly WatchMatch[]>;
|
|
19
|
+
listWaiting?(): Promise<readonly {
|
|
20
|
+
readonly workflowInstanceId: WorkflowInstanceId;
|
|
21
|
+
readonly waitingFor?: {
|
|
22
|
+
readonly from?: readonly {
|
|
23
|
+
readonly kind: string;
|
|
24
|
+
readonly watch?: string;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
}[]>;
|
|
28
|
+
get?(workflowInstanceId: WorkflowInstanceId): Promise<unknown>;
|
|
29
|
+
requestChild(request: ChildWorkflowRequest & {
|
|
30
|
+
readonly maxPerGroup: number;
|
|
31
|
+
}, context: CommandContext): Promise<unknown>;
|
|
32
|
+
rejectCausalActivation(request: ChildWorkflowRequest, context: CommandContext): Promise<unknown>;
|
|
33
|
+
isCausalRepeat?(workflowInstanceId: string, eventId: string, causalCycleId: string | undefined, requestId: string): Promise<boolean>;
|
|
34
|
+
}
|
|
35
|
+
export declare function createWatchReactor(orchestration: WatchOrchestrationPort, watchEventTypes?: () => readonly string[], runs?: Pick<RunRepository, 'load'>): {
|
|
36
|
+
react: (event: PersistedEvent, context: CommandContext) => Promise<void>;
|
|
37
|
+
processor: import("@atolis-hq/eventing").EventProcessor;
|
|
38
|
+
};
|
|
39
|
+
export declare function createWatchReconciler(orchestration: WatchOrchestrationPort, journal: EventJournal, checkpoints: CheckpointStore, runs?: Pick<RunRepository, 'load'>): {
|
|
40
|
+
reconcileOnce(limit?: number): Promise<number>;
|
|
41
|
+
};
|
|
42
|
+
export {};
|
|
@@ -1,20 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineEventProcessor, EventProcessorCategory, EventProcessorReplayPolicy, } from '@atolis-hq/eventing';
|
|
2
2
|
import { selectOrchestrationEvent } from '../contracts/event-decoder.js';
|
|
3
3
|
import { OrchestrationEventType, } from '../contracts/events.js';
|
|
4
4
|
import { workflowInstanceId, workflowName, } from '../contracts/identifiers.js';
|
|
5
5
|
import { workflowInstanceStream } from '../contracts/streams.js';
|
|
6
6
|
import { ApprovalAuthorityKind } from '../contracts/vocabulary.js';
|
|
7
|
+
import { reactorCommandContext } from './reactor-command-context.js';
|
|
7
8
|
import { resolveTriggerWorkflowInstanceId } from './trigger-workflow-instance.js';
|
|
8
9
|
const checkpoint = 'reactor:orchestration.watch';
|
|
9
10
|
const reconciliationCheckpoint = 'reconciler:orchestration.watch';
|
|
10
|
-
|
|
11
|
+
const noWatchEventTypes = () => [];
|
|
12
|
+
export function createWatchReactor(orchestration, watchEventTypes = noWatchEventTypes, runs) {
|
|
13
|
+
const react = async (event, context) => {
|
|
14
|
+
await dispatch(orchestration, runs, event, context, await orchestration.listWatchMatches(event, context));
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
react,
|
|
18
|
+
processor: defineEventProcessor({
|
|
19
|
+
consumer: checkpoint,
|
|
20
|
+
name: ApprovalAuthorityKind.Watch,
|
|
21
|
+
owner: 'orchestration',
|
|
22
|
+
category: EventProcessorCategory.Reactor,
|
|
23
|
+
replayPolicy: EventProcessorReplayPolicy.Idempotent,
|
|
24
|
+
select(event) {
|
|
25
|
+
if (!watchEventTypes().includes(event.event.eventType))
|
|
26
|
+
return null;
|
|
27
|
+
selectOrchestrationEvent(event);
|
|
28
|
+
return event;
|
|
29
|
+
},
|
|
30
|
+
handle: async (event) => react(event, reactorCommandContext(event, ApprovalAuthorityKind.Watch, 'watch-reactor')),
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function createWatchReconciler(orchestration, journal, checkpoints, runs) {
|
|
11
35
|
return {
|
|
12
|
-
async react(event, context) {
|
|
13
|
-
await dispatch(orchestration, runs, event, context, await orchestration.listWatchMatches(event, context));
|
|
14
|
-
},
|
|
15
36
|
async reconcileOnce(limit = 100) {
|
|
16
|
-
if (journal === undefined || checkpoints === undefined)
|
|
17
|
-
throw new Error('WatchReactor journal and checkpoints are required to reconcile');
|
|
18
37
|
if (orchestration.listWaiting === undefined)
|
|
19
38
|
throw new Error('WatchReactor listWaiting is required to reconcile');
|
|
20
39
|
const events = await journal.readAll(await checkpoints.load(reconciliationCheckpoint), limit);
|
|
@@ -26,11 +45,11 @@ export function createWatchReactor(orchestration, journal, checkpoints, runs) {
|
|
|
26
45
|
]));
|
|
27
46
|
let reconciled = 0;
|
|
28
47
|
for (const event of events) {
|
|
29
|
-
const context =
|
|
48
|
+
const context = reactorCommandContext(event, ApprovalAuthorityKind.Watch, 'watch-reactor');
|
|
30
49
|
const matches = (await Promise.all((await orchestration.listWatchMatches(event, context)).map(async (match) => {
|
|
31
50
|
const watches = waiting.get(match.parent.workflowInstanceId);
|
|
32
51
|
return watches?.has(match.watch.id) === true &&
|
|
33
|
-
!(await hasDurableWatchOutcome(orchestration, journal, match, event.eventId))
|
|
52
|
+
!(await hasDurableWatchOutcome(orchestration, journal, match, event.event.eventId))
|
|
34
53
|
? match
|
|
35
54
|
: null;
|
|
36
55
|
}))).filter((match) => match !== null);
|
|
@@ -42,16 +61,6 @@ export function createWatchReactor(orchestration, journal, checkpoints, runs) {
|
|
|
42
61
|
}
|
|
43
62
|
return reconciled;
|
|
44
63
|
},
|
|
45
|
-
async runOnce(limit = 100) {
|
|
46
|
-
if (journal === undefined || checkpoints === undefined)
|
|
47
|
-
throw new Error('WatchReactor journal and checkpoints are required to run');
|
|
48
|
-
const events = await journal.readAll(await checkpoints.load(checkpoint), limit);
|
|
49
|
-
for (const event of events) {
|
|
50
|
-
await this.react(event, commandContext(event));
|
|
51
|
-
await checkpoints.save(checkpoint, event.globalPosition);
|
|
52
|
-
}
|
|
53
|
-
return events.length;
|
|
54
|
-
},
|
|
55
64
|
};
|
|
56
65
|
}
|
|
57
66
|
async function dispatch(orchestration, runs, event, context, matches) {
|
|
@@ -61,18 +70,18 @@ async function dispatch(orchestration, runs, event, context, matches) {
|
|
|
61
70
|
if (sourceWorkflowInstanceId !== undefined &&
|
|
62
71
|
match.parent.workflowInstanceId !== sourceWorkflowInstanceId)
|
|
63
72
|
continue;
|
|
64
|
-
const requestId = workflowInstanceId(`${match.parent.workflowInstanceId}:watch:${match.watch.id}:trigger:${event.eventId}`);
|
|
73
|
+
const requestId = workflowInstanceId(`${match.parent.workflowInstanceId}:watch:${match.watch.id}:trigger:${event.event.eventId}`);
|
|
65
74
|
const request = {
|
|
66
75
|
parentWorkflowInstanceId: match.parent.workflowInstanceId,
|
|
67
76
|
watchId: match.watch.id,
|
|
68
|
-
triggerId: event.eventId,
|
|
77
|
+
triggerId: event.event.eventId,
|
|
69
78
|
workflowName: workflowName(match.watch.workflow),
|
|
70
79
|
causalCycleId: causalCycle ?? requestId,
|
|
71
80
|
requestId,
|
|
72
81
|
maxPerGroup: match.watch.maxPerGroup,
|
|
73
82
|
};
|
|
74
83
|
const requestContext = { ...context, commandId: watchCommandId(context, match, event) };
|
|
75
|
-
if ((await orchestration.isCausalRepeat?.(match.parent.workflowInstanceId, event.eventId, causalCycle, request.requestId)) === true) {
|
|
84
|
+
if ((await orchestration.isCausalRepeat?.(match.parent.workflowInstanceId, event.event.eventId, causalCycle, request.requestId)) === true) {
|
|
76
85
|
await orchestration.rejectCausalActivation(request, requestContext);
|
|
77
86
|
continue;
|
|
78
87
|
}
|
|
@@ -89,23 +98,15 @@ async function hasDurableWatchOutcome(orchestration, journal, match, triggerId)
|
|
|
89
98
|
const parentEvents = await journal.readStream(workflowInstanceStream(match.parent.workflowInstanceId));
|
|
90
99
|
return parentEvents.some((event) => {
|
|
91
100
|
const owned = selectOrchestrationEvent(event);
|
|
92
|
-
return (owned?.eventType === OrchestrationEventType.GroupBudgetExhausted &&
|
|
93
|
-
owned.payload.requestId === requestId);
|
|
101
|
+
return (owned?.event.eventType === OrchestrationEventType.GroupBudgetExhausted &&
|
|
102
|
+
owned.event.payload.requestId === requestId);
|
|
94
103
|
});
|
|
95
104
|
}
|
|
96
|
-
function commandContext(event) {
|
|
97
|
-
return {
|
|
98
|
-
commandId: `${event.eventId}:watch`,
|
|
99
|
-
correlationId: correlationId(event.correlationId),
|
|
100
|
-
occurredAt: event.occurredAt,
|
|
101
|
-
actor: { kind: EventActorKind.System, id: 'watch-reactor' },
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
105
|
function orchestrationCausalCycleId(event) {
|
|
105
|
-
return event !== null && 'causalCycleId' in event.payload
|
|
106
|
-
? event.payload.causalCycleId
|
|
106
|
+
return event !== null && 'causalCycleId' in event.event.payload
|
|
107
|
+
? event.event.payload.causalCycleId
|
|
107
108
|
: undefined;
|
|
108
109
|
}
|
|
109
110
|
function watchCommandId(context, match, event) {
|
|
110
|
-
return `${context.commandId}:parent:${match.parent.workflowInstanceId}:watch:${match.watch.id}:trigger:${event.eventId}`;
|
|
111
|
+
return `${context.commandId}:parent:${match.parent.workflowInstanceId}:watch:${match.watch.id}:trigger:${event.event.eventId}`;
|
|
111
112
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type EventJournal, type ProjectionDefinition, type ProjectionStore } from '@atolis-hq/eventing';
|
|
2
|
+
import type { CompiledWorkflow } from '../contracts/config.js';
|
|
3
|
+
import { type WorkflowName } from '../contracts/identifiers.js';
|
|
4
|
+
import type { WorkflowInstanceView } from '../contracts/views.js';
|
|
5
|
+
export declare const workflowDefinitionFingerprint: (definition: CompiledWorkflow) => string;
|
|
6
|
+
export declare const workflowDefinitionKey: (name: WorkflowName, fingerprint: string) => string;
|
|
7
|
+
export declare const workflowDefinitionsProjection: ProjectionDefinition<CompiledWorkflow>;
|
|
8
|
+
export declare class WorkflowDefinitionUnavailableError extends Error {
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
export declare class WorkflowDefinitionRegistry {
|
|
12
|
+
private readonly journal;
|
|
13
|
+
private readonly projections;
|
|
14
|
+
private readonly current;
|
|
15
|
+
private readonly knownRegistered;
|
|
16
|
+
constructor(journal: EventJournal, projections: ProjectionStore | undefined, current: Readonly<Record<string, CompiledWorkflow>>);
|
|
17
|
+
currentDefinition(name: WorkflowName): {
|
|
18
|
+
readonly definition: CompiledWorkflow;
|
|
19
|
+
readonly fingerprint: string;
|
|
20
|
+
};
|
|
21
|
+
currentDefinitions(): readonly {
|
|
22
|
+
readonly definition: CompiledWorkflow;
|
|
23
|
+
readonly fingerprint: string;
|
|
24
|
+
}[];
|
|
25
|
+
register(name: WorkflowName, fingerprint: string, definition: CompiledWorkflow, context: {
|
|
26
|
+
readonly occurredAt: string;
|
|
27
|
+
readonly correlationId: string;
|
|
28
|
+
readonly commandId: string;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
private isRegistered;
|
|
31
|
+
resolve(view: Pick<WorkflowInstanceView, 'workflowName' | 'workflowDefinitionFingerprint'>): Promise<CompiledWorkflow>;
|
|
32
|
+
}
|