@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
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/* eslint-disable complexity, max-lines-per-function */
|
|
2
|
+
import { correlationId, EventActorKind } from '@atolis-hq/eventing';
|
|
3
|
+
import { RunStatus } from '../../execution/index.js';
|
|
4
|
+
import { isAmbiguityResolutionBlock, WorkflowStatus } from '../../orchestration/index.js';
|
|
5
|
+
import { WorkStatus } from '../../work/index.js';
|
|
6
|
+
import { ControlStreamKind } from '../contracts/streams.js';
|
|
7
|
+
import { DispatchPolicy } from '../domain/dispatch-policy.js';
|
|
8
|
+
import { isRunnerQuotaOutcome, reportUnappliedRunnerQuotaRetry, runDispatchLoop, runnerQuotaMessage, } from './advance-once-dispatch.js';
|
|
9
|
+
import { findUnresolvedSucceededTerminal, findUnresolvedTerminal, } from './execution-reconciliation.js';
|
|
10
|
+
export function createActivationScheduler(orchestration, execution, resources, clock, dependencies) {
|
|
11
|
+
const runnerIneligibility = dependencies.runnerIneligibility ?? (async () => new Set());
|
|
12
|
+
const isDispatchPaused = dependencies.isDispatchPaused ?? (async () => false);
|
|
13
|
+
const workspaceRecovery = dependencies.workspaceRecovery;
|
|
14
|
+
const transcriptRetention = dependencies.transcriptRetention;
|
|
15
|
+
const dispatchPolicy = dependencies.dispatchPolicy ?? new DispatchPolicy({ maxDispatches: 1 });
|
|
16
|
+
const maxConcurrentRuns = dependencies.maxConcurrentRuns ?? 1;
|
|
17
|
+
const maxDispatches = dependencies.maxDispatches ?? 1;
|
|
18
|
+
const context = (cause) => ({
|
|
19
|
+
commandId: dependencies.ids.next('command'),
|
|
20
|
+
correlationId: correlationId(cause),
|
|
21
|
+
occurredAt: clock.now().toISOString(),
|
|
22
|
+
actor: { kind: EventActorKind.System, id: ControlStreamKind.Global },
|
|
23
|
+
});
|
|
24
|
+
const run = async (options) => {
|
|
25
|
+
if (options.maxProgress < 1)
|
|
26
|
+
return { kind: 'exhausted', progressCount: 0 };
|
|
27
|
+
if (await isDispatchPaused())
|
|
28
|
+
return { kind: 'paused' };
|
|
29
|
+
if (workspaceRecovery !== undefined) {
|
|
30
|
+
await workspaceRecovery.recover(await execution.list(), {
|
|
31
|
+
isPaused: isDispatchPaused,
|
|
32
|
+
retainWorkItem: async (workItemId) => {
|
|
33
|
+
const work = await dependencies.work?.get(workItemId);
|
|
34
|
+
return work?.state === WorkStatus.Open && work.deleted !== true;
|
|
35
|
+
},
|
|
36
|
+
onWorkspaceReclaimed: async (workItemId) => {
|
|
37
|
+
if (await isDispatchPaused())
|
|
38
|
+
return false;
|
|
39
|
+
const work = await dependencies.work?.get(workItemId);
|
|
40
|
+
if (work?.state !== WorkStatus.Closed)
|
|
41
|
+
return true;
|
|
42
|
+
try {
|
|
43
|
+
return (await transcriptRetention?.markClosedWorkItem(workItemId)) ?? true;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (await isDispatchPaused())
|
|
52
|
+
return { kind: 'paused' };
|
|
53
|
+
await execution.recoverActive?.(ControlStreamKind.Global);
|
|
54
|
+
if (await isDispatchPaused())
|
|
55
|
+
return { kind: 'paused' };
|
|
56
|
+
if (transcriptRetention !== undefined) {
|
|
57
|
+
for (const workItemId of (await dependencies.closedWorkItemIds?.()) ?? []) {
|
|
58
|
+
if (await isDispatchPaused())
|
|
59
|
+
return { kind: 'paused' };
|
|
60
|
+
try {
|
|
61
|
+
await transcriptRetention.markClosedWorkItem(workItemId);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
// Retention is operational filesystem maintenance, not Run lifecycle state.
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (await isDispatchPaused())
|
|
69
|
+
return { kind: 'paused' };
|
|
70
|
+
try {
|
|
71
|
+
await transcriptRetention?.sweep();
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// Retention is operational filesystem maintenance, not Run lifecycle state.
|
|
75
|
+
}
|
|
76
|
+
if (await isDispatchPaused())
|
|
77
|
+
return { kind: 'paused' };
|
|
78
|
+
await orchestration.reconcileChildCompletions(context('child-completion-reconciliation'));
|
|
79
|
+
if (await isDispatchPaused())
|
|
80
|
+
return { kind: 'paused' };
|
|
81
|
+
const rawPending = await orchestration.listPendingActivations(options.workItemId);
|
|
82
|
+
const pending = (await Promise.all(rawPending.map(async (candidate) => {
|
|
83
|
+
const work = await dependencies.work?.get(candidate.workflow.workItemId);
|
|
84
|
+
return work?.frozen || work?.deleted ? null : candidate;
|
|
85
|
+
}))).filter((candidate) => candidate !== null);
|
|
86
|
+
const blocked = ((await orchestration.listAll?.()) ?? []).flatMap((workflow) => workflow.status === WorkflowStatus.Blocked &&
|
|
87
|
+
workflow.pendingActivation !== undefined &&
|
|
88
|
+
(options.workItemId === undefined || workflow.workItemId === options.workItemId)
|
|
89
|
+
? [{ workflow, activation: workflow.pendingActivation }]
|
|
90
|
+
: []);
|
|
91
|
+
const ambiguityBlocked = blocked.filter((item) => isAmbiguityResolutionBlock(item.workflow.blockReason));
|
|
92
|
+
const recovery = (await findUnresolvedTerminal(pending, execution)) ??
|
|
93
|
+
(await findUnresolvedTerminal(ambiguityBlocked, execution)) ??
|
|
94
|
+
(await findUnresolvedSucceededTerminal(blocked, execution));
|
|
95
|
+
if (recovery !== undefined) {
|
|
96
|
+
if (await isDispatchPaused())
|
|
97
|
+
return { kind: 'paused' };
|
|
98
|
+
if (recovery.run.status === RunStatus.Succeeded) {
|
|
99
|
+
if (isRunnerQuotaOutcome(recovery.run.outcome)) {
|
|
100
|
+
const retried = await orchestration.retryRunnerQuotaFailure?.(recovery.item.workflow.workflowInstanceId, {
|
|
101
|
+
activationId: recovery.item.activation.activationId,
|
|
102
|
+
runId: recovery.run.runId,
|
|
103
|
+
runnerName: recovery.run.runner?.name ?? 'unknown-runner',
|
|
104
|
+
message: runnerQuotaMessage(recovery.run.outcome),
|
|
105
|
+
}, context(recovery.run.runId));
|
|
106
|
+
reportUnappliedRunnerQuotaRetry(retried, {
|
|
107
|
+
activationId: recovery.item.activation.activationId,
|
|
108
|
+
runId: recovery.run.runId,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
await orchestration.acceptOutcome({
|
|
113
|
+
workflowInstanceId: recovery.item.workflow.workflowInstanceId,
|
|
114
|
+
activationId: recovery.item.activation.activationId,
|
|
115
|
+
outcome: recovery.run.outcome,
|
|
116
|
+
}, context(recovery.run.runId));
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
kind: 'progressed',
|
|
120
|
+
dispatched: [
|
|
121
|
+
{ activationId: recovery.item.activation.activationId, runId: recovery.run.runId },
|
|
122
|
+
],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
await orchestration.resolveExecutionFailure?.(recovery.item.workflow.workflowInstanceId, {
|
|
126
|
+
activationId: recovery.item.activation.activationId,
|
|
127
|
+
runId: recovery.run.runId,
|
|
128
|
+
reason: recovery.run.failure?.message ?? 'execution failed',
|
|
129
|
+
}, context(recovery.run.runId));
|
|
130
|
+
return {
|
|
131
|
+
kind: WorkflowStatus.Blocked,
|
|
132
|
+
workflowInstanceId: recovery.item.workflow.workflowInstanceId,
|
|
133
|
+
reason: recovery.run.failure?.message ?? 'execution failed',
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
return runDispatchLoop(pending, {
|
|
137
|
+
orchestration,
|
|
138
|
+
execution,
|
|
139
|
+
resources,
|
|
140
|
+
dispatchPolicy,
|
|
141
|
+
maxConcurrentRuns,
|
|
142
|
+
maxDispatches,
|
|
143
|
+
runnerIneligibility,
|
|
144
|
+
isDispatchPaused,
|
|
145
|
+
commandContext: context,
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
const serialise = dependencies.schedulerSerialiser ?? createInProcessSerialiser();
|
|
149
|
+
return { runOnce: (options, signal) => serialise(() => run(options), signal) };
|
|
150
|
+
}
|
|
151
|
+
function createInProcessSerialiser() {
|
|
152
|
+
let prior = Promise.resolve();
|
|
153
|
+
return async (operation, signal) => {
|
|
154
|
+
const current = prior.then(async () => {
|
|
155
|
+
throwIfAborted(signal);
|
|
156
|
+
return operation();
|
|
157
|
+
});
|
|
158
|
+
prior = current.then(() => undefined, () => undefined);
|
|
159
|
+
return current;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function throwIfAborted(signal) {
|
|
163
|
+
if (signal?.aborted)
|
|
164
|
+
throw signal.reason ?? new Error('Activation scheduler run aborted');
|
|
165
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { CommandContext } from '@atolis-hq/eventing';
|
|
2
|
+
import { type ActivityOutcome } from '../../activities/index.js';
|
|
3
|
+
import type { ActivityActivationView, WorkflowInstanceView } from '../../orchestration/index.js';
|
|
4
|
+
import type { ResourceService } from '../../resources/index.js';
|
|
5
|
+
import type { AdvanceResult } from '../contracts/views.js';
|
|
6
|
+
import type { DispatchPolicy } from '../domain/dispatch-policy.js';
|
|
7
|
+
import type { ExecutionPort, OrchestrationPort } from './activation-scheduler-ports.js';
|
|
8
|
+
export interface DispatchLoopContext {
|
|
9
|
+
readonly orchestration: OrchestrationPort;
|
|
10
|
+
readonly execution: ExecutionPort;
|
|
11
|
+
readonly resources: ResourceService;
|
|
12
|
+
readonly dispatchPolicy: DispatchPolicy;
|
|
13
|
+
readonly maxConcurrentRuns: number;
|
|
14
|
+
readonly maxDispatches: number;
|
|
15
|
+
readonly runnerIneligibility: () => Promise<ReadonlySet<string>>;
|
|
16
|
+
readonly isDispatchPaused: () => Promise<boolean>;
|
|
17
|
+
readonly commandContext: (cause: string) => CommandContext;
|
|
18
|
+
}
|
|
19
|
+
interface PendingActivation {
|
|
20
|
+
readonly workflow: WorkflowInstanceView;
|
|
21
|
+
readonly activation: ActivityActivationView;
|
|
22
|
+
}
|
|
23
|
+
export declare function isRunnerQuotaOutcome(outcome: ActivityOutcome): boolean;
|
|
24
|
+
export declare function runnerQuotaMessage(outcome: ActivityOutcome): string;
|
|
25
|
+
/**
|
|
26
|
+
* A quota retry deliberately leaves the outcome unaccepted, so a port that
|
|
27
|
+
* never applied it (absent method, or a workflow instance that vanished)
|
|
28
|
+
* leaves the Run permanently unresolved. Surface that rather than going
|
|
29
|
+
* silent; it is an operational defect, not a workflow state.
|
|
30
|
+
*/
|
|
31
|
+
export declare function reportUnappliedRunnerQuotaRetry(result: unknown, input: {
|
|
32
|
+
readonly activationId: string;
|
|
33
|
+
readonly runId: string;
|
|
34
|
+
}): void;
|
|
35
|
+
/**
|
|
36
|
+
* Fills open capacity within one Advancement call: dispatches ready
|
|
37
|
+
* activations one at a time, rechecking `maxConcurrentRuns` and reselecting
|
|
38
|
+
* fresh candidates after every dispatch (per #346's capacity-recheck
|
|
39
|
+
* principle), until capacity, the per-call `maxDispatches` burst cap, or
|
|
40
|
+
* eligible candidates are exhausted. Candidates dispatched earlier in the
|
|
41
|
+
* same call are excluded from later selection via `dispatchedIds`, since
|
|
42
|
+
* their Run lifecycle event is not guaranteed visible through
|
|
43
|
+
* `execution.list()` yet.
|
|
44
|
+
*/
|
|
45
|
+
export declare function runDispatchLoop(pending: readonly PendingActivation[], ctx: DispatchLoopContext): Promise<AdvanceResult>;
|
|
46
|
+
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/* eslint-disable complexity, max-lines-per-function */
|
|
2
1
|
import { ActivityFailureCode, ActivityOutcomeKind, } from '../../activities/index.js';
|
|
3
|
-
import { ActivationClaimConflictError, NoEligibleRunnerError, RunStatus, WorkspaceMode, } from '../../execution/index.js';
|
|
2
|
+
import { ActivationClaimConflictError, isActiveRunStatus, NoEligibleRunnerError, RunStatus, WorkspaceMode, } from '../../execution/index.js';
|
|
4
3
|
import { WorkflowStatus } from '../../orchestration/index.js';
|
|
5
4
|
import { isExecutionFailureTerminal } from './execution-reconciliation.js';
|
|
6
5
|
export function isRunnerQuotaOutcome(outcome) {
|
|
@@ -32,7 +31,7 @@ export function reportUnappliedRunnerQuotaRetry(result, input) {
|
|
|
32
31
|
* principle), until capacity, the per-call `maxDispatches` burst cap, or
|
|
33
32
|
* eligible candidates are exhausted. Candidates dispatched earlier in the
|
|
34
33
|
* same call are excluded from later selection via `dispatchedIds`, since
|
|
35
|
-
* their
|
|
34
|
+
* their Run lifecycle event is not guaranteed visible through
|
|
36
35
|
* `execution.list()` yet.
|
|
37
36
|
*/
|
|
38
37
|
export async function runDispatchLoop(pending, ctx) {
|
|
@@ -41,7 +40,7 @@ export async function runDispatchLoop(pending, ctx) {
|
|
|
41
40
|
let stopReason;
|
|
42
41
|
while (dispatched.length < ctx.maxDispatches) {
|
|
43
42
|
const allRuns = await ctx.execution.list();
|
|
44
|
-
if (allRuns.filter((run) => run.status
|
|
43
|
+
if (allRuns.filter((run) => isActiveRunStatus(run.status)).length >= ctx.maxConcurrentRuns) {
|
|
45
44
|
stopReason = { kind: 'no-work' };
|
|
46
45
|
break;
|
|
47
46
|
}
|
|
@@ -50,8 +49,8 @@ export async function runDispatchLoop(pending, ctx) {
|
|
|
50
49
|
activationId: item.activation.activationId,
|
|
51
50
|
requestedPosition,
|
|
52
51
|
hasActiveRun: dispatchedIds.has(item.activation.activationId) ||
|
|
53
|
-
(await ctx.execution.list(item.activation.activationId)).some((run) => run.status
|
|
54
|
-
allRuns.some((run) => run.status
|
|
52
|
+
(await ctx.execution.list(item.activation.activationId)).some((run) => isActiveRunStatus(run.status)) ||
|
|
53
|
+
allRuns.some((run) => isActiveRunStatus(run.status) &&
|
|
55
54
|
run.workflowInstanceId === item.workflow.workflowInstanceId &&
|
|
56
55
|
run.workspace?.mode === WorkspaceMode.Branch),
|
|
57
56
|
cancelled: false,
|
|
@@ -141,7 +140,7 @@ export async function runDispatchLoop(pending, ctx) {
|
|
|
141
140
|
runId: run.runId,
|
|
142
141
|
reason: run.failure?.message ?? 'execution failed',
|
|
143
142
|
}, ctx.commandContext(run.runId));
|
|
144
|
-
if (run.status !== RunStatus.Succeeded && run.status
|
|
143
|
+
if (run.status !== RunStatus.Succeeded && !isActiveRunStatus(run.status)) {
|
|
145
144
|
stopReason = {
|
|
146
145
|
kind: WorkflowStatus.Blocked,
|
|
147
146
|
workflowInstanceId: selected.workflow.workflowInstanceId,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Clock } from '../../kernel/index.js';
|
|
2
|
+
import type { ResourceService } from '../../resources/index.js';
|
|
3
|
+
import type { ActivationSchedulerDependencies, ExecutionPort, OrchestrationPort } from './activation-scheduler-ports.js';
|
|
4
|
+
/** Compatibility facade for callers that still use the former Advancement name. */
|
|
5
|
+
export declare function createAdvanceOnce(orchestration: OrchestrationPort, execution: ExecutionPort, resources: ResourceService, clock: Clock, dependencies: ActivationSchedulerDependencies): (options: Parameters<(options: import("../index.js").AdvanceOptions, signal?: AbortSignal) => Promise<import("../index.js").AdvanceResult>>[0]) => Promise<import("../index.js").AdvanceResult>;
|
|
@@ -1,160 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { correlationId, EventActorKind } from '../../kernel/index.js';
|
|
4
|
-
import { isAmbiguityResolutionBlock, WorkflowStatus } from '../../orchestration/index.js';
|
|
5
|
-
import { WorkStatus } from '../../work/index.js';
|
|
6
|
-
import { ControlStreamKind } from '../contracts/streams.js';
|
|
7
|
-
import { DispatchPolicy } from '../domain/dispatch-policy.js';
|
|
8
|
-
import { isRunnerQuotaOutcome, reportUnappliedRunnerQuotaRetry, runDispatchLoop, runnerQuotaMessage, } from './advance-once-dispatch.js';
|
|
9
|
-
import { findUnresolvedSucceededTerminal, findUnresolvedTerminal, } from './execution-reconciliation.js';
|
|
1
|
+
import { createActivationScheduler } from './activation-scheduler.js';
|
|
2
|
+
/** Compatibility facade for callers that still use the former Advancement name. */
|
|
10
3
|
export function createAdvanceOnce(orchestration, execution, resources, clock, dependencies) {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const workspaceRecovery = dependencies.workspaceRecovery;
|
|
14
|
-
const transcriptRetention = dependencies.transcriptRetention;
|
|
15
|
-
const dispatchPolicy = dependencies.dispatchPolicy ?? new DispatchPolicy({ maxDispatches: 1 });
|
|
16
|
-
const maxConcurrentRuns = dependencies.maxConcurrentRuns ?? 1;
|
|
17
|
-
const maxDispatches = dependencies.maxDispatches ?? 1;
|
|
18
|
-
const context = (cause) => ({
|
|
19
|
-
commandId: dependencies.ids.next('command'),
|
|
20
|
-
correlationId: correlationId(cause),
|
|
21
|
-
occurredAt: clock.now().toISOString(),
|
|
22
|
-
actor: { kind: EventActorKind.System, id: ControlStreamKind.Global },
|
|
23
|
-
});
|
|
24
|
-
const advance = async (options) => {
|
|
25
|
-
if (options.maxProgress < 1)
|
|
26
|
-
return { kind: 'exhausted', progressCount: 0 };
|
|
27
|
-
if (await isDispatchPaused())
|
|
28
|
-
return { kind: 'paused' };
|
|
29
|
-
if (workspaceRecovery !== undefined) {
|
|
30
|
-
await workspaceRecovery.recover(await execution.list(), {
|
|
31
|
-
isPaused: isDispatchPaused,
|
|
32
|
-
retainWorkItem: async (workItemId) => {
|
|
33
|
-
const work = await dependencies.work?.get(workItemId);
|
|
34
|
-
return work?.state === WorkStatus.Open && work.deleted !== true;
|
|
35
|
-
},
|
|
36
|
-
onWorkspaceReclaimed: async (workItemId) => {
|
|
37
|
-
if (await isDispatchPaused())
|
|
38
|
-
return false;
|
|
39
|
-
const work = await dependencies.work?.get(workItemId);
|
|
40
|
-
if (work?.state !== WorkStatus.Closed)
|
|
41
|
-
return true;
|
|
42
|
-
try {
|
|
43
|
-
return (await transcriptRetention?.markClosedWorkItem(workItemId)) ?? true;
|
|
44
|
-
}
|
|
45
|
-
catch {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
if (await isDispatchPaused())
|
|
52
|
-
return { kind: 'paused' };
|
|
53
|
-
await execution.recoverActive?.(ControlStreamKind.Global);
|
|
54
|
-
if (await isDispatchPaused())
|
|
55
|
-
return { kind: 'paused' };
|
|
56
|
-
if (transcriptRetention !== undefined) {
|
|
57
|
-
for (const workItemId of (await dependencies.closedWorkItemIds?.()) ?? []) {
|
|
58
|
-
if (await isDispatchPaused())
|
|
59
|
-
return { kind: 'paused' };
|
|
60
|
-
try {
|
|
61
|
-
await transcriptRetention.markClosedWorkItem(workItemId);
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
// Retention is operational filesystem maintenance, not Run lifecycle state.
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
if (await isDispatchPaused())
|
|
69
|
-
return { kind: 'paused' };
|
|
70
|
-
try {
|
|
71
|
-
await transcriptRetention?.sweep();
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
// Retention is operational filesystem maintenance, not Run lifecycle state.
|
|
75
|
-
}
|
|
76
|
-
if (await isDispatchPaused())
|
|
77
|
-
return { kind: 'paused' };
|
|
78
|
-
await orchestration.reconcileChildCompletions(context('child-completion-reconciliation'));
|
|
79
|
-
if (await isDispatchPaused())
|
|
80
|
-
return { kind: 'paused' };
|
|
81
|
-
const rawPending = await orchestration.listPendingActivations(options.workItemId);
|
|
82
|
-
const pending = (await Promise.all(rawPending.map(async (candidate) => {
|
|
83
|
-
const work = await dependencies.work?.get(candidate.workflow.workItemId);
|
|
84
|
-
return work?.frozen || work?.deleted ? null : candidate;
|
|
85
|
-
}))).filter((candidate) => candidate !== null);
|
|
86
|
-
const blocked = ((await orchestration.listAll?.()) ?? []).flatMap((workflow) => workflow.status === WorkflowStatus.Blocked &&
|
|
87
|
-
workflow.pendingActivation !== undefined &&
|
|
88
|
-
(options.workItemId === undefined || workflow.workItemId === options.workItemId)
|
|
89
|
-
? [{ workflow, activation: workflow.pendingActivation }]
|
|
90
|
-
: []);
|
|
91
|
-
const ambiguityBlocked = blocked.filter((item) => isAmbiguityResolutionBlock(item.workflow.blockReason));
|
|
92
|
-
const recovery = (await findUnresolvedTerminal(pending, execution)) ??
|
|
93
|
-
(await findUnresolvedTerminal(ambiguityBlocked, execution)) ??
|
|
94
|
-
(await findUnresolvedSucceededTerminal(blocked, execution));
|
|
95
|
-
if (recovery !== undefined) {
|
|
96
|
-
if (await isDispatchPaused())
|
|
97
|
-
return { kind: 'paused' };
|
|
98
|
-
if (recovery.run.status === RunStatus.Succeeded) {
|
|
99
|
-
// An agent Run completes after execution.attempt() has already returned,
|
|
100
|
-
// so this reconciliation — not the dispatch loop — is where a real
|
|
101
|
-
// quota-classified outcome is resolved. It must divert here too, or the
|
|
102
|
-
// quota failure is published and charged to the retry budget after all.
|
|
103
|
-
if (isRunnerQuotaOutcome(recovery.run.outcome)) {
|
|
104
|
-
const retried = await orchestration.retryRunnerQuotaFailure?.(recovery.item.workflow.workflowInstanceId, {
|
|
105
|
-
activationId: recovery.item.activation.activationId,
|
|
106
|
-
runId: recovery.run.runId,
|
|
107
|
-
runnerName: recovery.run.runner?.name ?? 'unknown-runner',
|
|
108
|
-
message: runnerQuotaMessage(recovery.run.outcome),
|
|
109
|
-
}, context(recovery.run.runId));
|
|
110
|
-
reportUnappliedRunnerQuotaRetry(retried, {
|
|
111
|
-
activationId: recovery.item.activation.activationId,
|
|
112
|
-
runId: recovery.run.runId,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
await orchestration.acceptOutcome({
|
|
117
|
-
workflowInstanceId: recovery.item.workflow.workflowInstanceId,
|
|
118
|
-
activationId: recovery.item.activation.activationId,
|
|
119
|
-
outcome: recovery.run.outcome,
|
|
120
|
-
}, context(recovery.run.runId));
|
|
121
|
-
}
|
|
122
|
-
return {
|
|
123
|
-
kind: 'progressed',
|
|
124
|
-
dispatched: [
|
|
125
|
-
{ activationId: recovery.item.activation.activationId, runId: recovery.run.runId },
|
|
126
|
-
],
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
await orchestration.resolveExecutionFailure?.(recovery.item.workflow.workflowInstanceId, {
|
|
130
|
-
activationId: recovery.item.activation.activationId,
|
|
131
|
-
runId: recovery.run.runId,
|
|
132
|
-
reason: recovery.run.failure?.message ?? 'execution failed',
|
|
133
|
-
}, context(recovery.run.runId));
|
|
134
|
-
return {
|
|
135
|
-
kind: WorkflowStatus.Blocked,
|
|
136
|
-
workflowInstanceId: recovery.item.workflow.workflowInstanceId,
|
|
137
|
-
reason: recovery.run.failure?.message ?? 'execution failed',
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
return runDispatchLoop(pending, {
|
|
141
|
-
orchestration,
|
|
142
|
-
execution,
|
|
143
|
-
resources,
|
|
144
|
-
dispatchPolicy,
|
|
145
|
-
maxConcurrentRuns,
|
|
146
|
-
maxDispatches,
|
|
147
|
-
runnerIneligibility,
|
|
148
|
-
isDispatchPaused,
|
|
149
|
-
commandContext: context,
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
// Tick, resident, and API callers share this advancement instance. Serialize the
|
|
153
|
-
// capacity check through Run creation so concurrent callers cannot over-dispatch.
|
|
154
|
-
let prior = Promise.resolve();
|
|
155
|
-
return async (options) => {
|
|
156
|
-
const current = prior.then(() => advance(options));
|
|
157
|
-
prior = current.then(() => undefined, () => undefined);
|
|
158
|
-
return current;
|
|
159
|
-
};
|
|
4
|
+
const scheduler = createActivationScheduler(orchestration, execution, resources, clock, dependencies);
|
|
5
|
+
return (options) => scheduler.runOnce(options);
|
|
160
6
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { EventJournal, ProjectionDefinition } from '@atolis-hq/eventing';
|
|
2
|
+
import { ControlEventType, type ControlEvent } from '../contracts/events.js';
|
|
3
|
+
export interface ControlPlaneView {
|
|
4
|
+
readonly pausedUntil: string | null;
|
|
5
|
+
readonly reason?: string;
|
|
6
|
+
readonly runnerPauses: Readonly<Record<string, {
|
|
7
|
+
readonly cause: Extract<ControlEvent['event'], {
|
|
8
|
+
readonly eventType: typeof ControlEventType.RunnerPaused;
|
|
9
|
+
}>['payload']['cause'];
|
|
10
|
+
readonly reason: string;
|
|
11
|
+
readonly resumeAt?: string | undefined;
|
|
12
|
+
}>>;
|
|
13
|
+
}
|
|
14
|
+
export declare function ineligibleRunners(view: ControlPlaneView, now: string): ReadonlySet<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Reads pause eligibility from the authoritative control stream for scheduling.
|
|
17
|
+
* The folded view is cached only while the durable journal position is unchanged.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createDurableRunnerIneligibility(journal: Pick<EventJournal, 'latestGlobalPosition' | 'readStream'>, now: () => string): () => Promise<ReadonlySet<string>>;
|
|
20
|
+
export declare const controlPlaneProjection: ProjectionDefinition<ControlPlaneView>;
|
|
21
|
+
export declare const controlPlaneProjectionDefinitions: readonly ProjectionDefinition[];
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import { ControlEventType, selectControlEvent } from '../contracts/events.js';
|
|
2
|
-
import { ControlStreamKind } from '../contracts/streams.js';
|
|
2
|
+
import { ControlStreamKind, controlPlaneStream } from '../contracts/streams.js';
|
|
3
3
|
export function ineligibleRunners(view, now) {
|
|
4
4
|
const current = Date.parse(now);
|
|
5
5
|
return new Set(Object.entries(view.runnerPauses)
|
|
6
6
|
.filter(([, pause]) => pause.resumeAt === undefined || Date.parse(pause.resumeAt) > current)
|
|
7
7
|
.map(([runnerName]) => runnerName));
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Reads pause eligibility from the authoritative control stream for scheduling.
|
|
11
|
+
* The folded view is cached only while the durable journal position is unchanged.
|
|
12
|
+
*/
|
|
13
|
+
export function createDurableRunnerIneligibility(journal, now) {
|
|
14
|
+
let cached;
|
|
15
|
+
return async () => {
|
|
16
|
+
const position = await journal.latestGlobalPosition();
|
|
17
|
+
if (cached === undefined || cached.position !== position) {
|
|
18
|
+
const view = (await journal.readStream(controlPlaneStream())).reduce((previous, event) => controlPlaneProjection.project(previous, event), controlPlaneProjection.initial('global'));
|
|
19
|
+
cached = { position, view };
|
|
20
|
+
}
|
|
21
|
+
return ineligibleRunners(cached.view, now());
|
|
22
|
+
};
|
|
23
|
+
}
|
|
9
24
|
export const controlPlaneProjection = {
|
|
10
25
|
name: ControlStreamKind.Global,
|
|
11
26
|
select(event) {
|
|
@@ -16,18 +31,25 @@ export const controlPlaneProjection = {
|
|
|
16
31
|
const event = selectControlEvent(envelope);
|
|
17
32
|
if (event === null)
|
|
18
33
|
return previous;
|
|
19
|
-
switch (event.eventType) {
|
|
34
|
+
switch (event.event.eventType) {
|
|
20
35
|
case ControlEventType.DispatchPaused:
|
|
21
|
-
return {
|
|
36
|
+
return {
|
|
37
|
+
...previous,
|
|
38
|
+
pausedUntil: event.event.payload.resumeAt,
|
|
39
|
+
reason: event.event.payload.reason,
|
|
40
|
+
};
|
|
22
41
|
case ControlEventType.DispatchResumed:
|
|
23
42
|
return withoutDispatchPause(previous);
|
|
24
43
|
case ControlEventType.RunnerPaused:
|
|
25
44
|
return {
|
|
26
45
|
...previous,
|
|
27
|
-
runnerPauses: {
|
|
46
|
+
runnerPauses: {
|
|
47
|
+
...previous.runnerPauses,
|
|
48
|
+
[event.event.payload.runnerName]: event.event.payload,
|
|
49
|
+
},
|
|
28
50
|
};
|
|
29
51
|
case ControlEventType.RunnerResumed: {
|
|
30
|
-
const { [event.payload.runnerName]: _, ...runnerPauses } = previous.runnerPauses;
|
|
52
|
+
const { [event.event.payload.runnerName]: _, ...runnerPauses } = previous.runnerPauses;
|
|
31
53
|
return { ...previous, runnerPauses };
|
|
32
54
|
}
|
|
33
55
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type EventJournal } from '@atolis-hq/eventing';
|
|
2
|
+
import { type Clock, type IdGenerator } from '../../kernel/index.js';
|
|
3
|
+
export interface ControlPlaneService {
|
|
4
|
+
pause(idempotencyKey: string): Promise<void>;
|
|
5
|
+
resume(idempotencyKey: string): Promise<void>;
|
|
6
|
+
isPaused(): Promise<boolean>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createControlPlaneService(input: {
|
|
9
|
+
readonly journal: EventJournal;
|
|
10
|
+
readonly clock: Clock;
|
|
11
|
+
readonly ids: IdGenerator;
|
|
12
|
+
}): ControlPlaneService;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { EventActorKind, correlationId, } from '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { EventActorKind, EventSourceKind, correlationId, } from '@atolis-hq/eventing';
|
|
2
|
+
import { createControlPlaneEventData } from '../contracts/event-factory.js';
|
|
3
|
+
import { ControlEventType, selectControlEvent } from '../contracts/events.js';
|
|
4
|
+
import { ControlStreamKind, controlPlaneStream } from '../contracts/streams.js';
|
|
4
5
|
export function createControlPlaneService(input) {
|
|
5
6
|
// isPaused() is checked many times per pipeline run, so memoize by
|
|
6
7
|
// journal position to skip the read entirely when nothing has moved.
|
|
@@ -25,9 +26,9 @@ function isPausedIn(events) {
|
|
|
25
26
|
let paused = false;
|
|
26
27
|
for (const envelope of events) {
|
|
27
28
|
const event = selectControlEvent(envelope);
|
|
28
|
-
if (event?.eventType === ControlEventType.DispatchPaused)
|
|
29
|
+
if (event?.event.eventType === ControlEventType.DispatchPaused)
|
|
29
30
|
paused = true;
|
|
30
|
-
if (event?.eventType === ControlEventType.DispatchResumed)
|
|
31
|
+
if (event?.event.eventType === ControlEventType.DispatchResumed)
|
|
31
32
|
paused = false;
|
|
32
33
|
}
|
|
33
34
|
return paused;
|
|
@@ -37,7 +38,7 @@ async function change(input, idempotencyKey, operation) {
|
|
|
37
38
|
const events = await input.journal.readStream(stream);
|
|
38
39
|
const eventType = operation === 'pause' ? ControlEventType.DispatchPaused : ControlEventType.DispatchResumed;
|
|
39
40
|
const correlation = correlationId(`control:${operation}:${idempotencyKey}`);
|
|
40
|
-
if (events.some((event) => event.eventType === eventType && event.correlationId === correlation))
|
|
41
|
+
if (events.some((event) => event.event.eventType === eventType && event.event.correlationId === correlation))
|
|
41
42
|
return;
|
|
42
43
|
const currentlyPaused = isPausedIn(events);
|
|
43
44
|
if ((operation === 'pause' && currentlyPaused) || (operation === 'resume' && !currentlyPaused))
|
|
@@ -50,7 +51,25 @@ async function change(input, idempotencyKey, operation) {
|
|
|
50
51
|
actor: { kind: EventActorKind.Operator, id: 'web' },
|
|
51
52
|
};
|
|
52
53
|
const event = operation === 'pause'
|
|
53
|
-
?
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
? createControlPlaneEventData({
|
|
55
|
+
eventId: `${context.commandId}:${ControlEventType.DispatchPaused}`,
|
|
56
|
+
eventType: ControlEventType.DispatchPaused,
|
|
57
|
+
occurredAt: context.occurredAt,
|
|
58
|
+
correlationId: context.correlationId,
|
|
59
|
+
causationId: context.commandId,
|
|
60
|
+
actor: context.actor,
|
|
61
|
+
source: { kind: EventSourceKind.Internal, id: ControlStreamKind.Global },
|
|
62
|
+
payload: { resumeAt: '9999-12-31T23:59:59.999Z', reason: 'paused by operator' },
|
|
63
|
+
})
|
|
64
|
+
: createControlPlaneEventData({
|
|
65
|
+
eventId: `${context.commandId}:${ControlEventType.DispatchResumed}`,
|
|
66
|
+
eventType: ControlEventType.DispatchResumed,
|
|
67
|
+
occurredAt: context.occurredAt,
|
|
68
|
+
correlationId: context.correlationId,
|
|
69
|
+
causationId: context.commandId,
|
|
70
|
+
actor: context.actor,
|
|
71
|
+
source: { kind: EventSourceKind.Internal, id: ControlStreamKind.Global },
|
|
72
|
+
payload: { resumedAt: occurredAt },
|
|
73
|
+
});
|
|
74
|
+
await input.journal.appendToStream(stream, events.length, [event]);
|
|
56
75
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RunStatus, type RunView } from '../../execution/index.js';
|
|
2
|
+
import type { ActivityActivationView, WorkflowInstanceView } from '../../orchestration/index.js';
|
|
3
|
+
interface ExecutionRunLookup {
|
|
4
|
+
list(activationId?: ActivityActivationView['activationId']): Promise<readonly RunView[]>;
|
|
5
|
+
}
|
|
6
|
+
export declare function findUnresolvedTerminal(pending: readonly {
|
|
7
|
+
workflow: WorkflowInstanceView;
|
|
8
|
+
activation: ActivityActivationView;
|
|
9
|
+
}[], execution: ExecutionRunLookup): Promise<{
|
|
10
|
+
item: (typeof pending)[number];
|
|
11
|
+
run: RunView;
|
|
12
|
+
} | undefined>;
|
|
13
|
+
export declare function findUnresolvedSucceededTerminal(pending: readonly {
|
|
14
|
+
workflow: WorkflowInstanceView;
|
|
15
|
+
activation: ActivityActivationView;
|
|
16
|
+
}[], execution: ExecutionRunLookup): Promise<{
|
|
17
|
+
item: (typeof pending)[number];
|
|
18
|
+
run: RunView;
|
|
19
|
+
} | undefined>;
|
|
20
|
+
export declare function isExecutionFailureTerminal(status: RunStatus): boolean;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface IntakePipelineStages {
|
|
2
|
+
readonly isPaused?: () => Promise<boolean>;
|
|
3
|
+
readonly poll: (signal: AbortSignal) => Promise<number>;
|
|
4
|
+
}
|
|
5
|
+
export interface IntakeCycleResult {
|
|
6
|
+
readonly processed: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface IntakePipeline {
|
|
9
|
+
run(signal: AbortSignal): Promise<IntakeCycleResult>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Runs the externally-rate-limited half of a Wake tick: poll. Incremental
|
|
13
|
+
* inbound translation is independently supervised by the Eventing runtime.
|
|
14
|
+
* It stays separate from RunnerPipeline so its host can back off when
|
|
15
|
+
* idle without slowing down dispatch/delivery, which never touch a
|
|
16
|
+
* rate-limited external API.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createIntakePipeline(stages: IntakePipelineStages): IntakePipeline;
|