@atolis-hq/wake 0.4.2 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/src/activities/agent/agent-activity-definition.d.ts +9 -0
- package/dist/src/activities/agent/agent-activity.d.ts +51 -0
- package/dist/src/activities/agent/agent-result.d.ts +43 -0
- package/dist/src/activities/contracts/activity.d.ts +184 -0
- package/dist/src/activities/contracts/config.d.ts +3 -0
- package/dist/src/activities/contracts/decision-claim-schema.d.ts +35 -0
- package/dist/src/activities/contracts/decision-claim-schema.js +42 -0
- package/dist/src/activities/contracts/event-factory.d.ts +6 -0
- package/dist/src/activities/contracts/event-factory.js +40 -0
- package/dist/src/activities/contracts/event-integrity.d.ts +61 -0
- package/dist/src/activities/contracts/event-integrity.js +50 -0
- package/dist/src/activities/contracts/event-schema.d.ts +2803 -0
- package/dist/src/activities/contracts/event-schema.js +67 -121
- package/dist/src/activities/contracts/events.d.ts +153 -0
- package/dist/src/activities/contracts/events.js +4 -4
- package/dist/src/activities/contracts/identifiers.d.ts +5 -0
- package/dist/src/activities/contracts/registry.d.ts +19 -0
- package/dist/src/activities/contracts/streams.d.ts +13 -0
- package/dist/src/activities/contracts/vocabulary.d.ts +69 -0
- package/dist/src/activities/index.d.ts +23 -0
- package/dist/src/activities/index.js +1 -0
- package/dist/src/activities/issue/complete.d.ts +26 -0
- package/dist/src/activities/issue/complete.js +5 -5
- package/dist/src/activities/pr/activity-support.d.ts +38 -0
- package/dist/src/activities/pr/activity-support.js +1 -1
- package/dist/src/activities/pr/application.d.ts +17 -0
- package/dist/src/activities/pr/application.js +6 -6
- package/dist/src/activities/pr/approve.d.ts +7 -0
- package/dist/src/activities/pr/approve.js +8 -3
- package/dist/src/activities/pr/capability.d.ts +2 -0
- package/dist/src/activities/pr/contracts.d.ts +133 -0
- package/dist/src/activities/pr/decision-claim.d.ts +26 -0
- package/dist/src/activities/pr/decision-claim.js +50 -30
- package/dist/src/activities/pr/event-data.d.ts +21 -0
- package/dist/src/activities/pr/event-data.js +101 -0
- package/dist/src/activities/pr/intent.d.ts +12 -0
- package/dist/src/activities/pr/intent.js +5 -5
- package/dist/src/activities/pr/merge-authority-gate.d.ts +13 -0
- package/dist/src/activities/pr/merge-authority-gate.js +1 -1
- package/dist/src/activities/pr/merge.d.ts +7 -0
- package/dist/src/activities/pr/merge.js +8 -3
- package/dist/src/activities/pr/policy.d.ts +13 -0
- package/dist/src/activities/pr/projection.d.ts +5 -0
- package/dist/src/activities/pr/projection.js +18 -17
- package/dist/src/activities/pr/vocabulary.d.ts +34 -0
- package/dist/src/activities/review/authorization.d.ts +9 -0
- package/dist/src/activities/review/contracts.d.ts +46 -0
- package/dist/src/activities/review/signals.d.ts +2 -0
- package/dist/src/bootstrap/activation-scheduler-serialiser.d.ts +3 -0
- package/dist/src/bootstrap/activation-scheduler-serialiser.js +8 -0
- package/dist/src/bootstrap/activity-registry.d.ts +4 -0
- package/dist/src/bootstrap/analytics-projection.d.ts +12 -0
- package/dist/src/bootstrap/analytics-projection.js +3 -3
- package/dist/src/bootstrap/board-projection.d.ts +56 -0
- package/dist/src/bootstrap/board-projection.js +156 -71
- package/dist/src/bootstrap/composition-root.d.ts +76 -0
- package/dist/src/bootstrap/composition-root.js +20 -13
- package/dist/src/bootstrap/config/load-config.d.ts +6 -0
- package/dist/src/bootstrap/config/root-schema.d.ts +443 -0
- package/dist/src/bootstrap/event-processor-runtime.d.ts +22 -0
- package/dist/src/bootstrap/event-processor-runtime.js +88 -0
- package/dist/src/bootstrap/external-ref.d.ts +3 -0
- package/dist/src/bootstrap/fake-provider-files.d.ts +3 -0
- package/dist/src/bootstrap/fake-scenarios.d.ts +3 -0
- package/dist/src/bootstrap/index.d.ts +27 -0
- package/dist/src/bootstrap/index.js +2 -28
- package/dist/src/bootstrap/initialise.d.ts +4 -0
- package/dist/src/bootstrap/initialise.js +8 -16
- package/dist/src/bootstrap/integration-runtime.d.ts +48 -0
- package/dist/src/bootstrap/integration-runtime.js +36 -54
- package/dist/src/bootstrap/paths.d.ts +12 -0
- package/dist/src/bootstrap/persistence-composition.d.ts +21 -0
- package/dist/src/bootstrap/persistence-composition.js +12 -4
- package/dist/src/bootstrap/projection-runtime.d.ts +16 -0
- package/dist/src/bootstrap/projection-runtime.js +50 -23
- package/dist/src/bootstrap/resource-transition-evidence.d.ts +11 -0
- package/dist/src/bootstrap/runner-quota-reporter.d.ts +6 -0
- package/dist/src/bootstrap/runner-quota-reporter.js +16 -11
- package/dist/src/bootstrap/runner-registry.d.ts +3 -0
- package/dist/src/bootstrap/runner-tick-adapter.d.ts +16 -0
- package/dist/src/bootstrap/runner-tick-adapter.js +57 -0
- package/dist/src/bootstrap/schedule-checkpoint-store.d.ts +9 -0
- package/dist/src/bootstrap/self-update-application.d.ts +54 -0
- package/dist/src/bootstrap/self-update-failure-log.d.ts +17 -0
- package/dist/src/bootstrap/source-update-port.d.ts +8 -0
- package/dist/src/bootstrap/status-publish-activity.d.ts +7 -0
- package/dist/src/bootstrap/status-publish-activity.js +4 -5
- package/dist/src/bootstrap/surface-api-applications.d.ts +18 -0
- package/dist/src/bootstrap/surface-api-applications.js +104 -57
- package/dist/src/bootstrap/surface-api-execution-applications.d.ts +3 -0
- package/dist/src/bootstrap/surface-api-execution-applications.js +3 -3
- package/dist/src/bootstrap/surface-api-metadata.d.ts +4 -0
- package/dist/src/bootstrap/surface-api-metadata.js +1 -1
- package/dist/src/bootstrap/surface-api-projection-pages.d.ts +12 -0
- package/dist/src/bootstrap/surface-api-run-context.d.ts +12 -0
- package/dist/src/bootstrap/surface-api-transcripts.d.ts +10 -0
- package/dist/src/bootstrap/surface-api-work-applications.d.ts +3 -0
- package/dist/src/bootstrap/surface-api-work-applications.js +3 -3
- package/dist/src/bootstrap/surface-api-workflow-diagrams.d.ts +11 -0
- package/dist/src/bootstrap/surface-api-workflow-diagrams.js +2 -2
- package/dist/src/bootstrap/surface-applications.d.ts +10 -0
- package/dist/src/bootstrap/surface-cli-applications.d.ts +33 -0
- package/dist/src/bootstrap/surface-cli-applications.js +151 -65
- package/dist/src/bootstrap/transcript-retention.d.ts +11 -0
- package/dist/src/bootstrap/update-ledger.d.ts +9 -0
- package/dist/src/bootstrap/update-maintenance-lease.d.ts +24 -0
- package/dist/src/bootstrap/update-maintenance-lease.js +1 -1
- package/dist/src/bootstrap/version.d.ts +13 -0
- package/dist/src/bootstrap/version.js +1 -1
- package/dist/src/control-plane/application/activation-scheduler-ports.d.ts +71 -0
- package/dist/src/control-plane/application/activation-scheduler-subscriber.d.ts +42 -0
- package/dist/src/control-plane/application/activation-scheduler-subscriber.js +111 -0
- package/dist/src/control-plane/application/activation-scheduler.d.ts +8 -0
- package/dist/src/control-plane/application/activation-scheduler.js +165 -0
- package/dist/src/control-plane/application/advance-once-dispatch.d.ts +46 -0
- package/dist/src/control-plane/application/advance-once-dispatch.js +6 -7
- package/dist/src/control-plane/application/advance-once.d.ts +5 -0
- package/dist/src/control-plane/application/advance-once.js +4 -158
- package/dist/src/control-plane/application/control-plane-projection.d.ts +21 -0
- package/dist/src/control-plane/application/control-plane-projection.js +27 -5
- package/dist/src/control-plane/application/control-plane-service.d.ts +12 -0
- package/dist/src/control-plane/application/control-plane-service.js +28 -9
- package/dist/src/control-plane/application/execution-reconciliation.d.ts +21 -0
- package/dist/src/control-plane/application/intake-pipeline.d.ts +18 -0
- package/dist/src/control-plane/application/intake-pipeline.js +8 -18
- package/dist/src/control-plane/application/runner-control-service.d.ts +12 -0
- package/dist/src/control-plane/application/runner-control-service.js +35 -13
- package/dist/src/control-plane/application/runner-pipeline.d.ts +24 -0
- package/dist/src/control-plane/application/runner-pipeline.js +23 -41
- package/dist/src/control-plane/application/schedule-service.d.ts +31 -0
- package/dist/src/control-plane/application/schedule-service.js +1 -1
- package/dist/src/control-plane/application/work-cancellation-policy.d.ts +20 -0
- package/dist/src/control-plane/application/work-cancellation-policy.js +1 -1
- package/dist/src/control-plane/contracts/commands.d.ts +20 -0
- package/dist/src/control-plane/contracts/config.d.ts +30 -0
- package/dist/src/control-plane/contracts/config.js +7 -1
- package/dist/src/control-plane/contracts/event-factory.d.ts +6 -0
- package/dist/src/control-plane/contracts/event-factory.js +14 -0
- package/dist/src/control-plane/contracts/events.d.ts +36 -0
- package/dist/src/control-plane/contracts/events.js +42 -47
- package/dist/src/control-plane/contracts/streams.d.ts +6 -0
- package/dist/src/control-plane/contracts/views.d.ts +28 -0
- package/dist/src/control-plane/domain/dispatch-policy.d.ts +18 -0
- package/dist/src/control-plane/domain/quota-policy.d.ts +21 -0
- package/dist/src/control-plane/domain/runner-quota.d.ts +2 -0
- package/dist/src/control-plane/domain/schedule-policy.d.ts +8 -0
- package/dist/src/control-plane/index.d.ts +24 -0
- package/dist/src/control-plane/index.js +3 -0
- package/dist/src/control-plane/infrastructure/intake-host.d.ts +19 -0
- package/dist/src/control-plane/infrastructure/intake-host.js +2 -3
- package/dist/src/control-plane/infrastructure/resident-host.d.ts +16 -0
- package/dist/src/control-plane/infrastructure/resident-host.js +3 -1
- package/dist/src/control-plane/infrastructure/tick-host.d.ts +6 -0
- package/dist/src/control-plane/infrastructure/tick-host.js +2 -2
- package/dist/src/conversations/application/conversation-projection.d.ts +3 -0
- package/dist/src/conversations/application/conversation-repository.d.ts +13 -0
- package/dist/src/conversations/application/conversation-repository.js +1 -1
- package/dist/src/conversations/application/conversation-service.d.ts +16 -0
- package/dist/src/conversations/application/conversation-service.js +32 -27
- package/dist/src/conversations/contracts/commands.d.ts +33 -0
- package/dist/src/conversations/contracts/event-factory.d.ts +6 -0
- package/dist/src/conversations/contracts/event-factory.js +18 -0
- package/dist/src/conversations/contracts/events.d.ts +42 -0
- package/dist/src/conversations/contracts/events.js +37 -24
- package/dist/src/conversations/contracts/identifiers.d.ts +5 -0
- package/dist/src/conversations/contracts/streams.d.ts +7 -0
- package/dist/src/conversations/contracts/views.d.ts +49 -0
- package/dist/src/conversations/contracts/vocabulary.d.ts +5 -0
- package/dist/src/conversations/domain/conversation.d.ts +4 -0
- package/dist/src/conversations/domain/conversation.js +8 -7
- package/dist/src/conversations/index.d.ts +9 -0
- package/dist/src/conversations/index.js +1 -0
- package/dist/src/execution/application/activation-claim.d.ts +23 -0
- package/dist/src/execution/application/activation-claim.js +8 -9
- package/dist/src/execution/application/active-run-cancellation.d.ts +4 -0
- package/dist/src/execution/application/active-run-cancellation.js +2 -2
- package/dist/src/execution/application/execution-activity.d.ts +61 -0
- package/dist/src/execution/application/execution-activity.js +4 -1
- package/dist/src/execution/application/execution-projection.d.ts +11 -0
- package/dist/src/execution/application/execution-projection.js +8 -4
- package/dist/src/execution/application/execution-service.d.ts +33 -0
- package/dist/src/execution/application/execution-service.js +288 -59
- package/dist/src/execution/application/execution-validation.d.ts +8 -0
- package/dist/src/execution/application/execution-validation.js +3 -2
- package/dist/src/execution/application/recovery-service.d.ts +52 -0
- package/dist/src/execution/application/recovery-service.js +32 -17
- package/dist/src/execution/application/run-lifecycle.d.ts +75 -0
- package/dist/src/execution/application/run-lifecycle.js +130 -62
- package/dist/src/execution/application/run-liveness-service.d.ts +14 -0
- package/dist/src/execution/application/run-liveness-service.js +68 -30
- package/dist/src/execution/application/run-repository.d.ts +18 -0
- package/dist/src/execution/application/run-repository.js +2 -2
- package/dist/src/execution/contracts/commands.d.ts +30 -0
- package/dist/src/execution/contracts/config.d.ts +94 -0
- package/dist/src/execution/contracts/control-plane.d.ts +10 -0
- package/dist/src/execution/contracts/event-factory.d.ts +10 -0
- package/dist/src/execution/contracts/event-factory.js +20 -31
- package/dist/src/execution/contracts/events.d.ts +198 -0
- package/dist/src/execution/contracts/events.js +152 -129
- package/dist/src/execution/contracts/identifiers.d.ts +3 -0
- package/dist/src/execution/contracts/liveness.d.ts +17 -0
- package/dist/src/execution/contracts/results.d.ts +23 -0
- package/dist/src/execution/contracts/runner.d.ts +78 -0
- package/dist/src/execution/contracts/streams.d.ts +12 -0
- package/dist/src/execution/contracts/views.d.ts +42 -0
- package/dist/src/execution/contracts/vocabulary.d.ts +50 -0
- package/dist/src/execution/contracts/vocabulary.js +4 -0
- package/dist/src/execution/contracts/workspace.d.ts +48 -0
- package/dist/src/execution/domain/run-result.d.ts +2 -0
- package/dist/src/execution/domain/run.d.ts +3 -0
- package/dist/src/execution/domain/run.js +72 -22
- package/dist/src/execution/index.d.ts +34 -0
- package/dist/src/execution/infrastructure/agent-runner-adapter.d.ts +2 -0
- package/dist/src/execution/infrastructure/codex-stop-hook.d.ts +13 -0
- package/dist/src/execution/infrastructure/process-execution.d.ts +23 -0
- package/dist/src/execution/infrastructure/prompt-templates.d.ts +15 -0
- package/dist/src/execution/infrastructure/runner-memory-profile.d.ts +11 -0
- package/dist/src/execution/infrastructure/runners/claude.d.ts +34 -0
- package/dist/src/execution/infrastructure/runners/codex.d.ts +13 -0
- package/dist/src/execution/infrastructure/runners/command.d.ts +3 -0
- package/dist/src/execution/infrastructure/runners/cursor.d.ts +12 -0
- package/dist/src/execution/infrastructure/runners/fake-scenarios.d.ts +35 -0
- package/dist/src/execution/infrastructure/runners/fake.d.ts +8 -0
- package/dist/src/execution/infrastructure/runners/registry.d.ts +14 -0
- package/dist/src/execution/infrastructure/transcript-store.d.ts +48 -0
- package/dist/src/execution/infrastructure/transcripts.d.ts +1 -0
- package/dist/src/execution/infrastructure/workspace/fake-workspace.d.ts +36 -0
- package/dist/src/execution/infrastructure/workspace/fake-workspace.js +2 -0
- package/dist/src/execution/infrastructure/workspace/git-workspace.d.ts +29 -0
- package/dist/src/execution/infrastructure/workspace/git-workspace.js +21 -11
- package/dist/src/execution/infrastructure/workspace/prepare-workspace.d.ts +3 -0
- package/dist/src/execution/infrastructure/workspace/prepare-workspace.js +4 -2
- package/dist/src/integrations/application/adapter-health-tracker.d.ts +17 -0
- package/dist/src/integrations/application/agent-run-publication-reactor.d.ts +25 -0
- package/dist/src/integrations/application/agent-run-publication-reactor.js +36 -20
- package/dist/src/integrations/application/artifact-registration-reactor.d.ts +32 -0
- package/dist/src/integrations/application/artifact-registration-reactor.js +43 -35
- package/dist/src/integrations/application/poll-service.d.ts +13 -0
- package/dist/src/integrations/application/poll-service.js +2 -2
- package/dist/src/integrations/application/terminal-agent-run-report.d.ts +33 -0
- package/dist/src/integrations/application/work-admission.d.ts +30 -0
- package/dist/src/integrations/application/work-conclusion.d.ts +13 -0
- package/dist/src/integrations/contracts/artifact-event-factory.d.ts +6 -0
- package/dist/src/integrations/contracts/artifact-event-factory.js +8 -0
- package/dist/src/integrations/contracts/artifact-events.d.ts +31 -0
- package/dist/src/integrations/contracts/artifact-events.js +24 -24
- package/dist/src/integrations/contracts/artifact-vocabulary.d.ts +11 -0
- package/dist/src/integrations/contracts/config.d.ts +13 -0
- package/dist/src/integrations/contracts/identifiers.d.ts +3 -0
- package/dist/src/integrations/contracts/intake-rules.d.ts +15 -0
- package/dist/src/integrations/contracts/intake.d.ts +15 -0
- package/dist/src/integrations/contracts/outcome-vocabulary.d.ts +6 -0
- package/dist/src/integrations/contracts/provider.d.ts +105 -0
- package/dist/src/integrations/contracts/reply-routing.d.ts +31 -0
- package/dist/src/integrations/contracts/streams.d.ts +12 -0
- package/dist/src/integrations/delivery/application/delivery-outcome-reactor.d.ts +24 -0
- package/dist/src/integrations/delivery/application/delivery-outcome-reactor.js +151 -73
- package/dist/src/integrations/delivery/application/delivery-projector.d.ts +5 -0
- package/dist/src/integrations/delivery/application/delivery-projector.js +52 -52
- package/dist/src/integrations/delivery/application/delivery-service.d.ts +40 -0
- package/dist/src/integrations/delivery/application/delivery-service.js +15 -16
- package/dist/src/integrations/delivery/contracts/commands.d.ts +7 -0
- package/dist/src/integrations/delivery/contracts/config.d.ts +25 -0
- package/dist/src/integrations/delivery/contracts/event-factory.d.ts +11 -0
- package/dist/src/integrations/delivery/contracts/event-factory.js +20 -9
- package/dist/src/integrations/delivery/contracts/events.d.ts +46 -0
- package/dist/src/integrations/delivery/contracts/events.js +33 -18
- package/dist/src/integrations/delivery/contracts/intents.d.ts +54 -0
- package/dist/src/integrations/delivery/contracts/intents.js +21 -14
- package/dist/src/integrations/delivery/contracts/views.d.ts +47 -0
- package/dist/src/integrations/delivery/contracts/vocabulary.d.ts +25 -0
- package/dist/src/integrations/fake/durable-delivery-provider.d.ts +29 -0
- package/dist/src/integrations/fake/external-sink.d.ts +5 -0
- package/dist/src/integrations/fake/external-source.d.ts +30 -0
- package/dist/src/integrations/fake/external-source.js +1 -3
- package/dist/src/integrations/fake/inbound-translator.d.ts +16 -0
- package/dist/src/integrations/fake/inbound-translator.js +22 -10
- package/dist/src/integrations/fake/provider.d.ts +38 -0
- package/dist/src/integrations/fake/provider.js +3 -1
- package/dist/src/integrations/github/application/agent-context-reader.d.ts +6 -0
- package/dist/src/integrations/github/application/agent-context-reader.js +10 -7
- package/dist/src/integrations/github/application/agent-run-comment.d.ts +22 -0
- package/dist/src/integrations/github/application/comment-history-reader.d.ts +25 -0
- package/dist/src/integrations/github/application/comment-history-reader.js +36 -32
- package/dist/src/integrations/github/application/delivery-marker.d.ts +2 -0
- package/dist/src/integrations/github/application/inbound-comment-syntax.d.ts +8 -0
- package/dist/src/integrations/github/application/inbound-context.d.ts +3 -0
- package/dist/src/integrations/github/application/inbound-context.js +4 -4
- package/dist/src/integrations/github/application/inbound-review-signals.d.ts +21 -0
- package/dist/src/integrations/github/application/inbound-review-signals.js +30 -25
- package/dist/src/integrations/github/application/inbound-translator.d.ts +103 -0
- package/dist/src/integrations/github/application/inbound-translator.js +149 -160
- package/dist/src/integrations/github/application/inbound-watch-gate-signals.d.ts +10 -0
- package/dist/src/integrations/github/application/inbound-watch-gate-signals.js +4 -4
- package/dist/src/integrations/github/application/intake-policy.d.ts +7 -0
- package/dist/src/integrations/github/application/operator-retry-command.d.ts +1 -0
- package/dist/src/integrations/github/application/outbound-translator.d.ts +19 -0
- package/dist/src/integrations/github/application/poll-service.d.ts +11 -0
- package/dist/src/integrations/github/application/poll-service.js +11 -2
- package/dist/src/integrations/github/application/pull-request-translation.d.ts +5 -0
- package/dist/src/integrations/github/application/reply-target-selector.d.ts +8 -0
- package/dist/src/integrations/github/application/resource-links.d.ts +2 -0
- package/dist/src/integrations/github/application/review-command-translator.d.ts +14 -0
- package/dist/src/integrations/github/application/wake-labels.d.ts +29 -0
- package/dist/src/integrations/github/contracts/check-evidence.d.ts +1 -0
- package/dist/src/integrations/github/contracts/config.d.ts +81 -0
- package/dist/src/integrations/github/contracts/event-factory.d.ts +6 -0
- package/dist/src/integrations/github/contracts/event-factory.js +26 -0
- package/dist/src/integrations/github/contracts/events.d.ts +135 -0
- package/dist/src/integrations/github/contracts/events.js +118 -132
- package/dist/src/integrations/github/contracts/external-key.d.ts +8 -0
- package/dist/src/integrations/github/contracts/issue-query.d.ts +5 -0
- package/dist/src/integrations/github/contracts/payloads.d.ts +74 -0
- package/dist/src/integrations/github/contracts/vocabulary.d.ts +64 -0
- package/dist/src/integrations/github/index.d.ts +34 -0
- package/dist/src/integrations/github/index.js +1 -0
- package/dist/src/integrations/github/infrastructure/adapter-health-registry.d.ts +11 -0
- package/dist/src/integrations/github/infrastructure/bounded-fetch.d.ts +10 -0
- package/dist/src/integrations/github/infrastructure/client-reads.d.ts +255 -0
- package/dist/src/integrations/github/infrastructure/client.d.ts +263 -0
- package/dist/src/integrations/github/infrastructure/comment-source.d.ts +7 -0
- package/dist/src/integrations/github/infrastructure/content-fingerprint.d.ts +2 -0
- package/dist/src/integrations/github/infrastructure/delivery.d.ts +6 -0
- package/dist/src/integrations/github/infrastructure/etag-cache.d.ts +29 -0
- package/dist/src/integrations/github/infrastructure/gh-auth.d.ts +4 -0
- package/dist/src/integrations/github/infrastructure/issue-source.d.ts +20 -0
- package/dist/src/integrations/github/infrastructure/issue-source.js +10 -6
- package/dist/src/integrations/github/infrastructure/poll-watermark.d.ts +12 -0
- package/dist/src/integrations/github/infrastructure/pr-source.d.ts +16 -0
- package/dist/src/integrations/github/infrastructure/pr-source.js +6 -4
- package/dist/src/integrations/github/infrastructure/request-coordinator.d.ts +13 -0
- package/dist/src/integrations/github/infrastructure/review-source.d.ts +10 -0
- package/dist/src/integrations/github/infrastructure/review-source.js +29 -25
- package/dist/src/integrations/github/infrastructure/source-contracts.d.ts +22 -0
- package/dist/src/integrations/github/infrastructure/source.d.ts +12 -0
- package/dist/src/integrations/github/infrastructure/source.js +3 -5
- package/dist/src/integrations/github/provider.d.ts +3 -0
- package/dist/src/integrations/github/provider.js +14 -12
- package/dist/src/integrations/index.d.ts +32 -0
- package/dist/src/integrations/index.js +1 -0
- package/dist/src/kernel/contracts/clock.d.ts +3 -0
- package/dist/src/kernel/contracts/id-generator.d.ts +3 -0
- package/dist/src/kernel/contracts/identifiers.d.ts +7 -0
- package/dist/src/kernel/contracts/identifiers.js +1 -8
- package/dist/src/kernel/contracts/relations.d.ts +14 -0
- package/dist/src/kernel/contracts/schema.d.ts +3 -0
- package/dist/src/kernel/contracts/vocabulary.d.ts +7 -0
- package/dist/src/kernel/domain/match-mode.d.ts +2 -0
- package/dist/src/kernel/domain/relation.d.ts +9 -0
- package/dist/src/kernel/index.d.ts +10 -0
- package/dist/src/kernel/index.js +0 -11
- package/dist/src/kernel/infrastructure/system-clock.d.ts +4 -0
- package/dist/src/kernel/infrastructure/ulid-id-generator.d.ts +4 -0
- package/dist/src/main.d.ts +15 -0
- package/dist/src/main.js +8 -2
- package/dist/src/node_modules/@atolis-hq/eventing/LICENSE +201 -0
- package/dist/src/node_modules/@atolis-hq/eventing/README.md +41 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/commands.d.ts +9 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/commands.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-envelope.d.ts +13 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-envelope.d.ts.map +1 -0
- package/dist/src/{kernel/domain → node_modules/@atolis-hq/eventing/dist/contracts}/event-envelope.js +4 -4
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-schema.d.ts +83 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-schema.d.ts.map +1 -0
- package/dist/src/{kernel → node_modules/@atolis-hq/eventing/dist}/contracts/event-schema.js +21 -5
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/events.d.ts +46 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/events.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/events.js +10 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/identifiers.d.ts +11 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/identifiers.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/identifiers.js +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/processor-state-store.d.ts +11 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/processor-state-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/index.d.ts +19 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/index.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/index.js +17 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-checkpoint-store.d.ts +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-checkpoint-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-event-journal.d.ts +19 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-event-journal.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-event-journal.js +82 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-run-serialiser.d.ts +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-run-serialiser.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-run-serialiser.js +26 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-state-store.d.ts +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-state-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-state-store.js +20 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-projection-store.d.ts +9 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-projection-store.d.ts.map +1 -0
- package/dist/src/{persistence → node_modules/@atolis-hq/eventing/dist}/memory/in-memory-projection-store.js +2 -1
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-process-journal-change-signal.d.ts +10 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-process-journal-change-signal.d.ts.map +1 -0
- package/dist/src/{kernel/infrastructure/journal-change-signal.js → node_modules/@atolis-hq/eventing/dist/memory/in-process-journal-change-signal.js} +5 -2
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory.d.ts +7 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory.js +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-processor.d.ts +20 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-processor.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-processor.js +83 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-store.d.ts +22 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/cached-journal-view.d.ts +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/cached-journal-view.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/cached-journal-view.js +24 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/clock.d.ts +4 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/clock.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/event-processor-host.d.ts +39 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/event-processor-host.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/event-processor-host.js +168 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-health.d.ts +43 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-health.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-health.js +66 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-run-serialiser.d.ts +2 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-run-serialiser.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-run-serialiser.js +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-validation.d.ts +7 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-validation.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-validation.js +43 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/checkpoint-store.d.ts +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/checkpoint-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/checkpoint-store.js +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/event-journal.d.ts +14 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/event-journal.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/event-processor.d.ts +49 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/event-processor.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/event-processor.js +17 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/journal-change-signal.d.ts +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/journal-change-signal.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/journal-change-signal.js +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/package.json +42 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/LICENSE +201 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/README.md +40 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/atomic-write.d.ts +23 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/atomic-write.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/atomic-write.js +54 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/event-record-codec.d.ts +4 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/event-record-codec.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/event-record-codec.js +50 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-checkpoint-store.d.ts +17 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-checkpoint-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-checkpoint-store.js +99 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-event-journal.d.ts +51 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-event-journal.d.ts.map +1 -0
- package/dist/src/{persistence/filesystem → node_modules/@atolis-hq/eventing-filesystem/dist}/file-event-journal.js +185 -103
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-lock.d.ts +34 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-lock.d.ts.map +1 -0
- package/dist/src/{persistence/filesystem → node_modules/@atolis-hq/eventing-filesystem/dist}/file-lock.js +10 -1
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-run-serialiser.d.ts +9 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-run-serialiser.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-run-serialiser.js +82 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-state-store.d.ts +12 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-state-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-state-store.js +127 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-projection-store.d.ts +19 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-projection-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-projection-store.js +219 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/index.d.ts +7 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/index.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/index.js +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-paths.d.ts +10 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-paths.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-paths.js +27 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-record.d.ts +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-record.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-record.js +28 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/storage-name.d.ts +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/storage-name.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/storage-name.js +34 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/package.json +38 -0
- package/dist/src/orchestration/application/accept-activity-outcome.d.ts +18 -0
- package/dist/src/orchestration/application/accept-signal.d.ts +14 -0
- package/dist/src/orchestration/application/advance-workflow.d.ts +50 -0
- package/dist/src/orchestration/application/advance-workflow.js +7 -12
- package/dist/src/orchestration/application/coordination-claims.d.ts +17 -0
- package/dist/src/orchestration/application/coordination-claims.js +17 -20
- package/dist/src/orchestration/application/durable-append.d.ts +17 -0
- package/dist/src/orchestration/application/durable-append.js +1 -1
- package/dist/src/orchestration/application/group-budget-recorder.d.ts +9 -0
- package/dist/src/orchestration/application/group-budget-recorder.js +9 -6
- package/dist/src/orchestration/application/orchestration-projection.d.ts +6 -0
- package/dist/src/orchestration/application/orchestration-projection.js +6 -7
- package/dist/src/orchestration/application/orchestration-repository.d.ts +23 -0
- package/dist/src/orchestration/application/orchestration-repository.js +2 -2
- package/dist/src/orchestration/application/orchestration-service.d.ts +93 -0
- package/dist/src/orchestration/application/orchestration-service.js +10 -1
- package/dist/src/orchestration/application/pull-request-transition-evidence.d.ts +3 -0
- package/dist/src/orchestration/application/pull-request-transition-evidence.js +10 -10
- package/dist/src/orchestration/application/reactor-command-context.d.ts +5 -0
- package/dist/src/orchestration/application/reactor-command-context.js +9 -0
- package/dist/src/orchestration/application/request-child.d.ts +29 -0
- package/dist/src/orchestration/application/request-child.js +26 -10
- package/dist/src/orchestration/application/resource-transition-evidence.d.ts +18 -0
- package/dist/src/orchestration/application/resource-transition-matching.d.ts +19 -0
- package/dist/src/orchestration/application/resource-transition-matching.js +9 -3
- package/dist/src/orchestration/application/resource-transition-reactor.d.ts +16 -0
- package/dist/src/orchestration/application/resource-transition-reactor.js +21 -42
- package/dist/src/orchestration/application/signal-reactor.d.ts +11 -0
- package/dist/src/orchestration/application/start-workflow.d.ts +18 -0
- package/dist/src/orchestration/application/start-workflow.js +3 -4
- package/dist/src/orchestration/application/trigger-workflow-instance.d.ts +12 -0
- package/dist/src/orchestration/application/trigger-workflow-instance.js +1 -1
- package/dist/src/orchestration/application/watch-child-transitions.d.ts +2 -0
- package/dist/src/orchestration/application/watch-matching.d.ts +13 -0
- package/dist/src/orchestration/application/watch-matching.js +3 -3
- package/dist/src/orchestration/application/watch-reactor.d.ts +42 -0
- package/dist/src/orchestration/application/watch-reactor.js +36 -35
- package/dist/src/orchestration/application/workflow-definition-registry.d.ts +32 -0
- package/dist/src/orchestration/application/workflow-definition-registry.js +13 -11
- package/dist/src/orchestration/contracts/activity-outcome.d.ts +15 -0
- package/dist/src/orchestration/contracts/commands.d.ts +30 -0
- package/dist/src/orchestration/contracts/config.d.ts +356 -0
- package/dist/src/orchestration/contracts/event-decoder.d.ts +262 -0
- package/dist/src/orchestration/contracts/event-decoder.js +88 -64
- package/dist/src/orchestration/contracts/event-factory.d.ts +6 -0
- package/dist/src/orchestration/contracts/event-factory.js +64 -0
- package/dist/src/orchestration/contracts/events.d.ts +233 -0
- package/dist/src/orchestration/contracts/identifiers.d.ts +15 -0
- package/dist/src/orchestration/contracts/streams.d.ts +28 -0
- package/dist/src/orchestration/contracts/views.d.ts +68 -0
- package/dist/src/orchestration/contracts/vocabulary.d.ts +34 -0
- package/dist/src/orchestration/domain/activation-policy.d.ts +60 -0
- package/dist/src/orchestration/domain/activation-policy.js +34 -19
- package/dist/src/orchestration/domain/approval-defaults.d.ts +8 -0
- package/dist/src/orchestration/domain/child-policy.d.ts +20 -0
- package/dist/src/orchestration/domain/compiler.d.ts +3 -0
- package/dist/src/orchestration/domain/coordination-events.d.ts +18 -0
- package/dist/src/orchestration/domain/coordination-events.js +25 -11
- package/dist/src/orchestration/domain/decision-events.d.ts +33 -0
- package/dist/src/orchestration/domain/decision-events.js +26 -15
- package/dist/src/orchestration/domain/interpreter.d.ts +14 -0
- package/dist/src/orchestration/domain/interpreter.js +4 -1
- package/dist/src/orchestration/domain/operator-retry-policy.d.ts +14 -0
- package/dist/src/orchestration/domain/operator-retry-policy.js +29 -11
- package/dist/src/orchestration/domain/resource-transition-compiler.d.ts +8 -0
- package/dist/src/orchestration/domain/retry-policy.d.ts +7 -0
- package/dist/src/orchestration/domain/retry-policy.js +7 -4
- package/dist/src/orchestration/domain/runner-quota-retry-policy.d.ts +10 -0
- package/dist/src/orchestration/domain/runner-quota-retry-policy.js +21 -15
- package/dist/src/orchestration/domain/signal-policy.d.ts +11 -0
- package/dist/src/orchestration/domain/signal-policy.js +18 -7
- package/dist/src/orchestration/domain/supplemental-policy.d.ts +11 -0
- package/dist/src/orchestration/domain/supplemental-policy.js +29 -14
- package/dist/src/orchestration/domain/transition.d.ts +16 -0
- package/dist/src/orchestration/domain/transition.js +46 -28
- package/dist/src/orchestration/domain/workflow-graph.d.ts +4 -0
- package/dist/src/orchestration/domain/workflow-instance-events.d.ts +44 -0
- package/dist/src/orchestration/domain/workflow-instance.d.ts +7 -0
- package/dist/src/orchestration/domain/workflow-instance.js +29 -9
- package/dist/src/orchestration/domain/workflow-selector.d.ts +15 -0
- package/dist/src/orchestration/index.d.ts +27 -0
- package/dist/src/orchestration/index.js +1 -0
- package/dist/src/resources/application/lookup-projections.d.ts +6 -0
- package/dist/src/resources/application/lookup-projections.js +15 -15
- package/dist/src/resources/application/resource-correlation-retry.d.ts +16 -0
- package/dist/src/resources/application/resource-correlation-retry.js +39 -44
- package/dist/src/resources/application/resource-event-support.d.ts +12 -0
- package/dist/src/resources/application/resource-event-support.js +17 -0
- package/dist/src/resources/application/resource-lookup.d.ts +17 -0
- package/dist/src/resources/application/resource-lookup.js +9 -9
- package/dist/src/resources/application/resource-projections.d.ts +4 -0
- package/dist/src/resources/application/resource-projections.js +32 -24
- package/dist/src/resources/application/resource-repository.d.ts +16 -0
- package/dist/src/resources/application/resource-repository.js +3 -3
- package/dist/src/resources/application/resource-service.d.ts +34 -0
- package/dist/src/resources/application/resource-service.js +73 -52
- package/dist/src/resources/contracts/commands.d.ts +23 -0
- package/dist/src/resources/contracts/config.d.ts +3 -0
- package/dist/src/resources/contracts/event-factory.d.ts +6 -0
- package/dist/src/resources/contracts/event-factory.js +32 -0
- package/dist/src/resources/contracts/events.d.ts +79 -0
- package/dist/src/resources/contracts/events.js +94 -102
- package/dist/src/resources/contracts/identifiers.d.ts +7 -0
- package/dist/src/resources/contracts/streams.d.ts +8 -0
- package/dist/src/resources/contracts/views.d.ts +35 -0
- package/dist/src/resources/contracts/vocabulary.d.ts +50 -0
- package/dist/src/resources/domain/correlation.d.ts +6 -0
- package/dist/src/resources/domain/resource.d.ts +8 -0
- package/dist/src/resources/domain/resource.js +24 -21
- package/dist/src/resources/index.d.ts +15 -0
- package/dist/src/resources/index.js +1 -0
- package/dist/src/surfaces/api/contracts/activities.d.ts +1 -0
- package/dist/src/surfaces/api/contracts/board.d.ts +46 -0
- package/dist/src/surfaces/api/contracts/board.js +1 -1
- package/dist/src/surfaces/api/contracts/common.d.ts +43 -0
- package/dist/src/surfaces/api/contracts/control-plane.d.ts +37 -0
- package/dist/src/surfaces/api/contracts/events.d.ts +13 -0
- package/dist/src/surfaces/api/contracts/execution.d.ts +67 -0
- package/dist/src/surfaces/api/contracts/index.d.ts +14 -0
- package/dist/src/surfaces/api/contracts/observability.d.ts +10 -0
- package/dist/src/surfaces/api/contracts/orchestration.d.ts +16 -0
- package/dist/src/surfaces/api/contracts/resources.d.ts +10 -0
- package/dist/src/surfaces/api/contracts/status.d.ts +4 -0
- package/dist/src/surfaces/api/contracts/system.d.ts +32 -0
- package/dist/src/surfaces/api/contracts/transport-values.d.ts +50 -0
- package/dist/src/surfaces/api/contracts/transport-values.js +6 -0
- package/dist/src/surfaces/api/contracts/work.d.ts +74 -0
- package/dist/src/surfaces/api/contracts/workflow-diagram.d.ts +64 -0
- package/dist/src/surfaces/api/http-server.d.ts +33 -0
- package/dist/src/surfaces/api/http-server.js +2 -2
- package/dist/src/surfaces/api/presenters/activities.d.ts +1 -0
- package/dist/src/surfaces/api/presenters/board.d.ts +2 -0
- package/dist/src/surfaces/api/presenters/control-plane.d.ts +1 -0
- package/dist/src/surfaces/api/presenters/events.d.ts +1 -0
- package/dist/src/surfaces/api/presenters/execution.d.ts +3 -0
- package/dist/src/surfaces/api/presenters/execution.js +5 -2
- package/dist/src/surfaces/api/presenters/observability.d.ts +1 -0
- package/dist/src/surfaces/api/presenters/orchestration.d.ts +3 -0
- package/dist/src/surfaces/api/presenters/resources.d.ts +3 -0
- package/dist/src/surfaces/api/presenters/status.d.ts +2 -0
- package/dist/src/surfaces/api/presenters/system.d.ts +2 -0
- package/dist/src/surfaces/api/presenters/work.d.ts +4 -0
- package/dist/src/surfaces/api/problem-details.d.ts +2 -0
- package/dist/src/surfaces/api/router.d.ts +8 -0
- package/dist/src/surfaces/api/routes/activities.d.ts +1 -0
- package/dist/src/surfaces/api/routes/applications.d.ts +88 -0
- package/dist/src/surfaces/api/routes/commands.d.ts +3 -0
- package/dist/src/surfaces/api/routes/commands.js +1 -3
- package/dist/src/surfaces/api/routes/control-plane.d.ts +1 -0
- package/dist/src/surfaces/api/routes/control-plane.js +0 -1
- package/dist/src/surfaces/api/routes/events.d.ts +1 -0
- package/dist/src/surfaces/api/routes/execution.d.ts +1 -0
- package/dist/src/surfaces/api/routes/index.d.ts +4 -0
- package/dist/src/surfaces/api/routes/observability.d.ts +1 -0
- package/dist/src/surfaces/api/routes/orchestration.d.ts +1 -0
- package/dist/src/surfaces/api/routes/pagination.d.ts +5 -0
- package/dist/src/surfaces/api/routes/read.d.ts +3 -0
- package/dist/src/surfaces/api/routes/resources.d.ts +1 -0
- package/dist/src/surfaces/api/routes/responses.d.ts +15 -0
- package/dist/src/surfaces/api/routes/system.d.ts +1 -0
- package/dist/src/surfaces/api/routes/work.d.ts +1 -0
- package/dist/src/surfaces/auth/credentials.d.ts +22 -0
- package/dist/src/surfaces/auth/credentials.js +8 -12
- package/dist/src/surfaces/auth/vocabulary.d.ts +9 -0
- package/dist/src/surfaces/cli/commands/api.d.ts +4 -0
- package/dist/src/surfaces/cli/commands/audit.d.ts +16 -0
- package/dist/src/surfaces/cli/commands/audit.js +11 -2
- package/dist/src/surfaces/cli/commands/correlate.d.ts +7 -0
- package/dist/src/surfaces/cli/commands/doctor.d.ts +24 -0
- package/dist/src/surfaces/cli/commands/init.d.ts +2 -0
- package/dist/src/surfaces/cli/commands/sandbox-entrypoint.d.ts +43 -0
- package/dist/src/surfaces/cli/commands/sandbox-setup.d.ts +9 -0
- package/dist/src/surfaces/cli/commands/sandbox.d.ts +16 -0
- package/dist/src/surfaces/cli/commands/self-update.d.ts +15 -0
- package/dist/src/surfaces/cli/commands/smoke.d.ts +14 -0
- package/dist/src/surfaces/cli/commands/start.d.ts +5 -0
- package/dist/src/surfaces/cli/commands/stop.d.ts +11 -0
- package/dist/src/surfaces/cli/commands/tick.d.ts +5 -0
- package/dist/src/surfaces/cli/commands/ui.d.ts +5 -0
- package/dist/src/surfaces/cli/commands/validate-state.d.ts +13 -0
- package/dist/src/surfaces/cli/infrastructure/docker-cli.d.ts +66 -0
- package/dist/src/surfaces/cli/infrastructure/docker-invocation.d.ts +14 -0
- package/dist/src/surfaces/cli/infrastructure/process-log.d.ts +35 -0
- package/dist/src/surfaces/cli/infrastructure/resident-start.d.ts +10 -0
- package/dist/src/surfaces/cli/main.d.ts +115 -0
- package/dist/src/surfaces/cli/usage.d.ts +1 -0
- package/dist/src/surfaces/contracts/config.d.ts +51 -0
- package/dist/src/surfaces/index.d.ts +49 -0
- package/dist/src/surfaces/web-assets/assets/index-D9xGa5tD.css +1 -0
- package/dist/src/surfaces/web-assets/assets/index-qai1Ymhv.js +1179 -0
- package/dist/src/surfaces/web-assets/index.html +2 -2
- package/dist/src/surfaces/web-host/asset-source.d.ts +9 -0
- package/dist/src/surfaces/web-host/packaged-assets.d.ts +8 -0
- package/dist/src/work/application/work-projection.d.ts +3 -0
- package/dist/src/work/application/work-projection.js +4 -4
- package/dist/src/work/application/work-repository.d.ts +15 -0
- package/dist/src/work/application/work-repository.js +2 -2
- package/dist/src/work/application/work-service.d.ts +18 -0
- package/dist/src/work/application/work-service.js +70 -31
- package/dist/src/work/contracts/commands.d.ts +15 -0
- package/dist/src/work/contracts/config.d.ts +3 -0
- package/dist/src/work/contracts/event-factory.d.ts +6 -0
- package/dist/src/work/contracts/event-factory.js +26 -0
- package/dist/src/work/contracts/events.d.ts +46 -0
- package/dist/src/work/contracts/events.js +54 -60
- package/dist/src/work/contracts/identifiers.d.ts +3 -0
- package/dist/src/work/contracts/streams.d.ts +8 -0
- package/dist/src/work/contracts/views.d.ts +18 -0
- package/dist/src/work/contracts/vocabulary.d.ts +7 -0
- package/dist/src/work/domain/work-item.d.ts +3 -0
- package/dist/src/work/domain/work-item.js +10 -7
- package/dist/src/work/index.d.ts +12 -0
- package/dist/src/work/index.js +1 -0
- package/docker/Dockerfile +9 -7
- package/docker/Dockerfile.packaged +4 -6
- package/package.json +24 -24
- package/dist/src/activities/pr/event-drafts.js +0 -66
- package/dist/src/kernel/contracts/events.js +0 -11
- package/dist/src/kernel/infrastructure/cached-journal-view.js +0 -27
- package/dist/src/persistence/application/projection-runner.js +0 -128
- package/dist/src/persistence/filesystem/file-checkpoint-store.js +0 -50
- package/dist/src/persistence/filesystem/file-projection-store.js +0 -137
- package/dist/src/persistence/index.js +0 -8
- package/dist/src/persistence/memory/in-memory-event-journal.js +0 -99
- package/dist/src/surfaces/web-assets/assets/index-B0ofn_L5.css +0 -1
- package/dist/src/surfaces/web-assets/assets/index-DFBhpSSX.js +0 -1179
- /package/dist/src/control-plane/application/{advance-once-ports.js → activation-scheduler-ports.js} +0 -0
- /package/dist/src/{kernel → node_modules/@atolis-hq/eventing/dist}/contracts/commands.js +0 -0
- /package/dist/src/{kernel/contracts/checkpoint-store.js → node_modules/@atolis-hq/eventing/dist/contracts/processor-state-store.js} +0 -0
- /package/dist/src/{persistence → node_modules/@atolis-hq/eventing/dist}/memory/in-memory-checkpoint-store.js +0 -0
- /package/dist/src/{kernel/contracts → node_modules/@atolis-hq/eventing/dist/projections}/projection-store.js +0 -0
- /package/dist/src/{kernel/contracts/journal-change-signal.js → node_modules/@atolis-hq/eventing/dist/runtime/clock.js} +0 -0
- /package/dist/src/{kernel/contracts → node_modules/@atolis-hq/eventing/dist/store}/event-journal.js +0 -0
|
@@ -1,18 +1,20 @@
|
|
|
1
|
+
import { EventActorKind, JOURNAL_CHANGE_FALLBACK_MS, correlationId } from '@atolis-hq/eventing';
|
|
2
|
+
import { withFileLock } from '@atolis-hq/eventing-filesystem';
|
|
1
3
|
import { execFile as nodeExecFile, spawn } from 'node:child_process';
|
|
2
4
|
import { access, copyFile, mkdir, writeFile as writeFileContent } from 'node:fs/promises';
|
|
3
5
|
import { join } from 'node:path';
|
|
4
6
|
import { createInterface } from 'node:readline/promises';
|
|
5
7
|
import { promisify } from 'node:util';
|
|
6
8
|
import { BuiltInActivityName, agentActivityDefinition } from '../activities/index.js';
|
|
7
|
-
import { IntakeHost, ResidentHost, TickHost } from '../control-plane/index.js';
|
|
8
|
-
import { ExecutionCancellationReason, ExecutionFailureCode, RunStatus, loadPromptTemplate, } from '../execution/index.js';
|
|
9
|
-
import { EventActorKind, JOURNAL_CHANGE_FALLBACK_MS, correlationId } from '../kernel/index.js';
|
|
9
|
+
import { IntakeHost, ResidentHost, TickHost, } from '../control-plane/index.js';
|
|
10
|
+
import { ExecutionCancellationReason, ExecutionFailureCode, RunStatus, isActiveRunStatus, loadPromptTemplate, } from '../execution/index.js';
|
|
10
11
|
import { ResourceCorrelationRole, resourceId } from '../resources/index.js';
|
|
11
12
|
import { DockerProcessError, createApiDispatcher, createLoggedDockerCli, createPackagedAssetSource, createPairingGrant, createProcessLogSink, createSandboxDockerPort, createSurfaceHttpServer, drainProcessOutput, loadOrCreateCredentials, redeemPairingGrant, replaceAccessKey, runDoctor, runSandbox, runSandboxEntrypoint, runSandboxSetup, runSelfUpdateLatestLoop, runTargetSmoke, verifyResidentStart, waitForActiveRuns, waitForever, } from '../surfaces/index.js';
|
|
12
13
|
import { WorkStreamKind, workItemId } from '../work/index.js';
|
|
13
14
|
import { loadConfig } from './config/load-config.js';
|
|
14
15
|
import { runtimeProjectionDefinitions } from './projection-runtime.js';
|
|
15
16
|
import { createRunnerRegistry } from './runner-registry.js';
|
|
17
|
+
import { createOneShotRunnerAdvance, createResidentRunnerAdvance, withFinalProjectionCatchUp, } from './runner-tick-adapter.js';
|
|
16
18
|
import { createSelfUpdateApplication, } from './self-update-application.js';
|
|
17
19
|
import { createSelfUpdateFailureLog } from './self-update-failure-log.js';
|
|
18
20
|
import { createSourceUpdatePort } from './source-update-port.js';
|
|
@@ -20,34 +22,33 @@ import { createUpdateLedger } from './update-ledger.js';
|
|
|
20
22
|
import { resolveWakeVersion, wakeVersion } from './version.js';
|
|
21
23
|
const execFile = promisify(nodeExecFile);
|
|
22
24
|
export function createSurfaceCliApplications(root, api, now) {
|
|
23
|
-
const runnerTick = new TickHost((
|
|
25
|
+
const runnerTick = new TickHost(createOneShotRunnerAdvance(root));
|
|
26
|
+
const runnerResidentTick = new TickHost(createResidentRunnerAdvance(root));
|
|
24
27
|
const intakeHost = new IntakeHost((signal) => root.intakePipeline.run(signal));
|
|
25
28
|
const runnerIdleWait = createRunnerIdleWait(root, root.config.controlPlane?.resident);
|
|
26
29
|
const reportResidentError = (label) => async (error) => {
|
|
27
30
|
process.stderr.write(`Wake ${label} tick failed: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
28
31
|
};
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
// stages (deliver, label maintenance) DO call that same external API, so a
|
|
37
|
-
// run of consecutive *errors* — as opposed to ordinary "no local work"
|
|
38
|
-
// idling — still backs off exponentially, or a live rate-limit window gets
|
|
39
|
-
// hammered every cycle instead of given a chance to recover.
|
|
40
|
-
const runnerResident = new ResidentHost(runnerTick, runnerIdleWait, reportResidentError('runner'));
|
|
32
|
+
// Intake owns provider polling, so only its resident loop backs off
|
|
33
|
+
// exponentially when idle. The runner loop owns schedules, reconciliation,
|
|
34
|
+
// and delivery; it stays on a fast cadence when there is no local work.
|
|
35
|
+
// The independent durable subscriber owns activation scheduling. Delivery
|
|
36
|
+
// can still hit an external API, so consecutive errors back off
|
|
37
|
+
// independently of ordinary idle ticks.
|
|
38
|
+
const runnerResident = new ResidentHost(runnerResidentTick, runnerIdleWait, reportResidentError('runner'));
|
|
41
39
|
const intakeResident = new ResidentHost(intakeHost, (signal, { consecutiveIdleTicks }) => sleepUntilAbort(signal, nextPollBackoffMs(root.config.controlPlane?.resident, consecutiveIdleTicks)), reportResidentError('intake'));
|
|
42
40
|
const servers = new Set();
|
|
43
41
|
const startHttp = createHttpStarter(root, api, servers);
|
|
44
42
|
return {
|
|
45
43
|
tick: {
|
|
46
44
|
async run(budget) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
return withFinalProjectionCatchUp(async () => {
|
|
46
|
+
await root.projectionSubscriptions.catchUpOnce();
|
|
47
|
+
// Mirrors legacy's combined one-shot `runTick`: intake once, then
|
|
48
|
+
// let the runner loop drain up to its own budget.
|
|
49
|
+
await intakeHost.run(budget);
|
|
50
|
+
return await runnerTick.run(budget);
|
|
51
|
+
}, () => root.projectionSubscriptions.catchUpOnce());
|
|
51
52
|
},
|
|
52
53
|
},
|
|
53
54
|
start: {
|
|
@@ -56,21 +57,15 @@ export function createSurfaceCliApplications(root, api, now) {
|
|
|
56
57
|
await startHttp({}, true);
|
|
57
58
|
else if (root.config.surfaces.api.enabled)
|
|
58
59
|
await startHttp({}, false);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
finally {
|
|
70
|
-
await intakeRun;
|
|
71
|
-
await projectionPump;
|
|
72
|
-
await closeAll(servers);
|
|
73
|
-
}
|
|
60
|
+
return runResidentLifecycle({
|
|
61
|
+
signal,
|
|
62
|
+
budget,
|
|
63
|
+
processorRuntime: root.processorRuntime,
|
|
64
|
+
activationSchedulerSubscriber: root.activationSchedulerSubscriber,
|
|
65
|
+
intakeResident,
|
|
66
|
+
runnerResident,
|
|
67
|
+
close: () => closeResidentRuntime(root.execution, () => closeAll(servers)),
|
|
68
|
+
});
|
|
74
69
|
},
|
|
75
70
|
},
|
|
76
71
|
stop: {
|
|
@@ -89,8 +84,8 @@ export function createSurfaceCliApplications(root, api, now) {
|
|
|
89
84
|
if (root.config.surfaces.web.auth.disabled)
|
|
90
85
|
return 'UI authentication is disabled by surfaces.web.auth.disabled.';
|
|
91
86
|
if (accessKey !== undefined)
|
|
92
|
-
await replaceAccessKey(root.paths.wakeRoot, accessKey);
|
|
93
|
-
const grant = await createPairingGrant(root.paths.wakeRoot);
|
|
87
|
+
await replaceAccessKey(root.paths.wakeRoot, accessKey, serialiseCredentialMutation);
|
|
88
|
+
const grant = await createPairingGrant(root.paths.wakeRoot, undefined, serialiseCredentialMutation);
|
|
94
89
|
const localHost = root.config.surfaces.api.host === '0.0.0.0' ? 'localhost' : root.config.surfaces.api.host;
|
|
95
90
|
const local = `http://${localHost}:${root.config.surfaces.api.port}/?grant=${encodeURIComponent(grant.value)}`;
|
|
96
91
|
const publicUrl = root.config.surfaces.web.publicUrl;
|
|
@@ -113,12 +108,12 @@ export function createSurfaceCliApplications(root, api, now) {
|
|
|
113
108
|
return (await root.journal.readAll(0))
|
|
114
109
|
.filter((event) => event.stream.kind === WorkStreamKind.WorkItem && event.stream.id === id)
|
|
115
110
|
.map((event) => ({
|
|
116
|
-
eventId: event.eventId,
|
|
117
|
-
eventType: event.eventType,
|
|
118
|
-
occurredAt: event.occurredAt,
|
|
111
|
+
eventId: event.event.eventId,
|
|
112
|
+
eventType: event.event.eventType,
|
|
113
|
+
occurredAt: event.event.occurredAt,
|
|
119
114
|
stream: `${event.stream.kind}:${event.stream.id}`,
|
|
120
|
-
causationId: event.causationId,
|
|
121
|
-
correlationId: event.correlationId,
|
|
115
|
+
causationId: event.event.causationId,
|
|
116
|
+
correlationId: event.event.correlationId,
|
|
122
117
|
}));
|
|
123
118
|
},
|
|
124
119
|
},
|
|
@@ -153,29 +148,117 @@ export function createSurfaceCliApplications(root, api, now) {
|
|
|
153
148
|
};
|
|
154
149
|
}
|
|
155
150
|
export function createRunnerIdleWait(root, resident) {
|
|
156
|
-
|
|
157
|
-
|
|
151
|
+
// Cursor initialization stays inside the resident lifecycle. The first
|
|
152
|
+
// wait starts at the origin so an append during the first pass remains
|
|
153
|
+
// visible; each subsequent cursor is sampled before waiting.
|
|
154
|
+
let priorPosition;
|
|
155
|
+
return (signal, { consecutiveIdleTicks: _consecutiveIdleTicks, consecutiveErrorTicks, }) => {
|
|
158
156
|
if (consecutiveErrorTicks > 0)
|
|
159
157
|
return sleepUntilAbort(signal, nextPollBackoffMs(resident, consecutiveErrorTicks));
|
|
160
|
-
const
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
: root.journal.changeSignal.waitForChange(signal, JOURNAL_CHANGE_FALLBACK_MS);
|
|
158
|
+
const initializing = priorPosition === undefined;
|
|
159
|
+
const cursor = priorPosition ?? Promise.resolve(0);
|
|
160
|
+
return waitForRunnerEvents(root, cursor, signal, resident, _consecutiveIdleTicks, initializing).then((position) => {
|
|
161
|
+
priorPosition = Promise.resolve(position);
|
|
162
|
+
});
|
|
166
163
|
};
|
|
167
164
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
|
|
165
|
+
/** Starts one processor registry before its resident consumers. */
|
|
166
|
+
export async function runResidentLifecycle(input) {
|
|
167
|
+
const controller = new AbortController();
|
|
168
|
+
const abort = () => controller.abort();
|
|
169
|
+
if (input.signal.aborted)
|
|
170
|
+
abort();
|
|
171
|
+
else
|
|
172
|
+
input.signal.addEventListener('abort', abort, { once: true });
|
|
173
|
+
let processorRun;
|
|
174
|
+
let schedulerRun;
|
|
175
|
+
let intakeRun;
|
|
176
|
+
const failures = [];
|
|
177
|
+
let result;
|
|
178
|
+
try {
|
|
179
|
+
processorRun = input.processorRuntime.start(controller.signal);
|
|
180
|
+
schedulerRun = input.activationSchedulerSubscriber.start(controller.signal);
|
|
181
|
+
intakeRun = input.intakeResident.run(controller.signal, input.budget);
|
|
182
|
+
result = await input.runnerResident.run(controller.signal, input.budget);
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
failures.push(error);
|
|
186
|
+
}
|
|
187
|
+
finally {
|
|
188
|
+
captureCleanupFailure(failures, () => controller.abort());
|
|
189
|
+
captureCleanupFailure(failures, () => processorRun?.abort());
|
|
190
|
+
captureCleanupFailure(failures, () => schedulerRun?.abort());
|
|
191
|
+
await captureAsyncCleanupFailure(failures, async () => {
|
|
192
|
+
failures.push(...(await settledRunFailures([intakeRun, processorRun?.done, schedulerRun?.done])));
|
|
193
|
+
});
|
|
194
|
+
captureCleanupFailure(failures, () => input.signal.removeEventListener('abort', abort));
|
|
195
|
+
await captureAsyncCleanupFailure(failures, () => input.close());
|
|
196
|
+
}
|
|
197
|
+
if (failures.length === 1)
|
|
198
|
+
throw failures[0];
|
|
199
|
+
if (failures.length > 1)
|
|
200
|
+
throw new AggregateError(failures, 'Resident lifecycle failed');
|
|
201
|
+
return result;
|
|
202
|
+
}
|
|
203
|
+
export async function closeResidentRuntime(execution, closeResources) {
|
|
204
|
+
const failures = [];
|
|
205
|
+
await captureAsyncCleanupFailure(failures, () => execution.shutdown());
|
|
206
|
+
await captureAsyncCleanupFailure(failures, closeResources);
|
|
207
|
+
if (failures.length === 1)
|
|
208
|
+
throw failures[0];
|
|
209
|
+
if (failures.length > 1)
|
|
210
|
+
throw new AggregateError(failures, 'Resident execution and resource cleanup failed');
|
|
211
|
+
}
|
|
212
|
+
function captureCleanupFailure(failures, cleanup) {
|
|
213
|
+
try {
|
|
214
|
+
cleanup();
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
failures.push(error);
|
|
177
218
|
}
|
|
178
219
|
}
|
|
220
|
+
async function captureAsyncCleanupFailure(failures, cleanup) {
|
|
221
|
+
try {
|
|
222
|
+
await cleanup();
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
failures.push(error);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
async function settledRunFailures(runs) {
|
|
229
|
+
const settled = await Promise.allSettled(runs.filter((run) => run !== undefined));
|
|
230
|
+
return settled.flatMap((run) => (run.status === 'fulfilled' ? [] : [run.reason]));
|
|
231
|
+
}
|
|
232
|
+
async function waitForRunnerEvents(root, priorPosition, signal, resident, consecutiveIdleTicks, initializing) {
|
|
233
|
+
let currentPosition = 0;
|
|
234
|
+
try {
|
|
235
|
+
const afterPosition = await priorPosition;
|
|
236
|
+
currentPosition = initializing
|
|
237
|
+
? await sampleRunnerPosition(root)
|
|
238
|
+
: await root.journal.latestGlobalPosition();
|
|
239
|
+
await root.journal.waitForEventsAfter(afterPosition, signal, JOURNAL_CHANGE_FALLBACK_MS);
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
reportRunnerWaitError(error);
|
|
243
|
+
await sleepUntilAbort(signal, nextPollBackoffMs(resident, consecutiveIdleTicks));
|
|
244
|
+
}
|
|
245
|
+
return currentPosition;
|
|
246
|
+
}
|
|
247
|
+
function sampleRunnerPosition(root) {
|
|
248
|
+
try {
|
|
249
|
+
return root.journal.latestGlobalPosition().catch((error) => {
|
|
250
|
+
reportRunnerWaitError(error);
|
|
251
|
+
return 0;
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
reportRunnerWaitError(error);
|
|
256
|
+
return Promise.resolve(0);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
function reportRunnerWaitError(error) {
|
|
260
|
+
process.stderr.write(`Wake runner event wait failed: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
261
|
+
}
|
|
179
262
|
function nextPollBackoffMs(resident, consecutiveIdleTicks) {
|
|
180
263
|
const baseMs = resident?.pollBackoffMs ?? 1000;
|
|
181
264
|
const maxMs = resident?.maxPollBackoffMs ?? baseMs * 16;
|
|
@@ -202,7 +285,7 @@ function createHttpStarter(root, api, servers) {
|
|
|
202
285
|
credentials: await loadOrCreateCredentials(root.paths.wakeRoot),
|
|
203
286
|
auth: {
|
|
204
287
|
disabled: root.config.surfaces.web.auth.disabled,
|
|
205
|
-
redeemGrant: (grant) => redeemPairingGrant(root.paths.wakeRoot, grant),
|
|
288
|
+
redeemGrant: (grant) => redeemPairingGrant(root.paths.wakeRoot, grant, undefined, serialiseCredentialMutation),
|
|
206
289
|
},
|
|
207
290
|
...(assets === undefined ? {} : { assets }),
|
|
208
291
|
});
|
|
@@ -219,6 +302,9 @@ function createHttpStarter(root, api, servers) {
|
|
|
219
302
|
}
|
|
220
303
|
};
|
|
221
304
|
}
|
|
305
|
+
function serialiseCredentialMutation(lockPath, operation) {
|
|
306
|
+
return withFileLock(lockPath, operation, { waitMs: 5_000, retryIntervalMs: 10 });
|
|
307
|
+
}
|
|
222
308
|
function createDockerCliForRoot(root) {
|
|
223
309
|
return createLoggedDockerCli({
|
|
224
310
|
execute: (arguments_, onChunk, options) => spawnDocker(arguments_, onChunk, root.paths.wakeRoot, options),
|
|
@@ -260,13 +346,13 @@ async function activeExecutionRuns(root) {
|
|
|
260
346
|
// Run whose lease already expired would otherwise never be recovered during
|
|
261
347
|
// a maintenance quiesce wait. Recover it here so an owner that is truly gone
|
|
262
348
|
// (no heartbeat, no lease renewal) reaches a terminal or ambiguous status
|
|
263
|
-
// instead of sitting as
|
|
349
|
+
// instead of sitting as active and blocking the update forever.
|
|
264
350
|
await root.recovery.recoverActive('self-update', root.execution.isLocallyActive);
|
|
265
351
|
// Ambiguous Runs are always terminal (finishedAt is set the moment escalation
|
|
266
352
|
// occurs) and require an operator's `run-resolve`, not a maintenance drain or
|
|
267
353
|
// cancellation. Treating them as active would deadlock every future update.
|
|
268
354
|
return (await root.execution.list())
|
|
269
|
-
.filter((run) => run.status
|
|
355
|
+
.filter((run) => isActiveRunStatus(run.status))
|
|
270
356
|
.map((run) => ({
|
|
271
357
|
runId: run.runId,
|
|
272
358
|
maintenanceCancellable: run.cancellation === undefined,
|
|
@@ -274,7 +360,7 @@ async function activeExecutionRuns(root) {
|
|
|
274
360
|
}
|
|
275
361
|
async function activeExecutionRunIds(root) {
|
|
276
362
|
return (await root.execution.list())
|
|
277
|
-
.filter((run) => run.status
|
|
363
|
+
.filter((run) => isActiveRunStatus(run.status))
|
|
278
364
|
.map((run) => run.runId);
|
|
279
365
|
}
|
|
280
366
|
/** The production maintenance boundary shared by the CLI update application. */
|
|
@@ -351,7 +437,7 @@ function createOperationalApplications(root) {
|
|
|
351
437
|
health: async () => projectionHealth(root),
|
|
352
438
|
rebuild: async () => {
|
|
353
439
|
for (const definition of runtimeProjectionDefinitions)
|
|
354
|
-
await root.
|
|
440
|
+
await root.projectionSubscriptions.rebuild(definition);
|
|
355
441
|
},
|
|
356
442
|
},
|
|
357
443
|
}),
|
|
@@ -660,7 +746,7 @@ function createValidationApplications(root) {
|
|
|
660
746
|
},
|
|
661
747
|
async rebuildProjections() {
|
|
662
748
|
for (const definition of runtimeProjectionDefinitions)
|
|
663
|
-
await root.
|
|
749
|
+
await root.projectionSubscriptions.rebuild(definition);
|
|
664
750
|
},
|
|
665
751
|
};
|
|
666
752
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ProjectionStore } from '@atolis-hq/eventing';
|
|
2
|
+
import type { TranscriptStore } from '../execution/index.js';
|
|
3
|
+
import type { Clock } from '../kernel/index.js';
|
|
4
|
+
import type { ResolvedWakeModulesConfig } from './config/load-config.js';
|
|
5
|
+
export declare function createTranscriptRetention(transcriptStore: TranscriptStore, projections: ProjectionStore, config: ResolvedWakeModulesConfig, clock: Clock): {
|
|
6
|
+
transcriptRetention: {
|
|
7
|
+
markClosedWorkItem(workItemId: string): Promise<boolean>;
|
|
8
|
+
sweep(): Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
closedWorkItemIds: () => Promise<readonly string[]>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface UpdateLedger {
|
|
2
|
+
read(): Promise<string | null>;
|
|
3
|
+
begin(tag: string): Promise<void>;
|
|
4
|
+
write(tag: string): Promise<void>;
|
|
5
|
+
recover(): Promise<string | null>;
|
|
6
|
+
isBad(tag: string): Promise<boolean>;
|
|
7
|
+
recordBad(tag: string): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare function createUpdateLedger(wakeRoot: string): UpdateLedger;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ValueOf } from '../kernel/index.js';
|
|
2
|
+
export declare const UpdateMaintenancePhase: {
|
|
3
|
+
readonly Quiescing: "quiescing";
|
|
4
|
+
readonly Updating: "updating";
|
|
5
|
+
readonly RollingBack: "rolling-back";
|
|
6
|
+
readonly Failed: "failed";
|
|
7
|
+
};
|
|
8
|
+
export type UpdateMaintenancePhase = ValueOf<typeof UpdateMaintenancePhase>;
|
|
9
|
+
export interface UpdateMaintenanceState {
|
|
10
|
+
readonly attemptId: string;
|
|
11
|
+
readonly tag: string;
|
|
12
|
+
readonly phase: UpdateMaintenancePhase;
|
|
13
|
+
readonly startedAt: string;
|
|
14
|
+
readonly failure?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface UpdateMaintenanceLease {
|
|
17
|
+
read(): Promise<UpdateMaintenanceState | null>;
|
|
18
|
+
acquire(tag: string, retryFailed?: boolean): Promise<UpdateMaintenanceState>;
|
|
19
|
+
runExclusive<Value>(tag: string, retryFailed: boolean, operation: (state: UpdateMaintenanceState) => Promise<Value>): Promise<Value>;
|
|
20
|
+
transition(phase: Exclude<UpdateMaintenancePhase, typeof UpdateMaintenancePhase.Failed>, attemptId?: string): Promise<UpdateMaintenanceState>;
|
|
21
|
+
fail(error: unknown, attemptId?: string): Promise<UpdateMaintenanceState>;
|
|
22
|
+
clear(attemptId?: string): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export declare function createUpdateMaintenanceLease(wakeRoot: string, now?: () => string, createAttemptId?: () => string, isProcessAlive?: (pid: number) => boolean): UpdateMaintenanceLease;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { acquireFileLock } from '@atolis-hq/eventing-filesystem';
|
|
1
2
|
import { randomUUID } from 'node:crypto';
|
|
2
3
|
import { mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
|
|
3
4
|
import { dirname, join } from 'node:path';
|
|
4
5
|
import { defineClosedVocabulary } from '../kernel/index.js';
|
|
5
|
-
import { acquireFileLock } from '../persistence/index.js';
|
|
6
6
|
export const UpdateMaintenancePhase = defineClosedVocabulary({
|
|
7
7
|
Quiescing: 'quiescing',
|
|
8
8
|
Updating: 'updating',
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ReadTextFile = (path: string) => string | undefined;
|
|
2
|
+
export type ListTextFiles = (path: string) => Array<{
|
|
3
|
+
path: string;
|
|
4
|
+
content: string;
|
|
5
|
+
}>;
|
|
6
|
+
export interface ResolveWakeVersionOptions {
|
|
7
|
+
readonly repoRoot?: string;
|
|
8
|
+
readonly gitOutput?: (args: readonly string[]) => string;
|
|
9
|
+
readonly readTextFile?: ReadTextFile;
|
|
10
|
+
readonly listTextFiles?: ListTextFiles;
|
|
11
|
+
}
|
|
12
|
+
export declare function resolveWakeVersion(options?: ResolveWakeVersionOptions): string;
|
|
13
|
+
export declare const wakeVersion: string;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { CommandContext } from '@atolis-hq/eventing';
|
|
2
|
+
import type { RunView, WorkspaceRecovery } from '../../execution/index.js';
|
|
3
|
+
import type { IdGenerator } from '../../kernel/index.js';
|
|
4
|
+
import type { ActivityActivationView, WorkflowInstanceView } from '../../orchestration/index.js';
|
|
5
|
+
import type { ResourceService } from '../../resources/index.js';
|
|
6
|
+
import type { WorkStatus } from '../../work/index.js';
|
|
7
|
+
import type { DispatchPolicy } from '../domain/dispatch-policy.js';
|
|
8
|
+
export interface OrchestrationPort {
|
|
9
|
+
reconcileChildCompletions(context: CommandContext): Promise<void>;
|
|
10
|
+
listPendingActivations(workItemId?: string): Promise<readonly {
|
|
11
|
+
workflow: WorkflowInstanceView;
|
|
12
|
+
activation: ActivityActivationView;
|
|
13
|
+
}[]>;
|
|
14
|
+
listWaiting(): Promise<readonly (WorkflowInstanceView | null)[]>;
|
|
15
|
+
listAll?(): Promise<readonly WorkflowInstanceView[]>;
|
|
16
|
+
validateActivationDispatch?(workflowInstanceId: string, context: CommandContext): Promise<boolean>;
|
|
17
|
+
acceptOutcome(command: {
|
|
18
|
+
workflowInstanceId: string;
|
|
19
|
+
activationId: string;
|
|
20
|
+
outcome: NonNullable<RunView['outcome']>;
|
|
21
|
+
}, context: CommandContext): Promise<WorkflowInstanceView>;
|
|
22
|
+
resolveExecutionFailure?(workflowInstanceId: string, input: {
|
|
23
|
+
readonly activationId: string;
|
|
24
|
+
readonly runId: string;
|
|
25
|
+
readonly reason: string;
|
|
26
|
+
}, context: CommandContext): Promise<WorkflowInstanceView | null>;
|
|
27
|
+
retryRunnerQuotaFailure?(workflowInstanceId: string, input: {
|
|
28
|
+
readonly activationId: string;
|
|
29
|
+
readonly runId: string;
|
|
30
|
+
readonly runnerName: string;
|
|
31
|
+
readonly message: string;
|
|
32
|
+
}, context: CommandContext): Promise<WorkflowInstanceView | null>;
|
|
33
|
+
markActivationStarted(workflowInstanceId: string, activationId: string, context: CommandContext): Promise<WorkflowInstanceView | null>;
|
|
34
|
+
}
|
|
35
|
+
export interface ExecutionPort {
|
|
36
|
+
recoverActive?(owner: string): Promise<readonly RunView[]>;
|
|
37
|
+
attempt(activation: ActivityActivationView, context: {
|
|
38
|
+
workItemId: WorkflowInstanceView['workItemId'];
|
|
39
|
+
workflowInstanceId: WorkflowInstanceView['workflowInstanceId'];
|
|
40
|
+
orchestrationGroupId: WorkflowInstanceView['orchestrationGroupId'];
|
|
41
|
+
resources: readonly NonNullable<Awaited<ReturnType<ResourceService['get']>>>[];
|
|
42
|
+
ineligibleRunners?: ReadonlySet<string>;
|
|
43
|
+
sessionPolicy?: 'fresh' | 'resume-stage';
|
|
44
|
+
awaitImmediateCompletion?: boolean;
|
|
45
|
+
}): Promise<RunView>;
|
|
46
|
+
list(activationId?: ActivityActivationView['activationId']): Promise<readonly RunView[]>;
|
|
47
|
+
}
|
|
48
|
+
/** Protects one complete scheduler pass across local or competing processes. */
|
|
49
|
+
export type ActivationSchedulerSerialiser = <Value>(operation: () => Promise<Value>, signal?: AbortSignal) => Promise<Value>;
|
|
50
|
+
export interface ActivationSchedulerDependencies {
|
|
51
|
+
readonly ids: IdGenerator;
|
|
52
|
+
readonly work?: {
|
|
53
|
+
get(workItemId: string): Promise<{
|
|
54
|
+
readonly state: WorkStatus;
|
|
55
|
+
readonly frozen?: boolean;
|
|
56
|
+
readonly deleted?: boolean;
|
|
57
|
+
} | null>;
|
|
58
|
+
};
|
|
59
|
+
readonly runnerIneligibility?: () => Promise<ReadonlySet<string>>;
|
|
60
|
+
readonly isDispatchPaused?: () => Promise<boolean>;
|
|
61
|
+
readonly workspaceRecovery?: WorkspaceRecovery;
|
|
62
|
+
readonly transcriptRetention?: {
|
|
63
|
+
markClosedWorkItem(workItemId: string): Promise<boolean>;
|
|
64
|
+
sweep(): Promise<void>;
|
|
65
|
+
};
|
|
66
|
+
readonly closedWorkItemIds?: () => Promise<readonly string[]>;
|
|
67
|
+
readonly dispatchPolicy?: DispatchPolicy;
|
|
68
|
+
readonly maxConcurrentRuns?: number;
|
|
69
|
+
readonly maxDispatches?: number;
|
|
70
|
+
readonly schedulerSerialiser?: ActivationSchedulerSerialiser;
|
|
71
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type EventProcessor } from '@atolis-hq/eventing';
|
|
2
|
+
import type { AdvanceOptions, AdvanceResult } from '../contracts/views.js';
|
|
3
|
+
import type { ActivationScheduler } from './activation-scheduler.js';
|
|
4
|
+
/** Durable subscriber/checkpoint identity; held across event load, handling, and save. */
|
|
5
|
+
export declare const activationSchedulerSubscriptionConsumer = "subscriber:control-plane.activation-scheduler";
|
|
6
|
+
/** Global scheduler critical-section identity; distinct from the subscription checkpoint lock. */
|
|
7
|
+
export declare const activationSchedulerCriticalSectionConsumer = "control-plane.activation-scheduler-critical-section";
|
|
8
|
+
export declare const ActivationSchedulerSubscriptionStatus: {
|
|
9
|
+
readonly Starting: "starting";
|
|
10
|
+
readonly CatchingUp: "catching-up";
|
|
11
|
+
readonly Healthy: "healthy";
|
|
12
|
+
readonly Degraded: "degraded";
|
|
13
|
+
readonly Stopped: "stopped";
|
|
14
|
+
};
|
|
15
|
+
export type ActivationSchedulerSubscriptionHealthStatus = (typeof ActivationSchedulerSubscriptionStatus)[keyof typeof ActivationSchedulerSubscriptionStatus];
|
|
16
|
+
export interface ActivationSchedulerSubscriberOptions {
|
|
17
|
+
readonly fallbackMs?: number;
|
|
18
|
+
/** Test seam for deterministic reconciliation barriers. */
|
|
19
|
+
readonly waitForFallback?: (signal: AbortSignal, milliseconds: number) => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export interface ActivationSchedulerSubscriberRun {
|
|
22
|
+
abort(): void;
|
|
23
|
+
readonly done: Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export interface ActivationSchedulerSubscriptionHealth {
|
|
26
|
+
readonly consumer: string;
|
|
27
|
+
readonly status: ActivationSchedulerSubscriptionHealthStatus;
|
|
28
|
+
readonly checkpoint: number;
|
|
29
|
+
readonly consecutiveFailures: number;
|
|
30
|
+
readonly lastError?: unknown;
|
|
31
|
+
}
|
|
32
|
+
/** Schedules durable activation work independently from slow runner reactors. */
|
|
33
|
+
export interface ActivationSchedulerSubscriber {
|
|
34
|
+
/** The named Eventing processor that schedules once for each delivered batch. */
|
|
35
|
+
readonly processor: EventProcessor;
|
|
36
|
+
start(signal?: AbortSignal): ActivationSchedulerSubscriberRun;
|
|
37
|
+
poke(options?: AdvanceOptions, signal?: AbortSignal): Promise<AdvanceResult>;
|
|
38
|
+
/** Result from the most recent processor-owned scheduler pass, if any. */
|
|
39
|
+
lastResult(): AdvanceResult | undefined;
|
|
40
|
+
health(): ActivationSchedulerSubscriptionHealth | undefined;
|
|
41
|
+
}
|
|
42
|
+
export declare function createActivationSchedulerSubscriber(scheduler: ActivationScheduler, options?: ActivationSchedulerSubscriberOptions): ActivationSchedulerSubscriber;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { EventProcessorCategory, EventProcessorHealthStatus, EventProcessorReplayPolicy, createBatchEventProcessor, } from '@atolis-hq/eventing';
|
|
2
|
+
import { ControlStreamKind } from '../contracts/streams.js';
|
|
3
|
+
/** Durable subscriber/checkpoint identity; held across event load, handling, and save. */
|
|
4
|
+
export const activationSchedulerSubscriptionConsumer = 'subscriber:control-plane.activation-scheduler';
|
|
5
|
+
/** Global scheduler critical-section identity; distinct from the subscription checkpoint lock. */
|
|
6
|
+
export const activationSchedulerCriticalSectionConsumer = 'control-plane.activation-scheduler-critical-section';
|
|
7
|
+
const defaultFallbackMs = 30_000;
|
|
8
|
+
const maximumTimerDelayMs = 2_147_483_647;
|
|
9
|
+
export const ActivationSchedulerSubscriptionStatus = {
|
|
10
|
+
Starting: EventProcessorHealthStatus.Starting,
|
|
11
|
+
CatchingUp: EventProcessorHealthStatus.CatchingUp,
|
|
12
|
+
Healthy: EventProcessorHealthStatus.Healthy,
|
|
13
|
+
Degraded: EventProcessorHealthStatus.Degraded,
|
|
14
|
+
Stopped: EventProcessorHealthStatus.Stopped,
|
|
15
|
+
};
|
|
16
|
+
export function createActivationSchedulerSubscriber(scheduler, options = {}) {
|
|
17
|
+
const fallbackMs = options.fallbackMs ?? defaultFallbackMs;
|
|
18
|
+
const waitForFallback = options.waitForFallback ?? waitUntilAbort;
|
|
19
|
+
let reconciliationFailures = 0;
|
|
20
|
+
let reconciliationError;
|
|
21
|
+
let lastResult;
|
|
22
|
+
if (!Number.isSafeInteger(fallbackMs) || fallbackMs <= 0 || fallbackMs > maximumTimerDelayMs)
|
|
23
|
+
throw new Error(`Activation scheduler fallback must be a positive safe integer no greater than ${maximumTimerDelayMs}`);
|
|
24
|
+
const poke = async (advance = { maxProgress: 1 }, signal) => {
|
|
25
|
+
try {
|
|
26
|
+
const result = await scheduler.runOnce(advance, signal);
|
|
27
|
+
lastResult = result;
|
|
28
|
+
reconciliationFailures = 0;
|
|
29
|
+
reconciliationError = undefined;
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
reconciliationFailures += 1;
|
|
34
|
+
reconciliationError = error;
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const processor = createBatchEventProcessor({
|
|
39
|
+
consumer: activationSchedulerSubscriptionConsumer,
|
|
40
|
+
name: 'activation-scheduler',
|
|
41
|
+
owner: ControlStreamKind.Global,
|
|
42
|
+
category: EventProcessorCategory.Coordinator,
|
|
43
|
+
replayPolicy: EventProcessorReplayPolicy.Idempotent,
|
|
44
|
+
handle: async (_events, signal) => {
|
|
45
|
+
await poke(undefined, signal);
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
processor,
|
|
50
|
+
start: (parentSignal) => createSubscriberRun(parentSignal, fallbackMs, waitForFallback, poke),
|
|
51
|
+
poke,
|
|
52
|
+
lastResult: () => lastResult,
|
|
53
|
+
health: () => {
|
|
54
|
+
if (reconciliationFailures === 0)
|
|
55
|
+
return undefined;
|
|
56
|
+
return {
|
|
57
|
+
consumer: activationSchedulerSubscriptionConsumer,
|
|
58
|
+
status: ActivationSchedulerSubscriptionStatus.Degraded,
|
|
59
|
+
checkpoint: 0,
|
|
60
|
+
consecutiveFailures: reconciliationFailures,
|
|
61
|
+
...(reconciliationError === undefined ? {} : { lastError: reconciliationError }),
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function createSubscriberRun(parentSignal, fallbackMs, waitForFallback, poke) {
|
|
67
|
+
const controller = new AbortController();
|
|
68
|
+
const abort = () => controller.abort();
|
|
69
|
+
if (parentSignal?.aborted)
|
|
70
|
+
abort();
|
|
71
|
+
else
|
|
72
|
+
parentSignal?.addEventListener('abort', abort, { once: true });
|
|
73
|
+
const startup = reconcileIgnoringFailure(() => poke(undefined, controller.signal));
|
|
74
|
+
const fallback = reconcileOnFallback(controller.signal, fallbackMs, waitForFallback, () => poke(undefined, controller.signal));
|
|
75
|
+
return {
|
|
76
|
+
abort,
|
|
77
|
+
done: Promise.all([startup, fallback])
|
|
78
|
+
.then(() => undefined)
|
|
79
|
+
.finally(() => parentSignal?.removeEventListener('abort', abort)),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
async function reconcileOnFallback(signal, fallbackMs, waitForFallback, poke) {
|
|
83
|
+
while (!signal.aborted) {
|
|
84
|
+
await waitForFallback(signal, fallbackMs);
|
|
85
|
+
if (signal.aborted)
|
|
86
|
+
return;
|
|
87
|
+
await reconcileIgnoringFailure(poke);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async function reconcileIgnoringFailure(poke) {
|
|
91
|
+
try {
|
|
92
|
+
await poke();
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
// A later durable event or fallback pass retries. Event handling itself is
|
|
96
|
+
// left to the host so its checkpoint only advances after scheduler success.
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function waitUntilAbort(signal, milliseconds) {
|
|
100
|
+
return new Promise((resolve) => {
|
|
101
|
+
if (signal.aborted)
|
|
102
|
+
return resolve();
|
|
103
|
+
const timer = setTimeout(done, milliseconds);
|
|
104
|
+
signal.addEventListener('abort', done, { once: true });
|
|
105
|
+
function done() {
|
|
106
|
+
clearTimeout(timer);
|
|
107
|
+
signal.removeEventListener('abort', done);
|
|
108
|
+
resolve();
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Clock } from '../../kernel/index.js';
|
|
2
|
+
import type { ResourceService } from '../../resources/index.js';
|
|
3
|
+
import type { AdvanceOptions, AdvanceResult } from '../contracts/views.js';
|
|
4
|
+
import type { ActivationSchedulerDependencies, ExecutionPort, OrchestrationPort } from './activation-scheduler-ports.js';
|
|
5
|
+
export interface ActivationScheduler {
|
|
6
|
+
runOnce(options: AdvanceOptions, signal?: AbortSignal): Promise<AdvanceResult>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createActivationScheduler(orchestration: OrchestrationPort, execution: ExecutionPort, resources: ResourceService, clock: Clock, dependencies: ActivationSchedulerDependencies): ActivationScheduler;
|