@atolis-hq/wake 0.2.96 → 0.3.0
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/dist/src/activities/agent/agent-activity-definition.js +26 -0
- package/dist/src/activities/agent/agent-activity.js +171 -0
- package/dist/src/activities/agent/agent-result.js +149 -0
- package/dist/src/activities/contracts/activity.js +10 -0
- package/dist/src/activities/contracts/config.js +2 -0
- package/dist/src/activities/contracts/event-schema.js +302 -0
- package/dist/src/activities/contracts/events.js +42 -0
- package/dist/src/activities/contracts/identifiers.js +29 -0
- package/dist/src/activities/contracts/registry.js +71 -0
- package/dist/src/activities/contracts/streams.js +17 -0
- package/dist/src/activities/contracts/vocabulary.js +58 -0
- package/dist/src/activities/index.js +21 -0
- package/dist/src/activities/pr/activity-support.js +111 -0
- package/dist/src/activities/pr/application.js +158 -0
- package/dist/src/activities/pr/approve.js +85 -0
- package/dist/src/activities/pr/capability.js +11 -0
- package/dist/src/activities/pr/decision-claim.js +76 -0
- package/dist/src/activities/pr/event-drafts.js +66 -0
- package/dist/src/activities/pr/intent.js +37 -0
- package/dist/src/activities/pr/merge-authority-gate.js +14 -0
- package/dist/src/activities/pr/merge.js +110 -0
- package/dist/src/activities/pr/policy.js +135 -0
- package/dist/src/activities/pr/projection.js +130 -0
- package/dist/src/activities/pr/vocabulary.js +30 -0
- package/dist/src/activities/review/authorization.js +22 -0
- package/dist/src/activities/review/contracts.js +22 -0
- package/dist/src/activities/review/signals.js +3 -0
- package/dist/src/bootstrap/analytics-projection.js +26 -0
- package/dist/src/bootstrap/board-projection.js +337 -0
- package/dist/src/bootstrap/composition-root.js +382 -0
- package/dist/src/bootstrap/config/load-config.js +51 -0
- package/dist/src/bootstrap/config/root-schema.js +134 -0
- package/dist/src/bootstrap/external-ref.js +12 -0
- package/dist/src/bootstrap/fake-provider-files.js +44 -0
- package/dist/src/bootstrap/fake-scenarios.js +22 -0
- package/dist/src/bootstrap/index.js +48 -0
- package/dist/src/bootstrap/initialise.js +434 -0
- package/dist/src/bootstrap/paths.js +15 -0
- package/dist/src/bootstrap/projection-runtime.js +27 -0
- package/dist/src/bootstrap/runner-quota-reporter.js +21 -0
- package/dist/src/bootstrap/runner-registry.js +30 -0
- package/dist/src/bootstrap/schedule-checkpoint-store.js +49 -0
- package/dist/src/bootstrap/self-update-application.js +195 -0
- package/dist/src/bootstrap/self-update-failure-log.js +33 -0
- package/dist/src/bootstrap/source-update-port.js +47 -0
- package/dist/src/bootstrap/status-publish-activity.js +42 -0
- package/dist/src/bootstrap/surface-api-applications.js +325 -0
- package/dist/src/bootstrap/surface-api-execution-applications.js +95 -0
- package/dist/src/bootstrap/surface-api-metadata.js +12 -0
- package/dist/src/bootstrap/surface-api-projection-pages.js +22 -0
- package/dist/src/bootstrap/surface-api-run-context.js +5 -0
- package/dist/src/bootstrap/surface-api-transcripts.js +57 -0
- package/dist/src/bootstrap/surface-api-work-applications.js +199 -0
- package/dist/src/bootstrap/surface-applications.js +7 -0
- package/dist/src/bootstrap/surface-cli-applications.js +701 -0
- package/dist/src/bootstrap/update-ledger.js +61 -0
- package/dist/src/bootstrap/update-maintenance-lease.js +176 -0
- package/dist/src/{version.js → bootstrap/version.js} +35 -51
- package/dist/src/control-plane/application/advance-once.js +184 -0
- package/dist/src/control-plane/application/control-plane-projection.js +42 -0
- package/dist/src/control-plane/application/control-plane-service.js +42 -0
- package/dist/src/control-plane/application/intake-pipeline.js +29 -0
- package/dist/src/control-plane/application/runner-control-service.js +66 -0
- package/dist/src/control-plane/application/runner-pipeline.js +57 -0
- package/dist/src/control-plane/application/schedule-service.js +47 -0
- package/dist/src/control-plane/application/work-cancellation-policy.js +31 -0
- package/dist/src/control-plane/contracts/commands.js +10 -0
- package/dist/src/control-plane/contracts/config.js +22 -0
- package/dist/src/control-plane/contracts/events.js +81 -0
- package/dist/src/control-plane/contracts/streams.js +5 -0
- package/dist/src/control-plane/domain/dispatch-policy.js +15 -0
- package/dist/src/control-plane/domain/quota-policy.js +26 -0
- package/dist/src/control-plane/domain/runner-quota.js +35 -0
- package/dist/src/control-plane/domain/schedule-policy.js +46 -0
- package/dist/src/control-plane/index.js +20 -0
- package/dist/src/control-plane/infrastructure/intake-host.js +24 -0
- package/dist/src/control-plane/infrastructure/resident-host.js +45 -0
- package/dist/src/control-plane/infrastructure/tick-host.js +35 -0
- package/dist/src/execution/application/activation-claim.js +50 -0
- package/dist/src/execution/application/active-run-cancellation.js +14 -0
- package/dist/src/execution/application/execution-activity.js +97 -0
- package/dist/src/execution/application/execution-projection.js +17 -0
- package/dist/src/execution/application/execution-service.js +372 -0
- package/dist/src/execution/application/execution-validation.js +26 -0
- package/dist/src/execution/application/recovery-service.js +212 -0
- package/dist/src/execution/application/run-lifecycle.js +115 -0
- package/dist/src/execution/application/run-liveness-service.js +80 -0
- package/dist/src/execution/application/run-repository.js +27 -0
- package/dist/src/execution/contracts/commands.js +1 -0
- package/dist/src/execution/contracts/config.js +35 -0
- package/dist/src/execution/contracts/control-plane.js +1 -0
- package/dist/src/execution/contracts/event-factory.js +53 -0
- package/dist/src/execution/contracts/events.js +274 -0
- package/dist/src/execution/contracts/identifiers.js +5 -0
- package/dist/src/execution/contracts/liveness.js +1 -0
- package/dist/src/execution/contracts/results.js +1 -0
- package/dist/src/execution/contracts/runner.js +15 -0
- package/dist/src/execution/contracts/streams.js +10 -0
- package/dist/src/execution/contracts/views.js +1 -0
- package/dist/src/execution/contracts/vocabulary.js +43 -0
- package/dist/src/execution/contracts/workspace.js +1 -0
- package/dist/src/execution/domain/run-result.js +34 -0
- package/dist/src/execution/domain/run.js +142 -0
- package/dist/src/execution/index.js +31 -0
- package/dist/src/execution/infrastructure/agent-runner-adapter.js +114 -0
- package/dist/src/execution/infrastructure/process-execution.js +29 -0
- package/dist/src/execution/infrastructure/prompt-templates.js +42 -0
- package/dist/src/execution/infrastructure/runners/claude.js +120 -0
- package/dist/src/execution/infrastructure/runners/codex.js +143 -0
- package/dist/src/execution/infrastructure/runners/command.js +4 -0
- package/dist/src/execution/infrastructure/runners/cursor.js +69 -0
- package/dist/src/execution/infrastructure/runners/fake-scenarios.js +99 -0
- package/dist/src/execution/infrastructure/runners/fake.js +65 -0
- package/dist/src/execution/infrastructure/runners/registry.js +26 -0
- package/dist/src/execution/infrastructure/transcript-store.js +223 -0
- package/dist/src/execution/infrastructure/transcripts.js +11 -0
- package/dist/src/execution/infrastructure/workspace/fake-workspace.js +19 -0
- package/dist/src/execution/infrastructure/workspace/git-workspace.js +241 -0
- package/dist/src/integrations/application/agent-run-publication-reactor.js +111 -0
- package/dist/src/integrations/application/artifact-registration-reactor.js +159 -0
- package/dist/src/integrations/application/poll-service.js +25 -0
- package/dist/src/integrations/application/terminal-agent-run-report.js +40 -0
- package/dist/src/integrations/application/work-admission.js +31 -0
- package/dist/src/integrations/application/work-conclusion.js +19 -0
- package/dist/src/integrations/contracts/artifact-events.js +60 -0
- package/dist/src/integrations/contracts/artifact-vocabulary.js +9 -0
- package/dist/src/integrations/contracts/config.js +14 -0
- package/dist/src/integrations/contracts/identifiers.js +5 -0
- package/dist/src/integrations/contracts/intake-rules.js +14 -0
- package/dist/src/integrations/contracts/intake.js +1 -0
- package/dist/src/integrations/contracts/outcome-vocabulary.js +7 -0
- package/dist/src/integrations/contracts/provider.js +37 -0
- package/dist/src/integrations/contracts/streams.js +10 -0
- package/dist/src/integrations/delivery/application/delivery-outcome-reactor.js +75 -0
- package/dist/src/integrations/delivery/application/delivery-projector.js +165 -0
- package/dist/src/integrations/delivery/application/delivery-service.js +173 -0
- package/dist/src/integrations/delivery/contracts/commands.js +1 -0
- package/dist/src/integrations/delivery/contracts/config.js +1 -0
- package/dist/src/integrations/delivery/contracts/event-factory.js +18 -0
- package/dist/src/integrations/delivery/contracts/events.js +86 -0
- package/dist/src/integrations/delivery/contracts/intents.js +89 -0
- package/dist/src/integrations/delivery/contracts/views.js +1 -0
- package/dist/src/integrations/delivery/contracts/vocabulary.js +22 -0
- package/dist/src/integrations/fake/durable-delivery-provider.js +48 -0
- package/dist/src/integrations/fake/external-sink.js +9 -0
- package/dist/src/integrations/fake/external-source.js +44 -0
- package/dist/src/integrations/fake/inbound-translator.js +130 -0
- package/dist/src/integrations/fake/provider.js +95 -0
- package/dist/src/integrations/github/application/agent-context-reader.js +54 -0
- package/dist/src/integrations/github/application/agent-run-comment.js +94 -0
- package/dist/src/integrations/github/application/comment-history-reader.js +43 -0
- package/dist/src/integrations/github/application/inbound-context.js +10 -0
- package/dist/src/integrations/github/application/inbound-review-signals.js +159 -0
- package/dist/src/integrations/github/application/inbound-translator.js +231 -0
- package/dist/src/integrations/github/application/inbound-watch-gate-signals.js +84 -0
- package/dist/src/integrations/github/application/intake-policy.js +23 -0
- package/dist/src/integrations/github/application/outbound-translator.js +47 -0
- package/dist/src/integrations/github/application/poll-service.js +29 -0
- package/dist/src/integrations/github/application/pull-request-translation.js +10 -0
- package/dist/src/integrations/github/application/resource-links.js +8 -0
- package/dist/src/integrations/github/application/review-command-translator.js +16 -0
- package/dist/src/integrations/github/application/wake-labels.js +95 -0
- package/dist/src/integrations/github/contracts/config.js +47 -0
- package/dist/src/integrations/github/contracts/events.js +127 -0
- package/dist/src/integrations/github/contracts/external-key.js +19 -0
- package/dist/src/integrations/github/contracts/payloads.js +9 -0
- package/dist/src/integrations/github/contracts/vocabulary.js +55 -0
- package/dist/src/integrations/github/index.js +31 -0
- package/dist/src/integrations/github/infrastructure/client-reads.js +214 -0
- package/dist/src/integrations/github/infrastructure/client.js +132 -0
- package/dist/src/integrations/github/infrastructure/content-fingerprint.js +10 -0
- package/dist/src/integrations/github/infrastructure/delivery.js +31 -0
- package/dist/src/integrations/github/infrastructure/etag-cache.js +56 -0
- package/dist/src/integrations/github/infrastructure/gh-auth.js +19 -0
- package/dist/src/integrations/github/infrastructure/issue-source.js +109 -0
- package/dist/src/integrations/github/infrastructure/pr-source.js +186 -0
- package/dist/src/integrations/github/infrastructure/review-source.js +70 -0
- package/dist/src/integrations/github/infrastructure/source.js +108 -0
- package/dist/src/integrations/github/provider.js +96 -0
- package/dist/src/integrations/index.js +30 -0
- package/dist/src/kernel/contracts/checkpoint-store.js +1 -0
- package/dist/src/kernel/contracts/clock.js +1 -0
- package/dist/src/kernel/contracts/commands.js +1 -0
- package/dist/src/kernel/contracts/event-journal.js +2 -0
- package/dist/src/kernel/contracts/event-schema.js +54 -0
- package/dist/src/kernel/contracts/events.js +11 -0
- package/dist/src/kernel/contracts/id-generator.js +1 -0
- package/dist/src/kernel/contracts/identifiers.js +8 -0
- package/dist/src/kernel/contracts/projection-store.js +1 -0
- package/dist/src/kernel/contracts/relations.js +1 -0
- package/dist/src/kernel/contracts/schema.js +17 -0
- package/dist/src/kernel/contracts/vocabulary.js +6 -0
- package/dist/src/kernel/domain/event-envelope.js +29 -0
- package/dist/src/kernel/domain/match-mode.js +11 -0
- package/dist/src/kernel/domain/relation.js +10 -0
- package/dist/src/kernel/index.js +17 -0
- package/dist/src/{lib/clock.js → kernel/infrastructure/system-clock.js} +3 -3
- package/dist/src/kernel/infrastructure/ulid-id-generator.js +9 -0
- package/dist/src/main.js +137 -1030
- package/dist/src/orchestration/application/accept-activity-outcome.js +25 -0
- package/dist/src/orchestration/application/accept-signal.js +35 -0
- package/dist/src/orchestration/application/advance-workflow.js +160 -0
- package/dist/src/orchestration/application/coordination-claims.js +107 -0
- package/dist/src/orchestration/application/group-budget-recorder.js +43 -0
- package/dist/src/orchestration/application/orchestration-projection.js +20 -0
- package/dist/src/orchestration/application/orchestration-repository.js +36 -0
- package/dist/src/orchestration/application/orchestration-service.js +82 -0
- package/dist/src/orchestration/application/request-child.js +118 -0
- package/dist/src/orchestration/application/signal-reactor.js +17 -0
- package/dist/src/orchestration/application/start-workflow.js +51 -0
- package/dist/src/orchestration/application/watch-reactor.js +82 -0
- package/dist/src/orchestration/contracts/activity-outcome.js +18 -0
- package/dist/src/orchestration/contracts/commands.js +1 -0
- package/dist/src/orchestration/contracts/config.js +128 -0
- package/dist/src/orchestration/contracts/event-decoder.js +263 -0
- package/dist/src/orchestration/contracts/events.js +41 -0
- package/dist/src/orchestration/contracts/identifiers.js +35 -0
- package/dist/src/orchestration/contracts/streams.js +38 -0
- package/dist/src/orchestration/contracts/views.js +1 -0
- package/dist/src/orchestration/contracts/vocabulary.js +30 -0
- package/dist/src/orchestration/domain/activation-policy.js +55 -0
- package/dist/src/orchestration/domain/approval-defaults.js +17 -0
- package/dist/src/orchestration/domain/child-policy.js +63 -0
- package/dist/src/orchestration/domain/compiler.js +162 -0
- package/dist/src/orchestration/domain/coordination-events.js +25 -0
- package/dist/src/orchestration/domain/decision-events.js +47 -0
- package/dist/src/orchestration/domain/interpreter.js +49 -0
- package/dist/src/orchestration/domain/operator-retry-policy.js +34 -0
- package/dist/src/orchestration/domain/retry-policy.js +26 -0
- package/dist/src/orchestration/domain/signal-policy.js +120 -0
- package/dist/src/orchestration/domain/supplemental-policy.js +61 -0
- package/dist/src/orchestration/domain/transition.js +55 -0
- package/dist/src/orchestration/domain/workflow-graph.js +41 -0
- package/dist/src/orchestration/domain/workflow-instance-events.js +236 -0
- package/dist/src/orchestration/domain/workflow-instance.js +41 -0
- package/dist/src/orchestration/domain/workflow-selector.js +21 -0
- package/dist/src/orchestration/index.js +19 -0
- package/dist/src/persistence/application/projection-runner.js +79 -0
- package/dist/src/persistence/filesystem/file-checkpoint-store.js +35 -0
- package/dist/src/persistence/filesystem/file-event-journal.js +143 -0
- package/dist/src/persistence/filesystem/file-lock.js +91 -0
- package/dist/src/persistence/filesystem/file-projection-store.js +64 -0
- package/dist/src/persistence/index.js +8 -0
- package/dist/src/persistence/memory/in-memory-checkpoint-store.js +14 -0
- package/dist/src/persistence/memory/in-memory-event-journal.js +88 -0
- package/dist/src/persistence/memory/in-memory-projection-store.js +17 -0
- package/dist/src/resources/application/lookup-projections.js +48 -0
- package/dist/src/resources/application/resource-lookup.js +16 -0
- package/dist/src/resources/application/resource-projections.js +81 -0
- package/dist/src/resources/application/resource-repository.js +18 -0
- package/dist/src/resources/application/resource-service.js +83 -0
- package/dist/src/resources/contracts/commands.js +1 -0
- package/dist/src/resources/contracts/config.js +2 -0
- package/dist/src/resources/contracts/events.js +83 -0
- package/dist/src/resources/contracts/identifiers.js +15 -0
- package/dist/src/resources/contracts/streams.js +6 -0
- package/dist/src/resources/contracts/views.js +1 -0
- package/dist/src/resources/contracts/vocabulary.js +67 -0
- package/dist/src/resources/domain/correlation.js +8 -0
- package/dist/src/resources/domain/resource.js +58 -0
- package/dist/src/resources/index.js +14 -0
- package/dist/src/surfaces/api/contracts/activities.js +1 -0
- package/dist/src/surfaces/api/contracts/board.js +2 -0
- package/dist/src/surfaces/api/contracts/common.js +46 -0
- package/dist/src/surfaces/api/contracts/control-plane.js +5 -0
- package/dist/src/surfaces/api/contracts/events.js +1 -0
- package/dist/src/surfaces/api/contracts/execution.js +1 -0
- package/dist/src/surfaces/api/contracts/index.js +13 -0
- package/dist/src/surfaces/api/contracts/observability.js +1 -0
- package/dist/src/surfaces/api/contracts/orchestration.js +1 -0
- package/dist/src/surfaces/api/contracts/resources.js +1 -0
- package/dist/src/surfaces/api/contracts/status.js +1 -0
- package/dist/src/surfaces/api/contracts/system.js +1 -0
- package/dist/src/surfaces/api/contracts/transport-values.js +39 -0
- package/dist/src/surfaces/api/contracts/work.js +17 -0
- package/dist/src/surfaces/api/http-server.js +121 -0
- package/dist/src/surfaces/api/presenters/activities.js +1 -0
- package/dist/src/surfaces/api/presenters/board.js +3 -0
- package/dist/src/surfaces/api/presenters/control-plane.js +1 -0
- package/dist/src/surfaces/api/presenters/events.js +1 -0
- package/dist/src/surfaces/api/presenters/execution.js +59 -0
- package/dist/src/surfaces/api/presenters/observability.js +1 -0
- package/dist/src/surfaces/api/presenters/orchestration.js +19 -0
- package/dist/src/surfaces/api/presenters/resources.js +15 -0
- package/dist/src/surfaces/api/presenters/status.js +3 -0
- package/dist/src/surfaces/api/presenters/system.js +14 -0
- package/dist/src/surfaces/api/presenters/work.js +16 -0
- package/dist/src/surfaces/api/problem-details.js +9 -0
- package/dist/src/surfaces/api/router.js +13 -0
- package/dist/src/surfaces/api/routes/activities.js +1 -0
- package/dist/src/surfaces/api/routes/applications.js +1 -0
- package/dist/src/surfaces/api/routes/commands.js +82 -0
- package/dist/src/surfaces/api/routes/control-plane.js +6 -0
- package/dist/src/surfaces/api/routes/events.js +1 -0
- package/dist/src/surfaces/api/routes/execution.js +8 -0
- package/dist/src/surfaces/api/routes/index.js +18 -0
- package/dist/src/surfaces/api/routes/observability.js +1 -0
- package/dist/src/surfaces/api/routes/orchestration.js +1 -0
- package/dist/src/surfaces/api/routes/pagination.js +78 -0
- package/dist/src/surfaces/api/routes/read.js +135 -0
- package/dist/src/surfaces/api/routes/resources.js +1 -0
- package/dist/src/surfaces/api/routes/responses.js +67 -0
- package/dist/src/surfaces/api/routes/system.js +1 -0
- package/dist/src/surfaces/api/routes/work.js +9 -0
- package/dist/src/surfaces/cli/commands/api.js +1 -0
- package/dist/src/surfaces/cli/commands/audit.js +10 -0
- package/dist/src/surfaces/cli/commands/correlate.js +2 -0
- package/dist/src/surfaces/cli/commands/doctor.js +6 -0
- package/dist/src/surfaces/cli/commands/init.js +39 -0
- package/dist/src/surfaces/cli/commands/sandbox-entrypoint.js +33 -0
- package/dist/src/surfaces/cli/commands/sandbox-setup.js +29 -0
- package/dist/src/surfaces/cli/commands/sandbox.js +105 -0
- package/dist/src/surfaces/cli/commands/self-update.js +38 -0
- package/dist/src/surfaces/cli/commands/smoke.js +16 -0
- package/dist/src/surfaces/cli/commands/start.js +1 -0
- package/dist/src/surfaces/cli/commands/stop.js +13 -0
- package/dist/src/surfaces/cli/commands/tick.js +1 -0
- package/dist/src/surfaces/cli/commands/ui.js +2 -0
- package/dist/src/surfaces/cli/commands/validate-state.js +5 -0
- package/dist/src/surfaces/cli/infrastructure/docker-cli.js +221 -0
- package/dist/src/surfaces/cli/infrastructure/process-log.js +86 -0
- package/dist/src/surfaces/cli/main.js +140 -0
- package/dist/src/surfaces/cli/usage.js +33 -0
- package/dist/src/surfaces/contracts/config.js +34 -0
- package/dist/src/surfaces/index.js +47 -0
- package/dist/src/surfaces/web-assets/assets/index-Bfn4FwZG.css +1 -0
- package/dist/src/surfaces/web-assets/assets/index-ipB6JPGU.js +1090 -0
- package/dist/src/surfaces/web-assets/index.html +13 -0
- package/dist/src/surfaces/web-host/asset-source.js +1 -0
- package/dist/src/surfaces/web-host/packaged-assets.js +44 -0
- package/dist/src/work/application/work-projection.js +59 -0
- package/dist/src/work/application/work-repository.js +18 -0
- package/dist/src/work/application/work-service.js +117 -0
- package/dist/src/work/contracts/commands.js +1 -0
- package/dist/src/work/contracts/config.js +2 -0
- package/dist/src/work/contracts/events.js +103 -0
- package/dist/src/work/contracts/identifiers.js +5 -0
- package/dist/src/work/contracts/streams.js +6 -0
- package/dist/src/work/contracts/views.js +1 -0
- package/dist/src/work/contracts/vocabulary.js +6 -0
- package/dist/src/work/domain/work-item.js +89 -0
- package/dist/src/work/index.js +11 -0
- package/docker/Dockerfile +10 -6
- package/docker/Dockerfile.packaged +3 -3
- package/package.json +29 -4
- package/prompts/implement.md +2 -2
- package/templates/SETUP.md +7 -7
- package/dist/src/adapters/claude/claude-runner.js +0 -529
- package/dist/src/adapters/codex/codex-runner.js +0 -503
- package/dist/src/adapters/cursor/cursor-runner.js +0 -418
- package/dist/src/adapters/docker/docker-cli.js +0 -150
- package/dist/src/adapters/fake/fake-artifact-verifier.js +0 -14
- package/dist/src/adapters/fake/fake-github-pull-request-activity-source.js +0 -77
- package/dist/src/adapters/fake/fake-resource-index.js +0 -21
- package/dist/src/adapters/fake/fake-runner.js +0 -77
- package/dist/src/adapters/fake/fake-ticketing-system.js +0 -185
- package/dist/src/adapters/fake/fake-workspace-manager.js +0 -81
- package/dist/src/adapters/fs/resource-index.js +0 -126
- package/dist/src/adapters/fs/self-update-ledger.js +0 -17
- package/dist/src/adapters/fs/state-store.js +0 -775
- package/dist/src/adapters/git/git-workspace-manager.js +0 -289
- package/dist/src/adapters/github/github-artifact-verifier.js +0 -38
- package/dist/src/adapters/github/github-auth.js +0 -16
- package/dist/src/adapters/github/github-client.js +0 -249
- package/dist/src/adapters/github/github-etag-cache.js +0 -57
- package/dist/src/adapters/github/github-issues-work-source.js +0 -692
- package/dist/src/adapters/github/github-pull-request-activity-source.js +0 -584
- package/dist/src/adapters/github/github-pull-request-merge-actor.js +0 -45
- package/dist/src/adapters/http/ui-assets.js +0 -1188
- package/dist/src/adapters/http/ui-data.js +0 -1107
- package/dist/src/adapters/http/ui-server.js +0 -458
- package/dist/src/adapters/runner/cli-command.js +0 -73
- package/dist/src/adapters/runner/prompt-templates.js +0 -76
- package/dist/src/adapters/runner/runner-cli-adapter.js +0 -112
- package/dist/src/adapters/runner/runner-registry.js +0 -139
- package/dist/src/adapters/runner/runtime-events.js +0 -32
- package/dist/src/adapters/runner/stage-prompt.js +0 -268
- package/dist/src/adapters/runner/transcripts.js +0 -25
- package/dist/src/cli/audit-command.js +0 -36
- package/dist/src/cli/correlate-command.js +0 -62
- package/dist/src/cli/doctor-command.js +0 -48
- package/dist/src/cli/init-command.js +0 -18
- package/dist/src/cli/sandbox-command.js +0 -258
- package/dist/src/cli/sandbox-entrypoint-command.js +0 -88
- package/dist/src/cli/sandbox-exec-logging.js +0 -7
- package/dist/src/cli/sandbox-resume.js +0 -79
- package/dist/src/cli/sandbox-setup-command.js +0 -31
- package/dist/src/cli/scaffold-assets.js +0 -100
- package/dist/src/cli/self-update-command.js +0 -198
- package/dist/src/cli/startup-preflight.js +0 -134
- package/dist/src/cli/stop-command.js +0 -46
- package/dist/src/cli/ui-command.js +0 -27
- package/dist/src/config/defaults.js +0 -10
- package/dist/src/config/discover-config-files.js +0 -11
- package/dist/src/config/load-config.js +0 -69
- package/dist/src/config/split-config.js +0 -14
- package/dist/src/core/active-run-recovery.js +0 -44
- package/dist/src/core/approval-intents.js +0 -16
- package/dist/src/core/audit-events.js +0 -82
- package/dist/src/core/control-plane.js +0 -192
- package/dist/src/core/event-builders.js +0 -153
- package/dist/src/core/event-resolver.js +0 -249
- package/dist/src/core/lifecycle-service.js +0 -8
- package/dist/src/core/live-execution.js +0 -81
- package/dist/src/core/outbox.js +0 -198
- package/dist/src/core/policy-engine.js +0 -389
- package/dist/src/core/projection-updater.js +0 -693
- package/dist/src/core/quota-backoff.js +0 -69
- package/dist/src/core/run-lease.js +0 -38
- package/dist/src/core/scheduled-workflow-source.js +0 -199
- package/dist/src/core/sink-router.js +0 -107
- package/dist/src/core/stale-run-reconciler.js +0 -352
- package/dist/src/core/tick-runner.js +0 -2365
- package/dist/src/core/workspace-cleanup.js +0 -117
- package/dist/src/domain/branch-naming.js +0 -14
- package/dist/src/domain/custom-commands.js +0 -58
- package/dist/src/domain/event-types.js +0 -158
- package/dist/src/domain/manual-labels.js +0 -1
- package/dist/src/domain/resource-uri.js +0 -38
- package/dist/src/domain/runner-routing.js +0 -127
- package/dist/src/domain/runtime-events.js +0 -36
- package/dist/src/domain/schema.js +0 -1233
- package/dist/src/domain/sources.js +0 -16
- package/dist/src/domain/stages.js +0 -36
- package/dist/src/domain/work-item-labels.js +0 -48
- package/dist/src/domain/work-item-lifecycle.js +0 -10
- package/dist/src/domain/work-item-status.js +0 -33
- package/dist/src/domain/workflows.js +0 -159
- package/dist/src/lib/deep-merge.js +0 -14
- package/dist/src/lib/detached-process-logging.js +0 -46
- package/dist/src/lib/event-log.js +0 -21
- package/dist/src/lib/format.js +0 -41
- package/dist/src/lib/json-file.js +0 -23
- package/dist/src/lib/lock.js +0 -181
- package/dist/src/lib/log-rotation.js +0 -42
- package/dist/src/lib/paths.js +0 -52
- package/dist/src/lib/process-identity.js +0 -54
- package/dist/src/lib/state-health.js +0 -30
- package/dist/src/lib/work-id.js +0 -19
- package/dist/src/lib/yaml-file.js +0 -20
- /package/dist/src/{core → activities/pr}/contracts.js +0 -0
- /package/dist/src/{domain/types.js → control-plane/contracts/views.js} +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Wake</title>
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-ipB6JPGU.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Bfn4FwZG.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
const contentTypeFor = (path) => path.endsWith('.js')
|
|
5
|
+
? 'text/javascript; charset=utf-8'
|
|
6
|
+
: path.endsWith('.css')
|
|
7
|
+
? 'text/css; charset=utf-8'
|
|
8
|
+
: 'application/octet-stream';
|
|
9
|
+
export class PackagedAssets {
|
|
10
|
+
read;
|
|
11
|
+
constructor(read) {
|
|
12
|
+
this.read = read;
|
|
13
|
+
}
|
|
14
|
+
async get(path) {
|
|
15
|
+
const normalized = path.replace(/^\/+/, '');
|
|
16
|
+
if (normalized.length === 0)
|
|
17
|
+
return undefined;
|
|
18
|
+
const body = await this.read(normalized);
|
|
19
|
+
if (body === undefined)
|
|
20
|
+
return undefined;
|
|
21
|
+
const immutable = /[.-][a-z0-9]{4,}\.(?:js|css)$/i.test(normalized);
|
|
22
|
+
return {
|
|
23
|
+
body,
|
|
24
|
+
contentType: contentTypeFor(normalized),
|
|
25
|
+
headers: { 'cache-control': immutable ? 'public, max-age=31536000, immutable' : 'no-cache' },
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function packagedWebAssetsRoot(moduleUrl = import.meta.url) {
|
|
30
|
+
return fileURLToPath(new URL('../web-assets/', moduleUrl)).replace(/[\\/]$/, '');
|
|
31
|
+
}
|
|
32
|
+
export function createPackagedAssetSource(moduleUrl = import.meta.url) {
|
|
33
|
+
const root = packagedWebAssetsRoot(moduleUrl);
|
|
34
|
+
return new PackagedAssets(async (path) => {
|
|
35
|
+
if (path.split(/[\\/]/).includes('..'))
|
|
36
|
+
return undefined;
|
|
37
|
+
try {
|
|
38
|
+
return await readFile(join(root, path));
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
return error.code === 'ENOENT' ? undefined : Promise.reject(error);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { selectWorkEvent, WorkEventType } from '../contracts/events.js';
|
|
2
|
+
import { WorkStatus } from '../contracts/vocabulary.js';
|
|
3
|
+
export const workProjection = {
|
|
4
|
+
name: 'work',
|
|
5
|
+
select(event) {
|
|
6
|
+
const owned = selectWorkEvent(event);
|
|
7
|
+
return owned === null ? null : { key: owned.stream.id };
|
|
8
|
+
},
|
|
9
|
+
initial: () => null,
|
|
10
|
+
project(previous, event) {
|
|
11
|
+
const owned = selectWorkEvent(event);
|
|
12
|
+
if (owned === null)
|
|
13
|
+
return previous;
|
|
14
|
+
if (owned.eventType === WorkEventType.ItemCreated)
|
|
15
|
+
return {
|
|
16
|
+
workItemId: owned.stream.id,
|
|
17
|
+
objective: owned.payload.objective,
|
|
18
|
+
state: WorkStatus.Open,
|
|
19
|
+
tags: owned.payload.tags ?? [],
|
|
20
|
+
autoApprovalGranted: false,
|
|
21
|
+
relatedWorkItems: [],
|
|
22
|
+
};
|
|
23
|
+
// Every other event revises an existing item; a fold that has not seen the creation
|
|
24
|
+
// yet has nothing to revise.
|
|
25
|
+
return previous === null ? previous : revise(previous, owned);
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
function revise(previous, owned) {
|
|
29
|
+
switch (owned.eventType) {
|
|
30
|
+
case WorkEventType.ObjectiveRevised:
|
|
31
|
+
return { ...previous, objective: owned.payload.objective };
|
|
32
|
+
case WorkEventType.ItemClosed:
|
|
33
|
+
return { ...previous, state: WorkStatus.Closed };
|
|
34
|
+
case WorkEventType.ItemCancelled:
|
|
35
|
+
return { ...previous, state: WorkStatus.Cancelled };
|
|
36
|
+
case WorkEventType.AutoApprovalGranted:
|
|
37
|
+
return { ...previous, autoApprovalGranted: true };
|
|
38
|
+
case WorkEventType.AutoApprovalRevoked:
|
|
39
|
+
return { ...previous, autoApprovalGranted: false };
|
|
40
|
+
case WorkEventType.ItemFrozen:
|
|
41
|
+
return { ...previous, frozen: true };
|
|
42
|
+
case WorkEventType.ItemUnfrozen:
|
|
43
|
+
return { ...previous, frozen: false };
|
|
44
|
+
case WorkEventType.ItemDeleted:
|
|
45
|
+
return { ...previous, deleted: true, frozen: false };
|
|
46
|
+
case WorkEventType.ItemLinked:
|
|
47
|
+
return link(previous, owned.payload.to, owned.payload.relation);
|
|
48
|
+
default:
|
|
49
|
+
return assertNever(owned);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function link(previous, workItemId, relation) {
|
|
53
|
+
return previous.relatedWorkItems.some((item) => item.workItemId === workItemId && item.relation === relation)
|
|
54
|
+
? previous
|
|
55
|
+
: { ...previous, relatedWorkItems: [...previous.relatedWorkItems, { workItemId, relation }] };
|
|
56
|
+
}
|
|
57
|
+
function assertNever(value) {
|
|
58
|
+
throw new Error(`Unhandled Work event: ${JSON.stringify(value)}`);
|
|
59
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { decodeWorkEvent, selectWorkEvent, } from '../contracts/events.js';
|
|
2
|
+
import { workItemStream } from '../contracts/streams.js';
|
|
3
|
+
import { foldWorkItem } from '../domain/work-item.js';
|
|
4
|
+
export class WorkRepository {
|
|
5
|
+
journal;
|
|
6
|
+
constructor(journal) {
|
|
7
|
+
this.journal = journal;
|
|
8
|
+
}
|
|
9
|
+
async load(workItemId) {
|
|
10
|
+
const events = await this.journal.readStream(workItemStream(workItemId));
|
|
11
|
+
const owned = events.map(selectWorkEvent).filter((event) => event !== null);
|
|
12
|
+
return { sequence: events.length, view: foldWorkItem(owned) };
|
|
13
|
+
}
|
|
14
|
+
async append(workItemId, expectedSequence, drafts) {
|
|
15
|
+
const events = await this.journal.append(workItemStream(workItemId), expectedSequence, drafts);
|
|
16
|
+
return events.map(decodeWorkEvent);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { createEventDraft, EventSourceKind, } from '../../kernel/index.js';
|
|
2
|
+
import { WorkEventType } from '../contracts/events.js';
|
|
3
|
+
import { workItemStream } from '../contracts/streams.js';
|
|
4
|
+
import { WorkStatus } from '../contracts/vocabulary.js';
|
|
5
|
+
import { WorkRepository } from './work-repository.js';
|
|
6
|
+
export function createWorkService(journal) {
|
|
7
|
+
const repository = new WorkRepository(journal);
|
|
8
|
+
const change = (workItemId, context, draft, allowMissing, requireOpen) => changeWorkItem(repository, workItemId, context, draft, allowMissing, requireOpen);
|
|
9
|
+
return {
|
|
10
|
+
async create(command, context) {
|
|
11
|
+
const loaded = await repository.load(command.workItemId);
|
|
12
|
+
const draft = workDraft(command.workItemId, context, WorkEventType.ItemCreated, {
|
|
13
|
+
objective: command.objective,
|
|
14
|
+
...(command.tags === undefined ? {} : { tags: command.tags }),
|
|
15
|
+
});
|
|
16
|
+
if (loaded.view !== null)
|
|
17
|
+
return change(command.workItemId, context, draft, true);
|
|
18
|
+
return change(command.workItemId, context, draft, true);
|
|
19
|
+
},
|
|
20
|
+
revise(command, context) {
|
|
21
|
+
return change(command.workItemId, context, workDraft(command.workItemId, context, WorkEventType.ObjectiveRevised, {
|
|
22
|
+
objective: command.objective,
|
|
23
|
+
}));
|
|
24
|
+
},
|
|
25
|
+
link(command, context) {
|
|
26
|
+
return change(command.from, context, workDraft(command.from, context, WorkEventType.ItemLinked, {
|
|
27
|
+
to: command.to,
|
|
28
|
+
relation: command.relation,
|
|
29
|
+
}));
|
|
30
|
+
},
|
|
31
|
+
close(workItemId, reason, context) {
|
|
32
|
+
return change(workItemId, context, workDraft(workItemId, context, WorkEventType.ItemClosed, { reason }));
|
|
33
|
+
},
|
|
34
|
+
cancel(workItemId, reason, context) {
|
|
35
|
+
return change(workItemId, context, workDraft(workItemId, context, WorkEventType.ItemCancelled, { reason }));
|
|
36
|
+
},
|
|
37
|
+
grantAutoApproval(workItemId, context) {
|
|
38
|
+
return setAutoApproval(repository, change, workItemId, context, true);
|
|
39
|
+
},
|
|
40
|
+
revokeAutoApproval(workItemId, context) {
|
|
41
|
+
return setAutoApproval(repository, change, workItemId, context, false);
|
|
42
|
+
},
|
|
43
|
+
freeze(workItemId, context) {
|
|
44
|
+
return setFrozen(repository, change, workItemId, context, true);
|
|
45
|
+
},
|
|
46
|
+
unfreeze(workItemId, context) {
|
|
47
|
+
return setFrozen(repository, change, workItemId, context, false);
|
|
48
|
+
},
|
|
49
|
+
delete(workItemId, context) {
|
|
50
|
+
return setDeleted(repository, change, workItemId, context);
|
|
51
|
+
},
|
|
52
|
+
async get(workItemId) {
|
|
53
|
+
return (await repository.load(workItemId)).view;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async function changeWorkItem(repository, workItemId, context, draft, allowMissing = false, requireOpen = true) {
|
|
58
|
+
const loaded = await repository.load(workItemId);
|
|
59
|
+
if (!allowMissing && loaded.view === null)
|
|
60
|
+
throw new Error(`WorkItem ${workItemId} does not exist`);
|
|
61
|
+
if (loaded.view !== null && loaded.view.deleted) {
|
|
62
|
+
throw new Error(`WorkItem ${workItemId} is deleted`);
|
|
63
|
+
}
|
|
64
|
+
if (requireOpen && loaded.view !== null && loaded.view.state !== WorkStatus.Open) {
|
|
65
|
+
throw new Error(`WorkItem ${workItemId} is ${loaded.view.state}`);
|
|
66
|
+
}
|
|
67
|
+
await repository.append(workItemId, loaded.sequence, [draft]);
|
|
68
|
+
const result = await repository.load(workItemId);
|
|
69
|
+
if (result.view === null)
|
|
70
|
+
throw new Error(`WorkItem ${workItemId} was not created`);
|
|
71
|
+
return result.view;
|
|
72
|
+
}
|
|
73
|
+
// Operator consent is a durable sibling of freeze/unfreeze. Setting it to the value it
|
|
74
|
+
// already holds appends nothing, so replay cannot manufacture consent history.
|
|
75
|
+
async function setAutoApproval(repository, change, workItemId, context, granted) {
|
|
76
|
+
const current = (await repository.load(workItemId)).view;
|
|
77
|
+
if (current === null)
|
|
78
|
+
throw new Error(`WorkItem ${workItemId} does not exist`);
|
|
79
|
+
if (current.autoApprovalGranted === granted)
|
|
80
|
+
return current;
|
|
81
|
+
const eventType = granted ? WorkEventType.AutoApprovalGranted : WorkEventType.AutoApprovalRevoked;
|
|
82
|
+
return change(workItemId, context, workDraft(workItemId, context, eventType, {}));
|
|
83
|
+
}
|
|
84
|
+
function workDraft(workItemId, context, eventType, payload) {
|
|
85
|
+
return createEventDraft({
|
|
86
|
+
eventId: `${context.commandId}:${eventType}`,
|
|
87
|
+
eventType,
|
|
88
|
+
occurredAt: context.occurredAt,
|
|
89
|
+
correlationId: context.correlationId,
|
|
90
|
+
causationId: context.commandId,
|
|
91
|
+
actor: context.actor,
|
|
92
|
+
source: { kind: EventSourceKind.Internal, id: 'work-service' },
|
|
93
|
+
stream: workItemStream(workItemId),
|
|
94
|
+
payload,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
async function setFrozen(repository, change, workItemId, context, frozen) {
|
|
98
|
+
const current = (await repository.load(workItemId)).view;
|
|
99
|
+
if (current === null)
|
|
100
|
+
throw new Error(`WorkItem ${workItemId} does not exist`);
|
|
101
|
+
if (current.deleted)
|
|
102
|
+
throw new Error(`WorkItem ${workItemId} is deleted`);
|
|
103
|
+
if (current.frozen === frozen)
|
|
104
|
+
return current;
|
|
105
|
+
return change(workItemId, context, workDraft(workItemId, context, frozen ? WorkEventType.ItemFrozen : WorkEventType.ItemUnfrozen, {}));
|
|
106
|
+
}
|
|
107
|
+
async function setDeleted(repository, change, workItemId, context) {
|
|
108
|
+
const current = (await repository.load(workItemId)).view;
|
|
109
|
+
if (current === null)
|
|
110
|
+
throw new Error(`WorkItem ${workItemId} does not exist`);
|
|
111
|
+
if (current.deleted)
|
|
112
|
+
return current;
|
|
113
|
+
// Deletion is a purge escape hatch, not a lifecycle transition — unlike
|
|
114
|
+
// freeze/revise/etc it must still work once a WorkItem is closed or
|
|
115
|
+
// cancelled, since that's the common case operators need it for.
|
|
116
|
+
return change(workItemId, context, workDraft(workItemId, context, WorkEventType.ItemDeleted, {}), false, false);
|
|
117
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { brandedStringSchema, eventEnvelopeSchema, } from '../../kernel/index.js';
|
|
3
|
+
import { workItemId } from './identifiers.js';
|
|
4
|
+
import { WorkStreamKind } from './streams.js';
|
|
5
|
+
export const WorkEventType = {
|
|
6
|
+
ItemCreated: 'work.item-created',
|
|
7
|
+
ObjectiveRevised: 'work.objective-revised',
|
|
8
|
+
ItemLinked: 'work.item-linked',
|
|
9
|
+
ItemClosed: 'work.item-closed',
|
|
10
|
+
ItemCancelled: 'work.item-cancelled',
|
|
11
|
+
AutoApprovalGranted: 'work.auto-approval-granted',
|
|
12
|
+
AutoApprovalRevoked: 'work.auto-approval-revoked',
|
|
13
|
+
ItemFrozen: 'work.item-frozen',
|
|
14
|
+
ItemUnfrozen: 'work.item-unfrozen',
|
|
15
|
+
ItemDeleted: 'work.item-deleted',
|
|
16
|
+
};
|
|
17
|
+
const streamSchema = z
|
|
18
|
+
.object({
|
|
19
|
+
kind: z.literal(WorkStreamKind.WorkItem),
|
|
20
|
+
id: brandedStringSchema(workItemId),
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
const objectiveSchema = z
|
|
24
|
+
.object({
|
|
25
|
+
objective: z.string().refine((objective) => objective.trim().length > 0, {
|
|
26
|
+
message: 'objective must not be empty',
|
|
27
|
+
}),
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
const reasonSchema = z.object({ reason: z.string() }).strict();
|
|
31
|
+
const consentSchema = z.object({}).strict();
|
|
32
|
+
const itemCreatedSchema = objectiveSchema.extend({
|
|
33
|
+
tags: z.array(z.string().trim().min(1)).readonly().optional(),
|
|
34
|
+
});
|
|
35
|
+
const eventSchema = z.discriminatedUnion('eventType', [
|
|
36
|
+
eventEnvelopeSchema.extend({
|
|
37
|
+
eventType: z.literal(WorkEventType.ItemCreated),
|
|
38
|
+
stream: streamSchema,
|
|
39
|
+
payload: itemCreatedSchema,
|
|
40
|
+
}),
|
|
41
|
+
eventEnvelopeSchema.extend({
|
|
42
|
+
eventType: z.literal(WorkEventType.ObjectiveRevised),
|
|
43
|
+
stream: streamSchema,
|
|
44
|
+
payload: objectiveSchema,
|
|
45
|
+
}),
|
|
46
|
+
eventEnvelopeSchema.extend({
|
|
47
|
+
eventType: z.literal(WorkEventType.ItemLinked),
|
|
48
|
+
stream: streamSchema,
|
|
49
|
+
payload: z
|
|
50
|
+
.object({
|
|
51
|
+
to: brandedStringSchema(workItemId),
|
|
52
|
+
relation: z.enum(['relates-to', 'parent-of', 'child-of']),
|
|
53
|
+
})
|
|
54
|
+
.strict(),
|
|
55
|
+
}),
|
|
56
|
+
eventEnvelopeSchema.extend({
|
|
57
|
+
eventType: z.literal(WorkEventType.ItemClosed),
|
|
58
|
+
stream: streamSchema,
|
|
59
|
+
payload: reasonSchema,
|
|
60
|
+
}),
|
|
61
|
+
eventEnvelopeSchema.extend({
|
|
62
|
+
eventType: z.literal(WorkEventType.ItemCancelled),
|
|
63
|
+
stream: streamSchema,
|
|
64
|
+
payload: reasonSchema,
|
|
65
|
+
}),
|
|
66
|
+
eventEnvelopeSchema.extend({
|
|
67
|
+
eventType: z.literal(WorkEventType.AutoApprovalGranted),
|
|
68
|
+
stream: streamSchema,
|
|
69
|
+
payload: consentSchema,
|
|
70
|
+
}),
|
|
71
|
+
eventEnvelopeSchema.extend({
|
|
72
|
+
eventType: z.literal(WorkEventType.AutoApprovalRevoked),
|
|
73
|
+
stream: streamSchema,
|
|
74
|
+
payload: consentSchema,
|
|
75
|
+
}),
|
|
76
|
+
eventEnvelopeSchema.extend({
|
|
77
|
+
eventType: z.literal(WorkEventType.ItemFrozen),
|
|
78
|
+
stream: streamSchema,
|
|
79
|
+
payload: consentSchema,
|
|
80
|
+
}),
|
|
81
|
+
eventEnvelopeSchema.extend({
|
|
82
|
+
eventType: z.literal(WorkEventType.ItemUnfrozen),
|
|
83
|
+
stream: streamSchema,
|
|
84
|
+
payload: consentSchema,
|
|
85
|
+
}),
|
|
86
|
+
eventEnvelopeSchema.extend({
|
|
87
|
+
eventType: z.literal(WorkEventType.ItemDeleted),
|
|
88
|
+
stream: streamSchema,
|
|
89
|
+
payload: consentSchema,
|
|
90
|
+
}),
|
|
91
|
+
]);
|
|
92
|
+
export function decodeWorkEvent(event) {
|
|
93
|
+
const result = eventSchema.safeParse(event);
|
|
94
|
+
if (!result.success)
|
|
95
|
+
throw invalidWorkEvent(event, result.error);
|
|
96
|
+
return result.data;
|
|
97
|
+
}
|
|
98
|
+
export function selectWorkEvent(event) {
|
|
99
|
+
return event.eventType.startsWith('work.') ? decodeWorkEvent(event) : null;
|
|
100
|
+
}
|
|
101
|
+
function invalidWorkEvent(event, cause) {
|
|
102
|
+
return new Error(`Invalid Work event ${event.eventId} at global position ${event.globalPosition} (${event.eventType}): ${cause.message}`, { cause });
|
|
103
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { WorkEventType } from '../contracts/events.js';
|
|
2
|
+
import { WorkStatus } from '../contracts/vocabulary.js';
|
|
3
|
+
export function foldWorkItem(events) {
|
|
4
|
+
if (events.length === 0)
|
|
5
|
+
return null;
|
|
6
|
+
if (events[0]?.eventType !== WorkEventType.ItemCreated) {
|
|
7
|
+
throw new Error(`WorkItem stream must begin with ${WorkEventType.ItemCreated}`);
|
|
8
|
+
}
|
|
9
|
+
const id = events[0].stream.id;
|
|
10
|
+
const state = {
|
|
11
|
+
objective: events[0].payload.objective,
|
|
12
|
+
tags: events[0].payload.tags ?? [],
|
|
13
|
+
lifecycle: WorkStatus.Open,
|
|
14
|
+
autoApprovalGranted: false,
|
|
15
|
+
frozen: false,
|
|
16
|
+
deleted: false,
|
|
17
|
+
links: [],
|
|
18
|
+
linkKeys: new Set(),
|
|
19
|
+
};
|
|
20
|
+
for (const [index, event] of events.entries())
|
|
21
|
+
applyEvent(state, event, index, id);
|
|
22
|
+
return {
|
|
23
|
+
workItemId: id,
|
|
24
|
+
objective: state.objective,
|
|
25
|
+
state: state.lifecycle,
|
|
26
|
+
tags: state.tags,
|
|
27
|
+
autoApprovalGranted: state.autoApprovalGranted,
|
|
28
|
+
frozen: state.frozen,
|
|
29
|
+
deleted: state.deleted,
|
|
30
|
+
relatedWorkItems: state.links,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function applyEvent(state, event, index, id) {
|
|
34
|
+
if (event.stream.id !== id) {
|
|
35
|
+
throw new Error('WorkItem events must belong to the same work-item stream');
|
|
36
|
+
}
|
|
37
|
+
switch (event.eventType) {
|
|
38
|
+
case WorkEventType.ItemCreated:
|
|
39
|
+
if (index > 0)
|
|
40
|
+
throw new Error('WorkItem stream cannot contain a second creation event');
|
|
41
|
+
break;
|
|
42
|
+
case WorkEventType.ObjectiveRevised:
|
|
43
|
+
state.objective = event.payload.objective;
|
|
44
|
+
break;
|
|
45
|
+
case WorkEventType.ItemLinked:
|
|
46
|
+
addLink(state, { workItemId: event.payload.to, relation: event.payload.relation });
|
|
47
|
+
break;
|
|
48
|
+
default:
|
|
49
|
+
applyStatusEvent(state, event);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function applyStatusEvent(state, event) {
|
|
53
|
+
switch (event.eventType) {
|
|
54
|
+
case WorkEventType.ItemClosed:
|
|
55
|
+
state.lifecycle = WorkStatus.Closed;
|
|
56
|
+
break;
|
|
57
|
+
case WorkEventType.ItemCancelled:
|
|
58
|
+
state.lifecycle = WorkStatus.Cancelled;
|
|
59
|
+
break;
|
|
60
|
+
case WorkEventType.AutoApprovalGranted:
|
|
61
|
+
state.autoApprovalGranted = true;
|
|
62
|
+
break;
|
|
63
|
+
case WorkEventType.AutoApprovalRevoked:
|
|
64
|
+
state.autoApprovalGranted = false;
|
|
65
|
+
break;
|
|
66
|
+
case WorkEventType.ItemFrozen:
|
|
67
|
+
state.frozen = true;
|
|
68
|
+
break;
|
|
69
|
+
case WorkEventType.ItemUnfrozen:
|
|
70
|
+
state.frozen = false;
|
|
71
|
+
break;
|
|
72
|
+
case WorkEventType.ItemDeleted:
|
|
73
|
+
state.deleted = true;
|
|
74
|
+
state.frozen = false;
|
|
75
|
+
break;
|
|
76
|
+
default:
|
|
77
|
+
assertNever(event);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function addLink(state, link) {
|
|
81
|
+
const key = `${link.workItemId}:${link.relation}`;
|
|
82
|
+
if (!state.linkKeys.has(key)) {
|
|
83
|
+
state.linkKeys.add(key);
|
|
84
|
+
state.links.push(link);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function assertNever(value) {
|
|
88
|
+
throw new Error(`Unhandled Work event: ${JSON.stringify(value)}`);
|
|
89
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './application/work-projection.js';
|
|
2
|
+
export * from './application/work-repository.js';
|
|
3
|
+
export * from './application/work-service.js';
|
|
4
|
+
export * from './contracts/commands.js';
|
|
5
|
+
export * from './contracts/config.js';
|
|
6
|
+
export * from './contracts/events.js';
|
|
7
|
+
export * from './contracts/identifiers.js';
|
|
8
|
+
export * from './contracts/streams.js';
|
|
9
|
+
export * from './contracts/views.js';
|
|
10
|
+
export * from './contracts/vocabulary.js';
|
|
11
|
+
export * from './domain/work-item.js';
|
package/docker/Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# syntax=docker/dockerfile:1
|
|
2
|
-
FROM node:
|
|
2
|
+
FROM node:24-bookworm-slim
|
|
3
3
|
|
|
4
4
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
|
5
5
|
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
|
|
@@ -42,14 +42,18 @@ RUN echo "cursor cache bust: ${CURSOR_CACHE_BUST}" \
|
|
|
42
42
|
|
|
43
43
|
WORKDIR /app
|
|
44
44
|
COPY package*.json ./
|
|
45
|
+
COPY src/surfaces/web/package.json src/surfaces/web/package.json
|
|
45
46
|
RUN --mount=type=cache,target=/root/.npm \
|
|
46
|
-
if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
|
47
|
+
if [ -f package-lock.json ]; then npm ci --include=dev; else npm install; fi
|
|
47
48
|
|
|
48
|
-
COPY . .
|
|
49
|
+
COPY tsconfig.json tsconfig.docker.json ./
|
|
50
|
+
COPY scripts/embed-version.mjs scripts/embed-version.mjs
|
|
51
|
+
COPY assets/ assets/
|
|
52
|
+
COPY src/ src/
|
|
49
53
|
ARG WAKE_BUILD_TAG
|
|
50
|
-
RUN WAKE_BUILD_TAG="$WAKE_BUILD_TAG" npm run build
|
|
54
|
+
RUN WAKE_BUILD_TAG="$WAKE_BUILD_TAG" npm run build:docker
|
|
51
55
|
|
|
52
|
-
USER
|
|
56
|
+
USER root
|
|
53
57
|
WORKDIR /home/wake
|
|
54
58
|
|
|
55
59
|
EXPOSE 4317
|
|
@@ -60,4 +64,4 @@ EXPOSE 4317
|
|
|
60
64
|
# that's fine since it's the very first thing that runs.
|
|
61
65
|
ENV WAKE_MAIN_JS=/app/dist/src/main.js
|
|
62
66
|
|
|
63
|
-
ENTRYPOINT ["
|
|
67
|
+
ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake; chown -R wake:wake /wake/.wake; exec su wake -s /bin/sh -c 'if [ \"$WAKE_START_ENABLED\" = \"true\" ]; then exec node /app/dist/src/main.js start --wake-root /wake --no-sandbox; else exec sleep infinity; fi'"]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# syntax=docker/dockerfile:1
|
|
2
|
-
FROM node:
|
|
2
|
+
FROM node:24-bookworm-slim
|
|
3
3
|
|
|
4
4
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
|
5
5
|
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
|
|
@@ -40,7 +40,7 @@ RUN curl https://cursor.com/install -fsS | HOME=/home/wake bash \
|
|
|
40
40
|
&& chmod +x /home/wake/.local/bin/cursor \
|
|
41
41
|
&& chown -R wake:wake /home/wake/.local
|
|
42
42
|
|
|
43
|
-
USER
|
|
43
|
+
USER root
|
|
44
44
|
WORKDIR /home/wake
|
|
45
45
|
|
|
46
46
|
EXPOSE 4317
|
|
@@ -50,4 +50,4 @@ EXPOSE 4317
|
|
|
50
50
|
# sandbox-entrypoint-command.ts) that the CLI should be invoked via the bare
|
|
51
51
|
# `wake` binary that `npm install -g` puts on PATH, rather than a hardcoded
|
|
52
52
|
# npm global lib path that varies by npm/OS setup.
|
|
53
|
-
ENTRYPOINT ["
|
|
53
|
+
ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake; chown -R wake:wake /wake/.wake; exec su wake -s /bin/sh -c 'exec wake sandbox-entrypoint'"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atolis-hq/wake",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Local autonomous agent control plane for software development",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
"url": "git+https://github.com/atolis-hq/wake.git"
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
|
+
"workspaces": [
|
|
12
|
+
"src/surfaces/web"
|
|
13
|
+
],
|
|
11
14
|
"bin": {
|
|
12
15
|
"wake": "dist/src/main.js"
|
|
13
16
|
},
|
|
@@ -15,6 +18,7 @@
|
|
|
15
18
|
"exports": "./dist/src/main.js",
|
|
16
19
|
"files": [
|
|
17
20
|
"dist/src",
|
|
21
|
+
"dist/src/surfaces/web-assets",
|
|
18
22
|
"docker",
|
|
19
23
|
"prompts",
|
|
20
24
|
"templates",
|
|
@@ -29,9 +33,24 @@
|
|
|
29
33
|
},
|
|
30
34
|
"scripts": {
|
|
31
35
|
"build": "tsc -p tsconfig.json && node scripts/embed-version.mjs",
|
|
32
|
-
"prepack": "npm run build",
|
|
36
|
+
"prepack": "npm run build && npm run build:web",
|
|
33
37
|
"test": "vitest run",
|
|
34
|
-
"test:
|
|
38
|
+
"test:fast": "npm run test:unit",
|
|
39
|
+
"check:catalogue": "node scripts/check-functional-catalogue.mjs",
|
|
40
|
+
"check:scenarios": "node scripts/check-scenario-coverage.mjs",
|
|
41
|
+
"check:specs": "node scripts/check-specs.mjs",
|
|
42
|
+
"lint:architecture": "node scripts/check-module-manifests.mjs && node scripts/check-contract-vocabulary.mjs && depcruise --config dependency-cruiser.config.mjs src",
|
|
43
|
+
"build:docker": "tsc -p tsconfig.docker.json && node scripts/embed-version.mjs && npm run build:web",
|
|
44
|
+
"build:web": "npm --workspace @atolis-hq/wake-web run build",
|
|
45
|
+
"test:web": "npm --workspace @atolis-hq/wake-web run test",
|
|
46
|
+
"test:web:e2e": "npm --workspace @atolis-hq/wake-web run test:e2e",
|
|
47
|
+
"test:unit": "vitest run --config vitest.unit.config.ts",
|
|
48
|
+
"test:architecture": "vitest run --config vitest.architecture.config.ts",
|
|
49
|
+
"test:integration": "vitest run --config vitest.integration.config.ts",
|
|
50
|
+
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
51
|
+
"test:e2e:live": "vitest run --config vitest.live-e2e.config.ts",
|
|
52
|
+
"lint:contracts": "node scripts/check-contract-vocabulary.mjs",
|
|
53
|
+
"knip": "knip --config knip.json",
|
|
35
54
|
"lint": "eslint .",
|
|
36
55
|
"format": "prettier --write .",
|
|
37
56
|
"format:check": "prettier --check .",
|
|
@@ -43,7 +62,7 @@
|
|
|
43
62
|
"smoke:claude": "tsx src/main.ts smoke claude",
|
|
44
63
|
"smoke:codex": "tsx src/main.ts smoke codex",
|
|
45
64
|
"smoke:cursor": "tsx src/main.ts smoke cursor",
|
|
46
|
-
"verify": "npm run lint && npm run format:check && npm run build && npm test"
|
|
65
|
+
"verify": "npm run check:catalogue && npm run check:scenarios && npm run lint:architecture && npm run lint && npm run format:check && npm run build && npm test"
|
|
47
66
|
},
|
|
48
67
|
"dependencies": {
|
|
49
68
|
"@octokit/rest": "^22.0.0",
|
|
@@ -54,10 +73,16 @@
|
|
|
54
73
|
},
|
|
55
74
|
"devDependencies": {
|
|
56
75
|
"@eslint/js": "^10.0.1",
|
|
76
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
57
77
|
"@types/node": "^24.0.0",
|
|
78
|
+
"@vitest/eslint-plugin": "^1.6.24",
|
|
79
|
+
"dependency-cruiser": "^17.4.3",
|
|
58
80
|
"eslint": "^10.8.0",
|
|
81
|
+
"eslint-config-prettier": "^10.1.8",
|
|
59
82
|
"globals": "^17.7.0",
|
|
83
|
+
"knip": "^5.88.1",
|
|
60
84
|
"prettier": "^3.9.6",
|
|
85
|
+
"prettier-plugin-organize-imports": "^4.3.0",
|
|
61
86
|
"tsx": "^4.23.1",
|
|
62
87
|
"typescript": "^6.0.3",
|
|
63
88
|
"typescript-eslint": "^8.65.0",
|
package/prompts/implement.md
CHANGED
|
@@ -21,7 +21,7 @@ Completion requirements:
|
|
|
21
21
|
commit message.
|
|
22
22
|
- Push the branch with `git push -u origin {{branch}}`.
|
|
23
23
|
- Open a pull request against main with `gh pr create --base main --head
|
|
24
|
-
{{branch}} --title "<summary>" --body "
|
|
24
|
+
{{branch}} --title "<summary>" --body "Refs #{{issueNumber}}
|
|
25
25
|
|
|
26
26
|
<!-- wake:work-item {{workItemKey}} -->"`. Include the
|
|
27
27
|
|
|
@@ -47,7 +47,7 @@ New comments since your last turn (excludes Wake/bot comments):
|
|
|
47
47
|
Wake will provide them below in a delimited untrusted data block.
|
|
48
48
|
|
|
49
49
|
Reminder of the completion requirements: commit, push {{branch}}, open a PR
|
|
50
|
-
with `gh pr create`
|
|
50
|
+
with `gh pr create` referencing #{{issueNumber}}, and never merge it yourself. The
|
|
51
51
|
PR body must include the `<!-- wake:work-item {{workItemKey}} -->` marker
|
|
52
52
|
verbatim.
|
|
53
53
|
{{/if}}
|