@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
package/docker/Dockerfile
CHANGED
|
@@ -37,12 +37,16 @@ RUN echo "cursor cache bust: ${CURSOR_CACHE_BUST}" \
|
|
|
37
37
|
|
|
38
38
|
WORKDIR /app
|
|
39
39
|
COPY package*.json ./
|
|
40
|
+
COPY packages/eventing/package.json packages/eventing/package.json
|
|
41
|
+
COPY packages/eventing-filesystem/package.json packages/eventing-filesystem/package.json
|
|
40
42
|
COPY src/surfaces/web/package.json src/surfaces/web/package.json
|
|
41
43
|
RUN --mount=type=cache,target=/root/.npm \
|
|
42
44
|
if [ -f package-lock.json ]; then npm ci --include=dev; else npm install; fi
|
|
43
45
|
|
|
44
|
-
COPY tsconfig.json tsconfig.docker.json ./
|
|
46
|
+
COPY tsconfig.json tsconfig.base.json tsconfig.app.json tsconfig.docker.json ./
|
|
47
|
+
COPY packages/ packages/
|
|
45
48
|
COPY scripts/embed-version.mjs scripts/embed-version.mjs
|
|
49
|
+
COPY scripts/embed-runtime-workspaces.mjs scripts/embed-runtime-workspaces.mjs
|
|
46
50
|
COPY assets/ assets/
|
|
47
51
|
COPY src/ src/
|
|
48
52
|
ARG WAKE_BUILD_TAG
|
|
@@ -75,9 +79,7 @@ EXPOSE 4317
|
|
|
75
79
|
# that's fine since it's the very first thing that runs.
|
|
76
80
|
ENV WAKE_MAIN_JS=/app/dist/src/main.js
|
|
77
81
|
|
|
78
|
-
#
|
|
79
|
-
#
|
|
80
|
-
#
|
|
81
|
-
|
|
82
|
-
# before wake start ever runs.
|
|
83
|
-
ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake; chown -R wake:wake /wake/.wake || true; exec su wake -s /bin/sh -c 'if [ \"$WAKE_START_ENABLED\" = \"true\" ]; then exec node /app/dist/src/main.js start --wake-root /wake --no-sandbox; else exec sleep infinity; fi'"]
|
|
82
|
+
# Startup ownership repair is best effort because bind-mounted paths or host
|
|
83
|
+
# permissions may prevent chown. The bounded direct-child pass avoids traversing
|
|
84
|
+
# accumulated runtime data.
|
|
85
|
+
ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake; chown wake:wake /wake/.wake || true; find /wake/.wake -mindepth 1 -maxdepth 1 -type d -exec chown wake:wake {} + || true; exec su wake -s /bin/sh -c 'if [ \"$WAKE_START_ENABLED\" = \"true\" ]; then exec node /app/dist/src/main.js start --wake-root /wake --no-sandbox; else exec sleep infinity; fi'"]
|
|
@@ -62,9 +62,7 @@ EXPOSE 4317
|
|
|
62
62
|
# `wake` binary that `npm install -g` puts on PATH, rather than a hardcoded
|
|
63
63
|
# npm global lib path that varies by npm/OS setup.
|
|
64
64
|
#
|
|
65
|
-
#
|
|
66
|
-
#
|
|
67
|
-
#
|
|
68
|
-
|
|
69
|
-
# before wake start ever runs.
|
|
70
|
-
ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake; chown -R wake:wake /wake/.wake || true; exec su wake -s /bin/sh -c 'exec wake sandbox-entrypoint'"]
|
|
65
|
+
# Startup ownership repair is best effort because bind-mounted paths or host
|
|
66
|
+
# permissions may prevent chown. The bounded direct-child pass avoids traversing
|
|
67
|
+
# accumulated runtime data.
|
|
68
|
+
ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake; chown wake:wake /wake/.wake || true; find /wake/.wake -mindepth 1 -maxdepth 1 -type d -exec chown wake:wake {} + || true; exec su wake -s /bin/sh -c 'exec wake sandbox-entrypoint'"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atolis-hq/wake",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "Local autonomous agent control plane for software development",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"workspaces": [
|
|
12
|
+
"packages/*",
|
|
12
13
|
"src/surfaces/web"
|
|
13
14
|
],
|
|
14
15
|
"bin": {
|
|
@@ -32,43 +33,43 @@
|
|
|
32
33
|
"access": "public"
|
|
33
34
|
},
|
|
34
35
|
"scripts": {
|
|
35
|
-
"build": "tsc
|
|
36
|
+
"build": "tsc --build tsconfig.json && node scripts/embed-version.mjs && node scripts/embed-runtime-workspaces.mjs && node scripts/check-cli-entrypoint.mjs",
|
|
36
37
|
"prepack": "npm run build && npm run build:web",
|
|
38
|
+
"check:workspace-packages": "node scripts/check-workspace-packages.mjs",
|
|
37
39
|
"test": "npm run test:unit",
|
|
38
40
|
"test:fast": "npm run test:unit",
|
|
39
41
|
"check:catalogue": "node scripts/check-functional-catalogue.mjs",
|
|
40
42
|
"check:scenarios": "node scripts/check-scenario-coverage.mjs",
|
|
41
43
|
"check:specs": "node scripts/check-specs.mjs",
|
|
42
44
|
"check:specs:report": "node scripts/report-spec-drift.mjs",
|
|
43
|
-
"lint:architecture": "node scripts/check-module-manifests.mjs && node scripts/check-contract-vocabulary.mjs && depcruise --config dependency-cruiser.config.mjs src",
|
|
44
|
-
"build:docker": "tsc
|
|
45
|
-
"build:
|
|
46
|
-
"
|
|
45
|
+
"lint:architecture": "node scripts/check-module-manifests.mjs && node scripts/check-contract-vocabulary.mjs && node scripts/check-event-architecture.mjs && depcruise --config dependency-cruiser.config.mjs src packages",
|
|
46
|
+
"build:docker": "tsc --build tsconfig.docker.json && node scripts/embed-version.mjs && node scripts/embed-runtime-workspaces.mjs && npm run build:web",
|
|
47
|
+
"build:eventing-packages": "tsc --build packages/eventing-filesystem/tsconfig.json",
|
|
48
|
+
"build:web": "npm run build:eventing-packages && npm --workspace @atolis-hq/wake-web run build",
|
|
49
|
+
"test:web": "npm run build:eventing-packages && npm --workspace @atolis-hq/wake-web run test",
|
|
47
50
|
"test:web:e2e": "npm --workspace @atolis-hq/wake-web run test:e2e",
|
|
48
|
-
"test:unit": "
|
|
51
|
+
"test:unit": "npm --workspace @atolis-hq/eventing test && npm --workspace @atolis-hq/eventing-filesystem test && npm run test:unit:wake",
|
|
52
|
+
"test:unit:wake": "vitest run --config vitest.unit.config.ts",
|
|
49
53
|
"test:architecture": "vitest run --config vitest.architecture.config.ts",
|
|
50
54
|
"test:integration": "vitest run --config vitest.integration.config.ts",
|
|
51
55
|
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
52
56
|
"test:e2e:live": "vitest run --config vitest.live-e2e.config.ts",
|
|
53
57
|
"lint:contracts": "node scripts/check-contract-vocabulary.mjs",
|
|
54
58
|
"knip": "knip --config knip.json",
|
|
55
|
-
"lint": "eslint .",
|
|
59
|
+
"lint": "eslint --cache --cache-strategy content --cache-location node_modules/.cache/eslint/.eslintcache .",
|
|
56
60
|
"format": "prettier --write .",
|
|
57
61
|
"format:check": "prettier --check .",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"smoke
|
|
64
|
-
"smoke:
|
|
65
|
-
"smoke:
|
|
66
|
-
"
|
|
67
|
-
"verify
|
|
68
|
-
"
|
|
69
|
-
},
|
|
70
|
-
"lint-staged": {
|
|
71
|
-
"*.{ts,tsx,js,mjs,cjs,json,yaml,yml,css,html}": "prettier --write"
|
|
62
|
+
"check:source-resolution": "tsx --tsconfig tsconfig.source.json scripts/check-workspace-source-resolution.ts",
|
|
63
|
+
"start": "tsx --tsconfig tsconfig.source.json src/main.ts start",
|
|
64
|
+
"tick": "tsx --tsconfig tsconfig.source.json src/main.ts tick",
|
|
65
|
+
"ui": "tsx --tsconfig tsconfig.source.json src/main.ts ui",
|
|
66
|
+
"e2e:github-fake": "tsx --tsconfig tsconfig.source.json scripts/e2e-github-fake.ts",
|
|
67
|
+
"smoke": "tsx --tsconfig tsconfig.source.json src/main.ts smoke",
|
|
68
|
+
"smoke:claude": "tsx --tsconfig tsconfig.source.json src/main.ts smoke claude",
|
|
69
|
+
"smoke:codex": "tsx --tsconfig tsconfig.source.json src/main.ts smoke codex",
|
|
70
|
+
"smoke:cursor": "tsx --tsconfig tsconfig.source.json src/main.ts smoke cursor",
|
|
71
|
+
"verify": "npm run check:catalogue && npm run check:scenarios && npm run check:specs:report && npm run lint:architecture && npm run lint && npm run format:check && npm run check:source-resolution && npm run build && npm run test:unit",
|
|
72
|
+
"verify:ci": "npm run verify && npm run test:architecture && npm run check:workspace-packages && npm run test:integration && npm run test:e2e && npm run knip && npm run test:web"
|
|
72
73
|
},
|
|
73
74
|
"dependencies": {
|
|
74
75
|
"@fastify/rate-limit": "^11.2.0",
|
|
@@ -92,9 +93,8 @@
|
|
|
92
93
|
"eslint": "^10.8.0",
|
|
93
94
|
"eslint-config-prettier": "^10.1.8",
|
|
94
95
|
"globals": "^17.7.0",
|
|
95
|
-
"husky": "^9.1.7",
|
|
96
96
|
"knip": "^5.88.1",
|
|
97
|
-
"
|
|
97
|
+
"lefthook": "^2.1.12",
|
|
98
98
|
"prettier": "^3.9.6",
|
|
99
99
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
100
100
|
"tsx": "^4.23.1",
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { createEventDraft, EventSourceKind } from '../../kernel/index.js';
|
|
2
|
-
import { resourceStream } from '../../resources/index.js';
|
|
3
|
-
import { ActivityEventType, } from '../contracts/events.js';
|
|
4
|
-
import { activationId } from '../contracts/identifiers.js';
|
|
5
|
-
import { isReviewAuthorized } from '../review/authorization.js';
|
|
6
|
-
export const discovered = ({ resourceId, ...command }, context) => fact(resourceId, ActivityEventType.PrDiscovered, command, context);
|
|
7
|
-
export const revisionChanged = (command, context) => fact(command.resourceId, ActivityEventType.PrRevisionChanged, {
|
|
8
|
-
headRevision: command.headRevision,
|
|
9
|
-
baseRevision: command.baseRevision,
|
|
10
|
-
...(command.changedFiles === undefined ? {} : { changedFiles: command.changedFiles }),
|
|
11
|
-
}, context);
|
|
12
|
-
export const stateChanged = (command, context) => fact(command.resourceId, ActivityEventType.PrStateChanged, { state: command.state }, context);
|
|
13
|
-
export const checksChanged = (command, context) => fact(command.resourceId, ActivityEventType.PrChecksChanged, { checks: command.checks }, context);
|
|
14
|
-
export const reviewAccepted = (command, context) => fact(command.resourceId, ActivityEventType.PrReviewAccepted, { revision: command.revision, actorId: command.actorId }, context);
|
|
15
|
-
export const reviewAcceptanceSignalRecorded = (command, context) => fact(command.resourceId, ActivityEventType.ReviewAcceptanceSignalRecorded, {
|
|
16
|
-
revision: command.revision,
|
|
17
|
-
actorId: command.actorId,
|
|
18
|
-
actorKind: command.actorKind,
|
|
19
|
-
acceptedEventId: `${context.commandId}:${ActivityEventType.PrReviewAccepted}`,
|
|
20
|
-
providerEventId: command.acceptedEventId,
|
|
21
|
-
trusted: isReviewAuthorized(command),
|
|
22
|
-
}, context);
|
|
23
|
-
export const reviewChangesRequested = (command, context) => fact(command.resourceId, ActivityEventType.PrReviewChangesRequested, { revision: command.revision, actorId: command.actorId }, context);
|
|
24
|
-
export const reviewRejected = (resourceId, reason, context) => fact(resourceId, ActivityEventType.PrReviewRejected, { reason }, context);
|
|
25
|
-
export const mergeDenied = (stream, reason, context, audit = {}) => denialDraft(ActivityEventType.PrMergeDenied, stream, reason, context, audit);
|
|
26
|
-
export const approveDenied = (stream, reason, context, audit = {}) => denialDraft(ActivityEventType.PrApproveDenied, stream, reason, context, audit);
|
|
27
|
-
export const mergeAuthorized = (stream, revision, context) => createEventDraft({
|
|
28
|
-
...metadata(ActivityEventType.PrMergeAuthorized, context),
|
|
29
|
-
stream,
|
|
30
|
-
payload: { revision },
|
|
31
|
-
});
|
|
32
|
-
export const deliveryIntentRequested = (resourceId, type, payload, context) => createEventDraft({
|
|
33
|
-
...metadata(type, context),
|
|
34
|
-
stream: resourceStream(resourceId),
|
|
35
|
-
payload: { idempotencyKey: `${context.commandId}:${type}`, ...payload },
|
|
36
|
-
});
|
|
37
|
-
function fact(resourceId, eventType, payload, context) {
|
|
38
|
-
return createEventDraft({
|
|
39
|
-
...metadata(eventType, context),
|
|
40
|
-
stream: resourceStream(resourceId),
|
|
41
|
-
payload,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
function denialDraft(eventType, stream, reason, context, audit) {
|
|
45
|
-
return createEventDraft({
|
|
46
|
-
...metadata(eventType, context),
|
|
47
|
-
stream,
|
|
48
|
-
payload: {
|
|
49
|
-
activationId: activationId(context.commandId),
|
|
50
|
-
idempotencyKey: `${context.commandId}:${eventType}`,
|
|
51
|
-
reason,
|
|
52
|
-
...audit,
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function metadata(eventType, context) {
|
|
57
|
-
return {
|
|
58
|
-
eventId: `${context.commandId}:${eventType}`,
|
|
59
|
-
eventType,
|
|
60
|
-
occurredAt: context.occurredAt,
|
|
61
|
-
correlationId: context.correlationId,
|
|
62
|
-
causationId: context.commandId,
|
|
63
|
-
actor: context.actor,
|
|
64
|
-
source: { kind: EventSourceKind.Internal, id: 'activities-pr' },
|
|
65
|
-
};
|
|
66
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { defineClosedVocabulary } from './vocabulary.js';
|
|
2
|
-
export const EventActorKind = defineClosedVocabulary({
|
|
3
|
-
System: 'system',
|
|
4
|
-
Operator: 'operator',
|
|
5
|
-
Agent: 'agent',
|
|
6
|
-
Integration: 'integration',
|
|
7
|
-
});
|
|
8
|
-
export const EventSourceKind = defineClosedVocabulary({
|
|
9
|
-
Internal: 'internal',
|
|
10
|
-
Adapter: 'adapter',
|
|
11
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export const JOURNAL_CHANGE_FALLBACK_MS = 30_000;
|
|
2
|
-
// Memoizes a full-journal derivation — a fold, decode, or index built from
|
|
3
|
-
// every event in history — so a resident loop calling it every tick only
|
|
4
|
-
// pays that cost when the journal has actually moved since the last call.
|
|
5
|
-
// Same gate ProjectionRunner keeps for itself (a last-seen global position),
|
|
6
|
-
// generalized for callers that want a materialized view rather than an
|
|
7
|
-
// incremental batch. Depends only on the EventJournal port, not on any
|
|
8
|
-
// concrete persistence implementation, so it lives in kernel rather than
|
|
9
|
-
// persistence — domain and adapter modules may call it directly.
|
|
10
|
-
export function cachedJournalView(journal, derive, now = Date.now) {
|
|
11
|
-
let cache;
|
|
12
|
-
return {
|
|
13
|
-
async get() {
|
|
14
|
-
const observedRevision = journal.changeSignal.revision();
|
|
15
|
-
const checkedAt = now();
|
|
16
|
-
if (cache !== undefined &&
|
|
17
|
-
cache.observedRevision === observedRevision &&
|
|
18
|
-
checkedAt - cache.checkedAt < JOURNAL_CHANGE_FALLBACK_MS)
|
|
19
|
-
return cache.value;
|
|
20
|
-
const value = await derive(await journal.readAll(0));
|
|
21
|
-
// Retain the revision observed before the read. An append that races
|
|
22
|
-
// this derivation must force one more pass instead of being hidden.
|
|
23
|
-
cache = { observedRevision, checkedAt: now(), value };
|
|
24
|
-
return value;
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { JOURNAL_CHANGE_FALLBACK_MS } from '../../kernel/index.js';
|
|
2
|
-
async function runImmediately(operation) {
|
|
3
|
-
return operation();
|
|
4
|
-
}
|
|
5
|
-
export class ProjectionRunner {
|
|
6
|
-
journal;
|
|
7
|
-
projections;
|
|
8
|
-
checkpoints;
|
|
9
|
-
registered;
|
|
10
|
-
serialiseRun;
|
|
11
|
-
now;
|
|
12
|
-
caughtUpToGlobalPosition;
|
|
13
|
-
caughtUpRevision;
|
|
14
|
-
caughtUpAt;
|
|
15
|
-
constructor(journal, projections, checkpoints, registered = [], serialiseRun = runImmediately, now = Date.now) {
|
|
16
|
-
this.journal = journal;
|
|
17
|
-
this.projections = projections;
|
|
18
|
-
this.checkpoints = checkpoints;
|
|
19
|
-
this.registered = registered;
|
|
20
|
-
this.serialiseRun = serialiseRun;
|
|
21
|
-
this.now = now;
|
|
22
|
-
}
|
|
23
|
-
// One shared journal read for every registered definition, not one per
|
|
24
|
-
// definition: readAll ultimately re-derives its content-fingerprint via
|
|
25
|
-
// readdir/stat on every call, so fanning that out per-definition costs a
|
|
26
|
-
// full filesystem probe per definition on every tick even when nothing
|
|
27
|
-
// changed. Fetching once and slicing per-checkpoint in memory keeps the
|
|
28
|
-
// same polling cadence at a fraction of the syscall cost.
|
|
29
|
-
//
|
|
30
|
-
// Resident hosts call this on a fast, fixed idle cadence (control-plane
|
|
31
|
-
// never backs off the internal runner loop, only the external poll), so a
|
|
32
|
-
// fully idle system still calls this multiple times a second. Without this
|
|
33
|
-
// short-circuit that means a per-registered-projection checkpoint file
|
|
34
|
-
// read every call forever, even though nothing changed. Only mark a
|
|
35
|
-
// position "caught up" once every definition processed fewer than a full
|
|
36
|
-
// batch — otherwise a backlog bigger than `limit` would get marked caught
|
|
37
|
-
// up after its first (partial) batch and never finish draining.
|
|
38
|
-
async runRegisteredOnce(limit = 100) {
|
|
39
|
-
return this.serialiseRun(() => this.runRegisteredOnceUnlocked(limit));
|
|
40
|
-
}
|
|
41
|
-
async runRegisteredOnceUnlocked(limit) {
|
|
42
|
-
const observedRevision = this.journal.changeSignal.revision();
|
|
43
|
-
const checkedAt = this.now();
|
|
44
|
-
if (this.caughtUpToGlobalPosition !== undefined &&
|
|
45
|
-
this.caughtUpRevision === observedRevision &&
|
|
46
|
-
this.caughtUpAt !== undefined &&
|
|
47
|
-
checkedAt - this.caughtUpAt < JOURNAL_CHANGE_FALLBACK_MS)
|
|
48
|
-
return 0;
|
|
49
|
-
const allEvents = await this.journal.readAll(0);
|
|
50
|
-
const latestGlobalPosition = allEvents.at(-1)?.globalPosition ?? 0;
|
|
51
|
-
if (this.caughtUpToGlobalPosition !== undefined &&
|
|
52
|
-
latestGlobalPosition <= this.caughtUpToGlobalPosition) {
|
|
53
|
-
this.caughtUpRevision = observedRevision;
|
|
54
|
-
this.caughtUpAt = this.now();
|
|
55
|
-
return 0;
|
|
56
|
-
}
|
|
57
|
-
let failed = false;
|
|
58
|
-
let firstFailure;
|
|
59
|
-
const counts = await Promise.all(this.registered.map(async (definition) => {
|
|
60
|
-
try {
|
|
61
|
-
return await this.applyFrom(definition, allEvents, limit);
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
if (!failed) {
|
|
65
|
-
failed = true;
|
|
66
|
-
firstFailure = error;
|
|
67
|
-
}
|
|
68
|
-
return 0;
|
|
69
|
-
}
|
|
70
|
-
}));
|
|
71
|
-
if (failed)
|
|
72
|
-
throw firstFailure;
|
|
73
|
-
if (counts.every((count) => count < limit)) {
|
|
74
|
-
this.caughtUpToGlobalPosition = latestGlobalPosition;
|
|
75
|
-
// Keep the revision from before the read so a concurrent append is
|
|
76
|
-
// never mistaken for content already included in this pass.
|
|
77
|
-
this.caughtUpRevision = observedRevision;
|
|
78
|
-
this.caughtUpAt = this.now();
|
|
79
|
-
}
|
|
80
|
-
return counts.reduce((total, count) => total + count, 0);
|
|
81
|
-
}
|
|
82
|
-
async runOnce(definition, limit = 100) {
|
|
83
|
-
return this.serialiseRun(() => this.runOnceUnlocked(definition, limit));
|
|
84
|
-
}
|
|
85
|
-
async runOnceUnlocked(definition, limit) {
|
|
86
|
-
const consumer = `projection:${definition.name}`;
|
|
87
|
-
const events = await this.journal.readAll(await this.checkpoints.load(consumer), limit);
|
|
88
|
-
return this.apply(definition, consumer, events);
|
|
89
|
-
}
|
|
90
|
-
async applyFrom(definition, allEvents, limit) {
|
|
91
|
-
const consumer = `projection:${definition.name}`;
|
|
92
|
-
const checkpoint = await this.checkpoints.load(consumer);
|
|
93
|
-
const events = allEvents.filter((event) => event.globalPosition > checkpoint).slice(0, limit);
|
|
94
|
-
return this.apply(definition, consumer, events);
|
|
95
|
-
}
|
|
96
|
-
async apply(definition, consumer, events) {
|
|
97
|
-
for (const event of events) {
|
|
98
|
-
const selected = definition.select(event);
|
|
99
|
-
if (selected !== null) {
|
|
100
|
-
const previous = await this.projections.read(definition.name, selected.key);
|
|
101
|
-
if ((previous?.lastGlobalPosition ?? 0) < event.globalPosition) {
|
|
102
|
-
await this.projections.write({
|
|
103
|
-
namespace: definition.name,
|
|
104
|
-
key: selected.key,
|
|
105
|
-
lastGlobalPosition: event.globalPosition,
|
|
106
|
-
value: definition.project(previous?.value ?? definition.initial(selected.key), event),
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
await this.checkpoints.save(consumer, event.globalPosition);
|
|
111
|
-
}
|
|
112
|
-
return events.length;
|
|
113
|
-
}
|
|
114
|
-
async rebuild(definition) {
|
|
115
|
-
return this.serialiseRun(() => this.rebuildUnlocked(definition));
|
|
116
|
-
}
|
|
117
|
-
async rebuildUnlocked(definition) {
|
|
118
|
-
await this.projections.clear(definition.name);
|
|
119
|
-
await this.checkpoints.reset(`projection:${definition.name}`);
|
|
120
|
-
let total = 0;
|
|
121
|
-
while (true) {
|
|
122
|
-
const count = await this.runOnceUnlocked(definition, 100);
|
|
123
|
-
total += count;
|
|
124
|
-
if (count < 100)
|
|
125
|
-
return total;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { readFile, rm } from 'node:fs/promises';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { atomicJson, encode } from './file-projection-store.js';
|
|
4
|
-
export class FileCheckpointStore {
|
|
5
|
-
root;
|
|
6
|
-
mutations = new Map();
|
|
7
|
-
constructor(root) {
|
|
8
|
-
this.root = root;
|
|
9
|
-
}
|
|
10
|
-
async load(consumer) {
|
|
11
|
-
try {
|
|
12
|
-
const value = JSON.parse(await readFile(this.path(consumer), 'utf8'));
|
|
13
|
-
if (value.consumer !== consumer ||
|
|
14
|
-
!Number.isSafeInteger(value.globalPosition) ||
|
|
15
|
-
value.globalPosition < 0)
|
|
16
|
-
throw new Error(`Invalid checkpoint: ${consumer}`);
|
|
17
|
-
return value.globalPosition;
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
if (error.code === 'ENOENT')
|
|
21
|
-
return 0;
|
|
22
|
-
throw error;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
async save(consumer, globalPosition) {
|
|
26
|
-
await this.mutate(consumer, async () => {
|
|
27
|
-
if (globalPosition < (await this.load(consumer)))
|
|
28
|
-
throw new Error(`Checkpoint regression for ${consumer}`);
|
|
29
|
-
await atomicJson(this.path(consumer), { consumer, globalPosition });
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
async reset(consumer) {
|
|
33
|
-
await this.mutate(consumer, () => rm(this.path(consumer), { force: true }));
|
|
34
|
-
}
|
|
35
|
-
async mutate(consumer, operation) {
|
|
36
|
-
const prior = this.mutations.get(consumer) ?? Promise.resolve();
|
|
37
|
-
const current = prior.catch(() => undefined).then(operation);
|
|
38
|
-
this.mutations.set(consumer, current);
|
|
39
|
-
try {
|
|
40
|
-
return await current;
|
|
41
|
-
}
|
|
42
|
-
finally {
|
|
43
|
-
if (this.mutations.get(consumer) === current)
|
|
44
|
-
this.mutations.delete(consumer);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
path(consumer) {
|
|
48
|
-
return join(this.root, 'checkpoints', `${encode(consumer)}.json`);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { mkdir, open, readFile, readdir, rename, rm, stat } from 'node:fs/promises';
|
|
3
|
-
import { dirname, join } from 'node:path';
|
|
4
|
-
export class FileProjectionStore {
|
|
5
|
-
root;
|
|
6
|
-
constructor(root) {
|
|
7
|
-
this.root = root;
|
|
8
|
-
}
|
|
9
|
-
listCache = new Map();
|
|
10
|
-
async read(namespace, key) {
|
|
11
|
-
try {
|
|
12
|
-
return JSON.parse(await readFile(this.path(namespace, key), 'utf8'));
|
|
13
|
-
}
|
|
14
|
-
catch (error) {
|
|
15
|
-
if (error.code === 'ENOENT')
|
|
16
|
-
return null;
|
|
17
|
-
throw error;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
// Patches the cached entry in place rather than invalidating the whole
|
|
21
|
-
// namespace, so a self-caused write doesn't force the next list() to
|
|
22
|
-
// re-read every other unchanged projection file in the namespace. Falls
|
|
23
|
-
// back to a full list() re-read for a namespace nothing has cached yet.
|
|
24
|
-
async write(projection) {
|
|
25
|
-
const path = this.path(projection.namespace, projection.key);
|
|
26
|
-
await atomicJson(path, projection);
|
|
27
|
-
const cached = this.listCache.get(projection.namespace);
|
|
28
|
-
if (cached === undefined)
|
|
29
|
-
return;
|
|
30
|
-
const [info, directoryInfo] = await Promise.all([stat(path), stat(dirname(path))]);
|
|
31
|
-
const file = `${encode(projection.key)}.json`;
|
|
32
|
-
const updatedEntry = {
|
|
33
|
-
file,
|
|
34
|
-
size: info.size,
|
|
35
|
-
mtimeMs: info.mtimeMs,
|
|
36
|
-
value: projection,
|
|
37
|
-
};
|
|
38
|
-
this.listCache.set(projection.namespace, {
|
|
39
|
-
files: [...cached.files.filter((entry) => entry.file !== file), updatedEntry].sort((a, b) => a.file < b.file ? -1 : a.file > b.file ? 1 : 0),
|
|
40
|
-
revision: directoryRevision(directoryInfo),
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
// Callers (advance-once, orchestration-service, DeliveryService, ...) list()
|
|
44
|
-
// an entire namespace unconditionally on every control-plane tick, even when
|
|
45
|
-
// fully idle. Without a cache that's a readdir+open+read+JSON.parse of every
|
|
46
|
-
// projection file in the namespace every tick forever, mirroring the same
|
|
47
|
-
// cost FileEventJournal.scan() already avoids for the event journal via a
|
|
48
|
-
// fingerprint cache. Same fix here: only re-read files whose directory
|
|
49
|
-
// listing (name:size:mtimeMs) actually changed since the last list().
|
|
50
|
-
async list(namespace) {
|
|
51
|
-
const directory = join(this.root, 'projections', encode(namespace));
|
|
52
|
-
let directoryInfo;
|
|
53
|
-
try {
|
|
54
|
-
directoryInfo = await stat(directory);
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
if (error.code === 'ENOENT') {
|
|
58
|
-
this.listCache.delete(namespace);
|
|
59
|
-
return [];
|
|
60
|
-
}
|
|
61
|
-
throw error;
|
|
62
|
-
}
|
|
63
|
-
const cached = this.listCache.get(namespace);
|
|
64
|
-
if (cached !== undefined && cached.revision === directoryRevision(directoryInfo))
|
|
65
|
-
return cached.files.map((entry) => entry.value);
|
|
66
|
-
let files;
|
|
67
|
-
try {
|
|
68
|
-
files = (await readdir(directory)).filter((file) => file.endsWith('.json')).sort();
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
if (error.code === 'ENOENT') {
|
|
72
|
-
this.listCache.delete(namespace);
|
|
73
|
-
return [];
|
|
74
|
-
}
|
|
75
|
-
throw error;
|
|
76
|
-
}
|
|
77
|
-
const stats = await Promise.all(files.map(async (file) => {
|
|
78
|
-
const info = await stat(join(directory, file));
|
|
79
|
-
return { file, size: info.size, mtimeMs: info.mtimeMs };
|
|
80
|
-
}));
|
|
81
|
-
if (cached !== undefined && sameProjectionFiles(cached.files, stats))
|
|
82
|
-
return cached.files.map((entry) => entry.value);
|
|
83
|
-
const entries = await Promise.all(stats.map(async ({ file, size, mtimeMs }) => ({
|
|
84
|
-
file,
|
|
85
|
-
size,
|
|
86
|
-
mtimeMs,
|
|
87
|
-
value: JSON.parse(await readFile(join(directory, file), 'utf8')),
|
|
88
|
-
})));
|
|
89
|
-
this.listCache.set(namespace, { files: entries, revision: directoryRevision(directoryInfo) });
|
|
90
|
-
return entries.map((entry) => entry.value);
|
|
91
|
-
}
|
|
92
|
-
async clear(namespace) {
|
|
93
|
-
await rm(namespace === undefined
|
|
94
|
-
? join(this.root, 'projections')
|
|
95
|
-
: join(this.root, 'projections', encode(namespace)), { recursive: true, force: true });
|
|
96
|
-
if (namespace === undefined)
|
|
97
|
-
this.listCache.clear();
|
|
98
|
-
else
|
|
99
|
-
this.listCache.delete(namespace);
|
|
100
|
-
}
|
|
101
|
-
path(namespace, key) {
|
|
102
|
-
return join(this.root, 'projections', encode(namespace), `${encode(key)}.json`);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
function directoryRevision(info) {
|
|
106
|
-
return `${info.mtimeMs}:${info.ctimeMs}`;
|
|
107
|
-
}
|
|
108
|
-
function sameProjectionFiles(cached, stats) {
|
|
109
|
-
return (cached.length === stats.length &&
|
|
110
|
-
cached.every((entry, index) => {
|
|
111
|
-
const other = stats[index];
|
|
112
|
-
return (entry.file === other.file && entry.size === other.size && entry.mtimeMs === other.mtimeMs);
|
|
113
|
-
}));
|
|
114
|
-
}
|
|
115
|
-
export function encode(value) {
|
|
116
|
-
if (value.length === 0 || /[\\/]/.test(value))
|
|
117
|
-
throw new Error('Storage name must not contain path separators');
|
|
118
|
-
return encodeURIComponent(value).replace(/%/g, '~').replace(/\./g, '~2E');
|
|
119
|
-
}
|
|
120
|
-
export async function atomicJson(path, value) {
|
|
121
|
-
await mkdir(dirname(path), { recursive: true });
|
|
122
|
-
const temporary = `${path}.${process.pid}.${Date.now()}.${randomUUID()}.tmp`;
|
|
123
|
-
try {
|
|
124
|
-
const handle = await open(temporary, 'wx');
|
|
125
|
-
try {
|
|
126
|
-
await handle.writeFile(`${JSON.stringify(value)}\n`, 'utf8');
|
|
127
|
-
await handle.sync();
|
|
128
|
-
}
|
|
129
|
-
finally {
|
|
130
|
-
await handle.close();
|
|
131
|
-
}
|
|
132
|
-
await rename(temporary, path);
|
|
133
|
-
}
|
|
134
|
-
finally {
|
|
135
|
-
await rm(temporary, { force: true });
|
|
136
|
-
}
|
|
137
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './application/projection-runner.js';
|
|
2
|
-
export * from './filesystem/file-checkpoint-store.js';
|
|
3
|
-
export * from './filesystem/file-event-journal.js';
|
|
4
|
-
export * from './filesystem/file-lock.js';
|
|
5
|
-
export * from './filesystem/file-projection-store.js';
|
|
6
|
-
export * from './memory/in-memory-checkpoint-store.js';
|
|
7
|
-
export * from './memory/in-memory-event-journal.js';
|
|
8
|
-
export * from './memory/in-memory-projection-store.js';
|