@atolis-hq/wake 0.4.1 → 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 +10 -8
- 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-comment-syntax.js +2 -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 +53 -23
- 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/contracts/vocabulary.js +3 -1
- 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/comment-source.js +2 -1
- 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 +15 -14
- 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 +13 -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 +27 -15
- package/dist/src/orchestration/domain/interpreter.d.ts +14 -0
- package/dist/src/orchestration/domain/interpreter.js +5 -2
- package/dist/src/orchestration/domain/operator-retry-policy.d.ts +14 -0
- package/dist/src/orchestration/domain/operator-retry-policy.js +36 -10
- 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-events.js +1 -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
|
@@ -2,29 +2,85 @@
|
|
|
2
2
|
import { ActivityExecutionKind, } from '../../activities/index.js';
|
|
3
3
|
import { runId } from '../contracts/identifiers.js';
|
|
4
4
|
import { ExecutionStreamKind } from '../contracts/streams.js';
|
|
5
|
-
import { RunStatus, WorkspaceMode } from '../contracts/vocabulary.js';
|
|
5
|
+
import { ExecutionCancellationReason, isActiveRunStatus, RunStatus, WorkspaceMode, } from '../contracts/vocabulary.js';
|
|
6
6
|
import { claimActivation, releaseActivation } from './activation-claim.js';
|
|
7
7
|
import { cancelActiveRuns } from './active-run-cancellation.js';
|
|
8
8
|
import { executeActivity, } from './execution-activity.js';
|
|
9
9
|
import { acquireWorkspace, validateResourceRequirements } from './execution-validation.js';
|
|
10
|
-
import { recordRunFailure, recordRunSuccess, recordWorkspaceCleanupFailure, startRun, } from './run-lifecycle.js';
|
|
10
|
+
import { prepareRun, recordRunFailure, recordRunSuccess, recordWorkspaceCleanupFailure, startRun, } from './run-lifecycle.js';
|
|
11
11
|
import { claimRun, confirmCancellation, renewLease, requestCancellation, } from './run-liveness-service.js';
|
|
12
12
|
import { RunRepository } from './run-repository.js';
|
|
13
13
|
export function createExecutionService(journal, activities, config, dependencies) {
|
|
14
14
|
const repository = new RunRepository(journal);
|
|
15
15
|
const active = new Map();
|
|
16
|
+
const localAttempts = new Set();
|
|
17
|
+
const lifecycle = {
|
|
18
|
+
closed: false,
|
|
19
|
+
shutdown: undefined,
|
|
20
|
+
attempts: new Set(),
|
|
21
|
+
cancellations: new Map(),
|
|
22
|
+
workers: new Map(),
|
|
23
|
+
};
|
|
24
|
+
const runtime = {
|
|
25
|
+
activities,
|
|
26
|
+
config,
|
|
27
|
+
dependencies,
|
|
28
|
+
repository,
|
|
29
|
+
active,
|
|
30
|
+
localAttempts,
|
|
31
|
+
lifecycle,
|
|
32
|
+
journal,
|
|
33
|
+
};
|
|
16
34
|
return {
|
|
17
|
-
attempt: (activation, context) =>
|
|
35
|
+
attempt: (activation, context) => startAttempt(runtime, activation, context),
|
|
18
36
|
list: (activationId) => repository.list(activationId),
|
|
19
|
-
isLocallyActive: (id) =>
|
|
37
|
+
isLocallyActive: (id) => localAttempts.has(runId(id)),
|
|
20
38
|
claim: (id, owner) => claimRun(repository, dependencies.clock, config, runId(id), owner),
|
|
21
39
|
renewLease: (id, owner) => renewLease(repository, dependencies.clock, config, runId(id), owner),
|
|
22
40
|
requestCancellation: (id, reason) => requestCancellation(repository, dependencies.clock, runId(id), reason, active),
|
|
23
41
|
confirmCancellation: (id) => confirmCancellation(repository, dependencies.clock, runId(id)),
|
|
24
42
|
cancelActive: (workflowInstanceIds, reason) => cancelActiveRuns(repository, dependencies.clock, workflowInstanceIds, reason, active),
|
|
43
|
+
shutdown: () => (lifecycle.shutdown ??= shutdownExecution(runtime)),
|
|
25
44
|
};
|
|
26
45
|
}
|
|
27
|
-
|
|
46
|
+
function startAttempt(runtime, activation, context) {
|
|
47
|
+
if (runtime.lifecycle.closed)
|
|
48
|
+
return Promise.reject(new Error('Execution service is shut down'));
|
|
49
|
+
const attempt = attemptExecution(runtime, activation, context);
|
|
50
|
+
runtime.lifecycle.attempts.add(attempt);
|
|
51
|
+
void attempt.finally(() => runtime.lifecycle.attempts.delete(attempt)).catch(() => undefined);
|
|
52
|
+
return attempt;
|
|
53
|
+
}
|
|
54
|
+
async function shutdownExecution(runtime) {
|
|
55
|
+
runtime.lifecycle.closed = true;
|
|
56
|
+
while (runtime.lifecycle.attempts.size > 0 ||
|
|
57
|
+
runtime.lifecycle.cancellations.size > 0 ||
|
|
58
|
+
runtime.lifecycle.workers.size > 0) {
|
|
59
|
+
const attempts = [...runtime.lifecycle.attempts];
|
|
60
|
+
const pendingCancellations = [...runtime.lifecycle.cancellations.values()];
|
|
61
|
+
const workers = [...runtime.lifecycle.workers.values()];
|
|
62
|
+
const controllers = [...runtime.active.entries()];
|
|
63
|
+
const cancellations = controllers.map(([currentRunId]) => beginShutdownCancellation(runtime, runId(currentRunId)));
|
|
64
|
+
for (const [, controller] of controllers)
|
|
65
|
+
if (!controller.signal.aborted)
|
|
66
|
+
controller.abort(ExecutionCancellationReason.Shutdown);
|
|
67
|
+
await Promise.allSettled([
|
|
68
|
+
...attempts,
|
|
69
|
+
...workers.map(({ completion }) => completion),
|
|
70
|
+
...pendingCancellations,
|
|
71
|
+
...cancellations,
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function beginShutdownCancellation(runtime, currentRunId) {
|
|
76
|
+
const existing = runtime.lifecycle.cancellations.get(currentRunId);
|
|
77
|
+
if (existing !== undefined)
|
|
78
|
+
return existing;
|
|
79
|
+
const pending = requestCancellation(runtime.repository, runtime.dependencies.clock, currentRunId, ExecutionCancellationReason.Shutdown, runtime.active).then(() => true, () => false);
|
|
80
|
+
runtime.lifecycle.cancellations.set(currentRunId, pending);
|
|
81
|
+
return pending;
|
|
82
|
+
}
|
|
83
|
+
// Prepares the durable Run before workspace acquisition, then hands invocation to the detached worker.
|
|
28
84
|
// eslint-disable-next-line max-lines-per-function
|
|
29
85
|
async function attemptExecution(runtime, activation, context) {
|
|
30
86
|
const definition = runtime.activities.describe(activation.activity);
|
|
@@ -45,17 +101,14 @@ async function attemptExecution(runtime, activation, context) {
|
|
|
45
101
|
return existing;
|
|
46
102
|
const currentRunId = runId(runtime.dependencies.ids.next(ExecutionStreamKind.Run));
|
|
47
103
|
const startedAt = runtime.dependencies.clock.now().toISOString();
|
|
48
|
-
|
|
49
|
-
const runnerStarted = new Promise((resolve) => {
|
|
50
|
-
reportRunnerStarted = resolve;
|
|
51
|
-
});
|
|
104
|
+
const reportRunnerStarted = () => undefined;
|
|
52
105
|
let lease;
|
|
106
|
+
let renewal;
|
|
53
107
|
let claimed = false;
|
|
54
108
|
try {
|
|
55
109
|
await claimActivationForAttempt(runtime, activation, currentRunId, owner, startedAt);
|
|
56
110
|
claimed = true;
|
|
57
|
-
|
|
58
|
-
await startRun({
|
|
111
|
+
await prepareRun({
|
|
59
112
|
dependencies: runLifecycleDependencies(runtime),
|
|
60
113
|
runId: currentRunId,
|
|
61
114
|
activation,
|
|
@@ -63,41 +116,174 @@ async function attemptExecution(runtime, activation, context) {
|
|
|
63
116
|
attempt: prior.length + 1,
|
|
64
117
|
startedAt,
|
|
65
118
|
runner,
|
|
119
|
+
});
|
|
120
|
+
runtime.localAttempts.add(currentRunId);
|
|
121
|
+
renewal = renewWhileActive(runtime, currentRunId, owner);
|
|
122
|
+
const controller = createExecutionController(runtime, currentRunId);
|
|
123
|
+
if (definition.executionKind !== ActivityExecutionKind.Deterministic) {
|
|
124
|
+
const prepared = (await runtime.repository.load(currentRunId)).view;
|
|
125
|
+
const detachedAttempt = {
|
|
126
|
+
activation,
|
|
127
|
+
context,
|
|
128
|
+
currentRunId,
|
|
129
|
+
attempt: prior.length + 1,
|
|
130
|
+
runner,
|
|
131
|
+
resume,
|
|
132
|
+
renewal,
|
|
133
|
+
reportRunnerStarted,
|
|
134
|
+
controller,
|
|
135
|
+
};
|
|
136
|
+
const worker = trackExecutionWorker(runtime, currentRunId, controller, continueDetachedAttemptOnNextTurn(runtime, detachedAttempt));
|
|
137
|
+
void worker.catch(() => {
|
|
138
|
+
reportRunnerStarted();
|
|
139
|
+
// The worker has already attempted durable settlement; never leak its rejection.
|
|
140
|
+
});
|
|
141
|
+
return prepared;
|
|
142
|
+
}
|
|
143
|
+
lease = await acquireAttemptWorkspace(runtime, activation, context, currentRunId, controller.signal);
|
|
144
|
+
const executionStartedAt = await startRun({
|
|
145
|
+
dependencies: runLifecycleDependencies(runtime),
|
|
146
|
+
runId: currentRunId,
|
|
147
|
+
activation,
|
|
148
|
+
context,
|
|
149
|
+
attempt: prior.length + 1,
|
|
150
|
+
runner,
|
|
151
|
+
lease,
|
|
152
|
+
});
|
|
153
|
+
if (executionStartedAt === undefined) {
|
|
154
|
+
await confirmCancellation(runtime.repository, runtime.dependencies.clock, currentRunId);
|
|
155
|
+
await renewal.stop();
|
|
156
|
+
await cleanupRun(runtime, currentRunId, activation, context, { lease });
|
|
157
|
+
return (await runtime.repository.load(currentRunId)).view;
|
|
158
|
+
}
|
|
159
|
+
const completion = trackExecutionWorker(runtime, currentRunId, controller, completeRun(runtime, currentRunId, activation, context, executionStartedAt, runner, resume.sessionId, resume.startedAt, resume.usageBaseline, lease, renewal, reportRunnerStarted));
|
|
160
|
+
void completion.catch(() => {
|
|
161
|
+
reportRunnerStarted();
|
|
162
|
+
// A detached worker must never create an unhandled rejection for its caller.
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
return recoverFailedAttempt(runtime, { activation, context, currentRunId, renewal, lease, claimed }, error);
|
|
167
|
+
}
|
|
168
|
+
await yieldToRunStart(context.awaitImmediateCompletion ? undefined : Promise.resolve());
|
|
169
|
+
return (await runtime.repository.load(currentRunId)).view;
|
|
170
|
+
}
|
|
171
|
+
function continueDetachedAttemptOnNextTurn(runtime, attempt) {
|
|
172
|
+
return new Promise((resolve) => setImmediate(resolve))
|
|
173
|
+
.then(() => continueDetachedAttempt(runtime, attempt))
|
|
174
|
+
.finally(async () => {
|
|
175
|
+
try {
|
|
176
|
+
await attempt.renewal.stop();
|
|
177
|
+
}
|
|
178
|
+
finally {
|
|
179
|
+
runtime.active.delete(attempt.currentRunId);
|
|
180
|
+
runtime.localAttempts.delete(attempt.currentRunId);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function createExecutionController(runtime, currentRunId) {
|
|
185
|
+
const controller = new AbortController();
|
|
186
|
+
runtime.active.set(currentRunId, controller);
|
|
187
|
+
if (runtime.lifecycle.closed) {
|
|
188
|
+
void beginShutdownCancellation(runtime, currentRunId);
|
|
189
|
+
controller.abort(ExecutionCancellationReason.Shutdown);
|
|
190
|
+
}
|
|
191
|
+
return controller;
|
|
192
|
+
}
|
|
193
|
+
function trackExecutionWorker(runtime, currentRunId, controller, completion) {
|
|
194
|
+
const tracked = completion.finally(() => {
|
|
195
|
+
if (runtime.lifecycle.workers.get(currentRunId)?.completion === tracked)
|
|
196
|
+
runtime.lifecycle.workers.delete(currentRunId);
|
|
197
|
+
runtime.lifecycle.cancellations.delete(currentRunId);
|
|
198
|
+
});
|
|
199
|
+
runtime.lifecycle.workers.set(currentRunId, { controller, completion: tracked });
|
|
200
|
+
return tracked;
|
|
201
|
+
}
|
|
202
|
+
async function continueDetachedAttempt(runtime, attempt) {
|
|
203
|
+
const { activation, context, currentRunId, attempt: attemptNumber, runner, resume, renewal, reportRunnerStarted, controller, } = attempt;
|
|
204
|
+
let lease;
|
|
205
|
+
try {
|
|
206
|
+
lease = await acquireAttemptWorkspace(runtime, activation, context, currentRunId, controller.signal);
|
|
207
|
+
const executionStartedAt = await startRun({
|
|
208
|
+
dependencies: runLifecycleDependencies(runtime),
|
|
209
|
+
runId: currentRunId,
|
|
210
|
+
activation,
|
|
211
|
+
context,
|
|
212
|
+
attempt: attemptNumber,
|
|
213
|
+
runner,
|
|
66
214
|
lease,
|
|
67
215
|
});
|
|
216
|
+
if (executionStartedAt === undefined) {
|
|
217
|
+
await confirmCancellation(runtime.repository, runtime.dependencies.clock, currentRunId);
|
|
218
|
+
await renewal.stop();
|
|
219
|
+
await cleanupRun(runtime, currentRunId, activation, context, {
|
|
220
|
+
lease,
|
|
221
|
+
preserveLocalAttempt: true,
|
|
222
|
+
});
|
|
223
|
+
return (await runtime.repository.load(currentRunId)).view;
|
|
224
|
+
}
|
|
225
|
+
const completion = completeRun(runtime, currentRunId, activation, context, executionStartedAt, runner, resume.sessionId, resume.startedAt, resume.usageBaseline, lease, renewal, reportRunnerStarted, true);
|
|
226
|
+
await completion;
|
|
227
|
+
return (await runtime.repository.load(currentRunId)).view;
|
|
68
228
|
}
|
|
69
229
|
catch (error) {
|
|
230
|
+
return recoverFailedAttempt(runtime, {
|
|
231
|
+
activation,
|
|
232
|
+
context,
|
|
233
|
+
currentRunId,
|
|
234
|
+
renewal,
|
|
235
|
+
lease,
|
|
236
|
+
claimed: true,
|
|
237
|
+
preserveLocalAttempt: true,
|
|
238
|
+
}, error);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
async function recoverFailedAttempt(runtime, attempt, error) {
|
|
242
|
+
const { activation, context, currentRunId, renewal, lease, claimed } = attempt;
|
|
243
|
+
try {
|
|
70
244
|
const persisted = await runtime.repository.load(currentRunId);
|
|
71
|
-
if (persisted.view
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
245
|
+
if (persisted.view !== null) {
|
|
246
|
+
await renewal?.stop();
|
|
247
|
+
const settled = await runtime.repository.load(currentRunId);
|
|
248
|
+
if (settled.view !== null && !isActiveRunStatus(settled.view.status)) {
|
|
249
|
+
await cleanupRun(runtime, currentRunId, activation, context, {
|
|
250
|
+
lease,
|
|
251
|
+
preserveLocalAttempt: attempt.preserveLocalAttempt,
|
|
252
|
+
});
|
|
253
|
+
return settled.view;
|
|
254
|
+
}
|
|
255
|
+
if (settled.view === null) {
|
|
256
|
+
await releasePreStartResources(runtime, activation, currentRunId, {
|
|
257
|
+
lease,
|
|
258
|
+
claimed,
|
|
259
|
+
preserveLocalAttempt: attempt.preserveLocalAttempt,
|
|
79
260
|
});
|
|
261
|
+
throw error;
|
|
262
|
+
}
|
|
263
|
+
try {
|
|
264
|
+
await settleRunFailure(runtime, currentRunId, activation, context, error);
|
|
80
265
|
}
|
|
81
266
|
finally {
|
|
82
|
-
await cleanupRun(runtime, currentRunId, activation, context,
|
|
267
|
+
await cleanupRun(runtime, currentRunId, activation, context, {
|
|
268
|
+
lease,
|
|
269
|
+
preserveLocalAttempt: attempt.preserveLocalAttempt,
|
|
270
|
+
});
|
|
83
271
|
}
|
|
84
272
|
return (await runtime.repository.load(currentRunId)).view;
|
|
85
273
|
}
|
|
86
|
-
await
|
|
274
|
+
await renewal?.stop();
|
|
275
|
+
await releasePreStartResources(runtime, activation, currentRunId, {
|
|
276
|
+
lease,
|
|
277
|
+
claimed,
|
|
278
|
+
preserveLocalAttempt: attempt.preserveLocalAttempt,
|
|
279
|
+
});
|
|
87
280
|
throw error;
|
|
88
281
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
await yieldToRunStart(definition.executionKind === ActivityExecutionKind.Deterministic &&
|
|
95
|
-
context.awaitImmediateCompletion
|
|
96
|
-
? undefined
|
|
97
|
-
: definition.executionKind === ActivityExecutionKind.Deterministic
|
|
98
|
-
? Promise.resolve()
|
|
99
|
-
: runnerStarted);
|
|
100
|
-
return (await runtime.repository.load(currentRunId)).view;
|
|
282
|
+
finally {
|
|
283
|
+
await renewal?.stop();
|
|
284
|
+
await runtime.lifecycle.cancellations.get(currentRunId);
|
|
285
|
+
runtime.lifecycle.cancellations.delete(currentRunId);
|
|
286
|
+
}
|
|
101
287
|
}
|
|
102
288
|
async function yieldToRunStart(runnerStarted) {
|
|
103
289
|
if (runnerStarted !== undefined)
|
|
@@ -106,8 +292,14 @@ async function yieldToRunStart(runnerStarted) {
|
|
|
106
292
|
}
|
|
107
293
|
// A Run completion atomically carries the full execution lease context.
|
|
108
294
|
// eslint-disable-next-line max-params
|
|
109
|
-
async function completeRun(runtime, currentRunId, activation, context, startedAt, runner, resumeSessionId, resumeStartedAt, usageBaseline, lease, reportRunnerStarted) {
|
|
110
|
-
|
|
295
|
+
async function completeRun(runtime, currentRunId, activation, context, startedAt, runner, resumeSessionId, resumeStartedAt, usageBaseline, lease, renewal, reportRunnerStarted, preserveLocalAttempt = false) {
|
|
296
|
+
let renewalStopped = false;
|
|
297
|
+
const stopRenewal = async () => {
|
|
298
|
+
if (renewalStopped)
|
|
299
|
+
return;
|
|
300
|
+
renewalStopped = true;
|
|
301
|
+
await renewal.stop();
|
|
302
|
+
};
|
|
111
303
|
try {
|
|
112
304
|
const outcome = await executeActivity(runtime, currentRunId, {
|
|
113
305
|
activation,
|
|
@@ -124,25 +316,13 @@ async function completeRun(runtime, currentRunId, activation, context, startedAt
|
|
|
124
316
|
...(lease === undefined ? {} : { workspace: { path: lease.path, mode: lease.mode } }),
|
|
125
317
|
reportRunnerStarted,
|
|
126
318
|
});
|
|
127
|
-
await
|
|
128
|
-
await
|
|
129
|
-
dependencies: runLifecycleDependencies(runtime),
|
|
130
|
-
runId: currentRunId,
|
|
131
|
-
activation,
|
|
132
|
-
context,
|
|
133
|
-
outcome,
|
|
134
|
-
});
|
|
319
|
+
await stopRenewal();
|
|
320
|
+
await settleRunSuccess(runtime, currentRunId, activation, context, outcome);
|
|
135
321
|
}
|
|
136
322
|
catch (error) {
|
|
137
323
|
try {
|
|
138
|
-
await
|
|
139
|
-
await
|
|
140
|
-
dependencies: runLifecycleDependencies(runtime),
|
|
141
|
-
runId: currentRunId,
|
|
142
|
-
activation,
|
|
143
|
-
context,
|
|
144
|
-
error,
|
|
145
|
-
});
|
|
324
|
+
await stopRenewal();
|
|
325
|
+
await settleRunFailure(runtime, currentRunId, activation, context, error);
|
|
146
326
|
}
|
|
147
327
|
catch {
|
|
148
328
|
// The caller already has a durable started Run; cleanup must still run.
|
|
@@ -150,11 +330,48 @@ async function completeRun(runtime, currentRunId, activation, context, startedAt
|
|
|
150
330
|
}
|
|
151
331
|
finally {
|
|
152
332
|
reportRunnerStarted();
|
|
153
|
-
await
|
|
154
|
-
await cleanupRun(runtime, currentRunId, activation, context,
|
|
333
|
+
await stopRenewal();
|
|
334
|
+
await cleanupRun(runtime, currentRunId, activation, context, {
|
|
335
|
+
lease,
|
|
336
|
+
preserveLocalAttempt,
|
|
337
|
+
});
|
|
155
338
|
}
|
|
156
339
|
}
|
|
157
|
-
function
|
|
340
|
+
async function settleRunSuccess(runtime, currentRunId, activation, context, outcome) {
|
|
341
|
+
if (await shutdownCancellationSucceeded(runtime, currentRunId)) {
|
|
342
|
+
await confirmCancellation(runtime.repository, runtime.dependencies.clock, currentRunId);
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
await recordRunSuccess({
|
|
346
|
+
dependencies: runLifecycleDependencies(runtime),
|
|
347
|
+
runId: currentRunId,
|
|
348
|
+
activation,
|
|
349
|
+
context,
|
|
350
|
+
outcome,
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
async function settleRunFailure(runtime, currentRunId, activation, context, error) {
|
|
354
|
+
if (await shutdownCancellationSucceeded(runtime, currentRunId)) {
|
|
355
|
+
await confirmCancellation(runtime.repository, runtime.dependencies.clock, currentRunId);
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
const run = await recordRunFailure({
|
|
359
|
+
dependencies: runLifecycleDependencies(runtime),
|
|
360
|
+
runId: currentRunId,
|
|
361
|
+
activation,
|
|
362
|
+
context,
|
|
363
|
+
error,
|
|
364
|
+
});
|
|
365
|
+
if (run !== null &&
|
|
366
|
+
run !== undefined &&
|
|
367
|
+
isActiveRunStatus(run.status) &&
|
|
368
|
+
run.cancellation !== undefined)
|
|
369
|
+
await confirmCancellation(runtime.repository, runtime.dependencies.clock, currentRunId);
|
|
370
|
+
}
|
|
371
|
+
async function shutdownCancellationSucceeded(runtime, currentRunId) {
|
|
372
|
+
return (await runtime.lifecycle.cancellations.get(currentRunId)) === true;
|
|
373
|
+
}
|
|
374
|
+
function renewWhileActive(runtime, currentRunId, owner) {
|
|
158
375
|
const leaseDurationMs = runtime.config.leaseDurationMs ?? 60_000;
|
|
159
376
|
const intervalMs = runtime.config.leaseRenewalIntervalMs ?? Math.max(1, Math.floor(leaseDurationMs / 2));
|
|
160
377
|
let inFlight;
|
|
@@ -179,7 +396,8 @@ function renewWhileRunning(runtime, currentRunId, owner) {
|
|
|
179
396
|
},
|
|
180
397
|
};
|
|
181
398
|
}
|
|
182
|
-
async function cleanupRun(runtime, currentRunId, activation, context,
|
|
399
|
+
async function cleanupRun(runtime, currentRunId, activation, context, options) {
|
|
400
|
+
const { lease } = options;
|
|
183
401
|
try {
|
|
184
402
|
await releaseActivation({
|
|
185
403
|
journal: runtime.journal,
|
|
@@ -188,6 +406,9 @@ async function cleanupRun(runtime, currentRunId, activation, context, lease) {
|
|
|
188
406
|
runId: currentRunId,
|
|
189
407
|
});
|
|
190
408
|
}
|
|
409
|
+
catch {
|
|
410
|
+
// An activation release can be retried after its claim expires; it must not mask the Run result.
|
|
411
|
+
}
|
|
191
412
|
finally {
|
|
192
413
|
runtime.active.delete(currentRunId);
|
|
193
414
|
try {
|
|
@@ -207,9 +428,17 @@ async function cleanupRun(runtime, currentRunId, activation, context, lease) {
|
|
|
207
428
|
// A cleanup diagnostic must not make an already-finished run fatal.
|
|
208
429
|
}
|
|
209
430
|
}
|
|
431
|
+
finally {
|
|
432
|
+
runtime.lifecycle.cancellations.delete(currentRunId);
|
|
433
|
+
if (options.preserveLocalAttempt !== true)
|
|
434
|
+
runtime.localAttempts.delete(currentRunId);
|
|
435
|
+
}
|
|
210
436
|
}
|
|
211
437
|
}
|
|
212
|
-
async function releasePreStartResources(runtime, activation, currentRunId,
|
|
438
|
+
async function releasePreStartResources(runtime, activation, currentRunId, options) {
|
|
439
|
+
const { lease, claimed } = options;
|
|
440
|
+
if (options.preserveLocalAttempt !== true)
|
|
441
|
+
runtime.localAttempts.delete(currentRunId);
|
|
213
442
|
if (claimed) {
|
|
214
443
|
try {
|
|
215
444
|
await releaseActivation({
|
|
@@ -368,8 +597,8 @@ async function claimActivationForAttempt(runtime, activation, currentRunId, owne
|
|
|
368
597
|
occurredAt,
|
|
369
598
|
});
|
|
370
599
|
}
|
|
371
|
-
function acquireAttemptWorkspace(runtime, activation, context, currentRunId) {
|
|
372
|
-
return acquireWorkspace(currentRunId, activation.execution?.workspace ?? WorkspaceMode.None, context.workItemId, context.resources, runtime.dependencies.workspaces);
|
|
600
|
+
function acquireAttemptWorkspace(runtime, activation, context, currentRunId, signal) {
|
|
601
|
+
return acquireWorkspace(currentRunId, activation.execution?.workspace ?? WorkspaceMode.None, context.workItemId, context.resources, runtime.dependencies.workspaces, signal);
|
|
373
602
|
}
|
|
374
603
|
function existingRun(runs, clock, owner) {
|
|
375
604
|
const completed = runs.find((run) => run.status === RunStatus.Succeeded);
|
|
@@ -378,7 +607,7 @@ function existingRun(runs, clock, owner) {
|
|
|
378
607
|
const ambiguous = runs.find((run) => run.status === RunStatus.Ambiguous);
|
|
379
608
|
if (ambiguous !== undefined)
|
|
380
609
|
return ambiguous;
|
|
381
|
-
const active = runs.find((run) => run.status
|
|
610
|
+
const active = runs.find((run) => isActiveRunStatus(run.status));
|
|
382
611
|
if (active === undefined)
|
|
383
612
|
return undefined;
|
|
384
613
|
if (active.lease !== undefined &&
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ResourceRequirement } from '../../activities/index.js';
|
|
2
|
+
import { type ResourceView } from '../../resources/index.js';
|
|
3
|
+
import type { WorkItemId } from '../../work/index.js';
|
|
4
|
+
import type { RunId } from '../contracts/identifiers.js';
|
|
5
|
+
import { WorkspaceMode } from '../contracts/vocabulary.js';
|
|
6
|
+
import type { WorkspaceLease, WorkspaceProvider } from '../contracts/workspace.js';
|
|
7
|
+
export declare function acquireWorkspace(runId: RunId, mode: typeof WorkspaceMode.None | typeof WorkspaceMode.ReadOnly | typeof WorkspaceMode.Branch, workItemId: WorkItemId, resources: readonly ResourceView[], provider?: WorkspaceProvider, signal?: AbortSignal): Promise<WorkspaceLease | undefined>;
|
|
8
|
+
export declare function validateResourceRequirements(requirements: readonly ResourceRequirement[], resources: readonly ResourceView[]): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ActivityResourceCardinality } from '../../activities/index.js';
|
|
2
2
|
import { BuiltInResourceKind } from '../../resources/index.js';
|
|
3
3
|
import { WorkspaceMode } from '../contracts/vocabulary.js';
|
|
4
|
-
export async function acquireWorkspace(runId, mode, workItemId, resources, provider) {
|
|
4
|
+
export async function acquireWorkspace(runId, mode, workItemId, resources, provider, signal = new AbortController().signal) {
|
|
5
5
|
if (mode === WorkspaceMode.None)
|
|
6
6
|
return undefined;
|
|
7
7
|
if (provider === undefined)
|
|
@@ -11,7 +11,8 @@ export async function acquireWorkspace(runId, mode, workItemId, resources, provi
|
|
|
11
11
|
resource.kind === BuiltInResourceKind.PullRequest);
|
|
12
12
|
if (repositoryResource === undefined)
|
|
13
13
|
throw new Error('Repository Resource is required');
|
|
14
|
-
|
|
14
|
+
signal.throwIfAborted();
|
|
15
|
+
return provider.acquire({ runId, signal, mode, workItemId, repositoryResource });
|
|
15
16
|
}
|
|
16
17
|
export function validateResourceRequirements(requirements, resources) {
|
|
17
18
|
for (const requirement of requirements) {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { CommandContext, EventJournal } from '@atolis-hq/eventing';
|
|
2
|
+
import type { ActivityRegistry } from '../../activities/index.js';
|
|
3
|
+
import type { Clock } from '../../kernel/index.js';
|
|
4
|
+
import type { ExecutionConfig } from '../contracts/config.js';
|
|
5
|
+
import type { RecoveryCoordinator } from '../contracts/control-plane.js';
|
|
6
|
+
import type { AgentRunnerResult } from '../contracts/runner.js';
|
|
7
|
+
import type { RunView } from '../contracts/views.js';
|
|
8
|
+
import { ExecutionFailureCode, ExternalExecutionState, RunStatus } from '../contracts/vocabulary.js';
|
|
9
|
+
export interface ExternalExecutionInspector {
|
|
10
|
+
inspect(reference: NonNullable<RunView['externalExecution']>): Promise<{
|
|
11
|
+
readonly kind: typeof ExternalExecutionState.Running;
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: typeof ExternalExecutionState.Completed;
|
|
14
|
+
readonly result: AgentRunnerResult;
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: typeof ExternalExecutionState.Absent;
|
|
17
|
+
} | {
|
|
18
|
+
readonly kind: typeof ExternalExecutionState.Unknown;
|
|
19
|
+
readonly reason: string;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
export type AmbiguityResolution = {
|
|
23
|
+
readonly kind: typeof RunStatus.Succeeded;
|
|
24
|
+
readonly outcome: unknown;
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: typeof RunStatus.Failed;
|
|
27
|
+
readonly failure: {
|
|
28
|
+
readonly kind: typeof ExecutionFailureCode.Unexpected;
|
|
29
|
+
readonly message: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export interface AmbiguityWorkflowBlocker {
|
|
33
|
+
block(workflowInstanceId: string, reason: string, context: CommandContext): Promise<unknown>;
|
|
34
|
+
}
|
|
35
|
+
export declare class RecoveryService {
|
|
36
|
+
private readonly clock;
|
|
37
|
+
private readonly inspector;
|
|
38
|
+
private readonly activities;
|
|
39
|
+
private readonly config;
|
|
40
|
+
private readonly blocker?;
|
|
41
|
+
private readonly repository;
|
|
42
|
+
constructor(journal: EventJournal, clock: Clock, inspector: ExternalExecutionInspector, activities: Pick<ActivityRegistry, 'validateOutcome'>, config?: Pick<ExecutionConfig, 'leaseDurationMs' | 'leaseRenewalIntervalMs' | 'maxAmbiguityReconciliationAttempts'>, blocker?: AmbiguityWorkflowBlocker | undefined);
|
|
43
|
+
recover(id: string, owner: string): Promise<RunView>;
|
|
44
|
+
resolve(id: string, resolution: AmbiguityResolution, context: CommandContext): Promise<RunView>;
|
|
45
|
+
recoverActive(owner: string, isLocallyActive?: (runId: string) => boolean): Promise<readonly RunView[]>;
|
|
46
|
+
private appendLease;
|
|
47
|
+
private appendRecovered;
|
|
48
|
+
private appendFailure;
|
|
49
|
+
private appendAmbiguity;
|
|
50
|
+
private append;
|
|
51
|
+
}
|
|
52
|
+
export declare function createRecoveryCoordinator(service: RecoveryService): RecoveryCoordinator;
|