@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
|
@@ -96,7 +96,7 @@ export async function appendResolved(journal, appender, stream, event) {
|
|
|
96
96
|
if (result !== IntentAppendStatus.Ambiguous)
|
|
97
97
|
return result;
|
|
98
98
|
const events = await journal.readStream(stream);
|
|
99
|
-
return events.some((candidate) => candidate.eventId === event.eventId)
|
|
99
|
+
return events.some((candidate) => candidate.event.eventId === event.eventId)
|
|
100
100
|
? IntentAppendStatus.Known
|
|
101
101
|
: IntentAppendStatus.Failed;
|
|
102
102
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type CommandContext, type EventJournal } from '@atolis-hq/eventing';
|
|
2
|
+
import { type ResourceService } from '../../resources/index.js';
|
|
3
|
+
import { type WorkService } from '../../work/index.js';
|
|
4
|
+
import { type ActivityEvent } from '../contracts/events.js';
|
|
5
|
+
import type { AcceptReviewSignal, ObservePullRequest, PullRequestAuthorityInput, PullRequestAuthorityOptions, PullRequestView, RequestChangesSignal } from './contracts.js';
|
|
6
|
+
import { decidePullRequestAuthority } from './policy.js';
|
|
7
|
+
export interface PullRequestService {
|
|
8
|
+
observe(command: ObservePullRequest, context: CommandContext): Promise<PullRequestView>;
|
|
9
|
+
acceptReviewSignal(command: AcceptReviewSignal, context: CommandContext): Promise<void>;
|
|
10
|
+
requestChangesSignal(command: RequestChangesSignal, context: CommandContext): Promise<void>;
|
|
11
|
+
authorizeMerge(workItemId: ObservePullRequest['workItemId'], context: CommandContext): Promise<boolean>;
|
|
12
|
+
decideAuthority(workItemId: ObservePullRequest['workItemId'], options: PullRequestAuthorityOptions): Promise<ReturnType<typeof decidePullRequestAuthority>>;
|
|
13
|
+
authorityInput(workItemId: ObservePullRequest['workItemId']): Promise<PullRequestAuthorityInput>;
|
|
14
|
+
get(resourceId: ObservePullRequest['resourceId']): Promise<PullRequestView | null>;
|
|
15
|
+
factsFor(resourceId: ObservePullRequest['resourceId']): Promise<readonly ActivityEvent[]>;
|
|
16
|
+
}
|
|
17
|
+
export declare function createPullRequestService(journal: EventJournal, work: WorkService, resources: ResourceService): PullRequestService;
|
|
@@ -4,7 +4,7 @@ import { ActivityEventType, selectActivityEvent, } from '../contracts/events.js'
|
|
|
4
4
|
import { ActivityResourceRole } from '../contracts/vocabulary.js';
|
|
5
5
|
import { isReviewAuthorized } from '../review/authorization.js';
|
|
6
6
|
import { isPullRequestLikeResource } from './capability.js';
|
|
7
|
-
import { checksChanged, discovered, mergeAuthorized, mergeDenied, reviewAcceptanceSignalRecorded, reviewAccepted, reviewChangesRequested, reviewRejected, revisionChanged, stateChanged, } from './event-
|
|
7
|
+
import { checksChanged, discovered, mergeAuthorized, mergeDenied, reviewAcceptanceSignalRecorded, reviewAccepted, reviewChangesRequested, reviewRejected, revisionChanged, stateChanged, } from './event-data.js';
|
|
8
8
|
import { decidePullRequestAuthority } from './policy.js';
|
|
9
9
|
import { acceptedReviewSignalProjection, pullRequestProjection } from './projection.js';
|
|
10
10
|
import { PullRequestDenialCode } from './vocabulary.js';
|
|
@@ -71,11 +71,11 @@ class JournalPullRequestService {
|
|
|
71
71
|
const decision = decidePullRequestAuthority(input);
|
|
72
72
|
if (decision.allowed) {
|
|
73
73
|
const stream = resourceStream(decision.resourceId);
|
|
74
|
-
await this.appendStream(stream, mergeAuthorized(
|
|
74
|
+
await this.appendStream(stream, mergeAuthorized(decision.revision, context));
|
|
75
75
|
return true;
|
|
76
76
|
}
|
|
77
77
|
const stream = denialStream(input, workItemId);
|
|
78
|
-
await this.appendStream(stream, mergeDenied(
|
|
78
|
+
await this.appendStream(stream, mergeDenied(decision.reason, context));
|
|
79
79
|
return false;
|
|
80
80
|
}
|
|
81
81
|
async decideAuthority(workItemId, options) {
|
|
@@ -96,13 +96,13 @@ class JournalPullRequestService {
|
|
|
96
96
|
}
|
|
97
97
|
async appendStream(stream, event) {
|
|
98
98
|
const events = Array.isArray(event) ? event : [event];
|
|
99
|
-
await this.journal.
|
|
99
|
+
await this.journal.appendToStream(stream, (await this.journal.readStream(stream)).length, events);
|
|
100
100
|
}
|
|
101
101
|
async priorMergeDecision(commandId) {
|
|
102
102
|
const events = await this.journal.readAll(0);
|
|
103
|
-
if (events.some((event) => event.eventId === `${commandId}:${ActivityEventType.PrMergeAuthorized}`))
|
|
103
|
+
if (events.some((event) => event.event.eventId === `${commandId}:${ActivityEventType.PrMergeAuthorized}`))
|
|
104
104
|
return true;
|
|
105
|
-
return events.some((event) => event.eventId === `${commandId}:${ActivityEventType.PrMergeDenied}`)
|
|
105
|
+
return events.some((event) => event.event.eventId === `${commandId}:${ActivityEventType.PrMergeDenied}`)
|
|
106
106
|
? false
|
|
107
107
|
: null;
|
|
108
108
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EventJournal } from '@atolis-hq/eventing';
|
|
2
|
+
import type { ActivityDefinition } from '../contracts/activity.js';
|
|
3
|
+
import { BuiltInActivityName } from '../contracts/vocabulary.js';
|
|
4
|
+
import type { PullRequestService } from './application.js';
|
|
5
|
+
import type { PullRequestActivityOutcome, PullRequestApproveInput } from './contracts.js';
|
|
6
|
+
import { type IntentAppender } from './intent.js';
|
|
7
|
+
export declare function createPullRequestApproveActivity(journal: EventJournal, pullRequests: PullRequestService, appender?: IntentAppender): ActivityDefinition<typeof BuiltInActivityName.PullRequestApprove, PullRequestApproveInput, PullRequestActivityOutcome>;
|
|
@@ -6,7 +6,7 @@ import { ActivityEventType } from '../contracts/events.js';
|
|
|
6
6
|
import { ActivityExecutionKind, BuiltInActivityName } from '../contracts/vocabulary.js';
|
|
7
7
|
import { pullRequestOutcomeSchema, pullRequestTargetSchema, resolvePrimaryCapability, selectedDenialAudit, selectionDenialAudit, } from './activity-support.js';
|
|
8
8
|
import { claimAndCompleteDecision, completeDecisionClaim, readDecisionClaim, } from './decision-claim.js';
|
|
9
|
-
import { approveDenied, deliveryIntentRequested } from './event-
|
|
9
|
+
import { approveDenied, deliveryIntentRequested } from './event-data.js';
|
|
10
10
|
import { activityCommandContext, createJournalIntentAppender, } from './intent.js';
|
|
11
11
|
import { decidePullRequestAuthority } from './policy.js';
|
|
12
12
|
const inputSchema = z
|
|
@@ -41,7 +41,8 @@ async function executeApproval(journal, pullRequests, appender, invocation, cont
|
|
|
41
41
|
const authority = await pullRequests.authorityInput(invocation.workItemId);
|
|
42
42
|
const resource = resolvePrimaryCapability(invocation.resources, authority, invocation.workItemId, invocation.input.target, BuiltInResourceCapability.Approvable);
|
|
43
43
|
if (!resource.allowed) {
|
|
44
|
-
const
|
|
44
|
+
const factStream = workItemStream(invocation.workItemId);
|
|
45
|
+
const denial = approveDenied(resource.reason, command, {
|
|
45
46
|
...selectionDenialAudit(invocation.input.target, resource.candidates),
|
|
46
47
|
body: invocation.input.body ?? null,
|
|
47
48
|
});
|
|
@@ -49,6 +50,7 @@ async function executeApproval(journal, pullRequests, appender, invocation, cont
|
|
|
49
50
|
decisionKind: 'denied',
|
|
50
51
|
outcome: { kind: ActivityOutcomeKind.Blocked, data: { reason: resource.reason } },
|
|
51
52
|
fact: denial,
|
|
53
|
+
factStream,
|
|
52
54
|
});
|
|
53
55
|
}
|
|
54
56
|
const decision = decidePullRequestAuthority(authority, {
|
|
@@ -57,7 +59,8 @@ async function executeApproval(journal, pullRequests, appender, invocation, cont
|
|
|
57
59
|
requireChecks: false,
|
|
58
60
|
});
|
|
59
61
|
if (!decision.allowed) {
|
|
60
|
-
const
|
|
62
|
+
const factStream = resourceStream(resource.resourceId);
|
|
63
|
+
const denial = approveDenied(decision.reason, command, {
|
|
61
64
|
...selectedDenialAudit(authority, resource.resourceId),
|
|
62
65
|
body: invocation.input.body ?? null,
|
|
63
66
|
});
|
|
@@ -65,6 +68,7 @@ async function executeApproval(journal, pullRequests, appender, invocation, cont
|
|
|
65
68
|
decisionKind: 'denied',
|
|
66
69
|
outcome: { kind: ActivityOutcomeKind.Blocked, data: { reason: decision.reason } },
|
|
67
70
|
fact: denial,
|
|
71
|
+
factStream,
|
|
68
72
|
});
|
|
69
73
|
}
|
|
70
74
|
const intent = deliveryIntentRequested(decision.resourceId, ActivityEventType.PrApproveRequested, {
|
|
@@ -81,5 +85,6 @@ async function executeApproval(journal, pullRequests, appender, invocation, cont
|
|
|
81
85
|
data: { intentEventId: intent.eventId, signalKind: 'delivery-result' },
|
|
82
86
|
},
|
|
83
87
|
fact: intent,
|
|
88
|
+
factStream: resourceStream(decision.resourceId),
|
|
84
89
|
});
|
|
85
90
|
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { ResourceCorrelationView, ResourceId, ResourceView } from '../../resources/index.js';
|
|
2
|
+
import type { WorkItemId, WorkItemView } from '../../work/index.js';
|
|
3
|
+
import type { ActivityFailureCode, ActivityOutcomeKind, ActivityResourceRole } from '../contracts/vocabulary.js';
|
|
4
|
+
import type { ReviewActorKind, ReviewerAuthorizationEvidence } from '../review/contracts.js';
|
|
5
|
+
import type { MergeMethod, PullRequestCheckState, PullRequestDenialCode, PullRequestState } from './vocabulary.js';
|
|
6
|
+
export interface PullRequestView {
|
|
7
|
+
readonly resourceId: ResourceId;
|
|
8
|
+
readonly workItemId: WorkItemId;
|
|
9
|
+
readonly state: PullRequestState;
|
|
10
|
+
readonly headRevision: string;
|
|
11
|
+
readonly baseRevision: string;
|
|
12
|
+
readonly checks: PullRequestCheckState;
|
|
13
|
+
readonly acceptedReview?: {
|
|
14
|
+
readonly revision: string;
|
|
15
|
+
readonly actorId: string;
|
|
16
|
+
readonly acceptedEventId: string;
|
|
17
|
+
};
|
|
18
|
+
readonly changedFiles?: readonly string[] | undefined;
|
|
19
|
+
}
|
|
20
|
+
export interface ObservePullRequest {
|
|
21
|
+
readonly resourceId: ResourceId;
|
|
22
|
+
readonly workItemId: WorkItemId;
|
|
23
|
+
readonly state: PullRequestView['state'];
|
|
24
|
+
readonly headRevision: string;
|
|
25
|
+
readonly baseRevision: string;
|
|
26
|
+
readonly checks: PullRequestView['checks'];
|
|
27
|
+
readonly changedFiles?: readonly string[] | undefined;
|
|
28
|
+
}
|
|
29
|
+
export interface AcceptReviewSignal {
|
|
30
|
+
readonly resourceId: ResourceId;
|
|
31
|
+
readonly revision: string;
|
|
32
|
+
readonly actorId: string;
|
|
33
|
+
readonly actorKind: ReviewActorKind;
|
|
34
|
+
/** The adapter validated this as a provider-native review, not a comment command. */
|
|
35
|
+
readonly origin?: 'provider-native-review';
|
|
36
|
+
readonly acceptedEventId: string;
|
|
37
|
+
readonly resourceAuthorId: string;
|
|
38
|
+
readonly authorization: ReviewerAuthorizationEvidence;
|
|
39
|
+
}
|
|
40
|
+
export interface RequestChangesSignal {
|
|
41
|
+
readonly resourceId: ResourceId;
|
|
42
|
+
readonly revision: string;
|
|
43
|
+
readonly actorId: string;
|
|
44
|
+
readonly requestedEventId: string;
|
|
45
|
+
}
|
|
46
|
+
export type PullRequestCommand = {
|
|
47
|
+
readonly kind: 'pr.observe';
|
|
48
|
+
readonly input: ObservePullRequest;
|
|
49
|
+
} | {
|
|
50
|
+
readonly kind: 'pr.accept-review-signal';
|
|
51
|
+
readonly input: AcceptReviewSignal;
|
|
52
|
+
} | {
|
|
53
|
+
readonly kind: 'pr.request-changes-signal';
|
|
54
|
+
readonly input: RequestChangesSignal;
|
|
55
|
+
};
|
|
56
|
+
export interface PullRequestResourceView {
|
|
57
|
+
readonly resource: ResourceView;
|
|
58
|
+
readonly correlations: readonly ResourceCorrelationView[];
|
|
59
|
+
}
|
|
60
|
+
export type PullRequestTarget = typeof ActivityResourceRole.Primary | {
|
|
61
|
+
readonly resourceId: ResourceId;
|
|
62
|
+
};
|
|
63
|
+
export interface PullRequestTargetInput {
|
|
64
|
+
readonly target: PullRequestTarget;
|
|
65
|
+
}
|
|
66
|
+
export interface PullRequestApproveInput extends PullRequestTargetInput {
|
|
67
|
+
readonly body?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface PullRequestMergeInput extends PullRequestTargetInput {
|
|
70
|
+
readonly method: MergeMethod;
|
|
71
|
+
readonly requireChecks: boolean;
|
|
72
|
+
readonly requireApproval?: boolean | undefined;
|
|
73
|
+
readonly autoMerge?: boolean | undefined;
|
|
74
|
+
readonly maxFilesChanged?: number | undefined;
|
|
75
|
+
readonly blockedPaths: readonly string[];
|
|
76
|
+
}
|
|
77
|
+
export type PullRequestActivityOutcome = {
|
|
78
|
+
readonly kind: typeof ActivityOutcomeKind.Waiting;
|
|
79
|
+
readonly data: {
|
|
80
|
+
readonly intentEventId: string;
|
|
81
|
+
readonly signalKind: 'delivery-result';
|
|
82
|
+
};
|
|
83
|
+
} | {
|
|
84
|
+
readonly kind: typeof ActivityOutcomeKind.Done;
|
|
85
|
+
readonly data: {
|
|
86
|
+
readonly deliveryEventId: string;
|
|
87
|
+
};
|
|
88
|
+
} | {
|
|
89
|
+
readonly kind: typeof ActivityOutcomeKind.Blocked;
|
|
90
|
+
readonly data: {
|
|
91
|
+
readonly reason: PullRequestDenialCode;
|
|
92
|
+
};
|
|
93
|
+
} | {
|
|
94
|
+
readonly kind: typeof ActivityOutcomeKind.Failed;
|
|
95
|
+
readonly data: {
|
|
96
|
+
readonly reason: typeof ActivityFailureCode.IntentWriteFailed;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
export interface PullRequestMergePolicy {
|
|
100
|
+
readonly maxFilesChanged?: number | undefined;
|
|
101
|
+
readonly blockedPaths: readonly string[];
|
|
102
|
+
}
|
|
103
|
+
export interface PullRequestAuthorityOptions {
|
|
104
|
+
readonly target: PullRequestTarget;
|
|
105
|
+
readonly requireAcceptedReview: boolean;
|
|
106
|
+
readonly requireChecks: boolean;
|
|
107
|
+
readonly allowPendingChecks?: boolean | undefined;
|
|
108
|
+
readonly mergePolicy?: PullRequestMergePolicy;
|
|
109
|
+
}
|
|
110
|
+
export interface AcceptedReviewSignalView {
|
|
111
|
+
readonly resourceId: ResourceId;
|
|
112
|
+
readonly revision: string;
|
|
113
|
+
readonly actorId: string;
|
|
114
|
+
readonly actorKind: ReviewActorKind;
|
|
115
|
+
/** The adapter validated this as a provider-native review, not a comment command. */
|
|
116
|
+
readonly origin?: 'provider-native-review';
|
|
117
|
+
readonly acceptedEventId: string;
|
|
118
|
+
readonly trusted: boolean;
|
|
119
|
+
}
|
|
120
|
+
export interface PullRequestAuthorityInput {
|
|
121
|
+
readonly work: WorkItemView | null;
|
|
122
|
+
readonly resources: readonly PullRequestResourceView[];
|
|
123
|
+
readonly pullRequests: readonly PullRequestView[];
|
|
124
|
+
readonly acceptedSignals: readonly AcceptedReviewSignalView[];
|
|
125
|
+
}
|
|
126
|
+
export type PullRequestAuthorityDecision = {
|
|
127
|
+
readonly allowed: true;
|
|
128
|
+
readonly resourceId: ResourceId;
|
|
129
|
+
readonly revision: string;
|
|
130
|
+
} | {
|
|
131
|
+
readonly allowed: false;
|
|
132
|
+
readonly reason: PullRequestDenialCode;
|
|
133
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type EventJournal } from '@atolis-hq/eventing';
|
|
2
|
+
import { ActivityEventType, type ActivityEventPayloads } from '../contracts/events.js';
|
|
3
|
+
import type { ActivationId } from '../contracts/identifiers.js';
|
|
4
|
+
import { type PullRequestDecisionAction } from '../contracts/streams.js';
|
|
5
|
+
import type { PullRequestActivityOutcome } from './contracts.js';
|
|
6
|
+
import type { IntentAppender } from './intent.js';
|
|
7
|
+
type PullRequestDecisionKind = 'requested' | 'denied';
|
|
8
|
+
export type PullRequestAction = PullRequestDecisionAction;
|
|
9
|
+
type DecisionClaimPayload<Action extends PullRequestAction> = Action extends 'approve' ? ActivityEventPayloads[typeof ActivityEventType.PrApproveDecisionClaimed] : ActivityEventPayloads[typeof ActivityEventType.PrMergeDecisionClaimed];
|
|
10
|
+
type DecisionFromClaim<Claim> = Claim extends {
|
|
11
|
+
readonly decisionKind: infer Kind extends PullRequestDecisionKind;
|
|
12
|
+
readonly outcome: infer Outcome extends PullRequestActivityOutcome;
|
|
13
|
+
readonly fact: infer Fact;
|
|
14
|
+
readonly factStream: infer FactStream;
|
|
15
|
+
} ? {
|
|
16
|
+
readonly decisionKind: Kind;
|
|
17
|
+
readonly outcome: Outcome;
|
|
18
|
+
readonly fact: Fact;
|
|
19
|
+
readonly factStream: FactStream;
|
|
20
|
+
} : never;
|
|
21
|
+
export type PullRequestDecision<Action extends PullRequestAction = PullRequestAction> = DecisionFromClaim<DecisionClaimPayload<Action>>;
|
|
22
|
+
export declare function readDecisionClaim<Action extends PullRequestAction>(journal: EventJournal, activationId: ActivationId, action: Action): Promise<PullRequestDecision<Action> | null>;
|
|
23
|
+
export declare function claimDecision<Action extends PullRequestAction>(journal: EventJournal, activationId: ActivationId, action: Action, proposal: PullRequestDecision<NoInfer<Action>>): Promise<PullRequestDecision<Action>>;
|
|
24
|
+
export declare function completeDecisionClaim(journal: EventJournal, appender: IntentAppender, decision: PullRequestDecision): Promise<PullRequestActivityOutcome>;
|
|
25
|
+
export declare function claimAndCompleteDecision<Action extends PullRequestAction>(journal: EventJournal, appender: IntentAppender, activationId: ActivationId, action: Action, proposal: PullRequestDecision<NoInfer<Action>>): Promise<PullRequestActivityOutcome>;
|
|
26
|
+
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { EventSourceKind } from '@atolis-hq/eventing';
|
|
2
|
+
import { createActivityEventData } from '../contracts/event-factory.js';
|
|
3
|
+
import { ActivityEventType, decodeActivityEvent, decodeActivityEventData, } from '../contracts/events.js';
|
|
3
4
|
import { activityDecisionStream } from '../contracts/streams.js';
|
|
4
5
|
import { ActivityFailureCode, ActivityOutcomeKind, IntentAppendStatus, } from '../contracts/vocabulary.js';
|
|
5
6
|
import { appendResolved } from './activity-support.js';
|
|
7
|
+
import { MergeMethod } from './vocabulary.js';
|
|
6
8
|
export async function readDecisionClaim(journal, activationId, action) {
|
|
7
9
|
const claimId = decisionClaimId(activationId, action);
|
|
8
|
-
const event = (await journal.readStream(activityDecisionStream(activationId, action))).find((candidate) => candidate.eventId === claimId);
|
|
10
|
+
const event = (await journal.readStream(activityDecisionStream(activationId, action))).find((candidate) => candidate.event.eventId === claimId);
|
|
9
11
|
return event === undefined ? null : parseClaim(event, activationId, action);
|
|
10
12
|
}
|
|
11
13
|
export async function claimDecision(journal, activationId, action, proposal) {
|
|
@@ -13,26 +15,10 @@ export async function claimDecision(journal, activationId, action, proposal) {
|
|
|
13
15
|
if (existing !== null)
|
|
14
16
|
return existing;
|
|
15
17
|
const stream = activityDecisionStream(activationId, action);
|
|
16
|
-
const claim =
|
|
17
|
-
|
|
18
|
-
eventType: decisionEventType(action),
|
|
19
|
-
occurredAt: proposal.fact.occurredAt,
|
|
20
|
-
correlationId: proposal.fact.correlationId,
|
|
21
|
-
causationId: proposal.fact.causationId,
|
|
22
|
-
actor: proposal.fact.actor,
|
|
23
|
-
source: { kind: EventSourceKind.Internal, id: 'activities-pr' },
|
|
24
|
-
stream,
|
|
25
|
-
payload: {
|
|
26
|
-
action,
|
|
27
|
-
activationId,
|
|
28
|
-
decisionKind: proposal.decisionKind,
|
|
29
|
-
outcome: proposal.outcome,
|
|
30
|
-
fact: proposal.fact,
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
decodeActivityEventDraft(claim);
|
|
18
|
+
const claim = decisionClaimEventData(activationId, action, proposal);
|
|
19
|
+
decodeActivityEventData(claim);
|
|
34
20
|
try {
|
|
35
|
-
await journal.
|
|
21
|
+
await journal.appendToStream(stream, 0, [claim]);
|
|
36
22
|
return proposal;
|
|
37
23
|
}
|
|
38
24
|
catch (error) {
|
|
@@ -42,8 +28,41 @@ export async function claimDecision(journal, activationId, action, proposal) {
|
|
|
42
28
|
throw error;
|
|
43
29
|
}
|
|
44
30
|
}
|
|
31
|
+
function decisionClaimEventData(activationId, action, proposal) {
|
|
32
|
+
const metadata = {
|
|
33
|
+
eventId: decisionClaimId(activationId, action),
|
|
34
|
+
occurredAt: proposal.fact.occurredAt,
|
|
35
|
+
correlationId: proposal.fact.correlationId,
|
|
36
|
+
causationId: proposal.fact.causationId,
|
|
37
|
+
actor: proposal.fact.actor,
|
|
38
|
+
source: { kind: EventSourceKind.Internal, id: 'activities-pr' },
|
|
39
|
+
};
|
|
40
|
+
if (action === 'approve') {
|
|
41
|
+
if (!isApproveDecision(proposal))
|
|
42
|
+
throw invalidDecisionClaim(proposal.fact.eventId);
|
|
43
|
+
return createActivityEventData({
|
|
44
|
+
...metadata,
|
|
45
|
+
eventType: ActivityEventType.PrApproveDecisionClaimed,
|
|
46
|
+
payload: { action: 'approve', activationId, ...proposal },
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (isApproveDecision(proposal))
|
|
50
|
+
throw invalidDecisionClaim(proposal.fact.eventId);
|
|
51
|
+
return createActivityEventData({
|
|
52
|
+
...metadata,
|
|
53
|
+
eventType: ActivityEventType.PrMergeDecisionClaimed,
|
|
54
|
+
payload: { action: MergeMethod.Merge, activationId, ...proposal },
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function isApproveDecision(decision) {
|
|
58
|
+
return (decision.fact.eventType === ActivityEventType.PrApproveRequested ||
|
|
59
|
+
decision.fact.eventType === ActivityEventType.PrApproveDenied);
|
|
60
|
+
}
|
|
61
|
+
function invalidDecisionClaim(eventId) {
|
|
62
|
+
return new Error(`Invalid Activity event data ${eventId}`);
|
|
63
|
+
}
|
|
45
64
|
export async function completeDecisionClaim(journal, appender, decision) {
|
|
46
|
-
const result = await appendResolved(journal, appender, decision.
|
|
65
|
+
const result = await appendResolved(journal, appender, decision.factStream, decision.fact);
|
|
47
66
|
return result === IntentAppendStatus.Failed
|
|
48
67
|
? { kind: ActivityOutcomeKind.Failed, data: { reason: ActivityFailureCode.IntentWriteFailed } }
|
|
49
68
|
: decision.outcome;
|
|
@@ -58,15 +77,16 @@ function decisionClaimId(activationId, action) {
|
|
|
58
77
|
function parseClaim(event, activationId, action) {
|
|
59
78
|
const decoded = decodeActivityEvent(event);
|
|
60
79
|
const expectedType = decisionEventType(action);
|
|
61
|
-
if (decoded.eventType !== expectedType ||
|
|
62
|
-
decoded.payload.activationId !== activationId ||
|
|
63
|
-
decoded.payload.action !== action) {
|
|
64
|
-
throw new Error(`Invalid pull-request decision claim ${event.eventId}`);
|
|
80
|
+
if (decoded.event.eventType !== expectedType ||
|
|
81
|
+
decoded.event.payload.activationId !== activationId ||
|
|
82
|
+
decoded.event.payload.action !== action) {
|
|
83
|
+
throw new Error(`Invalid pull-request decision claim ${event.event.eventId}`);
|
|
65
84
|
}
|
|
66
85
|
return {
|
|
67
|
-
decisionKind: decoded.payload.decisionKind,
|
|
68
|
-
outcome: decoded.payload.outcome,
|
|
69
|
-
fact: decoded.payload.fact,
|
|
86
|
+
decisionKind: decoded.event.payload.decisionKind,
|
|
87
|
+
outcome: decoded.event.payload.outcome,
|
|
88
|
+
fact: decoded.event.payload.fact,
|
|
89
|
+
factStream: decoded.event.payload.factStream,
|
|
70
90
|
};
|
|
71
91
|
}
|
|
72
92
|
function decisionEventType(action) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type CommandContext } from '@atolis-hq/eventing';
|
|
2
|
+
import { ActivityEventType, type ActivityEventData, type ActivityEventPayloads, type PullRequestDenialPayload } from '../contracts/events.js';
|
|
3
|
+
import type { AcceptReviewSignal, ObservePullRequest, RequestChangesSignal } from './contracts.js';
|
|
4
|
+
type ActivityEventDataOf<Type extends ActivityEventData['eventType']> = Extract<ActivityEventData, {
|
|
5
|
+
eventType: Type;
|
|
6
|
+
}>;
|
|
7
|
+
type DenialAudit = Omit<PullRequestDenialPayload, 'activationId' | 'idempotencyKey' | 'reason'>;
|
|
8
|
+
export declare const discovered: ({ resourceId: _resourceId, ...command }: ObservePullRequest, context: CommandContext) => ActivityEventDataOf<typeof ActivityEventType.PrDiscovered>;
|
|
9
|
+
export declare const revisionChanged: (command: ObservePullRequest, context: CommandContext) => ActivityEventDataOf<typeof ActivityEventType.PrRevisionChanged>;
|
|
10
|
+
export declare const stateChanged: (command: ObservePullRequest, context: CommandContext) => ActivityEventDataOf<typeof ActivityEventType.PrStateChanged>;
|
|
11
|
+
export declare const checksChanged: (command: ObservePullRequest, context: CommandContext) => ActivityEventDataOf<typeof ActivityEventType.PrChecksChanged>;
|
|
12
|
+
export declare const reviewAccepted: (command: AcceptReviewSignal, context: CommandContext) => ActivityEventDataOf<typeof ActivityEventType.PrReviewAccepted>;
|
|
13
|
+
export declare const reviewAcceptanceSignalRecorded: (command: AcceptReviewSignal, context: CommandContext) => ActivityEventDataOf<typeof ActivityEventType.ReviewAcceptanceSignalRecorded>;
|
|
14
|
+
export declare const reviewChangesRequested: (command: RequestChangesSignal, context: CommandContext) => ActivityEventDataOf<typeof ActivityEventType.PrReviewChangesRequested>;
|
|
15
|
+
export declare const reviewRejected: (resourceId: ObservePullRequest["resourceId"], reason: ActivityEventPayloads[typeof ActivityEventType.PrReviewRejected]["reason"], context: CommandContext) => ActivityEventDataOf<typeof ActivityEventType.PrReviewRejected>;
|
|
16
|
+
export declare const mergeDenied: (reason: PullRequestDenialPayload["reason"], context: CommandContext, audit?: DenialAudit) => ActivityEventDataOf<typeof ActivityEventType.PrMergeDenied>;
|
|
17
|
+
export declare const approveDenied: (reason: PullRequestDenialPayload["reason"], context: CommandContext, audit?: DenialAudit) => ActivityEventDataOf<typeof ActivityEventType.PrApproveDenied>;
|
|
18
|
+
export declare const mergeAuthorized: (revision: string, context: CommandContext) => ActivityEventDataOf<typeof ActivityEventType.PrMergeAuthorized>;
|
|
19
|
+
export declare function deliveryIntentRequested(resourceId: ObservePullRequest['resourceId'], type: typeof ActivityEventType.PrApproveRequested, payload: Omit<ActivityEventPayloads[typeof ActivityEventType.PrApproveRequested], 'idempotencyKey'>, context: CommandContext): ActivityEventDataOf<typeof ActivityEventType.PrApproveRequested>;
|
|
20
|
+
export declare function deliveryIntentRequested(resourceId: ObservePullRequest['resourceId'], type: typeof ActivityEventType.PrMergeRequested, payload: Omit<ActivityEventPayloads[typeof ActivityEventType.PrMergeRequested], 'idempotencyKey'>, context: CommandContext): ActivityEventDataOf<typeof ActivityEventType.PrMergeRequested>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { EventSourceKind } from '@atolis-hq/eventing';
|
|
2
|
+
import { createActivityEventData, } from '../contracts/event-factory.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: _resourceId, ...command }, context) => fact({ ...metadata(ActivityEventType.PrDiscovered, context), payload: command });
|
|
7
|
+
export const revisionChanged = (command, context) => fact({
|
|
8
|
+
...metadata(ActivityEventType.PrRevisionChanged, context),
|
|
9
|
+
payload: {
|
|
10
|
+
headRevision: command.headRevision,
|
|
11
|
+
baseRevision: command.baseRevision,
|
|
12
|
+
...(command.changedFiles === undefined ? {} : { changedFiles: command.changedFiles }),
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export const stateChanged = (command, context) => fact({
|
|
16
|
+
...metadata(ActivityEventType.PrStateChanged, context),
|
|
17
|
+
payload: { state: command.state },
|
|
18
|
+
});
|
|
19
|
+
export const checksChanged = (command, context) => fact({
|
|
20
|
+
...metadata(ActivityEventType.PrChecksChanged, context),
|
|
21
|
+
payload: { checks: command.checks },
|
|
22
|
+
});
|
|
23
|
+
export const reviewAccepted = (command, context) => fact({
|
|
24
|
+
...metadata(ActivityEventType.PrReviewAccepted, context),
|
|
25
|
+
payload: { revision: command.revision, actorId: command.actorId },
|
|
26
|
+
});
|
|
27
|
+
export const reviewAcceptanceSignalRecorded = (command, context) => fact({
|
|
28
|
+
...metadata(ActivityEventType.ReviewAcceptanceSignalRecorded, context),
|
|
29
|
+
payload: {
|
|
30
|
+
revision: command.revision,
|
|
31
|
+
actorId: command.actorId,
|
|
32
|
+
actorKind: command.actorKind,
|
|
33
|
+
acceptedEventId: `${context.commandId}:${ActivityEventType.PrReviewAccepted}`,
|
|
34
|
+
providerEventId: command.acceptedEventId,
|
|
35
|
+
trusted: isReviewAuthorized(command),
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
export const reviewChangesRequested = (command, context) => fact({
|
|
39
|
+
...metadata(ActivityEventType.PrReviewChangesRequested, context),
|
|
40
|
+
payload: { revision: command.revision, actorId: command.actorId },
|
|
41
|
+
});
|
|
42
|
+
export const reviewRejected = (resourceId, reason, context) => fact({ ...metadata(ActivityEventType.PrReviewRejected, context), payload: { reason } });
|
|
43
|
+
export const mergeDenied = (reason, context, audit = {}) => fact({
|
|
44
|
+
...metadata(ActivityEventType.PrMergeDenied, context),
|
|
45
|
+
payload: denialPayload(ActivityEventType.PrMergeDenied, reason, context, audit),
|
|
46
|
+
});
|
|
47
|
+
export const approveDenied = (reason, context, audit = {}) => fact({
|
|
48
|
+
...metadata(ActivityEventType.PrApproveDenied, context),
|
|
49
|
+
payload: denialPayload(ActivityEventType.PrApproveDenied, reason, context, audit),
|
|
50
|
+
});
|
|
51
|
+
export const mergeAuthorized = (revision, context) => fact({
|
|
52
|
+
...metadata(ActivityEventType.PrMergeAuthorized, context),
|
|
53
|
+
payload: { revision },
|
|
54
|
+
});
|
|
55
|
+
export function deliveryIntentRequested(resourceId, type, payload, context) {
|
|
56
|
+
void resourceId;
|
|
57
|
+
if (type === ActivityEventType.PrApproveRequested) {
|
|
58
|
+
if (!('body' in payload))
|
|
59
|
+
throw new Error('Approve intents require a body');
|
|
60
|
+
return fact({
|
|
61
|
+
...metadata(ActivityEventType.PrApproveRequested, context),
|
|
62
|
+
payload: { idempotencyKey: `${context.commandId}:${type}`, ...payload },
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if ('body' in payload)
|
|
66
|
+
throw new Error('Merge intents must not carry a body');
|
|
67
|
+
return fact({
|
|
68
|
+
...metadata(ActivityEventType.PrMergeRequested, context),
|
|
69
|
+
payload: { idempotencyKey: `${context.commandId}:${type}`, ...payload },
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function fact(input) {
|
|
73
|
+
const event = createActivityEventData(input);
|
|
74
|
+
switch (event.eventType) {
|
|
75
|
+
case ActivityEventType.IssueCompleteRequested:
|
|
76
|
+
case ActivityEventType.PrApproveDecisionClaimed:
|
|
77
|
+
case ActivityEventType.PrMergeDecisionClaimed:
|
|
78
|
+
throw new Error(`Unexpected non-PR-fact event ${event.eventType}`);
|
|
79
|
+
default:
|
|
80
|
+
return event;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function denialPayload(eventType, reason, context, audit) {
|
|
84
|
+
return {
|
|
85
|
+
activationId: activationId(context.commandId),
|
|
86
|
+
idempotencyKey: `${context.commandId}:${eventType}`,
|
|
87
|
+
reason,
|
|
88
|
+
...audit,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function metadata(eventType, context) {
|
|
92
|
+
return {
|
|
93
|
+
eventId: `${context.commandId}:${eventType}`,
|
|
94
|
+
eventType,
|
|
95
|
+
occurredAt: context.occurredAt,
|
|
96
|
+
correlationId: context.correlationId,
|
|
97
|
+
causationId: context.commandId,
|
|
98
|
+
actor: context.actor,
|
|
99
|
+
source: { kind: EventSourceKind.Internal, id: 'activities-pr' },
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CommandContext, type EventJournal } from '@atolis-hq/eventing';
|
|
2
|
+
import type { ResourceStreamRef } from '../../resources/index.js';
|
|
3
|
+
import type { WorkItemStreamRef } from '../../work/index.js';
|
|
4
|
+
import type { ActivityFactEventData } from '../contracts/events.js';
|
|
5
|
+
import { IntentAppendStatus } from '../contracts/vocabulary.js';
|
|
6
|
+
export type IntentAppendResult = typeof IntentAppendStatus.Appended | typeof IntentAppendStatus.Known | typeof IntentAppendStatus.Ambiguous | typeof IntentAppendStatus.Failed;
|
|
7
|
+
export interface IntentAppender {
|
|
8
|
+
append(stream: ResourceStreamRef | WorkItemStreamRef, intent: ActivityFactEventData): Promise<IntentAppendResult>;
|
|
9
|
+
}
|
|
10
|
+
export declare function createJournalIntentAppender(journal: EventJournal): IntentAppender;
|
|
11
|
+
export declare function appendIntentOnce(journal: EventJournal, stream: ResourceStreamRef | WorkItemStreamRef, intent: ActivityFactEventData): Promise<IntentAppendResult>;
|
|
12
|
+
export declare function activityCommandContext(activationId: string, orchestrationGroupId: string, occurredAt: string): CommandContext;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventActorKind, WrongExpectedSequenceError, } from '
|
|
1
|
+
import { EventActorKind, WrongExpectedSequenceError, } from '@atolis-hq/eventing';
|
|
2
2
|
import { IntentAppendStatus } from '../contracts/vocabulary.js';
|
|
3
3
|
export function createJournalIntentAppender(journal) {
|
|
4
4
|
return {
|
|
@@ -8,22 +8,22 @@ export function createJournalIntentAppender(journal) {
|
|
|
8
8
|
export async function appendIntentOnce(journal, stream, intent) {
|
|
9
9
|
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
10
10
|
const events = await journal.readStream(stream);
|
|
11
|
-
if (events.some((event) => event.eventId === intent.eventId))
|
|
11
|
+
if (events.some((event) => event.event.eventId === intent.eventId))
|
|
12
12
|
return IntentAppendStatus.Known;
|
|
13
13
|
try {
|
|
14
|
-
await journal.
|
|
14
|
+
await journal.appendToStream(stream, events.length, [intent]);
|
|
15
15
|
return IntentAppendStatus.Appended;
|
|
16
16
|
}
|
|
17
17
|
catch (error) {
|
|
18
18
|
const observed = await journal.readStream(stream);
|
|
19
|
-
if (observed.some((event) => event.eventId === intent.eventId))
|
|
19
|
+
if (observed.some((event) => event.event.eventId === intent.eventId))
|
|
20
20
|
return IntentAppendStatus.Known;
|
|
21
21
|
if (!(error instanceof WrongExpectedSequenceError))
|
|
22
22
|
return IntentAppendStatus.Failed;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
const reconciled = await journal.readStream(stream);
|
|
26
|
-
return reconciled.some((event) => event.eventId === intent.eventId)
|
|
26
|
+
return reconciled.some((event) => event.event.eventId === intent.eventId)
|
|
27
27
|
? IntentAppendStatus.Known
|
|
28
28
|
: IntentAppendStatus.Failed;
|
|
29
29
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { WorkItemId } from '../../work/index.js';
|
|
2
|
+
import type { PullRequestService } from './application.js';
|
|
3
|
+
export interface PullRequestMergeAuthorityGateInput {
|
|
4
|
+
readonly activationId: string;
|
|
5
|
+
readonly orchestrationGroupId: string;
|
|
6
|
+
readonly workItemId: WorkItemId;
|
|
7
|
+
}
|
|
8
|
+
export interface PullRequestMergeAuthorityGate {
|
|
9
|
+
evaluate(input: PullRequestMergeAuthorityGateInput, occurredAt: string): Promise<{
|
|
10
|
+
readonly kind: 'merge-denied' | 'merge-authorized';
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export declare function createPullRequestMergeAuthorityGate(service: PullRequestService): PullRequestMergeAuthorityGate;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EventJournal } from '@atolis-hq/eventing';
|
|
2
|
+
import type { ActivityDefinition } from '../contracts/activity.js';
|
|
3
|
+
import { BuiltInActivityName } from '../contracts/vocabulary.js';
|
|
4
|
+
import type { PullRequestService } from './application.js';
|
|
5
|
+
import type { PullRequestActivityOutcome, PullRequestMergeInput } from './contracts.js';
|
|
6
|
+
import { type IntentAppender } from './intent.js';
|
|
7
|
+
export declare function createPullRequestMergeActivity(journal: EventJournal, pullRequests: PullRequestService, appender?: IntentAppender): ActivityDefinition<typeof BuiltInActivityName.PullRequestMerge, PullRequestMergeInput, PullRequestActivityOutcome>;
|