@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
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ActivationId } from '../../activities/index.js';
|
|
2
|
+
import { type WorkflowOrchestrationEventData } from '../contracts/events.js';
|
|
3
|
+
import type { ActivityActivationView, WorkflowInstanceView } from '../contracts/views.js';
|
|
4
|
+
type WorkflowFact = WorkflowOrchestrationEventData;
|
|
5
|
+
/**
|
|
6
|
+
* The single source of truth for which orchestration events change a
|
|
7
|
+
* workflow instance's status, and to what — every other consumer that needs
|
|
8
|
+
* to reflect status externally (GitHub labels, the operator board, delivery
|
|
9
|
+
* reactors) must derive from this table rather than hand-matching event
|
|
10
|
+
* types itself, or it silently falls out of sync whenever a new
|
|
11
|
+
* status-changing event type is introduced here.
|
|
12
|
+
*/
|
|
13
|
+
export declare const orchestrationStatusTransitions: Readonly<Partial<Record<WorkflowFact['eventType'], WorkflowInstanceView['status']>>>;
|
|
14
|
+
export type MutableWorkflowInstance = {
|
|
15
|
+
workflowInstanceId: WorkflowInstanceView['workflowInstanceId'];
|
|
16
|
+
workItemId: WorkflowInstanceView['workItemId'];
|
|
17
|
+
workflowName: WorkflowInstanceView['workflowName'];
|
|
18
|
+
workflowDefinitionFingerprint?: string;
|
|
19
|
+
orchestrationGroupId: WorkflowInstanceView['orchestrationGroupId'];
|
|
20
|
+
parentWorkflowInstanceId?: WorkflowInstanceView['parentWorkflowInstanceId'];
|
|
21
|
+
watchId?: string;
|
|
22
|
+
triggerId?: string;
|
|
23
|
+
causalCycleId?: string;
|
|
24
|
+
requestId?: string;
|
|
25
|
+
status: WorkflowInstanceView['status'];
|
|
26
|
+
blockReason?: string;
|
|
27
|
+
currentStage: WorkflowInstanceView['currentStage'];
|
|
28
|
+
pendingActivation?: ActivityActivationView;
|
|
29
|
+
repeatCounts: Record<string, number>;
|
|
30
|
+
retryCounts: Record<string, number>;
|
|
31
|
+
waitingFor?: WorkflowInstanceView['waitingFor'];
|
|
32
|
+
supplementalQueue: Array<WorkflowInstanceView['supplementalQueue'][number]>;
|
|
33
|
+
acceptedSignalIds: string[];
|
|
34
|
+
operatorRetryCommandIds: string[];
|
|
35
|
+
acceptedOutcomes: ActivationId[];
|
|
36
|
+
acceptedChildCompletionIds: WorkflowInstanceView['workflowInstanceId'][];
|
|
37
|
+
causalRejectionIds: string[];
|
|
38
|
+
childCompletionRecorded: boolean;
|
|
39
|
+
lastOutcome?: WorkflowInstanceView['lastOutcome'];
|
|
40
|
+
executionFailure?: WorkflowInstanceView['executionFailure'];
|
|
41
|
+
};
|
|
42
|
+
export declare function applyWorkflowInstanceEvent(state: MutableWorkflowInstance, event: WorkflowFact): void;
|
|
43
|
+
export declare function immutableWorkflowInstanceView(state: MutableWorkflowInstance): WorkflowInstanceView;
|
|
44
|
+
export {};
|
|
@@ -203,6 +203,7 @@ function applyActivityRequested(state, payload) {
|
|
|
203
203
|
...(payload.stage === undefined ? {} : { stage: payload.stage }),
|
|
204
204
|
input: payload.input,
|
|
205
205
|
execution: payload.execution,
|
|
206
|
+
...(payload.sessionPolicy === undefined ? {} : { sessionPolicy: payload.sessionPolicy }),
|
|
206
207
|
status: ActivityActivationStatus.Pending,
|
|
207
208
|
...(payload.followOnIndex === undefined ? {} : { followOnIndex: payload.followOnIndex }),
|
|
208
209
|
...(payload.supplemental === true ? { supplemental: true } : {}),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WorkflowOrchestrationEvent } from '../contracts/events.js';
|
|
2
|
+
import type { WorkflowInstanceView } from '../contracts/views.js';
|
|
3
|
+
import { orchestrationStatusTransitions } from './workflow-instance-events.js';
|
|
4
|
+
export { orchestrationStatusTransitions };
|
|
5
|
+
export declare function foldWorkflowInstance(events: readonly WorkflowOrchestrationEvent[]): WorkflowInstanceView | null;
|
|
6
|
+
/** Applies one decoded journal event to an already-folded workflow view. */
|
|
7
|
+
export declare function continueWorkflowInstance(previous: WorkflowInstanceView | null, event: WorkflowOrchestrationEvent): WorkflowInstanceView | null;
|
|
@@ -3,20 +3,22 @@ import { WorkflowStatus } from '../contracts/vocabulary.js';
|
|
|
3
3
|
import { applyWorkflowInstanceEvent, immutableWorkflowInstanceView, orchestrationStatusTransitions, } from './workflow-instance-events.js';
|
|
4
4
|
export { orchestrationStatusTransitions };
|
|
5
5
|
export function foldWorkflowInstance(events) {
|
|
6
|
-
const first = events.find((event) => event.eventType === OrchestrationEventType.InstanceStarted);
|
|
6
|
+
const first = events.find((event) => event.event.eventType === OrchestrationEventType.InstanceStarted);
|
|
7
7
|
if (first === undefined)
|
|
8
8
|
return null;
|
|
9
|
+
if (first.event.eventType !== OrchestrationEventType.InstanceStarted)
|
|
10
|
+
return null;
|
|
9
11
|
const state = {
|
|
10
12
|
workflowInstanceId: first.stream.id,
|
|
11
|
-
workItemId: first.payload.workItemId,
|
|
12
|
-
workflowName: first.payload.workflowName,
|
|
13
|
-
...(first.payload.workflowDefinitionFingerprint === undefined
|
|
13
|
+
workItemId: first.event.payload.workItemId,
|
|
14
|
+
workflowName: first.event.payload.workflowName,
|
|
15
|
+
...(first.event.payload.workflowDefinitionFingerprint === undefined
|
|
14
16
|
? {}
|
|
15
|
-
: { workflowDefinitionFingerprint: first.payload.workflowDefinitionFingerprint }),
|
|
16
|
-
orchestrationGroupId: first.payload.orchestrationGroupId,
|
|
17
|
-
...optionalChildFields(first.payload),
|
|
17
|
+
: { workflowDefinitionFingerprint: first.event.payload.workflowDefinitionFingerprint }),
|
|
18
|
+
orchestrationGroupId: first.event.payload.orchestrationGroupId,
|
|
19
|
+
...optionalChildFields(first.event.payload),
|
|
18
20
|
status: WorkflowStatus.Active,
|
|
19
|
-
currentStage: first.payload.entry,
|
|
21
|
+
currentStage: first.event.payload.entry,
|
|
20
22
|
repeatCounts: {},
|
|
21
23
|
retryCounts: {},
|
|
22
24
|
supplementalQueue: [],
|
|
@@ -28,7 +30,25 @@ export function foldWorkflowInstance(events) {
|
|
|
28
30
|
childCompletionRecorded: false,
|
|
29
31
|
};
|
|
30
32
|
for (const event of events)
|
|
31
|
-
applyWorkflowInstanceEvent(state, event);
|
|
33
|
+
applyWorkflowInstanceEvent(state, event.event);
|
|
34
|
+
return immutableWorkflowInstanceView(state);
|
|
35
|
+
}
|
|
36
|
+
/** Applies one decoded journal event to an already-folded workflow view. */
|
|
37
|
+
export function continueWorkflowInstance(previous, event) {
|
|
38
|
+
if (previous === null)
|
|
39
|
+
return foldWorkflowInstance([event]);
|
|
40
|
+
const state = {
|
|
41
|
+
...previous,
|
|
42
|
+
repeatCounts: { ...previous.repeatCounts },
|
|
43
|
+
retryCounts: { ...previous.retryCounts },
|
|
44
|
+
supplementalQueue: [...previous.supplementalQueue],
|
|
45
|
+
acceptedSignalIds: [...previous.acceptedSignalIds],
|
|
46
|
+
operatorRetryCommandIds: [...previous.operatorRetryCommandIds],
|
|
47
|
+
acceptedOutcomes: [...previous.acceptedOutcomes],
|
|
48
|
+
acceptedChildCompletionIds: [...previous.acceptedChildCompletionIds],
|
|
49
|
+
causalRejectionIds: [...previous.causalRejectionIds],
|
|
50
|
+
};
|
|
51
|
+
applyWorkflowInstanceEvent(state, event.event);
|
|
32
52
|
return immutableWorkflowInstanceView(state);
|
|
33
53
|
}
|
|
34
54
|
function optionalChildFields(payload) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type MatchMode } from '../../kernel/index.js';
|
|
2
|
+
import type { WorkflowSelectorConfig } from '../contracts/config.js';
|
|
3
|
+
import { type WorkflowName } from '../contracts/identifiers.js';
|
|
4
|
+
export interface WorkflowCandidate {
|
|
5
|
+
readonly tags: readonly string[];
|
|
6
|
+
readonly kind?: string | undefined;
|
|
7
|
+
readonly adapter?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface CompiledWorkflowSelector {
|
|
10
|
+
readonly match: WorkflowSelectorConfig['match'];
|
|
11
|
+
readonly matchMode: MatchMode;
|
|
12
|
+
readonly workflow: WorkflowName;
|
|
13
|
+
}
|
|
14
|
+
export declare function compileWorkflowSelectors(selectors: readonly WorkflowSelectorConfig[]): readonly CompiledWorkflowSelector[];
|
|
15
|
+
export declare function selectWorkflow(candidate: WorkflowCandidate, selectors: readonly CompiledWorkflowSelector[], fallback: WorkflowName): WorkflowName;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from './application/orchestration-projection.js';
|
|
2
|
+
export * from './application/orchestration-repository.js';
|
|
3
|
+
export * from './application/orchestration-service.js';
|
|
4
|
+
export * from './application/advance-workflow.js';
|
|
5
|
+
export * from './application/durable-append.js';
|
|
6
|
+
export * from './application/pull-request-transition-evidence.js';
|
|
7
|
+
export * from './application/resource-transition-evidence.js';
|
|
8
|
+
export * from './application/resource-transition-matching.js';
|
|
9
|
+
export * from './application/resource-transition-reactor.js';
|
|
10
|
+
export * from './application/signal-reactor.js';
|
|
11
|
+
export * from './application/watch-reactor.js';
|
|
12
|
+
export * from './application/trigger-workflow-instance.js';
|
|
13
|
+
export * from './application/workflow-definition-registry.js';
|
|
14
|
+
export * from './contracts/activity-outcome.js';
|
|
15
|
+
export * from './contracts/commands.js';
|
|
16
|
+
export * from './contracts/config.js';
|
|
17
|
+
export * from './contracts/event-decoder.js';
|
|
18
|
+
export * from './contracts/events.js';
|
|
19
|
+
export * from './contracts/event-factory.js';
|
|
20
|
+
export * from './contracts/identifiers.js';
|
|
21
|
+
export * from './contracts/streams.js';
|
|
22
|
+
export * from './contracts/views.js';
|
|
23
|
+
export * from './contracts/vocabulary.js';
|
|
24
|
+
export * from './domain/compiler.js';
|
|
25
|
+
export * from './domain/interpreter.js';
|
|
26
|
+
export * from './domain/workflow-instance.js';
|
|
27
|
+
export * from './domain/workflow-selector.js';
|
|
@@ -16,6 +16,7 @@ export * from './contracts/commands.js';
|
|
|
16
16
|
export * from './contracts/config.js';
|
|
17
17
|
export * from './contracts/event-decoder.js';
|
|
18
18
|
export * from './contracts/events.js';
|
|
19
|
+
export * from './contracts/event-factory.js';
|
|
19
20
|
export * from './contracts/identifiers.js';
|
|
20
21
|
export * from './contracts/streams.js';
|
|
21
22
|
export * from './contracts/views.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ProjectionDefinition } from '@atolis-hq/eventing';
|
|
2
|
+
import type { ResourceId } from '../contracts/identifiers.js';
|
|
3
|
+
import type { ExternalResourceKey, ResourceCorrelationView } from '../contracts/views.js';
|
|
4
|
+
export declare const externalKeyProjectionKey: (externalKey: ExternalResourceKey) => string;
|
|
5
|
+
export declare const resourcesByExternalKeyProjection: ProjectionDefinition<ResourceId | null>;
|
|
6
|
+
export declare const workCorrelationsProjection: ProjectionDefinition<readonly ResourceCorrelationView[]>;
|
|
@@ -4,14 +4,14 @@ export const resourcesByExternalKeyProjection = {
|
|
|
4
4
|
name: 'resources-by-external-key',
|
|
5
5
|
select(event) {
|
|
6
6
|
const owned = selectResourceEvent(event);
|
|
7
|
-
return owned?.eventType === ResourceEventType.ResourceDiscovered
|
|
8
|
-
? { key: externalKeyProjectionKey(owned.payload.externalKey) }
|
|
7
|
+
return owned?.event.eventType === ResourceEventType.ResourceDiscovered
|
|
8
|
+
? { key: externalKeyProjectionKey(owned.event.payload.externalKey) }
|
|
9
9
|
: null;
|
|
10
10
|
},
|
|
11
11
|
initial: () => null,
|
|
12
12
|
project(previous, event) {
|
|
13
13
|
const owned = selectResourceEvent(event);
|
|
14
|
-
if (owned?.eventType !== ResourceEventType.ResourceDiscovered)
|
|
14
|
+
if (owned?.event.eventType !== ResourceEventType.ResourceDiscovered)
|
|
15
15
|
return previous;
|
|
16
16
|
return previous ?? owned.stream.id;
|
|
17
17
|
},
|
|
@@ -20,30 +20,30 @@ export const workCorrelationsProjection = {
|
|
|
20
20
|
name: 'work-correlations',
|
|
21
21
|
select(event) {
|
|
22
22
|
const owned = selectResourceEvent(event);
|
|
23
|
-
if (owned?.eventType === ResourceEventType.WorkCorrelationEstablished)
|
|
24
|
-
return { key: owned.payload.workItemId };
|
|
25
|
-
if (owned?.eventType === ResourceEventType.WorkCorrelationRetracted)
|
|
26
|
-
return { key: owned.payload.workItemId };
|
|
27
|
-
if (owned?.eventType === ResourceEventType.WorkCorrelationConflicted)
|
|
28
|
-
return { key: owned.payload.workItemId };
|
|
23
|
+
if (owned?.event.eventType === ResourceEventType.WorkCorrelationEstablished)
|
|
24
|
+
return { key: owned.event.payload.workItemId };
|
|
25
|
+
if (owned?.event.eventType === ResourceEventType.WorkCorrelationRetracted)
|
|
26
|
+
return { key: owned.event.payload.workItemId };
|
|
27
|
+
if (owned?.event.eventType === ResourceEventType.WorkCorrelationConflicted)
|
|
28
|
+
return { key: owned.event.payload.workItemId };
|
|
29
29
|
return null;
|
|
30
30
|
},
|
|
31
31
|
initial: () => [],
|
|
32
32
|
project(previous, event) {
|
|
33
33
|
const owned = selectResourceEvent(event);
|
|
34
|
-
if (owned?.eventType === ResourceEventType.WorkCorrelationEstablished) {
|
|
34
|
+
if (owned?.event.eventType === ResourceEventType.WorkCorrelationEstablished) {
|
|
35
35
|
const correlation = {
|
|
36
36
|
resourceId: owned.stream.id,
|
|
37
|
-
workItemId: owned.payload.workItemId,
|
|
38
|
-
role: owned.payload.role,
|
|
39
|
-
provenance: owned.payload.provenance,
|
|
40
|
-
establishedByEventId: owned.eventId,
|
|
37
|
+
workItemId: owned.event.payload.workItemId,
|
|
38
|
+
role: owned.event.payload.role,
|
|
39
|
+
provenance: owned.event.payload.provenance,
|
|
40
|
+
establishedByEventId: owned.event.eventId,
|
|
41
41
|
};
|
|
42
42
|
return previous.some((value) => value.resourceId === correlation.resourceId)
|
|
43
43
|
? previous
|
|
44
44
|
: [...previous, correlation];
|
|
45
45
|
}
|
|
46
|
-
if (owned?.eventType === ResourceEventType.WorkCorrelationRetracted)
|
|
46
|
+
if (owned?.event.eventType === ResourceEventType.WorkCorrelationRetracted)
|
|
47
47
|
return previous.filter((value) => value.resourceId !== owned.stream.id);
|
|
48
48
|
return previous;
|
|
49
49
|
},
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type CommandContext } from '@atolis-hq/eventing';
|
|
2
|
+
import type { ResourceId } from '../contracts/identifiers.js';
|
|
3
|
+
import type { ResourceExternalOutcome } from '../contracts/vocabulary.js';
|
|
4
|
+
import type { ResourceRepository } from './resource-repository.js';
|
|
5
|
+
export declare function observeExternalOutcome(repository: ResourceRepository, resourceId: ResourceId, observation: {
|
|
6
|
+
readonly sourceObservationId: string;
|
|
7
|
+
readonly outcome?: ResourceExternalOutcome;
|
|
8
|
+
readonly revision: string;
|
|
9
|
+
}, context: CommandContext): Promise<void>;
|
|
10
|
+
export declare function pendingExternalOutcomes(repository: ResourceRepository): Promise<readonly {
|
|
11
|
+
readonly resourceId: ResourceId;
|
|
12
|
+
readonly outcome: ResourceExternalOutcome;
|
|
13
|
+
readonly sourceObservationId: string;
|
|
14
|
+
}[]>;
|
|
15
|
+
export declare function noteMissingPrimaryCorrelation(repository: ResourceRepository, resourceId: ResourceId, reason: string, context: CommandContext): Promise<void>;
|
|
16
|
+
export declare function retryPendingWorkCorrelations(repository: ResourceRepository): Promise<number>;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { correlationId,
|
|
2
|
-
import { ResourceEventType
|
|
3
|
-
import { resourceStream } from '../contracts/streams.js';
|
|
1
|
+
import { correlationId, EventActorKind } from '@atolis-hq/eventing';
|
|
2
|
+
import { ResourceEventType } from '../contracts/events.js';
|
|
4
3
|
import { ResourceCorrelationRole } from '../contracts/vocabulary.js';
|
|
4
|
+
import { appendResourceEvent, resourceDraft, } from './resource-event-support.js';
|
|
5
5
|
export async function observeExternalOutcome(repository, resourceId, observation, context) {
|
|
6
6
|
if (observation.outcome === undefined) {
|
|
7
|
-
await appendResourceEvent(repository, resourceId, resourceDraft(
|
|
8
|
-
|
|
7
|
+
await appendResourceEvent(repository, resourceId, resourceDraft(context, {
|
|
8
|
+
eventType: ResourceEventType.ExternalOutcomeReopened,
|
|
9
|
+
payload: { revision: observation.revision },
|
|
9
10
|
}));
|
|
10
11
|
return;
|
|
11
12
|
}
|
|
12
|
-
await appendResourceEvent(repository, resourceId, resourceDraft(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
await appendResourceEvent(repository, resourceId, resourceDraft(context, {
|
|
14
|
+
eventType: ResourceEventType.ExternalOutcomeObserved,
|
|
15
|
+
payload: {
|
|
16
|
+
sourceObservationId: observation.sourceObservationId,
|
|
17
|
+
outcome: observation.outcome,
|
|
18
|
+
revision: observation.revision,
|
|
19
|
+
},
|
|
16
20
|
}));
|
|
17
21
|
}
|
|
18
22
|
export async function pendingExternalOutcomes(repository) {
|
|
@@ -33,9 +37,9 @@ export async function noteMissingPrimaryCorrelation(repository, resourceId, reas
|
|
|
33
37
|
if (retryAttempts(loaded.resource.events) > 0)
|
|
34
38
|
return;
|
|
35
39
|
await repository.append(resourceId, loaded.sequence, [
|
|
36
|
-
resourceDraft(
|
|
37
|
-
|
|
38
|
-
lastFailureReason: reason,
|
|
40
|
+
resourceDraft(context, {
|
|
41
|
+
eventType: ResourceEventType.WorkCorrelationRetryPending,
|
|
42
|
+
payload: { attemptCount: 1, lastFailureReason: reason },
|
|
39
43
|
}),
|
|
40
44
|
]);
|
|
41
45
|
}
|
|
@@ -52,7 +56,8 @@ export async function retryPendingWorkCorrelations(repository) {
|
|
|
52
56
|
continue;
|
|
53
57
|
const last = [...loaded.resource.events]
|
|
54
58
|
.reverse()
|
|
55
|
-
.
|
|
59
|
+
.map((event) => event.event)
|
|
60
|
+
.find(isCorrelationRetryPending);
|
|
56
61
|
const reason = last?.payload.lastFailureReason ?? 'Resource has no active primary WorkItem correlation';
|
|
57
62
|
const attemptCount = attempts + 1;
|
|
58
63
|
const context = {
|
|
@@ -61,21 +66,28 @@ export async function retryPendingWorkCorrelations(repository) {
|
|
|
61
66
|
occurredAt: new Date().toISOString(),
|
|
62
67
|
actor: { kind: EventActorKind.System, id: 'resource-service' },
|
|
63
68
|
};
|
|
64
|
-
const
|
|
65
|
-
?
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
const input = attemptCount >= 4
|
|
70
|
+
? {
|
|
71
|
+
eventType: ResourceEventType.WorkCorrelationUnresolvable,
|
|
72
|
+
payload: {
|
|
73
|
+
externalKey: loaded.resource.view.externalKey,
|
|
74
|
+
attemptCount,
|
|
75
|
+
lastFailureReason: reason,
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
: {
|
|
79
|
+
eventType: ResourceEventType.WorkCorrelationRetryPending,
|
|
80
|
+
payload: { attemptCount, lastFailureReason: reason },
|
|
81
|
+
};
|
|
82
|
+
const draft = resourceDraft(context, input);
|
|
74
83
|
await repository.append(resourceId, loaded.sequence, [draft]);
|
|
75
84
|
processed += 1;
|
|
76
85
|
}
|
|
77
86
|
return processed;
|
|
78
87
|
}
|
|
88
|
+
function isCorrelationRetryPending(event) {
|
|
89
|
+
return event.eventType === ResourceEventType.WorkCorrelationRetryPending;
|
|
90
|
+
}
|
|
79
91
|
function hasPrimary(correlations) {
|
|
80
92
|
return correlations.some((value) => value.role === ResourceCorrelationRole.Primary);
|
|
81
93
|
}
|
|
@@ -83,28 +95,11 @@ function retryAttempts(events) {
|
|
|
83
95
|
let attempts = 0;
|
|
84
96
|
for (let index = events.length - 1; index >= 0; index -= 1) {
|
|
85
97
|
const event = events[index];
|
|
86
|
-
if (event.eventType === ResourceEventType.WorkCorrelationEstablished &&
|
|
87
|
-
event.payload.role === ResourceCorrelationRole.Primary)
|
|
98
|
+
if (event.event.eventType === ResourceEventType.WorkCorrelationEstablished &&
|
|
99
|
+
event.event.payload.role === ResourceCorrelationRole.Primary)
|
|
88
100
|
break;
|
|
89
|
-
if (event.eventType === ResourceEventType.WorkCorrelationRetryPending)
|
|
90
|
-
attempts = Math.max(attempts, event.payload.attemptCount);
|
|
101
|
+
if (event.event.eventType === ResourceEventType.WorkCorrelationRetryPending)
|
|
102
|
+
attempts = Math.max(attempts, event.event.payload.attemptCount);
|
|
91
103
|
}
|
|
92
104
|
return attempts;
|
|
93
105
|
}
|
|
94
|
-
async function appendResourceEvent(repository, resourceId, draft) {
|
|
95
|
-
const loaded = await repository.load(resourceId);
|
|
96
|
-
await repository.append(resourceId, loaded.sequence, [draft]);
|
|
97
|
-
}
|
|
98
|
-
function resourceDraft(resourceId, context, eventType, payload) {
|
|
99
|
-
return createEventDraft({
|
|
100
|
-
eventId: `${context.commandId}:${eventType}`,
|
|
101
|
-
eventType,
|
|
102
|
-
occurredAt: context.occurredAt,
|
|
103
|
-
correlationId: context.correlationId,
|
|
104
|
-
causationId: context.commandId,
|
|
105
|
-
actor: context.actor,
|
|
106
|
-
source: { kind: EventSourceKind.Internal, id: 'resource-service' },
|
|
107
|
-
stream: resourceStream(resourceId),
|
|
108
|
-
payload,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CommandContext } from '@atolis-hq/eventing';
|
|
2
|
+
import { type ResourceEventData, type ResourceEventPayloads } from '../contracts/events.js';
|
|
3
|
+
import type { ResourceId } from '../contracts/identifiers.js';
|
|
4
|
+
import type { ResourceRepository } from './resource-repository.js';
|
|
5
|
+
export declare function appendResourceEvent(repository: ResourceRepository, resourceId: ResourceId, draft: ResourceEventData): Promise<void>;
|
|
6
|
+
export type ResourceDraftInput = {
|
|
7
|
+
[Type in keyof ResourceEventPayloads]: {
|
|
8
|
+
readonly eventType: Type;
|
|
9
|
+
readonly payload: ResourceEventPayloads[Type];
|
|
10
|
+
};
|
|
11
|
+
}[keyof ResourceEventPayloads];
|
|
12
|
+
export declare function resourceDraft(context: CommandContext, input: ResourceDraftInput): ResourceEventData;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventSourceKind } from '@atolis-hq/eventing';
|
|
2
|
+
import { createResourceEventData } from '../contracts/event-factory.js';
|
|
3
|
+
export async function appendResourceEvent(repository, resourceId, draft) {
|
|
4
|
+
const loaded = await repository.load(resourceId);
|
|
5
|
+
await repository.append(resourceId, loaded.sequence, [draft]);
|
|
6
|
+
}
|
|
7
|
+
export function resourceDraft(context, input) {
|
|
8
|
+
return createResourceEventData({
|
|
9
|
+
eventId: `${context.commandId}:${input.eventType}`,
|
|
10
|
+
occurredAt: context.occurredAt,
|
|
11
|
+
correlationId: context.correlationId,
|
|
12
|
+
causationId: context.commandId,
|
|
13
|
+
actor: context.actor,
|
|
14
|
+
source: { kind: EventSourceKind.Internal, id: 'resource-service' },
|
|
15
|
+
...input,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { EventJournal, ProjectionStore } from '@atolis-hq/eventing';
|
|
2
|
+
import type { WorkItemId } from '../../work/index.js';
|
|
3
|
+
import type { ResourceId } from '../contracts/identifiers.js';
|
|
4
|
+
import type { ExternalResourceKey, ResourceCorrelationView } from '../contracts/views.js';
|
|
5
|
+
export interface ResourceLookup {
|
|
6
|
+
resourceIdForExternalKey(externalKey: ExternalResourceKey): Promise<ResourceId | null>;
|
|
7
|
+
correlationsForWork(workItemId: WorkItemId): Promise<readonly ResourceCorrelationView[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the active primary correlation, or the most recently retracted
|
|
10
|
+
* primary correlation when the Resource has no active primary.
|
|
11
|
+
*/
|
|
12
|
+
primaryCorrelation(resourceId: ResourceId): Promise<ResourceCorrelationView | null>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createResourceLookup(dependencies: {
|
|
15
|
+
readonly journal: EventJournal;
|
|
16
|
+
readonly projections: ProjectionStore;
|
|
17
|
+
}): ResourceLookup;
|
|
@@ -20,19 +20,19 @@ export function createResourceLookup(dependencies) {
|
|
|
20
20
|
const retracted = [];
|
|
21
21
|
for (const event of await dependencies.journal.readStream(resourceStream(resourceId))) {
|
|
22
22
|
const owned = selectResourceEvent(event);
|
|
23
|
-
if (owned?.eventType === ResourceEventType.WorkCorrelationEstablished) {
|
|
24
|
-
active.set(owned.payload.workItemId, {
|
|
23
|
+
if (owned?.event.eventType === ResourceEventType.WorkCorrelationEstablished) {
|
|
24
|
+
active.set(owned.event.payload.workItemId, {
|
|
25
25
|
resourceId,
|
|
26
|
-
workItemId: owned.payload.workItemId,
|
|
27
|
-
role: owned.payload.role,
|
|
28
|
-
provenance: owned.payload.provenance,
|
|
29
|
-
establishedByEventId: owned.eventId,
|
|
26
|
+
workItemId: owned.event.payload.workItemId,
|
|
27
|
+
role: owned.event.payload.role,
|
|
28
|
+
provenance: owned.event.payload.provenance,
|
|
29
|
+
establishedByEventId: owned.event.eventId,
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
if (owned?.eventType === ResourceEventType.WorkCorrelationRetracted) {
|
|
33
|
-
const correlation = active.get(owned.payload.workItemId);
|
|
32
|
+
if (owned?.event.eventType === ResourceEventType.WorkCorrelationRetracted) {
|
|
33
|
+
const correlation = active.get(owned.event.payload.workItemId);
|
|
34
34
|
if (correlation !== undefined) {
|
|
35
|
-
active.delete(owned.payload.workItemId);
|
|
35
|
+
active.delete(owned.event.payload.workItemId);
|
|
36
36
|
if (correlation.role === ResourceCorrelationRole.Primary)
|
|
37
37
|
retracted.push(correlation);
|
|
38
38
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ProjectionDefinition } from '@atolis-hq/eventing';
|
|
2
|
+
import type { ResourceCorrelationView, ResourceView } from '../contracts/views.js';
|
|
3
|
+
export declare const resourceProjection: ProjectionDefinition<ResourceView | null>;
|
|
4
|
+
export declare const resourceCorrelationProjection: ProjectionDefinition<readonly ResourceCorrelationView[]>;
|
|
@@ -12,37 +12,44 @@ export const resourceProjection = {
|
|
|
12
12
|
const owned = selectResourceEvent(event);
|
|
13
13
|
if (owned === null)
|
|
14
14
|
return previous;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const resourceEvent = owned.event;
|
|
16
|
+
if (isExternalOutcome(resourceEvent))
|
|
17
|
+
return projectExternalOutcome(previous, resourceEvent);
|
|
18
|
+
if (isCorrelationRetry(resourceEvent))
|
|
19
|
+
return projectCorrelationRetry(previous, resourceEvent);
|
|
20
|
+
switch (resourceEvent.eventType) {
|
|
20
21
|
case ResourceEventType.ResourceDiscovered:
|
|
21
22
|
return {
|
|
22
23
|
resourceId: owned.stream.id,
|
|
23
|
-
kind:
|
|
24
|
-
externalKey:
|
|
25
|
-
capabilities:
|
|
26
|
-
...(
|
|
27
|
-
|
|
24
|
+
kind: resourceEvent.payload.kind,
|
|
25
|
+
externalKey: resourceEvent.payload.externalKey,
|
|
26
|
+
capabilities: resourceEvent.payload.capabilities,
|
|
27
|
+
...(resourceEvent.payload.revision === undefined
|
|
28
|
+
? {}
|
|
29
|
+
: { revision: resourceEvent.payload.revision }),
|
|
30
|
+
...(resourceEvent.payload.title === undefined
|
|
31
|
+
? {}
|
|
32
|
+
: { title: resourceEvent.payload.title }),
|
|
28
33
|
};
|
|
29
34
|
case ResourceEventType.ResourceRevisionObserved:
|
|
30
|
-
return previous === null
|
|
35
|
+
return previous === null
|
|
36
|
+
? previous
|
|
37
|
+
: { ...previous, revision: resourceEvent.payload.revision };
|
|
31
38
|
case ResourceEventType.WorkCorrelationConflicted:
|
|
32
39
|
return previous === null
|
|
33
40
|
? previous
|
|
34
41
|
: {
|
|
35
42
|
...previous,
|
|
36
43
|
primaryCorrelationConflict: {
|
|
37
|
-
attemptedWorkItemId:
|
|
38
|
-
existingWorkItemId:
|
|
39
|
-
eventId:
|
|
44
|
+
attemptedWorkItemId: resourceEvent.payload.workItemId,
|
|
45
|
+
existingWorkItemId: resourceEvent.payload.existingWorkItemId,
|
|
46
|
+
eventId: resourceEvent.eventId,
|
|
40
47
|
},
|
|
41
48
|
};
|
|
42
49
|
case ResourceEventType.WorkCorrelationEstablished:
|
|
43
50
|
return previous === null
|
|
44
51
|
? previous
|
|
45
|
-
:
|
|
52
|
+
: resourceEvent.payload.role === ResourceCorrelationRole.Primary
|
|
46
53
|
? withoutCorrelationStatus(previous)
|
|
47
54
|
: previous;
|
|
48
55
|
case ResourceEventType.WorkCorrelationRetracted:
|
|
@@ -50,7 +57,7 @@ export const resourceProjection = {
|
|
|
50
57
|
case ResourceEventType.IssueCompletionObservationSuperseded:
|
|
51
58
|
return previous;
|
|
52
59
|
default:
|
|
53
|
-
return assertNever(
|
|
60
|
+
return assertNever(resourceEvent);
|
|
54
61
|
}
|
|
55
62
|
},
|
|
56
63
|
};
|
|
@@ -107,25 +114,26 @@ export const resourceCorrelationProjection = {
|
|
|
107
114
|
const owned = selectResourceEvent(event);
|
|
108
115
|
if (owned === null)
|
|
109
116
|
return previous;
|
|
110
|
-
|
|
117
|
+
const resourceEvent = owned.event;
|
|
118
|
+
if (!changesCorrelation(resourceEvent))
|
|
111
119
|
return previous;
|
|
112
|
-
switch (
|
|
120
|
+
switch (resourceEvent.eventType) {
|
|
113
121
|
case ResourceEventType.WorkCorrelationEstablished: {
|
|
114
122
|
const correlation = {
|
|
115
123
|
resourceId: owned.stream.id,
|
|
116
|
-
workItemId:
|
|
117
|
-
role:
|
|
118
|
-
provenance:
|
|
119
|
-
establishedByEventId:
|
|
124
|
+
workItemId: resourceEvent.payload.workItemId,
|
|
125
|
+
role: resourceEvent.payload.role,
|
|
126
|
+
provenance: resourceEvent.payload.provenance,
|
|
127
|
+
establishedByEventId: resourceEvent.eventId,
|
|
120
128
|
};
|
|
121
129
|
return previous.some((value) => value.workItemId === correlation.workItemId)
|
|
122
130
|
? previous
|
|
123
131
|
: [...previous, correlation];
|
|
124
132
|
}
|
|
125
133
|
case ResourceEventType.WorkCorrelationRetracted:
|
|
126
|
-
return previous.filter((value) => value.workItemId !==
|
|
134
|
+
return previous.filter((value) => value.workItemId !== resourceEvent.payload.workItemId);
|
|
127
135
|
default:
|
|
128
|
-
return assertNever(
|
|
136
|
+
return assertNever(resourceEvent);
|
|
129
137
|
}
|
|
130
138
|
},
|
|
131
139
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type EventJournal } from '@atolis-hq/eventing';
|
|
2
|
+
import { type ResourceEvent, type ResourceEventData } from '../contracts/events.js';
|
|
3
|
+
import type { ResourceId } from '../contracts/identifiers.js';
|
|
4
|
+
import { type FoldedResource } from '../domain/resource.js';
|
|
5
|
+
export interface LoadedResource {
|
|
6
|
+
readonly sequence: number;
|
|
7
|
+
readonly resource: FoldedResource | null;
|
|
8
|
+
}
|
|
9
|
+
export declare class ResourceRepository {
|
|
10
|
+
private readonly journal;
|
|
11
|
+
private readonly resourceIds;
|
|
12
|
+
constructor(journal: EventJournal);
|
|
13
|
+
load(resourceId: ResourceId): Promise<LoadedResource>;
|
|
14
|
+
append(resourceId: ResourceId, expectedSequence: number, drafts: readonly ResourceEventData[]): Promise<readonly ResourceEvent[]>;
|
|
15
|
+
listResourceIds(): Promise<readonly ResourceId[]>;
|
|
16
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cachedJournalView
|
|
1
|
+
import { cachedJournalView } from '@atolis-hq/eventing';
|
|
2
2
|
import { ResourceEventType, decodeResourceEvent, selectResourceEvent, } from '../contracts/events.js';
|
|
3
3
|
import { resourceStream } from '../contracts/streams.js';
|
|
4
4
|
import { foldResource } from '../domain/resource.js';
|
|
@@ -15,7 +15,7 @@ export class ResourceRepository {
|
|
|
15
15
|
return { sequence: events.length, resource: foldResource(owned) };
|
|
16
16
|
}
|
|
17
17
|
async append(resourceId, expectedSequence, drafts) {
|
|
18
|
-
const events = await this.journal.
|
|
18
|
+
const events = await this.journal.appendToStream(resourceStream(resourceId), expectedSequence, drafts);
|
|
19
19
|
return events.map(decodeResourceEvent);
|
|
20
20
|
}
|
|
21
21
|
async listResourceIds() {
|
|
@@ -26,7 +26,7 @@ function deriveResourceIds(events) {
|
|
|
26
26
|
return [
|
|
27
27
|
...new Set(events
|
|
28
28
|
.map(selectResourceEvent)
|
|
29
|
-
.filter((event) => event?.eventType === ResourceEventType.ResourceDiscovered)
|
|
29
|
+
.filter((event) => event?.event.eventType === ResourceEventType.ResourceDiscovered)
|
|
30
30
|
.map((event) => event.stream.id)),
|
|
31
31
|
];
|
|
32
32
|
}
|