@atolis-hq/wake 0.4.2 → 0.4.7
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 +14 -0
- 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,9 +1,9 @@
|
|
|
1
|
-
import { correlationId, EventActorKind, EventSourceKind } from '
|
|
2
|
-
import {
|
|
3
|
-
import { ExecutionEventType } from '../contracts/events.js';
|
|
1
|
+
import { correlationId, EventActorKind, EventSourceKind } from '@atolis-hq/eventing';
|
|
2
|
+
import { createExecutionEventData, } from '../contracts/event-factory.js';
|
|
3
|
+
import { ExecutionEventType, } from '../contracts/events.js';
|
|
4
4
|
import { runId } from '../contracts/identifiers.js';
|
|
5
5
|
import { runStream } from '../contracts/streams.js';
|
|
6
|
-
import { ExecutionFailureCode, ExternalExecutionState, RunStatus, } from '../contracts/vocabulary.js';
|
|
6
|
+
import { ExecutionFailureCode, ExternalExecutionState, isActiveRunStatus, RunStatus, } from '../contracts/vocabulary.js';
|
|
7
7
|
import { RunRepository } from './run-repository.js';
|
|
8
8
|
export class RecoveryService {
|
|
9
9
|
clock;
|
|
@@ -24,10 +24,12 @@ export class RecoveryService {
|
|
|
24
24
|
const currentRunId = runId(id);
|
|
25
25
|
const loaded = await this.repository.load(currentRunId);
|
|
26
26
|
const run = loaded.view;
|
|
27
|
-
if (run === null || run.status
|
|
27
|
+
if (run === null || !isActiveRunStatus(run.status))
|
|
28
28
|
return requireRun(run);
|
|
29
29
|
if (run.lease !== undefined && new Date(run.lease.expiresAt) > this.clock.now())
|
|
30
30
|
throw new Error(`Run ${id} does not have an expired lease`);
|
|
31
|
+
if (run.status === RunStatus.Starting)
|
|
32
|
+
return this.appendFailure(currentRunId, run, 'Preparation was interrupted before execution started');
|
|
31
33
|
if (run.externalExecution === undefined)
|
|
32
34
|
return this.appendFailure(currentRunId, run, 'External execution was never reported');
|
|
33
35
|
const inspection = await this.inspector.inspect(run.externalExecution);
|
|
@@ -47,9 +49,9 @@ export class RecoveryService {
|
|
|
47
49
|
if (loaded.view === null)
|
|
48
50
|
throw new Error(`Run ${id} does not exist`);
|
|
49
51
|
if (!loaded.view.escalated || loaded.view.status !== RunStatus.Ambiguous) {
|
|
50
|
-
if (loaded.events?.some((event) => event.causationId === context.commandId &&
|
|
51
|
-
(event.eventType === ExecutionEventType.RunSucceeded ||
|
|
52
|
-
event.eventType === ExecutionEventType.RunFailed)))
|
|
52
|
+
if (loaded.events?.some((event) => event.event.causationId === context.commandId &&
|
|
53
|
+
(event.event.eventType === ExecutionEventType.RunSucceeded ||
|
|
54
|
+
event.event.eventType === ExecutionEventType.RunFailed)))
|
|
53
55
|
return loaded.view;
|
|
54
56
|
throw new Error(`Run ${id} is not escalated`);
|
|
55
57
|
}
|
|
@@ -57,12 +59,12 @@ export class RecoveryService {
|
|
|
57
59
|
? this.activities.validateOutcome(loaded.view.activity, resolution.outcome)
|
|
58
60
|
: undefined;
|
|
59
61
|
const draft = resolution.kind === RunStatus.Succeeded
|
|
60
|
-
?
|
|
62
|
+
? runEventData({
|
|
61
63
|
...resolutionMetadata(currentRunId, loaded.view, context),
|
|
62
64
|
eventType: ExecutionEventType.RunSucceeded,
|
|
63
65
|
payload: { outcome: outcome, finishedAt: context.occurredAt },
|
|
64
66
|
})
|
|
65
|
-
:
|
|
67
|
+
: runEventData({
|
|
66
68
|
...resolutionMetadata(currentRunId, loaded.view, context),
|
|
67
69
|
eventType: ExecutionEventType.RunFailed,
|
|
68
70
|
payload: { failure: resolution.failure, finishedAt: context.occurredAt },
|
|
@@ -78,7 +80,7 @@ export class RecoveryService {
|
|
|
78
80
|
async recoverActive(owner, isLocallyActive = () => false) {
|
|
79
81
|
const recovered = [];
|
|
80
82
|
for (const run of await this.repository.list()) {
|
|
81
|
-
if (run.status
|
|
83
|
+
if (!isActiveRunStatus(run.status))
|
|
82
84
|
continue;
|
|
83
85
|
if (isLocallyActive(run.runId))
|
|
84
86
|
continue;
|
|
@@ -133,7 +135,7 @@ export class RecoveryService {
|
|
|
133
135
|
const loaded = await this.repository.load(id);
|
|
134
136
|
if (loaded.view === null)
|
|
135
137
|
throw new Error(`Run ${id} does not exist`);
|
|
136
|
-
if (loaded.view.status
|
|
138
|
+
if (!isActiveRunStatus(loaded.view.status))
|
|
137
139
|
return loaded.view;
|
|
138
140
|
await this.repository.append(id, loaded.sequence, [draft]);
|
|
139
141
|
return (await this.repository.load(id)).view;
|
|
@@ -143,28 +145,28 @@ export function createRecoveryCoordinator(service) {
|
|
|
143
145
|
return { recoverActive: (owner) => service.recoverActive(owner) };
|
|
144
146
|
}
|
|
145
147
|
function leaseRenewedDraft(id, run, payload, occurredAt) {
|
|
146
|
-
return
|
|
148
|
+
return runEventData({
|
|
147
149
|
...eventMetadata(id, run, occurredAt),
|
|
148
150
|
eventType: ExecutionEventType.RunLeaseRenewed,
|
|
149
151
|
payload,
|
|
150
152
|
});
|
|
151
153
|
}
|
|
152
154
|
function recoveredDraft(id, run, payload, occurredAt) {
|
|
153
|
-
return
|
|
155
|
+
return runEventData({
|
|
154
156
|
...eventMetadata(id, run, occurredAt),
|
|
155
157
|
eventType: ExecutionEventType.RunRecovered,
|
|
156
158
|
payload,
|
|
157
159
|
});
|
|
158
160
|
}
|
|
159
161
|
function failedDraft(id, run, payload, occurredAt) {
|
|
160
|
-
return
|
|
162
|
+
return runEventData({
|
|
161
163
|
...eventMetadata(id, run, occurredAt),
|
|
162
164
|
eventType: ExecutionEventType.RunFailed,
|
|
163
165
|
payload,
|
|
164
166
|
});
|
|
165
167
|
}
|
|
166
168
|
function ambiguityObservedDraft(id, run, payload, occurredAt) {
|
|
167
|
-
return
|
|
169
|
+
return runEventData({
|
|
168
170
|
...eventMetadata(id, run, occurredAt),
|
|
169
171
|
eventId: `${id}:recovery-ambiguity:${payload.attempt}:${occurredAt}`,
|
|
170
172
|
eventType: ExecutionEventType.RunAmbiguityObserved,
|
|
@@ -172,7 +174,7 @@ function ambiguityObservedDraft(id, run, payload, occurredAt) {
|
|
|
172
174
|
});
|
|
173
175
|
}
|
|
174
176
|
function ambiguousDraft(id, run, payload, occurredAt) {
|
|
175
|
-
return
|
|
177
|
+
return runEventData({
|
|
176
178
|
...eventMetadata(id, run, occurredAt),
|
|
177
179
|
eventType: ExecutionEventType.RunAmbiguous,
|
|
178
180
|
payload,
|
|
@@ -200,6 +202,19 @@ function eventMetadata(id, run, occurredAt) {
|
|
|
200
202
|
stream: runStream(id),
|
|
201
203
|
};
|
|
202
204
|
}
|
|
205
|
+
function runEventData(input) {
|
|
206
|
+
const event = createExecutionEventData(input);
|
|
207
|
+
return requireRunEventData(event);
|
|
208
|
+
}
|
|
209
|
+
function requireRunEventData(event) {
|
|
210
|
+
switch (event.eventType) {
|
|
211
|
+
case ExecutionEventType.ActivationClaimed:
|
|
212
|
+
case ExecutionEventType.ActivationReleased:
|
|
213
|
+
throw new Error(`Expected Run event data, received ${event.eventType}`);
|
|
214
|
+
default:
|
|
215
|
+
return event;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
203
218
|
function recoveredOutcome(run, result, activities) {
|
|
204
219
|
if (result.transport !== RunStatus.Succeeded)
|
|
205
220
|
throw new Error(`Recovered result is not successful: ${result.transport}`);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ActivityOutcome } from '../../activities/index.js';
|
|
2
|
+
import { type Clock } from '../../kernel/index.js';
|
|
3
|
+
import type { ExecutionActivation, ExecutionAttemptContext } from '../contracts/commands.js';
|
|
4
|
+
import type { ExecutionConfig } from '../contracts/config.js';
|
|
5
|
+
import { type RunExecutionEventData, type RunExecutionEventPayloads } from '../contracts/events.js';
|
|
6
|
+
import type { runId } from '../contracts/identifiers.js';
|
|
7
|
+
import type { RunView } from '../contracts/views.js';
|
|
8
|
+
import type { WorkspaceLease } from '../contracts/workspace.js';
|
|
9
|
+
import type { RunRepository } from './run-repository.js';
|
|
10
|
+
interface RunLifecycleDependencies {
|
|
11
|
+
readonly clock: Clock;
|
|
12
|
+
readonly config: ExecutionConfig;
|
|
13
|
+
readonly repository: RunRepository;
|
|
14
|
+
}
|
|
15
|
+
interface ResolvedRunner {
|
|
16
|
+
readonly name?: string | undefined;
|
|
17
|
+
readonly model?: string | undefined;
|
|
18
|
+
readonly effort?: string | undefined;
|
|
19
|
+
readonly pool?: string | undefined;
|
|
20
|
+
readonly cli?: string | undefined;
|
|
21
|
+
}
|
|
22
|
+
export declare function prepareRun(input: {
|
|
23
|
+
readonly dependencies: RunLifecycleDependencies;
|
|
24
|
+
readonly runId: ReturnType<typeof runId>;
|
|
25
|
+
readonly activation: ExecutionActivation;
|
|
26
|
+
readonly context: ExecutionAttemptContext;
|
|
27
|
+
readonly attempt: number;
|
|
28
|
+
readonly startedAt: string;
|
|
29
|
+
readonly runner: ResolvedRunner;
|
|
30
|
+
}): Promise<void>;
|
|
31
|
+
export declare function startRun(input: {
|
|
32
|
+
readonly dependencies: RunLifecycleDependencies;
|
|
33
|
+
readonly runId: ReturnType<typeof runId>;
|
|
34
|
+
readonly activation: ExecutionActivation;
|
|
35
|
+
readonly context: ExecutionAttemptContext;
|
|
36
|
+
readonly attempt: number;
|
|
37
|
+
readonly runner: ResolvedRunner;
|
|
38
|
+
readonly lease: WorkspaceLease | undefined;
|
|
39
|
+
}): Promise<string | undefined>;
|
|
40
|
+
export declare function recordWorkspaceCleanupFailure(input: {
|
|
41
|
+
readonly dependencies: RunLifecycleDependencies;
|
|
42
|
+
readonly runId: ReturnType<typeof runId>;
|
|
43
|
+
readonly activation: ExecutionActivation;
|
|
44
|
+
readonly context: ExecutionAttemptContext;
|
|
45
|
+
readonly error: unknown;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
export declare function recordRunSuccess(input: {
|
|
48
|
+
readonly dependencies: RunLifecycleDependencies;
|
|
49
|
+
readonly runId: ReturnType<typeof runId>;
|
|
50
|
+
readonly activation: ExecutionActivation;
|
|
51
|
+
readonly context: ExecutionAttemptContext;
|
|
52
|
+
readonly outcome: ActivityOutcome;
|
|
53
|
+
}): Promise<void>;
|
|
54
|
+
export declare function recordRunFailure(input: {
|
|
55
|
+
readonly dependencies: RunLifecycleDependencies;
|
|
56
|
+
readonly runId: ReturnType<typeof runId>;
|
|
57
|
+
readonly activation: ExecutionActivation;
|
|
58
|
+
readonly context: ExecutionAttemptContext;
|
|
59
|
+
readonly error: unknown;
|
|
60
|
+
}): Promise<RunView | null | undefined>;
|
|
61
|
+
interface RunEventMetadata {
|
|
62
|
+
readonly runId: ReturnType<typeof runId>;
|
|
63
|
+
readonly eventId: string;
|
|
64
|
+
readonly occurredAt: string;
|
|
65
|
+
readonly correlationId: string;
|
|
66
|
+
readonly causationId: string;
|
|
67
|
+
}
|
|
68
|
+
type RunEventInput = {
|
|
69
|
+
[Type in keyof RunExecutionEventPayloads]: RunEventMetadata & {
|
|
70
|
+
readonly eventType: Type;
|
|
71
|
+
readonly payload: RunExecutionEventPayloads[Type];
|
|
72
|
+
};
|
|
73
|
+
}[keyof RunExecutionEventPayloads];
|
|
74
|
+
export declare function createRunEvent(input: RunEventInput): RunExecutionEventData;
|
|
75
|
+
export {};
|
|
@@ -1,51 +1,99 @@
|
|
|
1
|
-
import { EventActorKind, EventSourceKind,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { RunStatus } from '../contracts/vocabulary.js';
|
|
1
|
+
import { EventActorKind, EventSourceKind, WrongExpectedSequenceError } from '@atolis-hq/eventing';
|
|
2
|
+
import { createExecutionEventData } from '../contracts/event-factory.js';
|
|
3
|
+
import { ExecutionEventType, } from '../contracts/events.js';
|
|
4
|
+
import { isActiveRunStatus, RunStatus } from '../contracts/vocabulary.js';
|
|
5
5
|
import { failureFrom } from '../domain/run-result.js';
|
|
6
|
-
import {
|
|
7
|
-
export async function
|
|
8
|
-
const { dependencies, runId: currentRunId, activation, context, attempt, startedAt, runner,
|
|
6
|
+
import { newRunLease } from './run-liveness-service.js';
|
|
7
|
+
export async function prepareRun(input) {
|
|
8
|
+
const { dependencies, runId: currentRunId, activation, context, attempt, startedAt, runner, } = input;
|
|
9
|
+
const lease = newRunLease(dependencies.clock, dependencies.config, context.owner ?? 'execution');
|
|
9
10
|
await dependencies.repository.append(currentRunId, 0, [
|
|
10
11
|
createRunEvent({
|
|
11
12
|
runId: currentRunId,
|
|
12
|
-
eventId: `${currentRunId}:started`,
|
|
13
|
-
eventType: ExecutionEventType.
|
|
13
|
+
eventId: `${currentRunId}:preparation-started`,
|
|
14
|
+
eventType: ExecutionEventType.RunPreparationStarted,
|
|
14
15
|
occurredAt: startedAt,
|
|
15
16
|
correlationId: context.orchestrationGroupId,
|
|
16
17
|
causationId: activation.activationId,
|
|
17
18
|
payload: {
|
|
18
|
-
|
|
19
|
-
activity: activation.activity,
|
|
20
|
-
...(activation.stage === undefined ? {} : { stage: activation.stage }),
|
|
21
|
-
workflowInstanceId: context.workflowInstanceId,
|
|
22
|
-
orchestrationGroupId: context.orchestrationGroupId,
|
|
23
|
-
attempt,
|
|
19
|
+
...runPreparationPayload(activation, context, attempt, runner),
|
|
24
20
|
startedAt,
|
|
25
|
-
...(runner.name === undefined
|
|
26
|
-
? {}
|
|
27
|
-
: {
|
|
28
|
-
runner: {
|
|
29
|
-
name: runner.name,
|
|
30
|
-
...(runner.model === undefined ? {} : { model: runner.model }),
|
|
31
|
-
...(runner.effort === undefined ? {} : { effort: runner.effort }),
|
|
32
|
-
...(runner.pool === undefined ? {} : { pool: runner.pool }),
|
|
33
|
-
...(runner.cli === undefined ? {} : { cli: runner.cli }),
|
|
34
|
-
},
|
|
35
|
-
}),
|
|
36
|
-
...(lease === undefined
|
|
37
|
-
? {}
|
|
38
|
-
: {
|
|
39
|
-
workspace: {
|
|
40
|
-
mode: lease.mode,
|
|
41
|
-
path: lease.path,
|
|
42
|
-
...(lease.branch === undefined ? {} : { branch: lease.branch }),
|
|
43
|
-
},
|
|
44
|
-
}),
|
|
45
21
|
},
|
|
46
22
|
}),
|
|
23
|
+
createRunEvent({
|
|
24
|
+
runId: currentRunId,
|
|
25
|
+
eventId: `${currentRunId}:lease-claimed`,
|
|
26
|
+
eventType: ExecutionEventType.RunLeaseClaimed,
|
|
27
|
+
occurredAt: lease.acquiredAt,
|
|
28
|
+
correlationId: context.orchestrationGroupId,
|
|
29
|
+
causationId: activation.activationId,
|
|
30
|
+
payload: lease,
|
|
31
|
+
}),
|
|
47
32
|
]);
|
|
48
|
-
|
|
33
|
+
}
|
|
34
|
+
export async function startRun(input) {
|
|
35
|
+
const { dependencies, runId: currentRunId, activation, context, attempt, runner, lease } = input;
|
|
36
|
+
let retriedAfterSequence;
|
|
37
|
+
while (true) {
|
|
38
|
+
const loaded = await dependencies.repository.load(currentRunId);
|
|
39
|
+
if (loaded.view?.status !== RunStatus.Starting || loaded.view.cancellation !== undefined)
|
|
40
|
+
return undefined;
|
|
41
|
+
if (retriedAfterSequence !== undefined && loaded.sequence <= retriedAfterSequence)
|
|
42
|
+
throw new Error(`Run ${currentRunId} did not advance after a start append conflict`);
|
|
43
|
+
const startedAt = dependencies.clock.now().toISOString();
|
|
44
|
+
try {
|
|
45
|
+
await dependencies.repository.append(currentRunId, loaded.sequence, [
|
|
46
|
+
createRunEvent({
|
|
47
|
+
runId: currentRunId,
|
|
48
|
+
eventId: `${currentRunId}:started`,
|
|
49
|
+
eventType: ExecutionEventType.RunStarted,
|
|
50
|
+
occurredAt: startedAt,
|
|
51
|
+
correlationId: context.orchestrationGroupId,
|
|
52
|
+
causationId: activation.activationId,
|
|
53
|
+
payload: {
|
|
54
|
+
...runPreparationPayload(activation, context, attempt, runner),
|
|
55
|
+
startedAt,
|
|
56
|
+
...(lease === undefined
|
|
57
|
+
? {}
|
|
58
|
+
: {
|
|
59
|
+
workspace: {
|
|
60
|
+
mode: lease.mode,
|
|
61
|
+
path: lease.path,
|
|
62
|
+
...(lease.branch === undefined ? {} : { branch: lease.branch }),
|
|
63
|
+
},
|
|
64
|
+
}),
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
]);
|
|
68
|
+
return startedAt;
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
if (!(error instanceof WrongExpectedSequenceError))
|
|
72
|
+
throw error;
|
|
73
|
+
retriedAfterSequence = loaded.sequence;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function runPreparationPayload(activation, context, attempt, runner) {
|
|
78
|
+
return {
|
|
79
|
+
activationId: activation.activationId,
|
|
80
|
+
activity: activation.activity,
|
|
81
|
+
...(activation.stage === undefined ? {} : { stage: activation.stage }),
|
|
82
|
+
workflowInstanceId: context.workflowInstanceId,
|
|
83
|
+
orchestrationGroupId: context.orchestrationGroupId,
|
|
84
|
+
attempt,
|
|
85
|
+
...(runner.name === undefined
|
|
86
|
+
? {}
|
|
87
|
+
: {
|
|
88
|
+
runner: {
|
|
89
|
+
name: runner.name,
|
|
90
|
+
...(runner.model === undefined ? {} : { model: runner.model }),
|
|
91
|
+
...(runner.effort === undefined ? {} : { effort: runner.effort }),
|
|
92
|
+
...(runner.pool === undefined ? {} : { pool: runner.pool }),
|
|
93
|
+
...(runner.cli === undefined ? {} : { cli: runner.cli }),
|
|
94
|
+
},
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
49
97
|
}
|
|
50
98
|
export async function recordWorkspaceCleanupFailure(input) {
|
|
51
99
|
const { dependencies, runId: currentRunId, activation, context, error } = input;
|
|
@@ -82,34 +130,54 @@ export async function recordRunSuccess(input) {
|
|
|
82
130
|
}
|
|
83
131
|
export async function recordRunFailure(input) {
|
|
84
132
|
const { dependencies, runId: currentRunId, activation, context, error } = input;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
133
|
+
let retriedAfterSequence;
|
|
134
|
+
while (true) {
|
|
135
|
+
const loaded = await dependencies.repository.load(currentRunId);
|
|
136
|
+
if (loaded.sequence === 0)
|
|
137
|
+
throw error;
|
|
138
|
+
if (loaded.view === null || !isActiveRunStatus(loaded.view.status))
|
|
139
|
+
return;
|
|
140
|
+
if (loaded.view.cancellation !== undefined)
|
|
141
|
+
return loaded.view;
|
|
142
|
+
if (retriedAfterSequence !== undefined && loaded.sequence <= retriedAfterSequence)
|
|
143
|
+
throw new Error(`Run ${currentRunId} did not advance after a failure append conflict`);
|
|
144
|
+
const finishedAt = dependencies.clock.now().toISOString();
|
|
145
|
+
try {
|
|
146
|
+
await dependencies.repository.append(currentRunId, loaded.sequence, [
|
|
147
|
+
createRunEvent({
|
|
148
|
+
runId: currentRunId,
|
|
149
|
+
eventId: `${currentRunId}:failed`,
|
|
150
|
+
eventType: ExecutionEventType.RunFailed,
|
|
151
|
+
occurredAt: finishedAt,
|
|
152
|
+
correlationId: context.orchestrationGroupId,
|
|
153
|
+
causationId: activation.activationId,
|
|
154
|
+
payload: { failure: failureFrom(error), finishedAt },
|
|
155
|
+
}),
|
|
156
|
+
]);
|
|
157
|
+
return (await dependencies.repository.load(currentRunId)).view;
|
|
158
|
+
}
|
|
159
|
+
catch (appendError) {
|
|
160
|
+
if (!(appendError instanceof WrongExpectedSequenceError))
|
|
161
|
+
throw appendError;
|
|
162
|
+
retriedAfterSequence = loaded.sequence;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
102
165
|
}
|
|
103
166
|
export function createRunEvent(input) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
correlationId: input.correlationId,
|
|
109
|
-
causationId: input.causationId,
|
|
167
|
+
const { runId: currentRunId, ...event } = input;
|
|
168
|
+
void currentRunId;
|
|
169
|
+
return requireRunEventData(createExecutionEventData({
|
|
170
|
+
...event,
|
|
110
171
|
actor: { kind: EventActorKind.System, id: 'execution' },
|
|
111
172
|
source: { kind: EventSourceKind.Internal, id: 'execution' },
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
function requireRunEventData(event) {
|
|
176
|
+
switch (event.eventType) {
|
|
177
|
+
case ExecutionEventType.ActivationClaimed:
|
|
178
|
+
case ExecutionEventType.ActivationReleased:
|
|
179
|
+
throw new Error(`Expected Run event data, received ${event.eventType}`);
|
|
180
|
+
default:
|
|
181
|
+
return event;
|
|
182
|
+
}
|
|
115
183
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Clock } from '../../kernel/index.js';
|
|
2
|
+
import type { ExecutionConfig } from '../contracts/config.js';
|
|
3
|
+
import type { runId } from '../contracts/identifiers.js';
|
|
4
|
+
import type { RunView } from '../contracts/views.js';
|
|
5
|
+
import type { RunRepository } from './run-repository.js';
|
|
6
|
+
export declare function newRunLease(clock: Clock, config: ExecutionConfig, owner: string): {
|
|
7
|
+
owner: string;
|
|
8
|
+
acquiredAt: string;
|
|
9
|
+
expiresAt: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function claimRun(repository: RunRepository, clock: Clock, config: ExecutionConfig, currentRunId: ReturnType<typeof runId>, owner: string): Promise<RunView>;
|
|
12
|
+
export declare function renewLease(repository: RunRepository, clock: Clock, config: ExecutionConfig, currentRunId: ReturnType<typeof runId>, owner: string): Promise<RunView>;
|
|
13
|
+
export declare function requestCancellation(repository: RunRepository, clock: Clock, currentRunId: ReturnType<typeof runId>, reason: NonNullable<RunView['cancellation']>['reason'], active: ReadonlyMap<string, AbortController>): Promise<RunView>;
|
|
14
|
+
export declare function confirmCancellation(repository: RunRepository, clock: Clock, currentRunId: ReturnType<typeof runId>): Promise<RunView>;
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { EventActorKind, EventSourceKind, WrongExpectedSequenceError } from '@atolis-hq/eventing';
|
|
2
|
+
import { createExecutionEventData } from '../contracts/event-factory.js';
|
|
3
|
+
import { ExecutionEventType, } from '../contracts/events.js';
|
|
4
|
+
import { isActiveRunStatus } from '../contracts/vocabulary.js';
|
|
5
5
|
const defaultLeaseDurationMs = 60_000;
|
|
6
|
+
export function newRunLease(clock, config, owner) {
|
|
7
|
+
const now = clock.now();
|
|
8
|
+
return {
|
|
9
|
+
owner,
|
|
10
|
+
acquiredAt: now.toISOString(),
|
|
11
|
+
expiresAt: new Date(now.getTime() + (config.leaseDurationMs ?? defaultLeaseDurationMs)).toISOString(),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
6
14
|
export async function claimRun(repository, clock, config, currentRunId, owner) {
|
|
7
15
|
const loaded = await repository.load(currentRunId);
|
|
8
16
|
const run = requireActiveRun(loaded.view);
|
|
9
17
|
const now = clock.now();
|
|
10
18
|
if (run.lease !== undefined && new Date(run.lease.expiresAt) > now && run.lease.owner !== owner)
|
|
11
19
|
throw new Error(`Run ${currentRunId} has an unexpired lease`);
|
|
12
|
-
const lease =
|
|
13
|
-
owner,
|
|
14
|
-
acquiredAt: now.toISOString(),
|
|
15
|
-
expiresAt: new Date(now.getTime() + (config.leaseDurationMs ?? defaultLeaseDurationMs)).toISOString(),
|
|
16
|
-
};
|
|
20
|
+
const lease = newRunLease(clock, config, owner);
|
|
17
21
|
await repository.append(currentRunId, loaded.sequence, [
|
|
18
|
-
livenessEvent(currentRunId, run, ExecutionEventType.RunLeaseClaimed, lease, now.toISOString()),
|
|
22
|
+
livenessEvent(currentRunId, run, { eventType: ExecutionEventType.RunLeaseClaimed, payload: lease }, now.toISOString()),
|
|
19
23
|
]);
|
|
20
24
|
return (await repository.load(currentRunId)).view;
|
|
21
25
|
}
|
|
@@ -34,11 +38,12 @@ export async function renewLease(repository, clock, config, currentRunId, owner)
|
|
|
34
38
|
expiresAt: new Date(now.getTime() + (config.leaseDurationMs ?? defaultLeaseDurationMs)).toISOString(),
|
|
35
39
|
};
|
|
36
40
|
await repository.append(currentRunId, loaded.sequence, [
|
|
37
|
-
livenessEvent(currentRunId, run, ExecutionEventType.RunLeaseRenewed, lease, now.toISOString()),
|
|
41
|
+
livenessEvent(currentRunId, run, { eventType: ExecutionEventType.RunLeaseRenewed, payload: lease }, now.toISOString()),
|
|
38
42
|
]);
|
|
39
43
|
return (await repository.load(currentRunId)).view;
|
|
40
44
|
}
|
|
41
45
|
export async function requestCancellation(repository, clock, currentRunId, reason, active) {
|
|
46
|
+
let retriedAfterSequence;
|
|
42
47
|
while (true) {
|
|
43
48
|
const loaded = await repository.load(currentRunId);
|
|
44
49
|
const run = requireActiveRun(loaded.view);
|
|
@@ -46,15 +51,22 @@ export async function requestCancellation(repository, clock, currentRunId, reaso
|
|
|
46
51
|
active.get(currentRunId)?.abort(reason);
|
|
47
52
|
return run;
|
|
48
53
|
}
|
|
54
|
+
if (retriedAfterSequence !== undefined && loaded.sequence <= retriedAfterSequence)
|
|
55
|
+
throw new Error(`Run ${currentRunId} did not advance after a cancellation request conflict`);
|
|
49
56
|
const requestedAt = clock.now().toISOString();
|
|
50
57
|
try {
|
|
51
58
|
await repository.append(currentRunId, loaded.sequence, [
|
|
52
|
-
livenessEvent(currentRunId, run,
|
|
59
|
+
livenessEvent(currentRunId, run, {
|
|
60
|
+
eventType: ExecutionEventType.RunCancellationRequested,
|
|
61
|
+
payload: { requestedAt, reason },
|
|
62
|
+
}, requestedAt),
|
|
53
63
|
]);
|
|
54
64
|
}
|
|
55
65
|
catch (error) {
|
|
56
|
-
if (error instanceof WrongExpectedSequenceError)
|
|
66
|
+
if (error instanceof WrongExpectedSequenceError) {
|
|
67
|
+
retriedAfterSequence = loaded.sequence;
|
|
57
68
|
continue;
|
|
69
|
+
}
|
|
58
70
|
throw error;
|
|
59
71
|
}
|
|
60
72
|
active.get(currentRunId)?.abort(reason);
|
|
@@ -62,32 +74,58 @@ export async function requestCancellation(repository, clock, currentRunId, reaso
|
|
|
62
74
|
}
|
|
63
75
|
}
|
|
64
76
|
export async function confirmCancellation(repository, clock, currentRunId) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
let retriedAfterSequence;
|
|
78
|
+
while (true) {
|
|
79
|
+
const loaded = await repository.load(currentRunId);
|
|
80
|
+
if (loaded.view === null)
|
|
81
|
+
throw new Error('Run is not active');
|
|
82
|
+
if (!isActiveRunStatus(loaded.view.status))
|
|
83
|
+
return loaded.view;
|
|
84
|
+
if (loaded.view.cancellation === undefined)
|
|
85
|
+
throw new Error(`Run ${currentRunId} has no cancellation request`);
|
|
86
|
+
if (retriedAfterSequence !== undefined && loaded.sequence <= retriedAfterSequence)
|
|
87
|
+
throw new Error(`Run ${currentRunId} did not advance after a cancellation conflict`);
|
|
88
|
+
const confirmedAt = clock.now().toISOString();
|
|
89
|
+
try {
|
|
90
|
+
await repository.append(currentRunId, loaded.sequence, [
|
|
91
|
+
livenessEvent(currentRunId, loaded.view, {
|
|
92
|
+
eventType: ExecutionEventType.RunCancellationConfirmed,
|
|
93
|
+
payload: { confirmedAt },
|
|
94
|
+
}, confirmedAt),
|
|
95
|
+
livenessEvent(currentRunId, loaded.view, { eventType: ExecutionEventType.RunCancelled, payload: { finishedAt: confirmedAt } }, confirmedAt),
|
|
96
|
+
]);
|
|
97
|
+
return (await repository.load(currentRunId)).view;
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
if (!(error instanceof WrongExpectedSequenceError))
|
|
101
|
+
throw error;
|
|
102
|
+
retriedAfterSequence = loaded.sequence;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
75
105
|
}
|
|
76
106
|
function requireActiveRun(run) {
|
|
77
|
-
if (run === null || run.status
|
|
107
|
+
if (run === null || !isActiveRunStatus(run.status))
|
|
78
108
|
throw new Error('Run is not active');
|
|
79
109
|
return run;
|
|
80
110
|
}
|
|
81
|
-
function livenessEvent(currentRunId, run,
|
|
82
|
-
|
|
83
|
-
eventId: `${currentRunId}:${eventType}:${occurredAt}`,
|
|
84
|
-
eventType,
|
|
111
|
+
function livenessEvent(currentRunId, run, input, occurredAt) {
|
|
112
|
+
const event = createExecutionEventData({
|
|
113
|
+
eventId: `${currentRunId}:${input.eventType}:${occurredAt}`,
|
|
85
114
|
occurredAt,
|
|
86
115
|
correlationId: run.orchestrationGroupId,
|
|
87
116
|
causationId: run.activationId,
|
|
88
117
|
actor: { kind: EventActorKind.System, id: 'execution' },
|
|
89
118
|
source: { kind: EventSourceKind.Internal, id: 'execution' },
|
|
90
|
-
|
|
91
|
-
payload,
|
|
119
|
+
...input,
|
|
92
120
|
});
|
|
121
|
+
return requireRunEventData(event);
|
|
122
|
+
}
|
|
123
|
+
function requireRunEventData(event) {
|
|
124
|
+
switch (event.eventType) {
|
|
125
|
+
case ExecutionEventType.ActivationClaimed:
|
|
126
|
+
case ExecutionEventType.ActivationReleased:
|
|
127
|
+
throw new Error(`Expected Run event data, received ${event.eventType}`);
|
|
128
|
+
default:
|
|
129
|
+
return event;
|
|
130
|
+
}
|
|
93
131
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type EventJournal } from '@atolis-hq/eventing';
|
|
2
|
+
import type { ActivationId } from '../../activities/index.js';
|
|
3
|
+
import { type RunExecutionEvent, type RunExecutionEventData } from '../contracts/events.js';
|
|
4
|
+
import { type RunId } from '../contracts/identifiers.js';
|
|
5
|
+
import type { RunView } from '../contracts/views.js';
|
|
6
|
+
import { foldRun } from '../domain/run.js';
|
|
7
|
+
export declare class RunRepository {
|
|
8
|
+
private readonly journal;
|
|
9
|
+
private readonly runs;
|
|
10
|
+
constructor(journal: EventJournal);
|
|
11
|
+
load(runId: RunId): Promise<{
|
|
12
|
+
readonly sequence: number;
|
|
13
|
+
readonly events?: readonly RunExecutionEvent[];
|
|
14
|
+
readonly view: ReturnType<typeof foldRun>;
|
|
15
|
+
}>;
|
|
16
|
+
append(runId: RunId, sequence: number, drafts: readonly RunExecutionEventData[]): Promise<readonly RunExecutionEvent[]>;
|
|
17
|
+
list(activationId?: ActivationId): Promise<readonly RunView[]>;
|
|
18
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cachedJournalView
|
|
1
|
+
import { cachedJournalView } from '@atolis-hq/eventing';
|
|
2
2
|
import { decodeRunExecutionEvent, } from '../contracts/events.js';
|
|
3
3
|
import { runId } from '../contracts/identifiers.js';
|
|
4
4
|
import { isRunStream, runStream } from '../contracts/streams.js';
|
|
@@ -16,7 +16,7 @@ export class RunRepository {
|
|
|
16
16
|
return { sequence: events.length, events: decoded, view: foldRun(decoded) };
|
|
17
17
|
}
|
|
18
18
|
async append(runId, sequence, drafts) {
|
|
19
|
-
const events = await this.journal.
|
|
19
|
+
const events = await this.journal.appendToStream(runStream(runId), sequence, drafts);
|
|
20
20
|
return events.map(decodeRunExecutionEvent);
|
|
21
21
|
}
|
|
22
22
|
async list(activationId) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ActivationId, ActivityName, ActivityOrchestrationGroupId, ActivityWorkflowInstanceId } from '../../activities/index.js';
|
|
2
|
+
import type { ResourceView } from '../../resources/index.js';
|
|
3
|
+
import type { WorkItemId } from '../../work/index.js';
|
|
4
|
+
import type { WorkspaceMode } from './vocabulary.js';
|
|
5
|
+
export interface ExecutionActivation {
|
|
6
|
+
readonly activationId: ActivationId;
|
|
7
|
+
readonly ordinal: number;
|
|
8
|
+
readonly activity: ActivityName;
|
|
9
|
+
readonly stage?: string | undefined;
|
|
10
|
+
readonly input: unknown;
|
|
11
|
+
readonly execution: {
|
|
12
|
+
readonly workspace?: WorkspaceMode | undefined;
|
|
13
|
+
readonly runnerPool?: string | undefined;
|
|
14
|
+
} | undefined;
|
|
15
|
+
/** A durable operator request to start this activation without session resume. */
|
|
16
|
+
readonly sessionPolicy?: 'fresh' | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface ExecutionAttemptContext {
|
|
19
|
+
readonly workItemId: WorkItemId;
|
|
20
|
+
readonly workflowInstanceId: ActivityWorkflowInstanceId;
|
|
21
|
+
readonly orchestrationGroupId: ActivityOrchestrationGroupId;
|
|
22
|
+
readonly resources: readonly ResourceView[];
|
|
23
|
+
readonly owner?: string;
|
|
24
|
+
/** Runner names currently quota-paused; unset means none. */
|
|
25
|
+
readonly ineligibleRunners?: ReadonlySet<string>;
|
|
26
|
+
/** Watch workflows always start fresh; primary stages resume their own compatible session. */
|
|
27
|
+
readonly sessionPolicy?: 'fresh' | 'resume-stage';
|
|
28
|
+
/** Let a control-plane tick observe an immediate deterministic completion before returning. */
|
|
29
|
+
readonly awaitImmediateCompletion?: boolean;
|
|
30
|
+
}
|