@atolis-hq/wake 0.4.2 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/src/activities/agent/agent-activity-definition.d.ts +9 -0
- package/dist/src/activities/agent/agent-activity.d.ts +51 -0
- package/dist/src/activities/agent/agent-result.d.ts +43 -0
- package/dist/src/activities/contracts/activity.d.ts +184 -0
- package/dist/src/activities/contracts/config.d.ts +3 -0
- package/dist/src/activities/contracts/decision-claim-schema.d.ts +35 -0
- package/dist/src/activities/contracts/decision-claim-schema.js +42 -0
- package/dist/src/activities/contracts/event-factory.d.ts +6 -0
- package/dist/src/activities/contracts/event-factory.js +40 -0
- package/dist/src/activities/contracts/event-integrity.d.ts +61 -0
- package/dist/src/activities/contracts/event-integrity.js +50 -0
- package/dist/src/activities/contracts/event-schema.d.ts +2803 -0
- package/dist/src/activities/contracts/event-schema.js +67 -121
- package/dist/src/activities/contracts/events.d.ts +153 -0
- package/dist/src/activities/contracts/events.js +4 -4
- package/dist/src/activities/contracts/identifiers.d.ts +5 -0
- package/dist/src/activities/contracts/registry.d.ts +19 -0
- package/dist/src/activities/contracts/streams.d.ts +13 -0
- package/dist/src/activities/contracts/vocabulary.d.ts +69 -0
- package/dist/src/activities/index.d.ts +23 -0
- package/dist/src/activities/index.js +1 -0
- package/dist/src/activities/issue/complete.d.ts +26 -0
- package/dist/src/activities/issue/complete.js +5 -5
- package/dist/src/activities/pr/activity-support.d.ts +38 -0
- package/dist/src/activities/pr/activity-support.js +1 -1
- package/dist/src/activities/pr/application.d.ts +17 -0
- package/dist/src/activities/pr/application.js +6 -6
- package/dist/src/activities/pr/approve.d.ts +7 -0
- package/dist/src/activities/pr/approve.js +8 -3
- package/dist/src/activities/pr/capability.d.ts +2 -0
- package/dist/src/activities/pr/contracts.d.ts +133 -0
- package/dist/src/activities/pr/decision-claim.d.ts +26 -0
- package/dist/src/activities/pr/decision-claim.js +50 -30
- package/dist/src/activities/pr/event-data.d.ts +21 -0
- package/dist/src/activities/pr/event-data.js +101 -0
- package/dist/src/activities/pr/intent.d.ts +12 -0
- package/dist/src/activities/pr/intent.js +5 -5
- package/dist/src/activities/pr/merge-authority-gate.d.ts +13 -0
- package/dist/src/activities/pr/merge-authority-gate.js +1 -1
- package/dist/src/activities/pr/merge.d.ts +7 -0
- package/dist/src/activities/pr/merge.js +8 -3
- package/dist/src/activities/pr/policy.d.ts +13 -0
- package/dist/src/activities/pr/projection.d.ts +5 -0
- package/dist/src/activities/pr/projection.js +18 -17
- package/dist/src/activities/pr/vocabulary.d.ts +34 -0
- package/dist/src/activities/review/authorization.d.ts +9 -0
- package/dist/src/activities/review/contracts.d.ts +46 -0
- package/dist/src/activities/review/signals.d.ts +2 -0
- package/dist/src/bootstrap/activation-scheduler-serialiser.d.ts +3 -0
- package/dist/src/bootstrap/activation-scheduler-serialiser.js +8 -0
- package/dist/src/bootstrap/activity-registry.d.ts +4 -0
- package/dist/src/bootstrap/analytics-projection.d.ts +12 -0
- package/dist/src/bootstrap/analytics-projection.js +3 -3
- package/dist/src/bootstrap/board-projection.d.ts +56 -0
- package/dist/src/bootstrap/board-projection.js +156 -71
- package/dist/src/bootstrap/composition-root.d.ts +76 -0
- package/dist/src/bootstrap/composition-root.js +20 -13
- package/dist/src/bootstrap/config/load-config.d.ts +6 -0
- package/dist/src/bootstrap/config/root-schema.d.ts +443 -0
- package/dist/src/bootstrap/event-processor-runtime.d.ts +22 -0
- package/dist/src/bootstrap/event-processor-runtime.js +88 -0
- package/dist/src/bootstrap/external-ref.d.ts +3 -0
- package/dist/src/bootstrap/fake-provider-files.d.ts +3 -0
- package/dist/src/bootstrap/fake-scenarios.d.ts +3 -0
- package/dist/src/bootstrap/index.d.ts +27 -0
- package/dist/src/bootstrap/index.js +2 -28
- package/dist/src/bootstrap/initialise.d.ts +4 -0
- package/dist/src/bootstrap/initialise.js +8 -16
- package/dist/src/bootstrap/integration-runtime.d.ts +48 -0
- package/dist/src/bootstrap/integration-runtime.js +36 -54
- package/dist/src/bootstrap/paths.d.ts +12 -0
- package/dist/src/bootstrap/persistence-composition.d.ts +21 -0
- package/dist/src/bootstrap/persistence-composition.js +12 -4
- package/dist/src/bootstrap/projection-runtime.d.ts +16 -0
- package/dist/src/bootstrap/projection-runtime.js +50 -23
- package/dist/src/bootstrap/resource-transition-evidence.d.ts +11 -0
- package/dist/src/bootstrap/runner-quota-reporter.d.ts +6 -0
- package/dist/src/bootstrap/runner-quota-reporter.js +16 -11
- package/dist/src/bootstrap/runner-registry.d.ts +3 -0
- package/dist/src/bootstrap/runner-tick-adapter.d.ts +16 -0
- package/dist/src/bootstrap/runner-tick-adapter.js +57 -0
- package/dist/src/bootstrap/schedule-checkpoint-store.d.ts +9 -0
- package/dist/src/bootstrap/self-update-application.d.ts +54 -0
- package/dist/src/bootstrap/self-update-failure-log.d.ts +17 -0
- package/dist/src/bootstrap/source-update-port.d.ts +8 -0
- package/dist/src/bootstrap/status-publish-activity.d.ts +7 -0
- package/dist/src/bootstrap/status-publish-activity.js +4 -5
- package/dist/src/bootstrap/surface-api-applications.d.ts +18 -0
- package/dist/src/bootstrap/surface-api-applications.js +104 -57
- package/dist/src/bootstrap/surface-api-execution-applications.d.ts +3 -0
- package/dist/src/bootstrap/surface-api-execution-applications.js +3 -3
- package/dist/src/bootstrap/surface-api-metadata.d.ts +4 -0
- package/dist/src/bootstrap/surface-api-metadata.js +1 -1
- package/dist/src/bootstrap/surface-api-projection-pages.d.ts +12 -0
- package/dist/src/bootstrap/surface-api-run-context.d.ts +12 -0
- package/dist/src/bootstrap/surface-api-transcripts.d.ts +10 -0
- package/dist/src/bootstrap/surface-api-work-applications.d.ts +3 -0
- package/dist/src/bootstrap/surface-api-work-applications.js +3 -3
- package/dist/src/bootstrap/surface-api-workflow-diagrams.d.ts +11 -0
- package/dist/src/bootstrap/surface-api-workflow-diagrams.js +2 -2
- package/dist/src/bootstrap/surface-applications.d.ts +10 -0
- package/dist/src/bootstrap/surface-cli-applications.d.ts +33 -0
- package/dist/src/bootstrap/surface-cli-applications.js +151 -65
- package/dist/src/bootstrap/transcript-retention.d.ts +11 -0
- package/dist/src/bootstrap/update-ledger.d.ts +9 -0
- package/dist/src/bootstrap/update-maintenance-lease.d.ts +24 -0
- package/dist/src/bootstrap/update-maintenance-lease.js +1 -1
- package/dist/src/bootstrap/version.d.ts +13 -0
- package/dist/src/bootstrap/version.js +1 -1
- package/dist/src/control-plane/application/activation-scheduler-ports.d.ts +71 -0
- package/dist/src/control-plane/application/activation-scheduler-subscriber.d.ts +42 -0
- package/dist/src/control-plane/application/activation-scheduler-subscriber.js +111 -0
- package/dist/src/control-plane/application/activation-scheduler.d.ts +8 -0
- package/dist/src/control-plane/application/activation-scheduler.js +165 -0
- package/dist/src/control-plane/application/advance-once-dispatch.d.ts +46 -0
- package/dist/src/control-plane/application/advance-once-dispatch.js +6 -7
- package/dist/src/control-plane/application/advance-once.d.ts +5 -0
- package/dist/src/control-plane/application/advance-once.js +4 -158
- package/dist/src/control-plane/application/control-plane-projection.d.ts +21 -0
- package/dist/src/control-plane/application/control-plane-projection.js +27 -5
- package/dist/src/control-plane/application/control-plane-service.d.ts +12 -0
- package/dist/src/control-plane/application/control-plane-service.js +28 -9
- package/dist/src/control-plane/application/execution-reconciliation.d.ts +21 -0
- package/dist/src/control-plane/application/intake-pipeline.d.ts +18 -0
- package/dist/src/control-plane/application/intake-pipeline.js +8 -18
- package/dist/src/control-plane/application/runner-control-service.d.ts +12 -0
- package/dist/src/control-plane/application/runner-control-service.js +35 -13
- package/dist/src/control-plane/application/runner-pipeline.d.ts +24 -0
- package/dist/src/control-plane/application/runner-pipeline.js +23 -41
- package/dist/src/control-plane/application/schedule-service.d.ts +31 -0
- package/dist/src/control-plane/application/schedule-service.js +1 -1
- package/dist/src/control-plane/application/work-cancellation-policy.d.ts +20 -0
- package/dist/src/control-plane/application/work-cancellation-policy.js +1 -1
- package/dist/src/control-plane/contracts/commands.d.ts +20 -0
- package/dist/src/control-plane/contracts/config.d.ts +30 -0
- package/dist/src/control-plane/contracts/config.js +7 -1
- package/dist/src/control-plane/contracts/event-factory.d.ts +6 -0
- package/dist/src/control-plane/contracts/event-factory.js +14 -0
- package/dist/src/control-plane/contracts/events.d.ts +36 -0
- package/dist/src/control-plane/contracts/events.js +42 -47
- package/dist/src/control-plane/contracts/streams.d.ts +6 -0
- package/dist/src/control-plane/contracts/views.d.ts +28 -0
- package/dist/src/control-plane/domain/dispatch-policy.d.ts +18 -0
- package/dist/src/control-plane/domain/quota-policy.d.ts +21 -0
- package/dist/src/control-plane/domain/runner-quota.d.ts +2 -0
- package/dist/src/control-plane/domain/schedule-policy.d.ts +8 -0
- package/dist/src/control-plane/index.d.ts +24 -0
- package/dist/src/control-plane/index.js +3 -0
- package/dist/src/control-plane/infrastructure/intake-host.d.ts +19 -0
- package/dist/src/control-plane/infrastructure/intake-host.js +2 -3
- package/dist/src/control-plane/infrastructure/resident-host.d.ts +16 -0
- package/dist/src/control-plane/infrastructure/resident-host.js +3 -1
- package/dist/src/control-plane/infrastructure/tick-host.d.ts +6 -0
- package/dist/src/control-plane/infrastructure/tick-host.js +2 -2
- package/dist/src/conversations/application/conversation-projection.d.ts +3 -0
- package/dist/src/conversations/application/conversation-repository.d.ts +13 -0
- package/dist/src/conversations/application/conversation-repository.js +1 -1
- package/dist/src/conversations/application/conversation-service.d.ts +16 -0
- package/dist/src/conversations/application/conversation-service.js +32 -27
- package/dist/src/conversations/contracts/commands.d.ts +33 -0
- package/dist/src/conversations/contracts/event-factory.d.ts +6 -0
- package/dist/src/conversations/contracts/event-factory.js +18 -0
- package/dist/src/conversations/contracts/events.d.ts +42 -0
- package/dist/src/conversations/contracts/events.js +37 -24
- package/dist/src/conversations/contracts/identifiers.d.ts +5 -0
- package/dist/src/conversations/contracts/streams.d.ts +7 -0
- package/dist/src/conversations/contracts/views.d.ts +49 -0
- package/dist/src/conversations/contracts/vocabulary.d.ts +5 -0
- package/dist/src/conversations/domain/conversation.d.ts +4 -0
- package/dist/src/conversations/domain/conversation.js +8 -7
- package/dist/src/conversations/index.d.ts +9 -0
- package/dist/src/conversations/index.js +1 -0
- package/dist/src/execution/application/activation-claim.d.ts +23 -0
- package/dist/src/execution/application/activation-claim.js +8 -9
- package/dist/src/execution/application/active-run-cancellation.d.ts +4 -0
- package/dist/src/execution/application/active-run-cancellation.js +2 -2
- package/dist/src/execution/application/execution-activity.d.ts +61 -0
- package/dist/src/execution/application/execution-activity.js +4 -1
- package/dist/src/execution/application/execution-projection.d.ts +11 -0
- package/dist/src/execution/application/execution-projection.js +8 -4
- package/dist/src/execution/application/execution-service.d.ts +33 -0
- package/dist/src/execution/application/execution-service.js +288 -59
- package/dist/src/execution/application/execution-validation.d.ts +8 -0
- package/dist/src/execution/application/execution-validation.js +3 -2
- package/dist/src/execution/application/recovery-service.d.ts +52 -0
- package/dist/src/execution/application/recovery-service.js +32 -17
- package/dist/src/execution/application/run-lifecycle.d.ts +75 -0
- package/dist/src/execution/application/run-lifecycle.js +130 -62
- package/dist/src/execution/application/run-liveness-service.d.ts +14 -0
- package/dist/src/execution/application/run-liveness-service.js +68 -30
- package/dist/src/execution/application/run-repository.d.ts +18 -0
- package/dist/src/execution/application/run-repository.js +2 -2
- package/dist/src/execution/contracts/commands.d.ts +30 -0
- package/dist/src/execution/contracts/config.d.ts +94 -0
- package/dist/src/execution/contracts/control-plane.d.ts +10 -0
- package/dist/src/execution/contracts/event-factory.d.ts +10 -0
- package/dist/src/execution/contracts/event-factory.js +20 -31
- package/dist/src/execution/contracts/events.d.ts +198 -0
- package/dist/src/execution/contracts/events.js +152 -129
- package/dist/src/execution/contracts/identifiers.d.ts +3 -0
- package/dist/src/execution/contracts/liveness.d.ts +17 -0
- package/dist/src/execution/contracts/results.d.ts +23 -0
- package/dist/src/execution/contracts/runner.d.ts +78 -0
- package/dist/src/execution/contracts/streams.d.ts +12 -0
- package/dist/src/execution/contracts/views.d.ts +42 -0
- package/dist/src/execution/contracts/vocabulary.d.ts +50 -0
- package/dist/src/execution/contracts/vocabulary.js +4 -0
- package/dist/src/execution/contracts/workspace.d.ts +48 -0
- package/dist/src/execution/domain/run-result.d.ts +2 -0
- package/dist/src/execution/domain/run.d.ts +3 -0
- package/dist/src/execution/domain/run.js +72 -22
- package/dist/src/execution/index.d.ts +34 -0
- package/dist/src/execution/infrastructure/agent-runner-adapter.d.ts +2 -0
- package/dist/src/execution/infrastructure/codex-stop-hook.d.ts +13 -0
- package/dist/src/execution/infrastructure/process-execution.d.ts +23 -0
- package/dist/src/execution/infrastructure/prompt-templates.d.ts +15 -0
- package/dist/src/execution/infrastructure/runner-memory-profile.d.ts +11 -0
- package/dist/src/execution/infrastructure/runners/claude.d.ts +34 -0
- package/dist/src/execution/infrastructure/runners/codex.d.ts +13 -0
- package/dist/src/execution/infrastructure/runners/command.d.ts +3 -0
- package/dist/src/execution/infrastructure/runners/cursor.d.ts +12 -0
- package/dist/src/execution/infrastructure/runners/fake-scenarios.d.ts +35 -0
- package/dist/src/execution/infrastructure/runners/fake.d.ts +8 -0
- package/dist/src/execution/infrastructure/runners/registry.d.ts +14 -0
- package/dist/src/execution/infrastructure/transcript-store.d.ts +48 -0
- package/dist/src/execution/infrastructure/transcripts.d.ts +1 -0
- package/dist/src/execution/infrastructure/workspace/fake-workspace.d.ts +36 -0
- package/dist/src/execution/infrastructure/workspace/fake-workspace.js +2 -0
- package/dist/src/execution/infrastructure/workspace/git-workspace.d.ts +29 -0
- package/dist/src/execution/infrastructure/workspace/git-workspace.js +21 -11
- package/dist/src/execution/infrastructure/workspace/prepare-workspace.d.ts +3 -0
- package/dist/src/execution/infrastructure/workspace/prepare-workspace.js +4 -2
- package/dist/src/integrations/application/adapter-health-tracker.d.ts +17 -0
- package/dist/src/integrations/application/agent-run-publication-reactor.d.ts +25 -0
- package/dist/src/integrations/application/agent-run-publication-reactor.js +36 -20
- package/dist/src/integrations/application/artifact-registration-reactor.d.ts +32 -0
- package/dist/src/integrations/application/artifact-registration-reactor.js +43 -35
- package/dist/src/integrations/application/poll-service.d.ts +13 -0
- package/dist/src/integrations/application/poll-service.js +2 -2
- package/dist/src/integrations/application/terminal-agent-run-report.d.ts +33 -0
- package/dist/src/integrations/application/work-admission.d.ts +30 -0
- package/dist/src/integrations/application/work-conclusion.d.ts +13 -0
- package/dist/src/integrations/contracts/artifact-event-factory.d.ts +6 -0
- package/dist/src/integrations/contracts/artifact-event-factory.js +8 -0
- package/dist/src/integrations/contracts/artifact-events.d.ts +31 -0
- package/dist/src/integrations/contracts/artifact-events.js +24 -24
- package/dist/src/integrations/contracts/artifact-vocabulary.d.ts +11 -0
- package/dist/src/integrations/contracts/config.d.ts +13 -0
- package/dist/src/integrations/contracts/identifiers.d.ts +3 -0
- package/dist/src/integrations/contracts/intake-rules.d.ts +15 -0
- package/dist/src/integrations/contracts/intake.d.ts +15 -0
- package/dist/src/integrations/contracts/outcome-vocabulary.d.ts +6 -0
- package/dist/src/integrations/contracts/provider.d.ts +105 -0
- package/dist/src/integrations/contracts/reply-routing.d.ts +31 -0
- package/dist/src/integrations/contracts/streams.d.ts +12 -0
- package/dist/src/integrations/delivery/application/delivery-outcome-reactor.d.ts +24 -0
- package/dist/src/integrations/delivery/application/delivery-outcome-reactor.js +151 -73
- package/dist/src/integrations/delivery/application/delivery-projector.d.ts +5 -0
- package/dist/src/integrations/delivery/application/delivery-projector.js +52 -52
- package/dist/src/integrations/delivery/application/delivery-service.d.ts +40 -0
- package/dist/src/integrations/delivery/application/delivery-service.js +15 -16
- package/dist/src/integrations/delivery/contracts/commands.d.ts +7 -0
- package/dist/src/integrations/delivery/contracts/config.d.ts +25 -0
- package/dist/src/integrations/delivery/contracts/event-factory.d.ts +11 -0
- package/dist/src/integrations/delivery/contracts/event-factory.js +20 -9
- package/dist/src/integrations/delivery/contracts/events.d.ts +46 -0
- package/dist/src/integrations/delivery/contracts/events.js +33 -18
- package/dist/src/integrations/delivery/contracts/intents.d.ts +54 -0
- package/dist/src/integrations/delivery/contracts/intents.js +21 -14
- package/dist/src/integrations/delivery/contracts/views.d.ts +47 -0
- package/dist/src/integrations/delivery/contracts/vocabulary.d.ts +25 -0
- package/dist/src/integrations/fake/durable-delivery-provider.d.ts +29 -0
- package/dist/src/integrations/fake/external-sink.d.ts +5 -0
- package/dist/src/integrations/fake/external-source.d.ts +30 -0
- package/dist/src/integrations/fake/external-source.js +1 -3
- package/dist/src/integrations/fake/inbound-translator.d.ts +16 -0
- package/dist/src/integrations/fake/inbound-translator.js +22 -10
- package/dist/src/integrations/fake/provider.d.ts +38 -0
- package/dist/src/integrations/fake/provider.js +3 -1
- package/dist/src/integrations/github/application/agent-context-reader.d.ts +6 -0
- package/dist/src/integrations/github/application/agent-context-reader.js +10 -7
- package/dist/src/integrations/github/application/agent-run-comment.d.ts +22 -0
- package/dist/src/integrations/github/application/comment-history-reader.d.ts +25 -0
- package/dist/src/integrations/github/application/comment-history-reader.js +36 -32
- package/dist/src/integrations/github/application/delivery-marker.d.ts +2 -0
- package/dist/src/integrations/github/application/inbound-comment-syntax.d.ts +8 -0
- package/dist/src/integrations/github/application/inbound-context.d.ts +3 -0
- package/dist/src/integrations/github/application/inbound-context.js +4 -4
- package/dist/src/integrations/github/application/inbound-review-signals.d.ts +21 -0
- package/dist/src/integrations/github/application/inbound-review-signals.js +30 -25
- package/dist/src/integrations/github/application/inbound-translator.d.ts +103 -0
- package/dist/src/integrations/github/application/inbound-translator.js +149 -160
- package/dist/src/integrations/github/application/inbound-watch-gate-signals.d.ts +10 -0
- package/dist/src/integrations/github/application/inbound-watch-gate-signals.js +4 -4
- package/dist/src/integrations/github/application/intake-policy.d.ts +7 -0
- package/dist/src/integrations/github/application/operator-retry-command.d.ts +1 -0
- package/dist/src/integrations/github/application/outbound-translator.d.ts +19 -0
- package/dist/src/integrations/github/application/poll-service.d.ts +11 -0
- package/dist/src/integrations/github/application/poll-service.js +11 -2
- package/dist/src/integrations/github/application/pull-request-translation.d.ts +5 -0
- package/dist/src/integrations/github/application/reply-target-selector.d.ts +8 -0
- package/dist/src/integrations/github/application/resource-links.d.ts +2 -0
- package/dist/src/integrations/github/application/review-command-translator.d.ts +14 -0
- package/dist/src/integrations/github/application/wake-labels.d.ts +29 -0
- package/dist/src/integrations/github/contracts/check-evidence.d.ts +1 -0
- package/dist/src/integrations/github/contracts/config.d.ts +81 -0
- package/dist/src/integrations/github/contracts/event-factory.d.ts +6 -0
- package/dist/src/integrations/github/contracts/event-factory.js +26 -0
- package/dist/src/integrations/github/contracts/events.d.ts +135 -0
- package/dist/src/integrations/github/contracts/events.js +118 -132
- package/dist/src/integrations/github/contracts/external-key.d.ts +8 -0
- package/dist/src/integrations/github/contracts/issue-query.d.ts +5 -0
- package/dist/src/integrations/github/contracts/payloads.d.ts +74 -0
- package/dist/src/integrations/github/contracts/vocabulary.d.ts +64 -0
- package/dist/src/integrations/github/index.d.ts +34 -0
- package/dist/src/integrations/github/index.js +1 -0
- package/dist/src/integrations/github/infrastructure/adapter-health-registry.d.ts +11 -0
- package/dist/src/integrations/github/infrastructure/bounded-fetch.d.ts +10 -0
- package/dist/src/integrations/github/infrastructure/client-reads.d.ts +255 -0
- package/dist/src/integrations/github/infrastructure/client.d.ts +263 -0
- package/dist/src/integrations/github/infrastructure/comment-source.d.ts +7 -0
- package/dist/src/integrations/github/infrastructure/content-fingerprint.d.ts +2 -0
- package/dist/src/integrations/github/infrastructure/delivery.d.ts +6 -0
- package/dist/src/integrations/github/infrastructure/etag-cache.d.ts +29 -0
- package/dist/src/integrations/github/infrastructure/gh-auth.d.ts +4 -0
- package/dist/src/integrations/github/infrastructure/issue-source.d.ts +20 -0
- package/dist/src/integrations/github/infrastructure/issue-source.js +10 -6
- package/dist/src/integrations/github/infrastructure/poll-watermark.d.ts +12 -0
- package/dist/src/integrations/github/infrastructure/pr-source.d.ts +16 -0
- package/dist/src/integrations/github/infrastructure/pr-source.js +6 -4
- package/dist/src/integrations/github/infrastructure/request-coordinator.d.ts +13 -0
- package/dist/src/integrations/github/infrastructure/review-source.d.ts +10 -0
- package/dist/src/integrations/github/infrastructure/review-source.js +29 -25
- package/dist/src/integrations/github/infrastructure/source-contracts.d.ts +22 -0
- package/dist/src/integrations/github/infrastructure/source.d.ts +12 -0
- package/dist/src/integrations/github/infrastructure/source.js +3 -5
- package/dist/src/integrations/github/provider.d.ts +3 -0
- package/dist/src/integrations/github/provider.js +14 -12
- package/dist/src/integrations/index.d.ts +32 -0
- package/dist/src/integrations/index.js +1 -0
- package/dist/src/kernel/contracts/clock.d.ts +3 -0
- package/dist/src/kernel/contracts/id-generator.d.ts +3 -0
- package/dist/src/kernel/contracts/identifiers.d.ts +7 -0
- package/dist/src/kernel/contracts/identifiers.js +1 -8
- package/dist/src/kernel/contracts/relations.d.ts +14 -0
- package/dist/src/kernel/contracts/schema.d.ts +3 -0
- package/dist/src/kernel/contracts/vocabulary.d.ts +7 -0
- package/dist/src/kernel/domain/match-mode.d.ts +2 -0
- package/dist/src/kernel/domain/relation.d.ts +9 -0
- package/dist/src/kernel/index.d.ts +10 -0
- package/dist/src/kernel/index.js +0 -11
- package/dist/src/kernel/infrastructure/system-clock.d.ts +4 -0
- package/dist/src/kernel/infrastructure/ulid-id-generator.d.ts +4 -0
- package/dist/src/main.d.ts +15 -0
- package/dist/src/main.js +8 -2
- package/dist/src/node_modules/@atolis-hq/eventing/LICENSE +201 -0
- package/dist/src/node_modules/@atolis-hq/eventing/README.md +41 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/commands.d.ts +9 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/commands.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-envelope.d.ts +13 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-envelope.d.ts.map +1 -0
- package/dist/src/{kernel/domain → node_modules/@atolis-hq/eventing/dist/contracts}/event-envelope.js +4 -4
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-schema.d.ts +83 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-schema.d.ts.map +1 -0
- package/dist/src/{kernel → node_modules/@atolis-hq/eventing/dist}/contracts/event-schema.js +21 -5
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/events.d.ts +46 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/events.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/events.js +10 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/identifiers.d.ts +11 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/identifiers.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/identifiers.js +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/processor-state-store.d.ts +11 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/processor-state-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/index.d.ts +19 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/index.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/index.js +17 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-checkpoint-store.d.ts +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-checkpoint-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-event-journal.d.ts +19 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-event-journal.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-event-journal.js +82 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-run-serialiser.d.ts +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-run-serialiser.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-run-serialiser.js +26 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-state-store.d.ts +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-state-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-state-store.js +20 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-projection-store.d.ts +9 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-projection-store.d.ts.map +1 -0
- package/dist/src/{persistence → node_modules/@atolis-hq/eventing/dist}/memory/in-memory-projection-store.js +2 -1
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-process-journal-change-signal.d.ts +10 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-process-journal-change-signal.d.ts.map +1 -0
- package/dist/src/{kernel/infrastructure/journal-change-signal.js → node_modules/@atolis-hq/eventing/dist/memory/in-process-journal-change-signal.js} +5 -2
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory.d.ts +7 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/memory.js +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-processor.d.ts +20 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-processor.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-processor.js +83 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-store.d.ts +22 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/cached-journal-view.d.ts +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/cached-journal-view.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/cached-journal-view.js +24 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/clock.d.ts +4 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/clock.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/event-processor-host.d.ts +39 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/event-processor-host.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/event-processor-host.js +168 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-health.d.ts +43 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-health.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-health.js +66 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-run-serialiser.d.ts +2 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-run-serialiser.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-run-serialiser.js +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-validation.d.ts +7 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-validation.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-validation.js +43 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/checkpoint-store.d.ts +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/checkpoint-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/checkpoint-store.js +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/event-journal.d.ts +14 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/store/event-journal.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/event-processor.d.ts +49 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/event-processor.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/event-processor.js +17 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/journal-change-signal.d.ts +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/journal-change-signal.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/journal-change-signal.js +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing/package.json +42 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/LICENSE +201 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/README.md +40 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/atomic-write.d.ts +23 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/atomic-write.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/atomic-write.js +54 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/event-record-codec.d.ts +4 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/event-record-codec.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/event-record-codec.js +50 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-checkpoint-store.d.ts +17 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-checkpoint-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-checkpoint-store.js +99 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-event-journal.d.ts +51 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-event-journal.d.ts.map +1 -0
- package/dist/src/{persistence/filesystem → node_modules/@atolis-hq/eventing-filesystem/dist}/file-event-journal.js +185 -103
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-lock.d.ts +34 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-lock.d.ts.map +1 -0
- package/dist/src/{persistence/filesystem → node_modules/@atolis-hq/eventing-filesystem/dist}/file-lock.js +10 -1
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-run-serialiser.d.ts +9 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-run-serialiser.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-run-serialiser.js +82 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-state-store.d.ts +12 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-state-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-state-store.js +127 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-projection-store.d.ts +19 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-projection-store.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-projection-store.js +219 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/index.d.ts +7 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/index.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/index.js +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-paths.d.ts +10 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-paths.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-paths.js +27 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-record.d.ts +8 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-record.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-record.js +28 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/storage-name.d.ts +6 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/storage-name.d.ts.map +1 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/storage-name.js +34 -0
- package/dist/src/node_modules/@atolis-hq/eventing-filesystem/package.json +38 -0
- package/dist/src/orchestration/application/accept-activity-outcome.d.ts +18 -0
- package/dist/src/orchestration/application/accept-signal.d.ts +14 -0
- package/dist/src/orchestration/application/advance-workflow.d.ts +50 -0
- package/dist/src/orchestration/application/advance-workflow.js +7 -12
- package/dist/src/orchestration/application/coordination-claims.d.ts +17 -0
- package/dist/src/orchestration/application/coordination-claims.js +17 -20
- package/dist/src/orchestration/application/durable-append.d.ts +17 -0
- package/dist/src/orchestration/application/durable-append.js +1 -1
- package/dist/src/orchestration/application/group-budget-recorder.d.ts +9 -0
- package/dist/src/orchestration/application/group-budget-recorder.js +9 -6
- package/dist/src/orchestration/application/orchestration-projection.d.ts +6 -0
- package/dist/src/orchestration/application/orchestration-projection.js +6 -7
- package/dist/src/orchestration/application/orchestration-repository.d.ts +23 -0
- package/dist/src/orchestration/application/orchestration-repository.js +2 -2
- package/dist/src/orchestration/application/orchestration-service.d.ts +93 -0
- package/dist/src/orchestration/application/orchestration-service.js +10 -1
- package/dist/src/orchestration/application/pull-request-transition-evidence.d.ts +3 -0
- package/dist/src/orchestration/application/pull-request-transition-evidence.js +10 -10
- package/dist/src/orchestration/application/reactor-command-context.d.ts +5 -0
- package/dist/src/orchestration/application/reactor-command-context.js +9 -0
- package/dist/src/orchestration/application/request-child.d.ts +29 -0
- package/dist/src/orchestration/application/request-child.js +26 -10
- package/dist/src/orchestration/application/resource-transition-evidence.d.ts +18 -0
- package/dist/src/orchestration/application/resource-transition-matching.d.ts +19 -0
- package/dist/src/orchestration/application/resource-transition-matching.js +9 -3
- package/dist/src/orchestration/application/resource-transition-reactor.d.ts +16 -0
- package/dist/src/orchestration/application/resource-transition-reactor.js +21 -42
- package/dist/src/orchestration/application/signal-reactor.d.ts +11 -0
- package/dist/src/orchestration/application/start-workflow.d.ts +18 -0
- package/dist/src/orchestration/application/start-workflow.js +3 -4
- package/dist/src/orchestration/application/trigger-workflow-instance.d.ts +12 -0
- package/dist/src/orchestration/application/trigger-workflow-instance.js +1 -1
- package/dist/src/orchestration/application/watch-child-transitions.d.ts +2 -0
- package/dist/src/orchestration/application/watch-matching.d.ts +13 -0
- package/dist/src/orchestration/application/watch-matching.js +3 -3
- package/dist/src/orchestration/application/watch-reactor.d.ts +42 -0
- package/dist/src/orchestration/application/watch-reactor.js +36 -35
- package/dist/src/orchestration/application/workflow-definition-registry.d.ts +32 -0
- package/dist/src/orchestration/application/workflow-definition-registry.js +13 -11
- package/dist/src/orchestration/contracts/activity-outcome.d.ts +15 -0
- package/dist/src/orchestration/contracts/commands.d.ts +30 -0
- package/dist/src/orchestration/contracts/config.d.ts +356 -0
- package/dist/src/orchestration/contracts/event-decoder.d.ts +262 -0
- package/dist/src/orchestration/contracts/event-decoder.js +88 -64
- package/dist/src/orchestration/contracts/event-factory.d.ts +6 -0
- package/dist/src/orchestration/contracts/event-factory.js +64 -0
- package/dist/src/orchestration/contracts/events.d.ts +233 -0
- package/dist/src/orchestration/contracts/identifiers.d.ts +15 -0
- package/dist/src/orchestration/contracts/streams.d.ts +28 -0
- package/dist/src/orchestration/contracts/views.d.ts +68 -0
- package/dist/src/orchestration/contracts/vocabulary.d.ts +34 -0
- package/dist/src/orchestration/domain/activation-policy.d.ts +60 -0
- package/dist/src/orchestration/domain/activation-policy.js +34 -19
- package/dist/src/orchestration/domain/approval-defaults.d.ts +8 -0
- package/dist/src/orchestration/domain/child-policy.d.ts +20 -0
- package/dist/src/orchestration/domain/compiler.d.ts +3 -0
- package/dist/src/orchestration/domain/coordination-events.d.ts +18 -0
- package/dist/src/orchestration/domain/coordination-events.js +25 -11
- package/dist/src/orchestration/domain/decision-events.d.ts +33 -0
- package/dist/src/orchestration/domain/decision-events.js +26 -15
- package/dist/src/orchestration/domain/interpreter.d.ts +14 -0
- package/dist/src/orchestration/domain/interpreter.js +4 -1
- package/dist/src/orchestration/domain/operator-retry-policy.d.ts +14 -0
- package/dist/src/orchestration/domain/operator-retry-policy.js +29 -11
- package/dist/src/orchestration/domain/resource-transition-compiler.d.ts +8 -0
- package/dist/src/orchestration/domain/retry-policy.d.ts +7 -0
- package/dist/src/orchestration/domain/retry-policy.js +7 -4
- package/dist/src/orchestration/domain/runner-quota-retry-policy.d.ts +10 -0
- package/dist/src/orchestration/domain/runner-quota-retry-policy.js +21 -15
- package/dist/src/orchestration/domain/signal-policy.d.ts +11 -0
- package/dist/src/orchestration/domain/signal-policy.js +18 -7
- package/dist/src/orchestration/domain/supplemental-policy.d.ts +11 -0
- package/dist/src/orchestration/domain/supplemental-policy.js +29 -14
- package/dist/src/orchestration/domain/transition.d.ts +16 -0
- package/dist/src/orchestration/domain/transition.js +46 -28
- package/dist/src/orchestration/domain/workflow-graph.d.ts +4 -0
- package/dist/src/orchestration/domain/workflow-instance-events.d.ts +44 -0
- package/dist/src/orchestration/domain/workflow-instance.d.ts +7 -0
- package/dist/src/orchestration/domain/workflow-instance.js +29 -9
- package/dist/src/orchestration/domain/workflow-selector.d.ts +15 -0
- package/dist/src/orchestration/index.d.ts +27 -0
- package/dist/src/orchestration/index.js +1 -0
- package/dist/src/resources/application/lookup-projections.d.ts +6 -0
- package/dist/src/resources/application/lookup-projections.js +15 -15
- package/dist/src/resources/application/resource-correlation-retry.d.ts +16 -0
- package/dist/src/resources/application/resource-correlation-retry.js +39 -44
- package/dist/src/resources/application/resource-event-support.d.ts +12 -0
- package/dist/src/resources/application/resource-event-support.js +17 -0
- package/dist/src/resources/application/resource-lookup.d.ts +17 -0
- package/dist/src/resources/application/resource-lookup.js +9 -9
- package/dist/src/resources/application/resource-projections.d.ts +4 -0
- package/dist/src/resources/application/resource-projections.js +32 -24
- package/dist/src/resources/application/resource-repository.d.ts +16 -0
- package/dist/src/resources/application/resource-repository.js +3 -3
- package/dist/src/resources/application/resource-service.d.ts +34 -0
- package/dist/src/resources/application/resource-service.js +73 -52
- package/dist/src/resources/contracts/commands.d.ts +23 -0
- package/dist/src/resources/contracts/config.d.ts +3 -0
- package/dist/src/resources/contracts/event-factory.d.ts +6 -0
- package/dist/src/resources/contracts/event-factory.js +32 -0
- package/dist/src/resources/contracts/events.d.ts +79 -0
- package/dist/src/resources/contracts/events.js +94 -102
- package/dist/src/resources/contracts/identifiers.d.ts +7 -0
- package/dist/src/resources/contracts/streams.d.ts +8 -0
- package/dist/src/resources/contracts/views.d.ts +35 -0
- package/dist/src/resources/contracts/vocabulary.d.ts +50 -0
- package/dist/src/resources/domain/correlation.d.ts +6 -0
- package/dist/src/resources/domain/resource.d.ts +8 -0
- package/dist/src/resources/domain/resource.js +24 -21
- package/dist/src/resources/index.d.ts +15 -0
- package/dist/src/resources/index.js +1 -0
- package/dist/src/surfaces/api/contracts/activities.d.ts +1 -0
- package/dist/src/surfaces/api/contracts/board.d.ts +46 -0
- package/dist/src/surfaces/api/contracts/board.js +1 -1
- package/dist/src/surfaces/api/contracts/common.d.ts +43 -0
- package/dist/src/surfaces/api/contracts/control-plane.d.ts +37 -0
- package/dist/src/surfaces/api/contracts/events.d.ts +13 -0
- package/dist/src/surfaces/api/contracts/execution.d.ts +67 -0
- package/dist/src/surfaces/api/contracts/index.d.ts +14 -0
- package/dist/src/surfaces/api/contracts/observability.d.ts +10 -0
- package/dist/src/surfaces/api/contracts/orchestration.d.ts +16 -0
- package/dist/src/surfaces/api/contracts/resources.d.ts +10 -0
- package/dist/src/surfaces/api/contracts/status.d.ts +4 -0
- package/dist/src/surfaces/api/contracts/system.d.ts +32 -0
- package/dist/src/surfaces/api/contracts/transport-values.d.ts +50 -0
- package/dist/src/surfaces/api/contracts/transport-values.js +6 -0
- package/dist/src/surfaces/api/contracts/work.d.ts +74 -0
- package/dist/src/surfaces/api/contracts/workflow-diagram.d.ts +64 -0
- package/dist/src/surfaces/api/http-server.d.ts +33 -0
- package/dist/src/surfaces/api/http-server.js +2 -2
- package/dist/src/surfaces/api/presenters/activities.d.ts +1 -0
- package/dist/src/surfaces/api/presenters/board.d.ts +2 -0
- package/dist/src/surfaces/api/presenters/control-plane.d.ts +1 -0
- package/dist/src/surfaces/api/presenters/events.d.ts +1 -0
- package/dist/src/surfaces/api/presenters/execution.d.ts +3 -0
- package/dist/src/surfaces/api/presenters/execution.js +5 -2
- package/dist/src/surfaces/api/presenters/observability.d.ts +1 -0
- package/dist/src/surfaces/api/presenters/orchestration.d.ts +3 -0
- package/dist/src/surfaces/api/presenters/resources.d.ts +3 -0
- package/dist/src/surfaces/api/presenters/status.d.ts +2 -0
- package/dist/src/surfaces/api/presenters/system.d.ts +2 -0
- package/dist/src/surfaces/api/presenters/work.d.ts +4 -0
- package/dist/src/surfaces/api/problem-details.d.ts +2 -0
- package/dist/src/surfaces/api/router.d.ts +8 -0
- package/dist/src/surfaces/api/routes/activities.d.ts +1 -0
- package/dist/src/surfaces/api/routes/applications.d.ts +88 -0
- package/dist/src/surfaces/api/routes/commands.d.ts +3 -0
- package/dist/src/surfaces/api/routes/commands.js +1 -3
- package/dist/src/surfaces/api/routes/control-plane.d.ts +1 -0
- package/dist/src/surfaces/api/routes/control-plane.js +0 -1
- package/dist/src/surfaces/api/routes/events.d.ts +1 -0
- package/dist/src/surfaces/api/routes/execution.d.ts +1 -0
- package/dist/src/surfaces/api/routes/index.d.ts +4 -0
- package/dist/src/surfaces/api/routes/observability.d.ts +1 -0
- package/dist/src/surfaces/api/routes/orchestration.d.ts +1 -0
- package/dist/src/surfaces/api/routes/pagination.d.ts +5 -0
- package/dist/src/surfaces/api/routes/read.d.ts +3 -0
- package/dist/src/surfaces/api/routes/resources.d.ts +1 -0
- package/dist/src/surfaces/api/routes/responses.d.ts +15 -0
- package/dist/src/surfaces/api/routes/system.d.ts +1 -0
- package/dist/src/surfaces/api/routes/work.d.ts +1 -0
- package/dist/src/surfaces/auth/credentials.d.ts +22 -0
- package/dist/src/surfaces/auth/credentials.js +8 -12
- package/dist/src/surfaces/auth/vocabulary.d.ts +9 -0
- package/dist/src/surfaces/cli/commands/api.d.ts +4 -0
- package/dist/src/surfaces/cli/commands/audit.d.ts +16 -0
- package/dist/src/surfaces/cli/commands/audit.js +11 -2
- package/dist/src/surfaces/cli/commands/correlate.d.ts +7 -0
- package/dist/src/surfaces/cli/commands/doctor.d.ts +24 -0
- package/dist/src/surfaces/cli/commands/init.d.ts +2 -0
- package/dist/src/surfaces/cli/commands/sandbox-entrypoint.d.ts +43 -0
- package/dist/src/surfaces/cli/commands/sandbox-setup.d.ts +9 -0
- package/dist/src/surfaces/cli/commands/sandbox.d.ts +16 -0
- package/dist/src/surfaces/cli/commands/self-update.d.ts +15 -0
- package/dist/src/surfaces/cli/commands/smoke.d.ts +14 -0
- package/dist/src/surfaces/cli/commands/start.d.ts +5 -0
- package/dist/src/surfaces/cli/commands/stop.d.ts +11 -0
- package/dist/src/surfaces/cli/commands/tick.d.ts +5 -0
- package/dist/src/surfaces/cli/commands/ui.d.ts +5 -0
- package/dist/src/surfaces/cli/commands/validate-state.d.ts +13 -0
- package/dist/src/surfaces/cli/infrastructure/docker-cli.d.ts +66 -0
- package/dist/src/surfaces/cli/infrastructure/docker-invocation.d.ts +14 -0
- package/dist/src/surfaces/cli/infrastructure/process-log.d.ts +35 -0
- package/dist/src/surfaces/cli/infrastructure/resident-start.d.ts +10 -0
- package/dist/src/surfaces/cli/main.d.ts +115 -0
- package/dist/src/surfaces/cli/usage.d.ts +1 -0
- package/dist/src/surfaces/contracts/config.d.ts +51 -0
- package/dist/src/surfaces/index.d.ts +49 -0
- package/dist/src/surfaces/web-assets/assets/index-D9xGa5tD.css +1 -0
- package/dist/src/surfaces/web-assets/assets/index-qai1Ymhv.js +1179 -0
- package/dist/src/surfaces/web-assets/index.html +2 -2
- package/dist/src/surfaces/web-host/asset-source.d.ts +9 -0
- package/dist/src/surfaces/web-host/packaged-assets.d.ts +8 -0
- package/dist/src/work/application/work-projection.d.ts +3 -0
- package/dist/src/work/application/work-projection.js +4 -4
- package/dist/src/work/application/work-repository.d.ts +15 -0
- package/dist/src/work/application/work-repository.js +2 -2
- package/dist/src/work/application/work-service.d.ts +18 -0
- package/dist/src/work/application/work-service.js +70 -31
- package/dist/src/work/contracts/commands.d.ts +15 -0
- package/dist/src/work/contracts/config.d.ts +3 -0
- package/dist/src/work/contracts/event-factory.d.ts +6 -0
- package/dist/src/work/contracts/event-factory.js +26 -0
- package/dist/src/work/contracts/events.d.ts +46 -0
- package/dist/src/work/contracts/events.js +54 -60
- package/dist/src/work/contracts/identifiers.d.ts +3 -0
- package/dist/src/work/contracts/streams.d.ts +8 -0
- package/dist/src/work/contracts/views.d.ts +18 -0
- package/dist/src/work/contracts/vocabulary.d.ts +7 -0
- package/dist/src/work/domain/work-item.d.ts +3 -0
- package/dist/src/work/domain/work-item.js +10 -7
- package/dist/src/work/index.d.ts +12 -0
- package/dist/src/work/index.js +1 -0
- package/docker/Dockerfile +9 -7
- package/docker/Dockerfile.packaged +4 -6
- package/package.json +24 -24
- package/dist/src/activities/pr/event-drafts.js +0 -66
- package/dist/src/kernel/contracts/events.js +0 -11
- package/dist/src/kernel/infrastructure/cached-journal-view.js +0 -27
- package/dist/src/persistence/application/projection-runner.js +0 -128
- package/dist/src/persistence/filesystem/file-checkpoint-store.js +0 -50
- package/dist/src/persistence/filesystem/file-projection-store.js +0 -137
- package/dist/src/persistence/index.js +0 -8
- package/dist/src/persistence/memory/in-memory-event-journal.js +0 -99
- package/dist/src/surfaces/web-assets/assets/index-B0ofn_L5.css +0 -1
- package/dist/src/surfaces/web-assets/assets/index-DFBhpSSX.js +0 -1179
- /package/dist/src/control-plane/application/{advance-once-ports.js → activation-scheduler-ports.js} +0 -0
- /package/dist/src/{kernel → node_modules/@atolis-hq/eventing/dist}/contracts/commands.js +0 -0
- /package/dist/src/{kernel/contracts/checkpoint-store.js → node_modules/@atolis-hq/eventing/dist/contracts/processor-state-store.js} +0 -0
- /package/dist/src/{persistence → node_modules/@atolis-hq/eventing/dist}/memory/in-memory-checkpoint-store.js +0 -0
- /package/dist/src/{kernel/contracts → node_modules/@atolis-hq/eventing/dist/projections}/projection-store.js +0 -0
- /package/dist/src/{kernel/contracts/journal-change-signal.js → node_modules/@atolis-hq/eventing/dist/runtime/clock.js} +0 -0
- /package/dist/src/{kernel/contracts → node_modules/@atolis-hq/eventing/dist/store}/event-journal.js +0 -0
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
|
-
import {
|
|
2
|
+
import { correlationId, defineEventProcessor, EventActorKind, EventProcessorCategory, EventProcessorReplayPolicy, EventSourceKind, WrongExpectedSequenceError, } from '@atolis-hq/eventing';
|
|
3
|
+
import { ActivityEventType, createPullRequestService, selectActivityEvent, } from '../../../activities/index.js';
|
|
3
4
|
import { conversationIdForWorkItem, ConversationOriginKind, } from '../../../conversations/index.js';
|
|
4
|
-
import {
|
|
5
|
-
import { BuiltInResourceCapability, BuiltInResourceKind, ResourceCorrelationRole, ResourceEventType, resourceId, resourceStream, } from '../../../resources/index.js';
|
|
5
|
+
import { UlidIdGenerator } from '../../../kernel/index.js';
|
|
6
|
+
import { BuiltInResourceCapability, BuiltInResourceKind, ResourceCorrelationRole, ResourceEventType, resourceId, resourceStream, selectResourceEvent, } from '../../../resources/index.js';
|
|
6
7
|
import { workItemId } from '../../../work/index.js';
|
|
7
8
|
import { admitObservedWork } from '../../application/work-admission.js';
|
|
8
9
|
import { concludeObservedWork } from '../../application/work-conclusion.js';
|
|
9
10
|
import { evaluateIntakeRules } from '../../contracts/intake-rules.js';
|
|
10
11
|
import { deliveryStream, integrationStream } from '../../contracts/streams.js';
|
|
11
12
|
import { DeliveryEventType, selectDeliveryEvent } from '../../delivery/contracts/events.js';
|
|
13
|
+
import { createGitHubEventData } from '../contracts/event-factory.js';
|
|
12
14
|
import { GitHubEventType, selectGitHubAdapterEvent } from '../contracts/events.js';
|
|
13
15
|
import { GitHubAdapter } from '../contracts/vocabulary.js';
|
|
14
16
|
import { commandContext } from './inbound-context.js';
|
|
@@ -18,10 +20,11 @@ import { gitHubIntakeFacts, gitHubIntakeRules } from './intake-policy.js';
|
|
|
18
20
|
import { observePullRequest } from './pull-request-translation.js';
|
|
19
21
|
export class InboundTranslator {
|
|
20
22
|
journal;
|
|
21
|
-
checkpoints;
|
|
22
23
|
work;
|
|
23
24
|
resources;
|
|
24
25
|
minted = new Map();
|
|
26
|
+
processor;
|
|
27
|
+
reconciler;
|
|
25
28
|
translate(payload) {
|
|
26
29
|
const { resourceId: resourceIdValue, workItemId: workItemIdValue } = this.newIdentity({
|
|
27
30
|
adapter: this.adapter,
|
|
@@ -45,9 +48,8 @@ export class InboundTranslator {
|
|
|
45
48
|
}
|
|
46
49
|
return commands;
|
|
47
50
|
}
|
|
48
|
-
constructor(journal,
|
|
51
|
+
constructor(journal, work, resources, dependencies = {}) {
|
|
49
52
|
this.journal = journal;
|
|
50
|
-
this.checkpoints = checkpoints;
|
|
51
53
|
this.work = work;
|
|
52
54
|
this.resources = resources;
|
|
53
55
|
this.pullRequests = dependencies.pullRequests;
|
|
@@ -60,6 +62,16 @@ export class InboundTranslator {
|
|
|
60
62
|
this.intake = gitHubIntakeRules(dependencies.intake ?? []);
|
|
61
63
|
this.conclusion = dependencies.conclusion;
|
|
62
64
|
this.conversations = dependencies.conversations;
|
|
65
|
+
this.processor = defineEventProcessor({
|
|
66
|
+
consumer: `reactor:integration.${this.adapter}.inbound`,
|
|
67
|
+
name: `integration.${this.adapter}.inbound`,
|
|
68
|
+
owner: 'integrations',
|
|
69
|
+
category: EventProcessorCategory.Translator,
|
|
70
|
+
replayPolicy: EventProcessorReplayPolicy.Idempotent,
|
|
71
|
+
select: (event) => this.selectInboundEvent(event),
|
|
72
|
+
handle: async (event) => this.translateEvent(event),
|
|
73
|
+
});
|
|
74
|
+
this.reconciler = { reconcileOnce: () => this.reconcileOnce() };
|
|
63
75
|
}
|
|
64
76
|
pullRequests;
|
|
65
77
|
ids;
|
|
@@ -72,66 +84,30 @@ export class InboundTranslator {
|
|
|
72
84
|
conclusion;
|
|
73
85
|
conversations;
|
|
74
86
|
conversationRecordRecoveryPending;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (this.journal === undefined ||
|
|
78
|
-
this.checkpoints === undefined ||
|
|
79
|
-
this.work === undefined ||
|
|
80
|
-
this.resources === undefined) {
|
|
87
|
+
async reconcileOnce() {
|
|
88
|
+
if (this.journal === undefined || this.work === undefined || this.resources === undefined) {
|
|
81
89
|
throw new Error('InboundTranslator services are required to run evidence translation');
|
|
82
90
|
}
|
|
83
|
-
// Retry state is resource-scoped, so it progresses even when the provider
|
|
84
|
-
// has no further observations for the broken resource.
|
|
85
91
|
await this.resources.retryPendingWorkCorrelations();
|
|
86
92
|
await this.applyDeferredExternalOutcomes();
|
|
87
|
-
const checkpoint = `reactor:integration.${this.adapter}.inbound`;
|
|
88
93
|
await this.retryPendingConversationRecords();
|
|
89
|
-
await this.retryPendingTranslations();
|
|
90
|
-
const position = await this.checkpoints.load(checkpoint);
|
|
91
|
-
const events = await this.journal.readAll(position, limit);
|
|
92
|
-
for (const event of events) {
|
|
93
|
-
await this.translateEvent(event);
|
|
94
|
-
await this.checkpoints.save(checkpoint, event.globalPosition);
|
|
95
|
-
}
|
|
96
|
-
return events.length;
|
|
97
94
|
}
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
.map(selectGitHubAdapterEvent)
|
|
102
|
-
.filter((event) => event !== null);
|
|
103
|
-
const failures = new Set(owned
|
|
104
|
-
.filter((event) => event.eventType === GitHubEventType.InboundTranslationFailed)
|
|
105
|
-
.map((event) => event.payload.sourceEventId));
|
|
106
|
-
const pending = new Set(owned
|
|
107
|
-
.filter((event) => event.eventType === GitHubEventType.InboundTranslationRetried)
|
|
108
|
-
.map((event) => event.payload.sourceEventId));
|
|
109
|
-
const recovered = new Set(owned
|
|
110
|
-
.filter((event) => event.eventType === GitHubEventType.InboundTranslationRecovered)
|
|
111
|
-
.map((event) => event.payload.sourceEventId));
|
|
112
|
-
for (const event of owned) {
|
|
113
|
-
if (pending.has(event.eventId) &&
|
|
114
|
-
!failures.has(event.eventId) &&
|
|
115
|
-
!recovered.has(event.eventId) &&
|
|
116
|
-
this.isTranslatable(event))
|
|
117
|
-
await this.translateEvent(event);
|
|
118
|
-
}
|
|
95
|
+
selectInboundEvent(event) {
|
|
96
|
+
const owned = selectGitHubAdapterEvent(event);
|
|
97
|
+
return owned === null || !this.isTranslatable(owned) ? null : owned;
|
|
119
98
|
}
|
|
120
99
|
isTranslatable(event) {
|
|
121
100
|
return (event.stream.id === this.adapter &&
|
|
122
|
-
(event.eventType === GitHubEventType.WorkObserved ||
|
|
123
|
-
event.eventType === GitHubEventType.CommentObserved));
|
|
101
|
+
(event.event.eventType === GitHubEventType.WorkObserved ||
|
|
102
|
+
event.event.eventType === GitHubEventType.CommentObserved));
|
|
124
103
|
}
|
|
125
|
-
async translateEvent(
|
|
126
|
-
|
|
127
|
-
if (owned === null || !this.isTranslatable(owned))
|
|
128
|
-
return;
|
|
129
|
-
if (await this.failureRecorded(owned.eventId))
|
|
104
|
+
async translateEvent(owned) {
|
|
105
|
+
if (await this.failureRecorded(owned.event.eventId))
|
|
130
106
|
return;
|
|
131
107
|
try {
|
|
132
|
-
if (owned
|
|
108
|
+
if (isGitHubAdapterEventType(owned, GitHubEventType.WorkObserved))
|
|
133
109
|
await this.apply(owned);
|
|
134
|
-
if (owned
|
|
110
|
+
if (isGitHubAdapterEventType(owned, GitHubEventType.CommentObserved)) {
|
|
135
111
|
if (!(await this.suppressWorkItemEffects(owned)))
|
|
136
112
|
await applyReviewSignal({
|
|
137
113
|
event: owned,
|
|
@@ -156,11 +132,12 @@ export class InboundTranslator {
|
|
|
156
132
|
await this.recordConversationDeferred(owned);
|
|
157
133
|
}
|
|
158
134
|
}
|
|
159
|
-
if (await this.retryRecorded(owned.eventId))
|
|
135
|
+
if (await this.retryRecorded(owned.event.eventId))
|
|
160
136
|
await this.recordTranslationRecovery(owned);
|
|
161
137
|
}
|
|
162
138
|
catch (error) {
|
|
163
139
|
await this.recordTranslationFailure(owned, error);
|
|
140
|
+
throw error;
|
|
164
141
|
}
|
|
165
142
|
}
|
|
166
143
|
async retryPendingConversationRecords() {
|
|
@@ -171,16 +148,17 @@ export class InboundTranslator {
|
|
|
171
148
|
.map(selectGitHubAdapterEvent)
|
|
172
149
|
.filter((event) => event !== null);
|
|
173
150
|
const recovered = new Set(events
|
|
174
|
-
.filter((event) => event
|
|
175
|
-
.map((event) => event.payload.sourceEventId));
|
|
151
|
+
.filter((event) => isGitHubAdapterEventType(event, GitHubEventType.ConversationRecordRecovered))
|
|
152
|
+
.map((event) => event.event.payload.sourceEventId));
|
|
176
153
|
const pending = events
|
|
177
|
-
.filter((event) => event
|
|
178
|
-
.filter((event) => !recovered.has(event.payload.sourceEventId));
|
|
154
|
+
.filter((event) => isGitHubAdapterEventType(event, GitHubEventType.ConversationRecordDeferred))
|
|
155
|
+
.filter((event) => !recovered.has(event.event.payload.sourceEventId));
|
|
179
156
|
this.conversationRecordRecoveryPending = pending.length > 0;
|
|
180
157
|
let stillPending = false;
|
|
181
158
|
for (const deferred of pending) {
|
|
182
|
-
const source = events.find((event) => event.eventId === deferred.payload.sourceEventId);
|
|
183
|
-
if (source
|
|
159
|
+
const source = events.find((event) => event.event.eventId === deferred.event.payload.sourceEventId);
|
|
160
|
+
if (source === undefined ||
|
|
161
|
+
!isGitHubAdapterEventType(source, GitHubEventType.CommentObserved)) {
|
|
184
162
|
stillPending = true;
|
|
185
163
|
continue;
|
|
186
164
|
}
|
|
@@ -201,21 +179,20 @@ export class InboundTranslator {
|
|
|
201
179
|
}
|
|
202
180
|
async appendConversationRecordFact(eventType, source) {
|
|
203
181
|
const stream = integrationStream(this.adapter);
|
|
204
|
-
const eventId = `github:${eventType}:${this.adapter}:${source.eventId}`;
|
|
182
|
+
const eventId = `github:${eventType}:${this.adapter}:${source.event.eventId}`;
|
|
205
183
|
const existing = await this.journal.readStream(stream);
|
|
206
|
-
if (existing.some((event) => event.eventId === eventId))
|
|
184
|
+
if (existing.some((event) => event.event.eventId === eventId))
|
|
207
185
|
return;
|
|
208
|
-
await this.journal.
|
|
209
|
-
|
|
186
|
+
await this.journal.appendToStream(stream, existing.length, [
|
|
187
|
+
createGitHubEventData({
|
|
210
188
|
eventId,
|
|
211
189
|
eventType,
|
|
212
|
-
occurredAt: source.occurredAt,
|
|
213
|
-
correlationId: source.correlationId,
|
|
214
|
-
causationId: source.eventId,
|
|
190
|
+
occurredAt: source.event.occurredAt,
|
|
191
|
+
correlationId: source.event.correlationId,
|
|
192
|
+
causationId: source.event.eventId,
|
|
215
193
|
actor: { kind: EventActorKind.Integration, id: this.adapter },
|
|
216
194
|
source: { kind: EventSourceKind.Internal, id: 'github-inbound-translator' },
|
|
217
|
-
|
|
218
|
-
payload: { adapter: this.adapter, sourceEventId: source.eventId },
|
|
195
|
+
payload: { adapter: this.adapter, sourceEventId: source.event.eventId },
|
|
219
196
|
}),
|
|
220
197
|
]);
|
|
221
198
|
}
|
|
@@ -225,7 +202,7 @@ export class InboundTranslator {
|
|
|
225
202
|
return;
|
|
226
203
|
const resource = await this.resources.findByExternalKey({
|
|
227
204
|
adapter: this.adapter,
|
|
228
|
-
key: event.payload.externalKey,
|
|
205
|
+
key: event.event.payload.externalKey,
|
|
229
206
|
});
|
|
230
207
|
if (resource === null)
|
|
231
208
|
return;
|
|
@@ -248,62 +225,62 @@ export class InboundTranslator {
|
|
|
248
225
|
representation.externalId === externalId)))
|
|
249
226
|
return;
|
|
250
227
|
if (priorEntry !== undefined) {
|
|
251
|
-
if (priorEntry.body !== event.payload.body)
|
|
228
|
+
if (priorEntry.body !== event.event.payload.body)
|
|
252
229
|
await this.conversations.revise({
|
|
253
230
|
conversationId,
|
|
254
231
|
entryId: priorEntry.entryId,
|
|
255
|
-
body: event.payload.body,
|
|
232
|
+
body: event.event.payload.body,
|
|
256
233
|
}, commandContext(event));
|
|
257
234
|
return;
|
|
258
235
|
}
|
|
259
236
|
await this.conversations.record({
|
|
260
237
|
conversationId,
|
|
261
|
-
entryId: event.eventId,
|
|
262
|
-
body: event.payload.body,
|
|
238
|
+
entryId: event.event.eventId,
|
|
239
|
+
body: event.event.payload.body,
|
|
263
240
|
origin: {
|
|
264
241
|
kind: ConversationOriginKind.External,
|
|
265
242
|
adapter: this.adapter,
|
|
266
|
-
actorId: event.payload.actor.id,
|
|
243
|
+
actorId: event.event.payload.actor.id,
|
|
267
244
|
resourceId: resource.resourceId,
|
|
268
245
|
threadId: resource.externalKey.key,
|
|
269
246
|
messageId: externalId,
|
|
270
|
-
...(event.payload.reviewKind !== 'issue' ||
|
|
247
|
+
...(event.event.payload.reviewKind !== 'issue' ||
|
|
248
|
+
event.event.payload.location === undefined
|
|
271
249
|
? {}
|
|
272
|
-
: { location: event.payload.location }),
|
|
250
|
+
: { location: event.event.payload.location }),
|
|
273
251
|
},
|
|
274
252
|
}, commandContext(event));
|
|
275
253
|
}
|
|
276
254
|
async failureRecorded(sourceEventId) {
|
|
277
255
|
return (await this.journal.readStream(integrationStream(this.adapter))).some((event) => {
|
|
278
256
|
const owned = selectGitHubAdapterEvent(event);
|
|
279
|
-
return (owned?.eventType === GitHubEventType.InboundTranslationFailed &&
|
|
280
|
-
owned.payload.sourceEventId === sourceEventId);
|
|
257
|
+
return (owned?.event.eventType === GitHubEventType.InboundTranslationFailed &&
|
|
258
|
+
owned.event.payload.sourceEventId === sourceEventId);
|
|
281
259
|
});
|
|
282
260
|
}
|
|
283
261
|
async retryRecorded(sourceEventId) {
|
|
284
262
|
return (await this.journal.readStream(integrationStream(this.adapter))).some((event) => {
|
|
285
263
|
const owned = selectGitHubAdapterEvent(event);
|
|
286
|
-
return (owned?.eventType === GitHubEventType.InboundTranslationRetried &&
|
|
287
|
-
owned.payload.sourceEventId === sourceEventId);
|
|
264
|
+
return (owned?.event.eventType === GitHubEventType.InboundTranslationRetried &&
|
|
265
|
+
owned.event.payload.sourceEventId === sourceEventId);
|
|
288
266
|
});
|
|
289
267
|
}
|
|
290
268
|
async recordTranslationRecovery(event) {
|
|
291
269
|
const stream = integrationStream(this.adapter);
|
|
292
|
-
const eventId = `github:inbound-translation-recovered:${this.adapter}:${event.eventId}`;
|
|
270
|
+
const eventId = `github:inbound-translation-recovered:${this.adapter}:${event.event.eventId}`;
|
|
293
271
|
const existing = await this.journal.readStream(stream);
|
|
294
|
-
if (existing.some((candidate) => candidate.eventId === eventId))
|
|
272
|
+
if (existing.some((candidate) => candidate.event.eventId === eventId))
|
|
295
273
|
return;
|
|
296
|
-
await this.journal.
|
|
297
|
-
|
|
274
|
+
await this.journal.appendToStream(stream, existing.length, [
|
|
275
|
+
createGitHubEventData({
|
|
298
276
|
eventId,
|
|
299
277
|
eventType: GitHubEventType.InboundTranslationRecovered,
|
|
300
|
-
occurredAt: event.occurredAt,
|
|
301
|
-
correlationId: event.correlationId,
|
|
302
|
-
causationId: event.eventId,
|
|
278
|
+
occurredAt: event.event.occurredAt,
|
|
279
|
+
correlationId: event.event.correlationId,
|
|
280
|
+
causationId: event.event.eventId,
|
|
303
281
|
actor: { kind: EventActorKind.Integration, id: this.adapter },
|
|
304
282
|
source: { kind: EventSourceKind.Internal, id: 'github-inbound-translator' },
|
|
305
|
-
|
|
306
|
-
payload: { adapter: this.adapter, sourceEventId: event.eventId },
|
|
283
|
+
payload: { adapter: this.adapter, sourceEventId: event.event.eventId },
|
|
307
284
|
}),
|
|
308
285
|
]);
|
|
309
286
|
}
|
|
@@ -313,51 +290,53 @@ export class InboundTranslator {
|
|
|
313
290
|
const retries = existing.reduce((count, candidate) => {
|
|
314
291
|
const owned = selectGitHubAdapterEvent(candidate);
|
|
315
292
|
return (count +
|
|
316
|
-
Number(owned?.eventType === GitHubEventType.InboundTranslationRetried &&
|
|
317
|
-
owned.payload.sourceEventId === event.eventId));
|
|
293
|
+
Number(owned?.event.eventType === GitHubEventType.InboundTranslationRetried &&
|
|
294
|
+
owned.event.payload.sourceEventId === event.event.eventId));
|
|
318
295
|
}, 0);
|
|
319
296
|
const attempt = retries + 1;
|
|
320
297
|
const message = error instanceof Error ? error.message : String(error);
|
|
321
298
|
const terminal = retries >= 3;
|
|
322
299
|
const eventId = terminal
|
|
323
|
-
? `github:inbound-translation-failed:${this.adapter}:${event.eventId}`
|
|
324
|
-
: `github:inbound-translation-retried:${this.adapter}:${event.eventId}:${attempt}`;
|
|
325
|
-
const
|
|
300
|
+
? `github:inbound-translation-failed:${this.adapter}:${event.event.eventId}`
|
|
301
|
+
: `github:inbound-translation-retried:${this.adapter}:${event.event.eventId}:${attempt}`;
|
|
302
|
+
const diagnostic = terminal
|
|
326
303
|
? {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
304
|
+
eventType: GitHubEventType.InboundTranslationFailed,
|
|
305
|
+
payload: {
|
|
306
|
+
adapter: this.adapter,
|
|
307
|
+
sourceEventId: event.event.eventId,
|
|
308
|
+
attempt,
|
|
309
|
+
message,
|
|
310
|
+
globalPosition: event.globalPosition,
|
|
311
|
+
eventType: event.event.eventType,
|
|
312
|
+
correlationId: event.event.correlationId,
|
|
313
|
+
causationId: event.event.causationId,
|
|
314
|
+
failedAt: event.event.occurredAt,
|
|
315
|
+
},
|
|
336
316
|
}
|
|
337
|
-
: {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
317
|
+
: {
|
|
318
|
+
eventType: GitHubEventType.InboundTranslationRetried,
|
|
319
|
+
payload: { adapter: this.adapter, sourceEventId: event.event.eventId, attempt, message },
|
|
320
|
+
};
|
|
321
|
+
await this.appendTranslationDiagnostic(eventId, event, diagnostic);
|
|
322
|
+
console.error(`Inbound translation failed for ${event.event.eventId} (attempt ${attempt})`, error);
|
|
342
323
|
}
|
|
343
|
-
async appendTranslationDiagnostic(eventId,
|
|
324
|
+
async appendTranslationDiagnostic(eventId, source, diagnostic) {
|
|
344
325
|
const stream = integrationStream(this.adapter);
|
|
345
326
|
for (let contentionAttempts = 0; contentionAttempts < 3; contentionAttempts += 1) {
|
|
346
327
|
const existing = await this.journal.readStream(stream);
|
|
347
|
-
if (existing.some((event) => event.eventId === eventId))
|
|
328
|
+
if (existing.some((event) => event.event.eventId === eventId))
|
|
348
329
|
return;
|
|
349
330
|
try {
|
|
350
|
-
await this.journal.
|
|
351
|
-
|
|
331
|
+
await this.journal.appendToStream(stream, existing.length, [
|
|
332
|
+
createGitHubEventData({
|
|
352
333
|
eventId,
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
causationId: source.eventId,
|
|
334
|
+
occurredAt: source.event.occurredAt,
|
|
335
|
+
correlationId: source.event.correlationId,
|
|
336
|
+
causationId: source.event.eventId,
|
|
357
337
|
actor: { kind: EventActorKind.Integration, id: this.adapter },
|
|
358
338
|
source: { kind: EventSourceKind.Internal, id: 'github-inbound-translator' },
|
|
359
|
-
|
|
360
|
-
payload,
|
|
339
|
+
...diagnostic,
|
|
361
340
|
}),
|
|
362
341
|
]);
|
|
363
342
|
return;
|
|
@@ -372,7 +351,7 @@ export class InboundTranslator {
|
|
|
372
351
|
async suppressWorkItemEffects(event) {
|
|
373
352
|
const resourceIdValue = await this.lookup?.resourceIdForExternalKey({
|
|
374
353
|
adapter: this.adapter,
|
|
375
|
-
key: event.payload.externalKey,
|
|
354
|
+
key: event.event.payload.externalKey,
|
|
376
355
|
});
|
|
377
356
|
if (resourceIdValue === null || resourceIdValue === undefined)
|
|
378
357
|
return false;
|
|
@@ -385,13 +364,13 @@ export class InboundTranslator {
|
|
|
385
364
|
async apply(event) {
|
|
386
365
|
if (this.work === undefined || this.resources === undefined)
|
|
387
366
|
return;
|
|
388
|
-
const payload = event.payload;
|
|
367
|
+
const payload = event.event.payload;
|
|
389
368
|
const context = commandContext(event);
|
|
390
369
|
const pullRequests = this.pullRequests ?? createPullRequestService(this.journal, this.work, this.resources);
|
|
391
370
|
const intake = evaluateIntakeRules(this.intake, gitHubIntakeFacts(payload));
|
|
392
371
|
if (intake.ignored)
|
|
393
372
|
return;
|
|
394
|
-
const identity = await this.resolveIdentity(event.eventId, { adapter: this.adapter, key: payload.externalKey }, intake.admitted);
|
|
373
|
+
const identity = await this.resolveIdentity(event.event.eventId, { adapter: this.adapter, key: payload.externalKey }, intake.admitted);
|
|
395
374
|
if (identity === null)
|
|
396
375
|
return;
|
|
397
376
|
if (!identity.created) {
|
|
@@ -523,21 +502,27 @@ export class InboundTranslator {
|
|
|
523
502
|
/** A confirmed completion consumes exactly one matching terminal observation. */
|
|
524
503
|
async unconsumedWakeCompletion(resourceIdValue) {
|
|
525
504
|
const events = await this.journal.readStream(resourceStream(resourceIdValue));
|
|
526
|
-
const intents = events
|
|
505
|
+
const intents = events
|
|
506
|
+
.map(selectActivityEvent)
|
|
507
|
+
.filter((event) => event?.event.eventType === ActivityEventType.IssueCompleteRequested);
|
|
527
508
|
for (const intent of intents) {
|
|
528
|
-
if (
|
|
529
|
-
event.eventType === ResourceEventType.IssueCompletionObservationSuperseded) &&
|
|
530
|
-
event.payload !== null &&
|
|
531
|
-
typeof event.payload === 'object' &&
|
|
532
|
-
'intentEventId' in event.payload &&
|
|
533
|
-
event.payload.intentEventId === intent.eventId))
|
|
509
|
+
if (intent?.event.eventType !== ActivityEventType.IssueCompleteRequested)
|
|
534
510
|
continue;
|
|
535
|
-
|
|
511
|
+
if (events.some((event) => {
|
|
512
|
+
const resourceEvent = selectResourceEvent(event);
|
|
513
|
+
return ((resourceEvent?.event.eventType ===
|
|
514
|
+
ResourceEventType.IssueCompletionObservationConsumed ||
|
|
515
|
+
resourceEvent?.event.eventType ===
|
|
516
|
+
ResourceEventType.IssueCompletionObservationSuperseded) &&
|
|
517
|
+
resourceEvent.event.payload.intentEventId === intent.event.eventId);
|
|
518
|
+
}))
|
|
519
|
+
continue;
|
|
520
|
+
const deliveries = await this.journal.readStream(deliveryStream(intent.event.eventId));
|
|
536
521
|
if (deliveries.some((event) => {
|
|
537
522
|
const delivery = selectDeliveryEvent(event);
|
|
538
|
-
return delivery?.eventType === DeliveryEventType.Confirmed;
|
|
523
|
+
return delivery?.event.eventType === DeliveryEventType.Confirmed;
|
|
539
524
|
}))
|
|
540
|
-
return intent.eventId;
|
|
525
|
+
return intent.event.eventId;
|
|
541
526
|
}
|
|
542
527
|
return null;
|
|
543
528
|
}
|
|
@@ -599,11 +584,14 @@ export class InboundTranslator {
|
|
|
599
584
|
async recordedAdmissionIdentity(sourceEventId) {
|
|
600
585
|
const event = (await this.journal.readStream(integrationStream(this.adapter)))
|
|
601
586
|
.map(selectGitHubAdapterEvent)
|
|
602
|
-
.find((candidate) => candidate?.eventType === GitHubEventType.AdmissionStarted &&
|
|
603
|
-
candidate.payload.sourceEventId === sourceEventId);
|
|
604
|
-
if (event?.eventType !== GitHubEventType.AdmissionStarted)
|
|
587
|
+
.find((candidate) => candidate?.event.eventType === GitHubEventType.AdmissionStarted &&
|
|
588
|
+
candidate.event.payload.sourceEventId === sourceEventId);
|
|
589
|
+
if (event?.event.eventType !== GitHubEventType.AdmissionStarted)
|
|
605
590
|
return undefined;
|
|
606
|
-
return {
|
|
591
|
+
return {
|
|
592
|
+
resourceId: event.event.payload.resourceId,
|
|
593
|
+
workItemId: event.event.payload.workItemId,
|
|
594
|
+
};
|
|
607
595
|
}
|
|
608
596
|
async resumeAdmissionIdentity(identity) {
|
|
609
597
|
const work = await this.work.get(identity.workItemId);
|
|
@@ -617,22 +605,21 @@ export class InboundTranslator {
|
|
|
617
605
|
if (identity.workItemId === null)
|
|
618
606
|
throw new Error('Created identity is missing a WorkItem');
|
|
619
607
|
const stream = integrationStream(this.adapter);
|
|
620
|
-
const eventId = `github:admission-started:${this.adapter}:${source.eventId}`;
|
|
608
|
+
const eventId = `github:admission-started:${this.adapter}:${source.event.eventId}`;
|
|
621
609
|
const existing = await this.journal.readStream(stream);
|
|
622
|
-
if (existing.some((event) => event.eventId === eventId))
|
|
610
|
+
if (existing.some((event) => event.event.eventId === eventId))
|
|
623
611
|
return;
|
|
624
|
-
await this.journal.
|
|
625
|
-
|
|
612
|
+
await this.journal.appendToStream(stream, existing.length, [
|
|
613
|
+
createGitHubEventData({
|
|
626
614
|
eventId,
|
|
627
615
|
eventType: GitHubEventType.AdmissionStarted,
|
|
628
|
-
occurredAt: source.occurredAt,
|
|
629
|
-
correlationId: source.correlationId,
|
|
630
|
-
causationId: source.eventId,
|
|
616
|
+
occurredAt: source.event.occurredAt,
|
|
617
|
+
correlationId: source.event.correlationId,
|
|
618
|
+
causationId: source.event.eventId,
|
|
631
619
|
actor: { kind: EventActorKind.Integration, id: this.adapter },
|
|
632
620
|
source: { kind: EventSourceKind.Internal, id: 'github-inbound-translator' },
|
|
633
|
-
stream,
|
|
634
621
|
payload: {
|
|
635
|
-
sourceEventId: source.eventId,
|
|
622
|
+
sourceEventId: source.event.eventId,
|
|
636
623
|
resourceId: identity.resourceId,
|
|
637
624
|
workItemId: identity.workItemId,
|
|
638
625
|
},
|
|
@@ -681,35 +668,34 @@ export class InboundTranslator {
|
|
|
681
668
|
}
|
|
682
669
|
async recordDeletedWorkObservation(event, workItemId) {
|
|
683
670
|
const stream = integrationStream(this.adapter);
|
|
684
|
-
const eventId = `github:deleted-work-skip:${event.eventId}:${workItemId}`;
|
|
671
|
+
const eventId = `github:deleted-work-skip:${event.event.eventId}:${workItemId}`;
|
|
685
672
|
const payload = {
|
|
686
|
-
externalKey: event.payload.externalKey,
|
|
673
|
+
externalKey: event.event.payload.externalKey,
|
|
687
674
|
workItemId,
|
|
688
|
-
sourceEventId: event.eventId,
|
|
689
|
-
revision: event.payload.revision,
|
|
675
|
+
sourceEventId: event.event.eventId,
|
|
676
|
+
revision: event.event.payload.revision,
|
|
690
677
|
reason: 'work-item-deleted',
|
|
691
678
|
};
|
|
692
679
|
for (;;) {
|
|
693
680
|
const existing = await this.journal.readStream(stream);
|
|
694
|
-
const recorded = existing.find((candidate) => candidate.eventId === eventId);
|
|
681
|
+
const recorded = existing.find((candidate) => candidate.event.eventId === eventId);
|
|
695
682
|
if (recorded !== undefined) {
|
|
696
683
|
const diagnostic = selectGitHubAdapterEvent(recorded);
|
|
697
|
-
if (diagnostic?.eventType !== GitHubEventType.DeletedWorkObservationSkipped ||
|
|
698
|
-
JSON.stringify(diagnostic.payload) !== JSON.stringify(payload))
|
|
684
|
+
if (diagnostic?.event.eventType !== GitHubEventType.DeletedWorkObservationSkipped ||
|
|
685
|
+
JSON.stringify(diagnostic.event.payload) !== JSON.stringify(payload))
|
|
699
686
|
throw new Error(`Event id ${eventId} has already been used with different content`);
|
|
700
687
|
return;
|
|
701
688
|
}
|
|
702
689
|
try {
|
|
703
|
-
await this.journal.
|
|
704
|
-
|
|
690
|
+
await this.journal.appendToStream(stream, existing.length, [
|
|
691
|
+
createGitHubEventData({
|
|
705
692
|
eventId,
|
|
706
693
|
eventType: GitHubEventType.DeletedWorkObservationSkipped,
|
|
707
|
-
occurredAt: event.occurredAt,
|
|
708
|
-
correlationId: event.correlationId,
|
|
709
|
-
causationId: event.eventId,
|
|
694
|
+
occurredAt: event.event.occurredAt,
|
|
695
|
+
correlationId: event.event.correlationId,
|
|
696
|
+
causationId: event.event.eventId,
|
|
710
697
|
actor: { kind: EventActorKind.Integration, id: this.adapter },
|
|
711
698
|
source: { kind: EventSourceKind.Internal, id: 'github-inbound-translator' },
|
|
712
|
-
stream,
|
|
713
699
|
payload,
|
|
714
700
|
}),
|
|
715
701
|
]);
|
|
@@ -723,6 +709,9 @@ export class InboundTranslator {
|
|
|
723
709
|
}
|
|
724
710
|
}
|
|
725
711
|
function observedCommentExternalId(event) {
|
|
726
|
-
const id = event.payload.raw.id;
|
|
727
|
-
return typeof id === 'string' || typeof id === 'number' ? String(id) : event.eventId;
|
|
712
|
+
const id = event.event.payload.raw.id;
|
|
713
|
+
return typeof id === 'string' || typeof id === 'number' ? String(id) : event.event.eventId;
|
|
714
|
+
}
|
|
715
|
+
function isGitHubAdapterEventType(event, eventType) {
|
|
716
|
+
return event.event.eventType === eventType;
|
|
728
717
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type RunRepository } from '../../../execution/index.js';
|
|
2
|
+
import { type OrchestrationService } from '../../../orchestration/index.js';
|
|
3
|
+
import type { GitHubAdapterEventOf, GitHubEventType } from '../contracts/events.js';
|
|
4
|
+
type CommentObservedEvent = GitHubAdapterEventOf<typeof GitHubEventType.CommentObserved>;
|
|
5
|
+
export declare function applyWatchGateVerdictSignal(input: {
|
|
6
|
+
readonly event: CommentObservedEvent;
|
|
7
|
+
readonly runs: RunRepository | undefined;
|
|
8
|
+
readonly orchestration: OrchestrationService | undefined;
|
|
9
|
+
}): Promise<void>;
|
|
10
|
+
export {};
|
|
@@ -43,7 +43,7 @@ export async function applyWatchGateVerdictSignal(input) {
|
|
|
43
43
|
const { event, runs, orchestration } = input;
|
|
44
44
|
if (runs === undefined || orchestration === undefined)
|
|
45
45
|
return;
|
|
46
|
-
const marker = extractMarker(event.payload.body);
|
|
46
|
+
const marker = extractMarker(event.event.payload.body);
|
|
47
47
|
if (marker === null)
|
|
48
48
|
return;
|
|
49
49
|
const outcome = translateOutcome(marker.outcome);
|
|
@@ -56,9 +56,9 @@ export async function applyWatchGateVerdictSignal(input) {
|
|
|
56
56
|
kind: WatchGateVerdictSignal,
|
|
57
57
|
outcome: verdict.outcome,
|
|
58
58
|
authority: { kind: ApprovalAuthorityKind.Watch, watch: verdict.childWatchId },
|
|
59
|
-
actorId: event.payload.actor.id,
|
|
60
|
-
actorDecision: { authorized: true, evidenceId: event.eventId },
|
|
61
|
-
providerEventId: event.eventId,
|
|
59
|
+
actorId: event.event.payload.actor.id,
|
|
60
|
+
actorDecision: { authorized: true, evidenceId: event.event.eventId },
|
|
61
|
+
providerEventId: event.event.eventId,
|
|
62
62
|
}, commandContext(event));
|
|
63
63
|
}
|
|
64
64
|
async function verifyWatchGateVerdict(input) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IntakeFacts, IntakeRule } from '../../contracts/intake-rules.js';
|
|
2
|
+
import type { GitHubIntakeRuleConfig } from '../contracts/config.js';
|
|
3
|
+
import type { ExternalWorkObservedPayload } from '../contracts/events.js';
|
|
4
|
+
import type { GitHubIssueQueryFilters } from '../contracts/issue-query.js';
|
|
5
|
+
export declare function gitHubIntakeRules(configured: readonly GitHubIntakeRuleConfig[]): readonly IntakeRule[];
|
|
6
|
+
export declare function gitHubIssueQueryFilters(configured: readonly GitHubIntakeRuleConfig[]): GitHubIssueQueryFilters;
|
|
7
|
+
export declare function gitHubIntakeFacts(payload: ExternalWorkObservedPayload): IntakeFacts;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ignoreIneligibleOperatorRetry(retry: () => Promise<unknown>): Promise<void>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MergeMethod } from '../../../activities/index.js';
|
|
2
|
+
import type { ResourceView } from '../../../resources/index.js';
|
|
3
|
+
import type { DeliveryIntentView } from '../../delivery/contracts/views.js';
|
|
4
|
+
import { type GitHubOutboundAction as GitHubOutboundActionValue } from '../contracts/vocabulary.js';
|
|
5
|
+
interface GitHubOutboundCommand {
|
|
6
|
+
readonly owner: string;
|
|
7
|
+
readonly repo: string;
|
|
8
|
+
readonly issue_number?: number;
|
|
9
|
+
readonly pull_number?: number;
|
|
10
|
+
readonly action: GitHubOutboundActionValue;
|
|
11
|
+
readonly idempotencyKey: string;
|
|
12
|
+
readonly body?: string;
|
|
13
|
+
readonly sha?: string;
|
|
14
|
+
readonly merge_method?: MergeMethod;
|
|
15
|
+
}
|
|
16
|
+
export declare function translateGitHubOutbound(resource: ResourceView, intent: DeliveryIntentView, options?: {
|
|
17
|
+
readonly publicUiUrl?: string | undefined;
|
|
18
|
+
}): GitHubOutboundCommand;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EventJournal } from '@atolis-hq/eventing';
|
|
2
|
+
import { type GitHubAdapterEventData } from '../contracts/events.js';
|
|
3
|
+
export interface ExternalEventSource {
|
|
4
|
+
poll(signal: AbortSignal): Promise<readonly GitHubAdapterEventData[]>;
|
|
5
|
+
}
|
|
6
|
+
export declare class PollService {
|
|
7
|
+
private readonly journal;
|
|
8
|
+
private readonly source;
|
|
9
|
+
constructor(journal: EventJournal, source: ExternalEventSource);
|
|
10
|
+
pollOnce(signal: AbortSignal): Promise<void>;
|
|
11
|
+
}
|