cloving 1.2.0 → 1.4.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/README.md +700 -331
- package/dist/src/agent-harness-shell.d.ts +13 -0
- package/dist/src/agent-harness-shell.js +93 -0
- package/dist/src/agent-harness-versions.d.ts +8 -0
- package/dist/src/agent-harness-versions.js +49 -0
- package/dist/src/agent-harnesses.d.ts +4 -0
- package/dist/src/agent-harnesses.js +13 -0
- package/dist/src/authority/command-wait-checks.d.ts +8 -0
- package/dist/src/authority/command-wait-checks.js +88 -0
- package/dist/src/authority/command-wait-results.d.ts +15 -0
- package/dist/src/authority/command-wait-results.js +73 -0
- package/dist/src/authority/command-wait-view.d.ts +21 -0
- package/dist/src/authority/command-wait-view.js +34 -0
- package/dist/src/authority/command-waits.d.ts +39 -0
- package/dist/src/authority/command-waits.js +97 -0
- package/dist/src/authority/commands.d.ts +1 -0
- package/dist/src/authority/commands.js +46 -5
- package/dist/src/authority/dispatch-decision.d.ts +8 -0
- package/dist/src/authority/dispatch-decision.js +26 -1
- package/dist/src/authority/effect-requests.js +6 -3
- package/dist/src/authority/effect-results.js +4 -2
- package/dist/src/authority/gate-reduction.d.ts +1 -0
- package/dist/src/authority/gate-reduction.js +18 -3
- package/dist/src/authority/gates.d.ts +2 -1
- package/dist/src/authority/gates.js +5 -1
- package/dist/src/authority/history-state.d.ts +2 -0
- package/dist/src/authority/history-state.js +13 -1
- package/dist/src/authority/instants.d.ts +1 -0
- package/dist/src/authority/instants.js +21 -0
- package/dist/src/authority/operations.js +1 -1
- package/dist/src/authority/reduction-state.d.ts +2 -0
- package/dist/src/authority/reduction-state.js +5 -0
- package/dist/src/authority/reduction.d.ts +1 -1
- package/dist/src/authority/reduction.js +30 -1
- package/dist/src/authority/status-input.d.ts +3 -1
- package/dist/src/authority/status.d.ts +3 -0
- package/dist/src/authority/status.js +28 -3
- package/dist/src/authority/stop-sequence.d.ts +1 -0
- package/dist/src/authority/stop-sequence.js +2 -1
- package/dist/src/authority/transitions.d.ts +7 -5
- package/dist/src/authority/transitions.js +13 -0
- package/dist/src/broker/actor/authority-delivery.js +1 -0
- package/dist/src/broker/actor/authority-queries.d.ts +9 -2
- package/dist/src/broker/actor/authority-queries.js +29 -5
- package/dist/src/broker/actor/authority-receipts.js +11 -1
- package/dist/src/broker/actor/authority-session.js +2 -2
- package/dist/src/broker/actor/authority-settings.js +4 -0
- package/dist/src/broker/actor/authority-upgrades.d.ts +19 -2
- package/dist/src/broker/actor/authority-upgrades.js +7 -2
- package/dist/src/broker/actor/delivery-intents.d.ts +2 -1
- package/dist/src/broker/actor/delivery-intents.js +6 -4
- package/dist/src/broker/actor/effect-delivery.d.ts +1 -1
- package/dist/src/broker/actor/effect-delivery.js +18 -2
- package/dist/src/broker/actor/effect-plan.js +11 -2
- package/dist/src/broker/actor/effect-queries.d.ts +5 -0
- package/dist/src/broker/actor/effect-queries.js +16 -1
- package/dist/src/broker/actor/effect-turn.js +2 -0
- package/dist/src/broker/actor/pin-check.js +1 -1
- package/dist/src/broker/actor/stop-plan.js +10 -4
- package/dist/src/broker/actor/stop-turn.d.ts +2 -0
- package/dist/src/broker/actor/stop-turn.js +24 -11
- package/dist/src/broker/actor/turn-draft.d.ts +1 -0
- package/dist/src/broker/actor/turn-draft.js +4 -0
- package/dist/src/broker/actor/turn-state.js +6 -2
- package/dist/src/broker/authority-admission.js +80 -7
- package/dist/src/broker/authority-restore.d.ts +2 -0
- package/dist/src/broker/authority-restore.js +36 -1
- package/dist/src/broker/command-wait-restore.d.ts +31 -0
- package/dist/src/broker/command-wait-restore.js +86 -0
- package/dist/src/broker/decision-restore.d.ts +1 -1
- package/dist/src/broker/decision-restore.js +5 -4
- package/dist/src/broker/effect-upgrade.d.ts +2 -0
- package/dist/src/broker/effect-upgrade.js +8 -2
- package/dist/src/broker/socket-address.d.ts +3 -1
- package/dist/src/broker/socket-address.js +2 -2
- package/dist/src/cli/arguments.d.ts +22 -11
- package/dist/src/cli/arguments.js +73 -104
- package/dist/src/cli/chat-stores.d.ts +2 -0
- package/dist/src/cli/chat-stores.js +113 -0
- package/dist/src/cli/client.d.ts +4 -1
- package/dist/src/cli/client.js +9 -3
- package/dist/src/cli/command-effects.d.ts +7 -0
- package/dist/src/cli/command-effects.js +39 -0
- package/dist/src/cli/command-requests.d.ts +17 -0
- package/dist/src/cli/command-requests.js +43 -0
- package/dist/src/cli/command-waits.d.ts +9 -0
- package/dist/src/cli/command-waits.js +51 -0
- package/dist/src/cli/commands.js +21 -41
- package/dist/src/cli/config-arguments.d.ts +11 -0
- package/dist/src/cli/config-arguments.js +59 -0
- package/dist/src/cli/config-command.d.ts +2 -0
- package/dist/src/cli/config-command.js +105 -0
- package/dist/src/cli/config-file.d.ts +3 -0
- package/dist/src/cli/config-file.js +52 -0
- package/dist/src/cli/config-lock.d.ts +7 -0
- package/dist/src/cli/config-lock.js +61 -0
- package/dist/src/cli/config-notice.d.ts +5 -0
- package/dist/src/cli/config-notice.js +46 -0
- package/dist/src/cli/doctor-github.d.ts +9 -0
- package/dist/src/cli/doctor-github.js +138 -0
- package/dist/src/cli/doctor-harness.d.ts +13 -0
- package/dist/src/cli/doctor-harness.js +242 -0
- package/dist/src/cli/doctor-local.d.ts +18 -0
- package/dist/src/cli/doctor-local.js +77 -0
- package/dist/src/cli/doctor-runtime.d.ts +15 -0
- package/dist/src/cli/doctor-runtime.js +176 -0
- package/dist/src/cli/doctor-service.d.ts +1 -0
- package/dist/src/cli/doctor-service.js +11 -0
- package/dist/src/cli/doctor-workflows.d.ts +6 -0
- package/dist/src/cli/doctor-workflows.js +50 -0
- package/dist/src/cli/doctor.d.ts +15 -0
- package/dist/src/cli/doctor.js +187 -0
- package/dist/src/cli/github-ci-progress.d.ts +8 -0
- package/dist/src/cli/github-ci-progress.js +83 -0
- package/dist/src/cli/github-retry.d.ts +6 -0
- package/dist/src/cli/github-retry.js +47 -0
- package/dist/src/cli/harness-probes.d.ts +24 -0
- package/dist/src/cli/harness-probes.js +183 -0
- package/dist/src/cli/harness-processes.d.ts +6 -0
- package/dist/src/cli/harness-processes.js +36 -0
- package/dist/src/cli/init-command.d.ts +9 -0
- package/dist/src/cli/init-command.js +52 -0
- package/dist/src/cli/init-prompt-command.d.ts +10 -0
- package/dist/src/cli/init-prompt-command.js +145 -0
- package/dist/src/cli/init-prompt.d.ts +35 -0
- package/dist/src/cli/init-prompt.js +74 -0
- package/dist/src/cli/init-selection.d.ts +13 -0
- package/dist/src/cli/init-selection.js +75 -0
- package/dist/src/cli/main.d.ts +9 -1
- package/dist/src/cli/main.js +69 -61
- package/dist/src/cli/mcp-server.d.ts +1 -0
- package/dist/src/cli/mcp-server.js +156 -0
- package/dist/src/cli/mcp-tools.d.ts +15 -0
- package/dist/src/cli/mcp-tools.js +80 -0
- package/dist/src/cli/phone-arguments.d.ts +14 -0
- package/dist/src/cli/phone-arguments.js +37 -0
- package/dist/src/cli/phone-client.d.ts +2 -0
- package/dist/src/cli/phone-client.js +32 -0
- package/dist/src/cli/phone-command.d.ts +13 -0
- package/dist/src/cli/phone-command.js +101 -0
- package/dist/src/cli/probe-command.d.ts +36 -0
- package/dist/src/cli/probe-command.js +59 -0
- package/dist/src/cli/project-settings.d.ts +4 -0
- package/dist/src/cli/project-settings.js +33 -0
- package/dist/src/cli/render.d.ts +2 -1
- package/dist/src/cli/render.js +57 -54
- package/dist/src/cli/report-ci-jobs.d.ts +23 -0
- package/dist/src/cli/report-ci-jobs.js +103 -0
- package/dist/src/cli/report-ci-usage.d.ts +9 -0
- package/dist/src/cli/report-ci-usage.js +185 -0
- package/dist/src/cli/report-ci.d.ts +13 -0
- package/dist/src/cli/report-ci.js +74 -0
- package/dist/src/cli/report-closures.d.ts +6 -0
- package/dist/src/cli/report-closures.js +97 -0
- package/dist/src/cli/report-flow.d.ts +7 -0
- package/dist/src/cli/report-flow.js +122 -0
- package/dist/src/cli/report-github-reader.d.ts +29 -0
- package/dist/src/cli/report-github-reader.js +157 -0
- package/dist/src/cli/report-github.d.ts +25 -0
- package/dist/src/cli/report-github.js +181 -0
- package/dist/src/cli/report-operator.d.ts +3 -0
- package/dist/src/cli/report-operator.js +40 -0
- package/dist/src/cli/report-ready.d.ts +3 -0
- package/dist/src/cli/report-ready.js +96 -0
- package/dist/src/cli/report-text.d.ts +9 -0
- package/dist/src/cli/report-text.js +33 -0
- package/dist/src/cli/report.d.ts +18 -0
- package/dist/src/cli/report.js +269 -0
- package/dist/src/cli/repository-arguments.d.ts +5 -0
- package/dist/src/cli/repository-arguments.js +34 -0
- package/dist/src/cli/runtime-arguments.d.ts +6 -1
- package/dist/src/cli/runtime-arguments.js +22 -2
- package/dist/src/cli/runtime-directory.d.ts +6 -2
- package/dist/src/cli/runtime-directory.js +72 -14
- package/dist/src/cli/schedule-arguments.d.ts +14 -0
- package/dist/src/cli/schedule-arguments.js +26 -0
- package/dist/src/cli/schedule-render.d.ts +22 -0
- package/dist/src/cli/schedule-render.js +73 -0
- package/dist/src/cli/terminal-text.d.ts +3 -0
- package/dist/src/cli/terminal-text.js +28 -0
- package/dist/src/cli/toolchain.d.ts +2 -0
- package/dist/src/cli/toolchain.js +22 -2
- package/dist/src/cli/usage-render.d.ts +6 -0
- package/dist/src/cli/usage-render.js +67 -1
- package/dist/src/cli/usage.d.ts +3 -3
- package/dist/src/cli/usage.js +119 -50
- package/dist/src/cli/watch-actions.d.ts +2 -0
- package/dist/src/cli/watch-actions.js +6 -6
- package/dist/src/cli/watch-board-view.d.ts +1 -1
- package/dist/src/cli/watch-board-view.js +27 -4
- package/dist/src/cli/watch-board.d.ts +4 -2
- package/dist/src/cli/watch-board.js +58 -35
- package/dist/src/cli/watch-card-forms.d.ts +1 -1
- package/dist/src/cli/watch-card-forms.js +13 -12
- package/dist/src/cli/watch-client.d.ts +1 -1
- package/dist/src/cli/watch-client.js +7 -11
- package/dist/src/cli/watch-header-view.d.ts +22 -0
- package/dist/src/cli/watch-header-view.js +104 -0
- package/dist/src/cli/watch-model.d.ts +4 -1
- package/dist/src/cli/watch-model.js +34 -15
- package/dist/src/cli/watch-page.js +57 -23
- package/dist/src/cli/watch-phases.d.ts +12 -3
- package/dist/src/cli/watch-phases.js +68 -11
- package/dist/src/cli/watch-phone-client.d.ts +1 -0
- package/dist/src/cli/watch-phone-client.js +84 -0
- package/dist/src/cli/watch-phone-view.d.ts +56 -0
- package/dist/src/cli/watch-phone-view.js +113 -0
- package/dist/src/cli/watch-phone.d.ts +5 -0
- package/dist/src/cli/watch-phone.js +53 -0
- package/dist/src/cli/watch-pr-board.js +1 -1
- package/dist/src/cli/watch-pr-command.d.ts +1 -0
- package/dist/src/cli/watch-pull-request.d.ts +3 -1
- package/dist/src/cli/watch-pull-request.js +22 -8
- package/dist/src/cli/watch-reads.d.ts +2 -0
- package/dist/src/cli/watch-reads.js +17 -16
- package/dist/src/cli/watch-render.d.ts +23 -1
- package/dist/src/cli/watch-run-input.d.ts +0 -1
- package/dist/src/cli/watch-run-input.js +0 -13
- package/dist/src/cli/watch-server.js +29 -11
- package/dist/src/cli/watch-turn.d.ts +4 -1
- package/dist/src/cli/watch-turn.js +37 -1
- package/dist/src/cli/watch-usage.js +5 -1
- package/dist/src/cli/watch-view.d.ts +4 -21
- package/dist/src/cli/watch-view.js +26 -118
- package/dist/src/cli.js +165 -28
- package/dist/src/command-settings.d.ts +16 -0
- package/dist/src/command-settings.js +42 -0
- package/dist/src/command-wait.d.ts +4 -0
- package/dist/src/command-wait.js +45 -0
- package/dist/src/configuration-change.d.ts +18 -0
- package/dist/src/configuration-change.js +76 -0
- package/dist/src/configuration-display.d.ts +21 -0
- package/dist/src/configuration-display.js +69 -0
- package/dist/src/configuration-schema.d.ts +58 -0
- package/dist/src/configuration-schema.js +163 -0
- package/dist/src/daemon/attachment-file.d.ts +6 -0
- package/dist/src/daemon/attachment-file.js +86 -0
- package/dist/src/daemon/attachments.d.ts +14 -0
- package/dist/src/daemon/attachments.js +17 -0
- package/dist/src/daemon/claude-recovery.d.ts +50 -0
- package/dist/src/daemon/claude-recovery.js +204 -0
- package/dist/src/daemon/claude-stream.d.ts +27 -0
- package/dist/src/daemon/claude-stream.js +63 -0
- package/dist/src/daemon/claude-turn.d.ts +18 -18
- package/dist/src/daemon/claude-turn.js +151 -105
- package/dist/src/daemon/claude-worker.d.ts +5 -4
- package/dist/src/daemon/claude-worker.js +149 -158
- package/dist/src/daemon/command-journal.d.ts +5 -0
- package/dist/src/daemon/command-journal.js +50 -0
- package/dist/src/daemon/command-process.d.ts +28 -0
- package/dist/src/daemon/command-process.js +164 -0
- package/dist/src/daemon/command-worker.d.ts +19 -0
- package/dist/src/daemon/command-worker.js +182 -0
- package/dist/src/daemon/cursor-stream.d.ts +4 -0
- package/dist/src/daemon/cursor-stream.js +154 -0
- package/dist/src/daemon/daemon-adapters.d.ts +60 -0
- package/dist/src/daemon/daemon-adapters.js +126 -0
- package/dist/src/daemon/daemon-loops.d.ts +16 -0
- package/dist/src/daemon/daemon-loops.js +41 -0
- package/dist/src/daemon/daemon.d.ts +2 -33
- package/dist/src/daemon/daemon.js +133 -131
- package/dist/src/daemon/declared-input.d.ts +3 -0
- package/dist/src/daemon/declared-input.js +9 -0
- package/dist/src/daemon/delivery-router.js +1 -1
- package/dist/src/daemon/gemini-stream.d.ts +4 -0
- package/dist/src/daemon/gemini-stream.js +129 -0
- package/dist/src/daemon/github-attach.d.ts +2 -0
- package/dist/src/daemon/github-attach.js +149 -0
- package/dist/src/daemon/github-ci-filters.d.ts +6 -0
- package/dist/src/daemon/github-ci-filters.js +138 -0
- package/dist/src/daemon/github-ci-rerun.d.ts +26 -0
- package/dist/src/daemon/github-ci-rerun.js +92 -0
- package/dist/src/daemon/github-ci-workflows.d.ts +10 -0
- package/dist/src/daemon/github-ci-workflows.js +148 -0
- package/dist/src/daemon/github-ci.js +109 -10
- package/dist/src/daemon/github-issue-methods.d.ts +2 -0
- package/dist/src/daemon/github-issue-methods.js +37 -2
- package/dist/src/daemon/github-merge-call.d.ts +4 -1
- package/dist/src/daemon/github-merge-call.js +10 -3
- package/dist/src/daemon/github-merge.js +58 -26
- package/dist/src/daemon/github-methods.js +22 -2
- package/dist/src/daemon/github-operation.d.ts +5 -0
- package/dist/src/daemon/github-operation.js +6 -0
- package/dist/src/daemon/github-retry.js +8 -44
- package/dist/src/daemon/github-worker.d.ts +4 -0
- package/dist/src/daemon/github-worker.js +6 -0
- package/dist/src/daemon/issue-queue.d.ts +1 -0
- package/dist/src/daemon/issue-queue.js +16 -34
- package/dist/src/daemon/notify-events.d.ts +6 -0
- package/dist/src/daemon/notify-events.js +84 -0
- package/dist/src/daemon/notify-journal.js +1 -1
- package/dist/src/daemon/notify-message.d.ts +4 -1
- package/dist/src/daemon/notify-message.js +36 -0
- package/dist/src/daemon/notify.d.ts +1 -1
- package/dist/src/daemon/notify.js +7 -78
- package/dist/src/daemon/opencode-stream.d.ts +5 -0
- package/dist/src/daemon/opencode-stream.js +87 -0
- package/dist/src/daemon/operation-journal.d.ts +1 -0
- package/dist/src/daemon/queue-status.d.ts +10 -0
- package/dist/src/daemon/queue-status.js +51 -0
- package/dist/src/daemon/resume-index-lock.d.ts +13 -0
- package/dist/src/daemon/resume-index-lock.js +160 -0
- package/dist/src/daemon/resume-worktree.d.ts +7 -0
- package/dist/src/daemon/resume-worktree.js +29 -0
- package/dist/src/daemon/retry-worktree.d.ts +18 -0
- package/dist/src/daemon/retry-worktree.js +139 -0
- package/dist/src/daemon/retrying-turn.d.ts +2 -10
- package/dist/src/daemon/retrying-turn.js +145 -141
- package/dist/src/daemon/schedule-control.d.ts +26 -0
- package/dist/src/daemon/schedule-control.js +110 -0
- package/dist/src/daemon/schedule-journal.d.ts +6 -0
- package/dist/src/daemon/schedule-journal.js +120 -0
- package/dist/src/daemon/text-output.d.ts +18 -0
- package/dist/src/daemon/text-output.js +44 -0
- package/dist/src/daemon/ticket-registration.d.ts +7 -14
- package/dist/src/daemon/ticket-registration.js +93 -114
- package/dist/src/daemon/turn-attempt-journal.d.ts +38 -0
- package/dist/src/daemon/turn-attempt-journal.js +136 -0
- package/dist/src/daemon/turn-attempts.d.ts +47 -0
- package/dist/src/daemon/turn-attempts.js +166 -0
- package/dist/src/daemon/turn-command.d.ts +10 -0
- package/dist/src/daemon/turn-command.js +33 -0
- package/dist/src/daemon/turn-report.d.ts +25 -0
- package/dist/src/daemon/turn-report.js +118 -0
- package/dist/src/daemon/work-tree.d.ts +11 -1
- package/dist/src/daemon/work-tree.js +35 -12
- package/dist/src/daemon/worker-profile.d.ts +8 -0
- package/dist/src/daemon/worker-profile.js +40 -0
- package/dist/src/daemon/workflow-generations.d.ts +32 -0
- package/dist/src/daemon/workflow-generations.js +57 -0
- package/dist/src/daemon/workflow-replay.d.ts +16 -0
- package/dist/src/daemon/workflow-replay.js +58 -0
- package/dist/src/daemon/workflow-schedules.d.ts +30 -0
- package/dist/src/daemon/workflow-schedules.js +238 -0
- package/dist/src/daemon/worktree-processes.d.ts +9 -0
- package/dist/src/daemon/worktree-processes.js +151 -0
- package/dist/src/decision-wait.d.ts +1 -0
- package/dist/src/decision-wait.js +3 -0
- package/dist/src/delivery-backoff.d.ts +1 -0
- package/dist/src/delivery-backoff.js +3 -0
- package/dist/src/doctor-report.d.ts +22 -0
- package/dist/src/doctor-report.js +63 -0
- package/dist/src/execution-pin.d.ts +5 -0
- package/dist/src/execution-pin.js +67 -4
- package/dist/src/grok-result.d.ts +12 -0
- package/dist/src/grok-result.js +61 -0
- package/dist/src/harness-defaults.d.ts +35 -0
- package/dist/src/harness-defaults.js +121 -0
- package/dist/src/harness-start.d.ts +15 -0
- package/dist/src/harness-start.js +37 -0
- package/dist/src/host/command-wait.d.ts +38 -0
- package/dist/src/host/command-wait.js +115 -0
- package/dist/src/host/decision-resume.d.ts +35 -0
- package/dist/src/host/decision-resume.js +86 -0
- package/dist/src/host/gate-bridge.d.ts +48 -0
- package/dist/src/host/gate-bridge.js +124 -0
- package/dist/src/host/run-wait.d.ts +26 -0
- package/dist/src/host/run-wait.js +37 -0
- package/dist/src/host/start-delivery.d.ts +6 -8
- package/dist/src/host/start-delivery.js +13 -18
- package/dist/src/host/step-bridge-host.d.ts +8 -20
- package/dist/src/host/step-bridge-host.js +65 -58
- package/dist/src/merge-request.d.ts +19 -0
- package/dist/src/merge-request.js +32 -0
- package/dist/src/operation-identity.d.ts +1 -0
- package/dist/src/operation-identity.js +4 -0
- package/dist/src/phone/canonical-json.d.ts +1 -0
- package/dist/src/phone/canonical-json.js +16 -0
- package/dist/src/phone/phone-link.d.ts +7 -0
- package/dist/src/phone/phone-link.js +21 -0
- package/dist/src/phone/qr-data.d.ts +8 -0
- package/dist/src/phone/qr-data.js +133 -0
- package/dist/src/phone/qr-matrix.d.ts +6 -0
- package/dist/src/phone/qr-matrix.js +175 -0
- package/dist/src/phone/qr-penalty.d.ts +3 -0
- package/dist/src/phone/qr-penalty.js +67 -0
- package/dist/src/phone/qr-picture.d.ts +5 -0
- package/dist/src/phone/qr-picture.js +24 -0
- package/dist/src/private-config.schema.json +303 -0
- package/dist/src/project-config.schema.json +105 -0
- package/dist/src/project-settings.d.ts +19 -0
- package/dist/src/project-settings.js +133 -0
- package/dist/src/queue-spend.d.ts +4 -0
- package/dist/src/queue-spend.js +21 -0
- package/dist/src/relay/answer-check.d.ts +24 -0
- package/dist/src/relay/answer-check.js +145 -0
- package/dist/src/relay/answer-inbox.d.ts +15 -0
- package/dist/src/relay/answer-inbox.js +173 -0
- package/dist/src/relay/daemon-keys.d.ts +16 -0
- package/dist/src/relay/daemon-keys.js +75 -0
- package/dist/src/relay/decision-check.d.ts +3 -0
- package/dist/src/relay/decision-check.js +77 -0
- package/dist/src/relay/decision-close.d.ts +6 -0
- package/dist/src/relay/decision-close.js +72 -0
- package/dist/src/relay/decision-envelopes.d.ts +29 -0
- package/dist/src/relay/decision-envelopes.js +93 -0
- package/dist/src/relay/decision-watch.d.ts +14 -0
- package/dist/src/relay/decision-watch.js +68 -0
- package/dist/src/relay/envelope-post.d.ts +8 -0
- package/dist/src/relay/envelope-post.js +71 -0
- package/dist/src/relay/envelope.d.ts +28 -0
- package/dist/src/relay/envelope.js +53 -0
- package/dist/src/relay/hpke.d.ts +25 -0
- package/dist/src/relay/hpke.js +108 -0
- package/dist/src/relay/pairing-checks.d.ts +42 -0
- package/dist/src/relay/pairing-checks.js +172 -0
- package/dist/src/relay/pairing-follow.d.ts +8 -0
- package/dist/src/relay/pairing-follow.js +95 -0
- package/dist/src/relay/pairing-session.d.ts +29 -0
- package/dist/src/relay/pairing-session.js +87 -0
- package/dist/src/relay/phone-delivery.d.ts +51 -0
- package/dist/src/relay/phone-delivery.js +139 -0
- package/dist/src/relay/phone-devices.d.ts +36 -0
- package/dist/src/relay/phone-devices.js +46 -0
- package/dist/src/relay/phone-inbox.d.ts +18 -0
- package/dist/src/relay/phone-inbox.js +17 -0
- package/dist/src/relay/phone-operations.d.ts +18 -0
- package/dist/src/relay/phone-operations.js +121 -0
- package/dist/src/relay/phone-outbox.d.ts +21 -0
- package/dist/src/relay/phone-outbox.js +25 -0
- package/dist/src/relay/phone-socket.d.ts +6 -0
- package/dist/src/relay/phone-socket.js +63 -0
- package/dist/src/relay/relay-control.d.ts +7 -0
- package/dist/src/relay/relay-control.js +24 -0
- package/dist/src/relay/relay-files.d.ts +2 -0
- package/dist/src/relay/relay-files.js +23 -0
- package/dist/src/relay/relay-heartbeat.d.ts +17 -0
- package/dist/src/relay/relay-heartbeat.js +81 -0
- package/dist/src/relay/relay-http.d.ts +14 -0
- package/dist/src/relay/relay-http.js +63 -0
- package/dist/src/relay/relay-registration.d.ts +15 -0
- package/dist/src/relay/relay-registration.js +63 -0
- package/dist/src/relay/relay-service.d.ts +28 -0
- package/dist/src/relay/relay-service.js +218 -0
- package/dist/src/relay/relay-store.d.ts +48 -0
- package/dist/src/relay/relay-store.js +131 -0
- package/dist/src/relay/sealed-post.d.ts +25 -0
- package/dist/src/relay/sealed-post.js +52 -0
- package/dist/src/relay.d.ts +1 -0
- package/dist/src/relay.js +8 -0
- package/dist/src/report-ci.d.ts +164 -0
- package/dist/src/report-ci.js +32 -0
- package/dist/src/report-effects.d.ts +15 -0
- package/dist/src/report-effects.js +212 -0
- package/dist/src/report-flow-types.d.ts +38 -0
- package/dist/src/report-flow-types.js +7 -0
- package/dist/src/report-flow.d.ts +43 -0
- package/dist/src/report-flow.js +193 -0
- package/dist/src/report-operator.d.ts +67 -0
- package/dist/src/report-operator.js +25 -0
- package/dist/src/report-quality.d.ts +221 -0
- package/dist/src/report-quality.js +94 -0
- package/dist/src/report-ready.d.ts +23 -0
- package/dist/src/report-ready.js +117 -0
- package/dist/src/report-statistics.d.ts +51 -0
- package/dist/src/report-statistics.js +106 -0
- package/dist/src/report.d.ts +712 -0
- package/dist/src/report.js +234 -0
- package/dist/src/repository-identity.d.ts +4 -0
- package/dist/src/repository-identity.js +4 -0
- package/dist/src/review-subject.d.ts +41 -0
- package/dist/src/review-subject.js +91 -0
- package/dist/src/run-wait.d.ts +23 -0
- package/dist/src/run-wait.js +20 -0
- package/dist/src/schedule-progress.d.ts +33 -0
- package/dist/src/schedule-progress.js +45 -0
- package/dist/src/service/active-tickets.d.ts +4 -0
- package/dist/src/service/active-tickets.js +49 -0
- package/dist/src/service/command-effects.d.ts +4 -0
- package/dist/src/service/command-effects.js +16 -0
- package/dist/src/service/command-waits.d.ts +34 -0
- package/dist/src/service/command-waits.js +86 -0
- package/dist/src/service/decision-handler.d.ts +4 -0
- package/dist/src/service/decision-handler.js +39 -4
- package/dist/src/service/expiry.js +2 -0
- package/dist/src/service/gateway.js +21 -4
- package/dist/src/service/queue-spend.d.ts +6 -0
- package/dist/src/service/queue-spend.js +68 -0
- package/dist/src/service/registry.d.ts +16 -3
- package/dist/src/service/registry.js +34 -3
- package/dist/src/service/replies.d.ts +16 -1
- package/dist/src/service/replies.js +23 -0
- package/dist/src/service/run-handlers.js +35 -56
- package/dist/src/service/run-metadata.d.ts +22 -0
- package/dist/src/service/run-metadata.js +138 -0
- package/dist/src/service/run-waits.d.ts +3 -0
- package/dist/src/service/run-waits.js +41 -0
- package/dist/src/service/service.d.ts +22 -2
- package/dist/src/service/service.js +29 -13
- package/dist/src/service/submission-handler.d.ts +0 -1
- package/dist/src/service/submission-handler.js +22 -36
- package/dist/src/service/worker-port.d.ts +1 -0
- package/dist/src/service/worker-port.js +9 -1
- package/dist/src/service/worker-totals.d.ts +2 -0
- package/dist/src/service/worker-totals.js +9 -24
- package/dist/src/step-bridge.d.ts +43 -0
- package/dist/src/steps/command-wait.d.ts +12 -0
- package/dist/src/steps/command-wait.js +26 -0
- package/dist/src/steps/merge-by-person.d.ts +2 -0
- package/dist/src/steps/merge-by-person.js +18 -0
- package/dist/src/steps/merge-when-green.d.ts +2 -0
- package/dist/src/steps/merge-when-green.js +62 -0
- package/dist/src/steps/open-decision-wait.d.ts +2 -0
- package/dist/src/steps/open-decision-wait.js +8 -0
- package/dist/src/steps/review-by-agent.d.ts +5 -0
- package/dist/src/steps/review-by-agent.js +124 -0
- package/dist/src/steps/review-by-person.d.ts +4 -0
- package/dist/src/steps/review-by-person.js +19 -0
- package/dist/src/steps/review-subject.d.ts +2 -0
- package/dist/src/steps/review-subject.js +11 -0
- package/dist/src/steps/run-command.d.ts +2 -0
- package/dist/src/steps/run-command.js +15 -0
- package/dist/src/steps/sleep.d.ts +3 -0
- package/dist/src/steps/sleep.js +19 -0
- package/dist/src/steps/wait-for-command.d.ts +3 -0
- package/dist/src/steps/wait-for-command.js +17 -0
- package/dist/src/steps/wait-for-decision.d.ts +2 -0
- package/dist/src/steps/wait-for-decision.js +71 -0
- package/dist/src/steps/wait-for-run.d.ts +5 -0
- package/dist/src/steps/wait-for-run.js +9 -0
- package/dist/src/storage/command-wait-rows.d.ts +30 -0
- package/dist/src/storage/command-wait-rows.js +96 -0
- package/dist/src/storage/decision-snapshots.d.ts +9 -1
- package/dist/src/storage/decision-snapshots.js +22 -2
- package/dist/src/storage/domain-changes.d.ts +2 -0
- package/dist/src/storage/domain-changes.js +3 -0
- package/dist/src/storage/domain-schema.d.ts +13 -1
- package/dist/src/storage/domain-schema.js +31 -4
- package/dist/src/storage/effect-schema.d.ts +1 -0
- package/dist/src/storage/effect-schema.js +5 -0
- package/dist/src/submission.d.ts +4 -0
- package/dist/src/submission.js +6 -2
- package/dist/src/testing-requests.d.ts +15 -0
- package/dist/src/testing-requests.js +93 -0
- package/dist/src/testing.d.ts +23 -0
- package/dist/src/testing.js +211 -0
- package/dist/src/ticket-status-stream.d.ts +9 -0
- package/dist/src/ticket-status-stream.js +94 -0
- package/dist/src/token-prices.d.ts +12 -4
- package/dist/src/token-prices.js +15 -2
- package/dist/src/turn-profile.d.ts +1 -0
- package/dist/src/turn-profile.js +8 -1
- package/dist/src/worker-usage.d.ts +17 -0
- package/dist/src/worker-usage.js +60 -0
- package/dist/src/workflow-admission.d.ts +5 -0
- package/dist/src/workflow-candidate.d.ts +8 -2
- package/dist/src/workflow-candidate.js +59 -6
- package/dist/src/workflow-contracts.d.ts +1 -0
- package/dist/src/workflow-contracts.js +9 -2
- package/dist/src/workflow-declaration.d.ts +21 -3
- package/dist/src/workflow-declaration.js +77 -9
- package/dist/src/workflow-discovery.d.ts +3 -13
- package/dist/src/workflow-discovery.js +5 -14
- package/dist/src/workflow-refusals.js +3 -1
- package/dist/src/workflow-schedule.d.ts +22 -0
- package/dist/src/workflow-schedule.js +53 -0
- package/dist/src/workflows.d.ts +12 -2
- package/dist/src/workflows.js +9 -1
- package/dist/tools/admit-workflow.d.ts +1 -0
- package/dist/tools/admit-workflow.js +18 -5
- package/dist/tools/doctor-adoption.d.ts +1 -0
- package/dist/tools/doctor-adoption.js +11 -0
- package/dist/tools/project-configuration.d.ts +4 -0
- package/dist/tools/project-configuration.js +47 -0
- package/dist/tools/red-green-command.d.ts +1 -0
- package/dist/tools/red-green-command.js +174 -0
- package/dist/tools/red-green-process.d.ts +10 -0
- package/dist/tools/red-green-process.js +59 -0
- package/dist/tools/self-host-processes.d.ts +3 -0
- package/dist/tools/self-host-processes.js +63 -33
- package/dist/tools/self-host-project.d.ts +4 -0
- package/dist/tools/self-host-project.js +42 -60
- package/dist/tools/self-host-runtime.d.ts +16 -0
- package/dist/tools/self-host-runtime.js +60 -0
- package/dist/tools/self-host-workflows.d.ts +1 -0
- package/dist/tools/self-host-workflows.js +36 -1
- package/dist/tools/self-host.js +128 -71
- package/dist/tools/template-command.d.ts +1 -0
- package/dist/tools/template-command.js +160 -0
- package/dist/tools/template-copy.d.ts +11 -0
- package/dist/tools/template-copy.js +130 -0
- package/dist/tools/template-files.d.ts +17 -0
- package/dist/tools/template-files.js +74 -0
- package/dist/tools/workflow-bundles.js +1 -0
- package/dist/tools/workflow-candidate-counts.d.ts +6 -2
- package/dist/tools/workflow-candidate-counts.js +31 -16
- package/dist/tools/workflow-candidate-fields.d.ts +5 -0
- package/dist/tools/workflow-candidate-fields.js +24 -0
- package/dist/tools/workflow-candidate-helper-counts.d.ts +10 -0
- package/dist/tools/workflow-candidate-helper-counts.js +129 -0
- package/dist/tools/workflow-candidate-program.d.ts +2 -0
- package/dist/tools/workflow-candidate-program.js +36 -8
- package/dist/tools/workflow-candidate-shape.d.ts +3 -0
- package/dist/tools/workflow-candidate-shape.js +90 -0
- package/dist/tools/workflow-candidate-source.js +92 -16
- package/dist/tools/workflow-candidate-syntax.d.ts +9 -3
- package/dist/tools/workflow-candidate-syntax.js +83 -109
- package/dist/tools/workflow-command.d.ts +1 -0
- package/dist/tools/workflow-command.js +142 -0
- package/dist/tools/workflow-folder-capture.d.ts +1 -0
- package/dist/tools/workflow-folder-capture.js +47 -2
- package/dist/tools/workflow-folders.d.ts +18 -3
- package/dist/tools/workflow-folders.js +60 -7
- package/dist/tools/workflow-test-hook.d.ts +7 -0
- package/dist/tools/workflow-test-hook.js +16 -0
- package/dist/tools/workflow-test-loader.d.ts +1 -0
- package/dist/tools/workflow-test-loader.js +10 -0
- package/package.json +60 -10
- package/templates/develop/README.md +90 -0
- package/templates/develop/develop/accept.ts +11 -0
- package/templates/develop/develop/flow-tests.ts +394 -0
- package/templates/develop/develop/local.ts +40 -0
- package/templates/develop/develop/option-tests.ts +174 -0
- package/templates/develop/develop/partial-choice.ts +29 -0
- package/templates/develop/develop/partial.ts +28 -0
- package/templates/develop/develop/pull.ts +156 -0
- package/templates/develop/develop/queue-partial.ts +39 -0
- package/templates/develop/develop/refusal-tests.ts +251 -0
- package/templates/develop/develop/report.ts +156 -0
- package/templates/develop/develop/round.ts +40 -0
- package/templates/develop/develop/scenarios.ts +87 -0
- package/templates/develop/develop/turn.ts +68 -0
- package/templates/develop/develop.declaration.json +24 -0
- package/templates/develop/develop.test.ts +287 -0
- package/templates/develop/develop.ts +30 -0
- package/templates/develop/template.json +153 -0
- package/templates/idea-to-issue/README.md +27 -0
- package/templates/idea-to-issue/idea-to-issue/effects.ts +52 -0
- package/templates/idea-to-issue/idea-to-issue/leave.ts +10 -0
- package/templates/idea-to-issue/idea-to-issue/next.ts +29 -0
- package/templates/idea-to-issue/idea-to-issue/post-person.ts +18 -0
- package/templates/idea-to-issue/idea-to-issue/post.ts +50 -0
- package/templates/idea-to-issue/idea-to-issue/queue.ts +27 -0
- package/templates/idea-to-issue/idea-to-issue/review.ts +42 -0
- package/templates/idea-to-issue/idea-to-issue/scenarios.ts +50 -0
- package/templates/idea-to-issue/idea-to-issue/turn.ts +40 -0
- package/templates/idea-to-issue/idea-to-issue.declaration.json +16 -0
- package/templates/idea-to-issue/idea-to-issue.test.ts +79 -0
- package/templates/idea-to-issue/idea-to-issue.ts +49 -0
- package/templates/idea-to-issue/template.json +81 -0
- package/templates/review-day/README.md +97 -0
- package/templates/review-day/review-day/critique.ts +58 -0
- package/templates/review-day/review-day/decision.ts +29 -0
- package/templates/review-day/review-day/facts.ts +69 -0
- package/templates/review-day/review-day/label.ts +29 -0
- package/templates/review-day/review-day/next.ts +28 -0
- package/templates/review-day/review-day/post.ts +27 -0
- package/templates/review-day/review-day/report.ts +98 -0
- package/templates/review-day/review-day/rules.ts +12 -0
- package/templates/review-day/review-day/scenarios.ts +76 -0
- package/templates/review-day/review-day/turn.ts +73 -0
- package/templates/review-day/review-day.declaration.json +16 -0
- package/templates/review-day/review-day.test.ts +362 -0
- package/templates/review-day/review-day.ts +37 -0
- package/templates/review-day/template.json +56 -0
- package/dist/src/chats/analysis-batches.d.ts +0 -42
- package/dist/src/chats/analysis-batches.js +0 -97
- package/dist/src/chats/analysis-checkpoint.d.ts +0 -29
- package/dist/src/chats/analysis-checkpoint.js +0 -31
- package/dist/src/chats/analysis-contract.d.ts +0 -80
- package/dist/src/chats/analysis-contract.js +0 -16
- package/dist/src/chats/analysis-data.d.ts +0 -3
- package/dist/src/chats/analysis-data.js +0 -85
- package/dist/src/chats/analysis-input.d.ts +0 -18
- package/dist/src/chats/analysis-input.js +0 -97
- package/dist/src/chats/analysis-links.d.ts +0 -2
- package/dist/src/chats/analysis-links.js +0 -25
- package/dist/src/chats/analysis-merge.d.ts +0 -16
- package/dist/src/chats/analysis-merge.js +0 -134
- package/dist/src/chats/analysis-prompt.d.ts +0 -18
- package/dist/src/chats/analysis-prompt.js +0 -42
- package/dist/src/chats/analysis-proposal.d.ts +0 -4
- package/dist/src/chats/analysis-proposal.js +0 -41
- package/dist/src/chats/analysis-provenance.d.ts +0 -4
- package/dist/src/chats/analysis-provenance.js +0 -99
- package/dist/src/chats/analysis-shape.d.ts +0 -4
- package/dist/src/chats/analysis-shape.js +0 -235
- package/dist/src/chats/analysis.d.ts +0 -3
- package/dist/src/chats/analysis.js +0 -42
- package/dist/src/chats/corpus-input.d.ts +0 -5
- package/dist/src/chats/corpus-input.js +0 -288
- package/dist/src/chats/destination.d.ts +0 -4
- package/dist/src/chats/destination.js +0 -96
- package/dist/src/chats/import.d.ts +0 -15
- package/dist/src/chats/import.js +0 -243
- package/dist/src/chats/input-file.d.ts +0 -3
- package/dist/src/chats/input-file.js +0 -32
- package/dist/src/chats/normalize.d.ts +0 -29
- package/dist/src/chats/normalize.js +0 -155
- package/dist/src/chats/previous-import.d.ts +0 -5
- package/dist/src/chats/previous-import.js +0 -34
- package/dist/src/chats/reader.d.ts +0 -21
- package/dist/src/chats/reader.js +0 -118
- package/dist/src/chats/redact-import.d.ts +0 -14
- package/dist/src/chats/redact-import.js +0 -141
- package/dist/src/chats/redaction.d.ts +0 -41
- package/dist/src/chats/redaction.js +0 -161
- package/dist/src/chats/reference-mapping.d.ts +0 -16
- package/dist/src/chats/reference-mapping.js +0 -153
- package/dist/src/chats/revision-input.d.ts +0 -3
- package/dist/src/chats/revision-input.js +0 -180
- package/dist/src/chats/revision.d.ts +0 -48
- package/dist/src/chats/revision.js +0 -94
- package/dist/src/chats/selection.d.ts +0 -25
- package/dist/src/chats/selection.js +0 -109
- package/dist/src/chats/source.d.ts +0 -23
- package/dist/src/chats/source.js +0 -135
- package/dist/src/chats/structure.d.ts +0 -57
- package/dist/src/chats/structure.js +0 -216
- package/dist/src/chats/workflow-generation-projection.d.ts +0 -8
- package/dist/src/chats/workflow-generation-projection.js +0 -75
- package/dist/src/chats/workflow-generation-source.d.ts +0 -25
- package/dist/src/chats/workflow-generation-source.js +0 -124
- package/dist/src/chats/workflow-generation-text.d.ts +0 -23
- package/dist/src/chats/workflow-generation-text.js +0 -74
- package/dist/src/chats/workflow-generation.d.ts +0 -69
- package/dist/src/chats/workflow-generation.js +0 -142
- package/dist/src/cli/watch-start-view.d.ts +0 -18
- package/dist/src/cli/watch-start-view.js +0 -77
- package/dist/src/daemon/analysis-launch.d.ts +0 -5
- package/dist/src/daemon/analysis-launch.js +0 -81
- package/dist/src/daemon/analysis-token.d.ts +0 -6
- package/dist/src/daemon/analysis-token.js +0 -88
- package/dist/src/daemon/analysis-worker.d.ts +0 -20
- package/dist/src/daemon/analysis-worker.js +0 -271
- package/dist/src/daemon/chats-batch-binding.d.ts +0 -23
- package/dist/src/daemon/chats-batch-binding.js +0 -99
- package/dist/src/daemon/chats-capture.d.ts +0 -18
- package/dist/src/daemon/chats-capture.js +0 -194
- package/dist/src/daemon/chats-checkpoints.d.ts +0 -41
- package/dist/src/daemon/chats-checkpoints.js +0 -186
- package/dist/src/daemon/chats-files.d.ts +0 -42
- package/dist/src/daemon/chats-files.js +0 -252
- package/dist/src/daemon/chats-follow-up.d.ts +0 -38
- package/dist/src/daemon/chats-follow-up.js +0 -180
- package/dist/src/daemon/chats-question.d.ts +0 -15
- package/dist/src/daemon/chats-question.js +0 -93
- package/dist/src/daemon/chats-worker.d.ts +0 -13
- package/dist/src/daemon/chats-worker.js +0 -201
- package/dist/src/steps/decision-gate.d.ts +0 -2
- package/dist/src/steps/decision-gate.js +0 -8
- package/dist/workflows/analyze-chats.d.ts +0 -15
- package/dist/workflows/analyze-chats.declaration.json +0 -22
- package/dist/workflows/analyze-chats.js +0 -250
- package/dist/workflows/develop-prd.d.ts +0 -7
- package/dist/workflows/develop-prd.js +0 -165
- package/dist/workflows/develop-ticket.d.ts +0 -9
- package/dist/workflows/develop-ticket.js +0 -207
- package/dist/workflows/issue-labels.d.ts +0 -16
- package/dist/workflows/issue-labels.js +0 -70
- package/dist/workflows/ticket-prompts.d.ts +0 -35
- package/dist/workflows/ticket-prompts.js +0 -143
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { shownScheduled } from "./schedule-render.js";
|
|
2
|
+
import { shownCommandWaits } from "./command-waits.js";
|
|
1
3
|
import { operationalDecision } from "../decision-visibility.js";
|
|
2
4
|
import { workflowRefusals, } from "../workflow-refusals.js";
|
|
3
5
|
import { isTicketStatus } from "../ticket-status.js";
|
|
4
6
|
import { isPromotionId } from "../workflow-contracts.js";
|
|
5
7
|
import { priceFields, statusTurns } from "./watch-usage.js";
|
|
6
|
-
import { priceOf, usageOf } from "../worker-usage.js";
|
|
8
|
+
import { priceOf, usageOf, attemptFields } from "../worker-usage.js";
|
|
7
9
|
import { priceText } from "./usage-render.js";
|
|
8
10
|
import { boardsOf, currentStepOf, roundOf, stagesFor, startWorkflowOf, } from "./watch-board.js";
|
|
9
11
|
import { decisionOf, phasesOf } from "./watch-phases.js";
|
|
10
12
|
import { pullOf } from "./watch-pull-request.js";
|
|
11
13
|
import { establishedIssue } from "./watch-pr-identity.js";
|
|
12
14
|
import { displayRun } from "./watch-paths.js";
|
|
15
|
+
import { shownCommands } from "./command-effects.js";
|
|
13
16
|
const textLimit = 600;
|
|
14
17
|
const activityLimit = 400;
|
|
15
18
|
function record(value) {
|
|
@@ -88,6 +91,9 @@ export function activityOf(line) {
|
|
|
88
91
|
return parts(value).flatMap(failed);
|
|
89
92
|
return value["type"] === "result" ? ended(value) : [];
|
|
90
93
|
}
|
|
94
|
+
export function turnActivity(lines) {
|
|
95
|
+
return lines.flatMap(activityOf).slice(-activityLimit - 1);
|
|
96
|
+
}
|
|
91
97
|
function concise(items) {
|
|
92
98
|
return items.map((item, index) => {
|
|
93
99
|
const before = items[index - 1];
|
|
@@ -119,7 +125,10 @@ export function turnOf(records) {
|
|
|
119
125
|
const result = record(records.result);
|
|
120
126
|
const outcome = text(result["outcome"]);
|
|
121
127
|
const report = record(parsed(text(result["result"])));
|
|
128
|
+
const harness = text(started["harness"]) || text(report["harness"]);
|
|
122
129
|
return {
|
|
130
|
+
...attemptFields(report["attempts"]),
|
|
131
|
+
...(harness === "" ? {} : { harness }),
|
|
123
132
|
key: records.key,
|
|
124
133
|
operationId: text(started["operationId"]),
|
|
125
134
|
usage: usageOf(report["usage"]),
|
|
@@ -131,8 +140,7 @@ export function turnOf(records) {
|
|
|
131
140
|
outcome: records.result === null ? "in work" : outcome,
|
|
132
141
|
costUsd: priceOf(report["costUsd"]),
|
|
133
142
|
estimatedCostUsd: priceOf(report["estimatedCostUsd"]),
|
|
134
|
-
activity: records.
|
|
135
|
-
.flatMap(activityOf)
|
|
143
|
+
activity: records.activity
|
|
136
144
|
.map((item) => item.kind === "result"
|
|
137
145
|
? {
|
|
138
146
|
kind: item.kind,
|
|
@@ -186,21 +194,28 @@ function outcomeOf(value) {
|
|
|
186
194
|
...(issueUpdate === "failed" ? { issueUpdate } : {}),
|
|
187
195
|
};
|
|
188
196
|
}
|
|
197
|
+
function runLinksOf(status) {
|
|
198
|
+
return {
|
|
199
|
+
parentRunId: stamp(status["parentRunId"]),
|
|
200
|
+
chainId: stamp(status["chainId"]) ?? text(status["runId"]),
|
|
201
|
+
childRunIds: texts(status["childRunIds"]),
|
|
202
|
+
awaitedRunId: stamp(status["awaitedRunId"]),
|
|
203
|
+
};
|
|
204
|
+
}
|
|
189
205
|
function runOf(inputs, value) {
|
|
190
206
|
const status = record(record(value)["status"]);
|
|
191
207
|
const runId = text(status["runId"]);
|
|
192
208
|
const workflowId = text(status["workflowId"]);
|
|
193
209
|
const budget = record(status["budget"]);
|
|
210
|
+
const pull = pullOf({ records: inputs.githubRecords, repository: inputs.repository ?? null }, runId);
|
|
194
211
|
const ticketId = text(status["ticketId"]);
|
|
195
|
-
const issue =
|
|
196
|
-
? establishedIssue(inputs.repository ?? null, status["issueIdentity"])
|
|
197
|
-
: null;
|
|
212
|
+
const issue = establishedIssue(inputs.repository ?? null, status["issueIdentity"]);
|
|
198
213
|
return {
|
|
199
214
|
runId,
|
|
200
215
|
workflowId,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
216
|
+
...shownScheduled(status["scheduled"]),
|
|
217
|
+
...runLinksOf(status),
|
|
218
|
+
commandWaits: shownCommandWaits(status["commandWaits"]),
|
|
204
219
|
ticketId: ticketId === "" ? null : ticketId,
|
|
205
220
|
...(issue === null ? {} : { issueIdentity: issue }),
|
|
206
221
|
title: stamp(status["title"]),
|
|
@@ -210,7 +225,7 @@ function runOf(inputs, value) {
|
|
|
210
225
|
estimatedCostUsd: priceOf(status["estimatedCostUsd"]),
|
|
211
226
|
usage: usageOf(status["usage"]),
|
|
212
227
|
currentStep: currentStepOf(list(record(value)["events"]), {
|
|
213
|
-
|
|
228
|
+
pullRequest: pull.pullRequest,
|
|
214
229
|
stages: stagesFor(inputs.workflowStages, workflowId),
|
|
215
230
|
}),
|
|
216
231
|
round: roundOf(list(record(value)["events"])),
|
|
@@ -224,13 +239,16 @@ function runOf(inputs, value) {
|
|
|
224
239
|
.map((decision) => decisionCommands(operationalDecision(record(decision), workflowId), inputs.client)),
|
|
225
240
|
events: list(record(value)["events"]).map(eventOf),
|
|
226
241
|
turns: statusTurns(inputs.turns, status),
|
|
227
|
-
|
|
242
|
+
...(status["commandEffects"] === undefined
|
|
243
|
+
? {}
|
|
244
|
+
: { commandEffects: shownCommands(status["commandEffects"]) }),
|
|
245
|
+
phases: phasesOf(list(record(value)["events"]), {
|
|
246
|
+
pullRequest: pull.pullRequest,
|
|
247
|
+
stages: stagesFor(inputs.workflowStages, workflowId),
|
|
248
|
+
}),
|
|
228
249
|
decision: decisionOf(list(record(value)["events"])),
|
|
229
250
|
feedback: list(status["feedback"]).map(feedbackOf),
|
|
230
|
-
...
|
|
231
|
-
records: inputs.githubRecords,
|
|
232
|
-
repository: workflowId === "develop-issue" ? (inputs.repository ?? null) : null,
|
|
233
|
-
}, runId),
|
|
251
|
+
...pull,
|
|
234
252
|
};
|
|
235
253
|
}
|
|
236
254
|
function began(run) {
|
|
@@ -245,6 +263,7 @@ export function watchModel(inputs) {
|
|
|
245
263
|
const workflows = boardsOf({ ...inputs, completionCandidates: candidates }, runs);
|
|
246
264
|
return {
|
|
247
265
|
workflows,
|
|
266
|
+
...(inputs.schedules === undefined ? {} : { schedules: inputs.schedules }),
|
|
248
267
|
...(inputs.queue === undefined ? {} : { queue: inputs.queue }),
|
|
249
268
|
workflowRefusals: workflowRefusals(inputs.workflowRefusals),
|
|
250
269
|
startWorkflowId: startWorkflowOf(workflows),
|
|
@@ -1,19 +1,37 @@
|
|
|
1
|
+
import { scheduleStatusLine, scheduledText, shownScheduled, } from "./schedule-render.js";
|
|
2
|
+
import * as waitDisplay from "./command-waits.js";
|
|
1
3
|
import { cardReply } from "./watch-card-reply.js";
|
|
2
4
|
import { record } from "../protocol.js";
|
|
5
|
+
import { Commands, commandText } from "./command-effects.js";
|
|
3
6
|
import { watchCardClient } from "./watch-card-client.js";
|
|
4
7
|
import { AddCard, CardInput, cardKey, cardSubmitKey, } from "./watch-card-view.js";
|
|
5
8
|
import { watchClient } from "./watch-client.js";
|
|
9
|
+
import { watchPhoneClient } from "./watch-phone-client.js";
|
|
10
|
+
import { PhoneAsk, PhoneCode, PhoneList, PhonePanel, phoneButton, phoneNotices, refusalText, timeLeft, } from "./watch-phone-view.js";
|
|
6
11
|
import { priceOf, tokenCount, usageOf } from "../worker-usage.js";
|
|
7
|
-
import { priceText, usageText, totalsSuffix } from "./usage-render.js";
|
|
8
|
-
import { startPrompts, StartCard, StartRun } from "./watch-start-view.js";
|
|
12
|
+
import { priceText, queueSpendLines, usageText, attemptText, totalsSuffix, } from "./usage-render.js";
|
|
9
13
|
import { Board, boardSizing, Card, HandoffLinks, Column, columnCollapsed, CardReview, WorkflowList, cardReview, cardStep, completionMark, observationText, staleObservation, } from "./watch-board-view.js";
|
|
10
14
|
import { boardWorkflow, watchHash, watchLocation, watchTitle, } from "./watch-navigation.js";
|
|
11
15
|
import { clockTime, completedDetail, counted, elapsed, groupActivity, pageTitle, phaseTime, runName, runTone, selectedRun, toneOf, turnTime, waitingDetail, } from "./watch-render.js";
|
|
12
16
|
import { Command, Decision, Events, Group, Item, Turn, Work, } from "./watch-turn.js";
|
|
13
|
-
import {
|
|
17
|
+
import { Banner, BannerDetail, BoardPage, Page, Phases, PullRequest, Review, RefusedWorkflows, Run, } from "./watch-view.js";
|
|
18
|
+
import { Brand, clove, Header, HeaderActions, HeaderStatus, Queue, queueLanes, skippedText, } from "./watch-header-view.js";
|
|
14
19
|
const functions = [
|
|
20
|
+
scheduleStatusLine,
|
|
21
|
+
scheduledText,
|
|
22
|
+
shownScheduled,
|
|
15
23
|
record,
|
|
24
|
+
commandText,
|
|
25
|
+
Commands,
|
|
26
|
+
waitDisplay.CommandWaits,
|
|
27
|
+
waitDisplay.commandWaitText,
|
|
28
|
+
waitDisplay.effectBudgetText,
|
|
29
|
+
queueLanes,
|
|
30
|
+
skippedText,
|
|
16
31
|
Queue,
|
|
32
|
+
Brand,
|
|
33
|
+
HeaderStatus,
|
|
34
|
+
HeaderActions,
|
|
17
35
|
cardReply,
|
|
18
36
|
cardSubmitKey,
|
|
19
37
|
cardKey,
|
|
@@ -23,7 +41,9 @@ const functions = [
|
|
|
23
41
|
tokenCount,
|
|
24
42
|
usageOf,
|
|
25
43
|
priceText,
|
|
44
|
+
queueSpendLines,
|
|
26
45
|
usageText,
|
|
46
|
+
attemptText,
|
|
27
47
|
totalsSuffix,
|
|
28
48
|
watchHash,
|
|
29
49
|
watchLocation,
|
|
@@ -61,15 +81,20 @@ const functions = [
|
|
|
61
81
|
Command,
|
|
62
82
|
Decision,
|
|
63
83
|
Events,
|
|
64
|
-
startPrompts,
|
|
65
|
-
StartCard,
|
|
66
|
-
StartRun,
|
|
67
84
|
BannerDetail,
|
|
68
85
|
Banner,
|
|
69
86
|
Phases,
|
|
70
87
|
PullRequest,
|
|
71
88
|
Review,
|
|
72
89
|
Run,
|
|
90
|
+
timeLeft,
|
|
91
|
+
refusalText,
|
|
92
|
+
phoneButton,
|
|
93
|
+
phoneNotices,
|
|
94
|
+
PhoneCode,
|
|
95
|
+
PhoneAsk,
|
|
96
|
+
PhoneList,
|
|
97
|
+
PhonePanel,
|
|
73
98
|
Header,
|
|
74
99
|
RefusedWorkflows,
|
|
75
100
|
BoardPage,
|
|
@@ -126,64 +151,72 @@ body { margin: 0 auto; max-width: 1800px; padding: 0 20px 96px; }
|
|
|
126
151
|
body:has(.board-page) { padding-bottom: 0; overflow: hidden; }
|
|
127
152
|
.board-page { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
|
|
128
153
|
.board-page > header, .board-page > .down { flex-shrink: 0; }
|
|
129
|
-
.start-run { flex-shrink: 0; max-height: 45dvh; overflow-y: auto; }
|
|
130
154
|
.workflow-refusals { flex-shrink: 0; max-height: 25dvh; overflow-y: auto; overflow-wrap: anywhere; }
|
|
131
155
|
.workflow-refusals h2 { margin: 8px 0; }
|
|
132
156
|
a { color: var(--accent-strong); }
|
|
133
|
-
|
|
157
|
+
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
|
|
158
|
+
.header-status { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
|
|
159
|
+
.queue-lanes { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums; }
|
|
160
|
+
.header-actions { margin-left: auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
|
|
161
|
+
.queue-waiting { flex-shrink: 0; margin: 0 0 4px; color: var(--muted); font-size: 12px; }
|
|
162
|
+
.queue-waiting ul { margin: 6px 0 0; padding: 0 0 0 18px; columns: 220px; column-gap: 24px; max-height: 25dvh; overflow-y: auto; }
|
|
163
|
+
.phone { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0; }
|
|
164
|
+
.phone-pairing { flex-basis: 100%; }
|
|
165
|
+
.phone-pairing div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
|
|
166
|
+
.phone-qr { width: 196px; height: 196px; border-radius: 8px; }
|
|
167
|
+
.phone-ask { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
|
|
168
|
+
.phone-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
|
|
169
|
+
.phone-list li { display: flex; gap: 8px; align-items: center; color: var(--ink); }
|
|
170
|
+
header { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 18px 0 12px; color: var(--muted); font-size: 12px; }
|
|
134
171
|
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font: 800 26px/1.2 var(--heading-font); }
|
|
135
172
|
.brand svg { width: 30px; height: 30px; color: var(--accent); }
|
|
136
173
|
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 6px var(--code-bg); }
|
|
137
174
|
h2, h3 { font-family: var(--heading-font); font-weight: 700; }
|
|
138
|
-
.start-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-top: 12px; }
|
|
139
|
-
.start-card { min-width: 0; padding: 14px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
|
|
140
|
-
.start-card h3 { margin: 0; }
|
|
141
|
-
.start-card p { margin: 6px 0 12px; }
|
|
142
|
-
.start-card .command { grid-template-columns: minmax(0, 1fr); margin: 0; }
|
|
143
|
-
.start-card button { justify-self: end; }
|
|
144
175
|
.workspace { display: flex; width: 100%; margin-top: 12px; flex: 1; min-height: 0; }
|
|
145
176
|
.workflows { display: flex; flex-direction: row; flex-shrink: 0; gap: 8px; min-width: 0; margin-top: 12px; padding: 6px; overflow-x: auto; overflow-y: hidden; }
|
|
146
177
|
.workflows a { display: grid; flex-shrink: 0; white-space: nowrap; gap: 2px; border-bottom: 3px solid transparent; padding: 10px; color: inherit; text-decoration: none; }
|
|
147
178
|
.workflows a[aria-current="page"] { border-bottom-color: var(--accent); background: var(--surface); border-radius: 8px 8px 0 0; }
|
|
148
179
|
.workflows span, .card small { color: var(--muted); font-size: 12px; }
|
|
149
180
|
.board { width: 100%; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
|
|
150
|
-
.board h2 { margin: 0 0 8px; font-size: 24px; flex-shrink: 0; }
|
|
151
181
|
.columns { display: flex; align-items: flex-start; gap: ${String(boardSizing.gap)}px; flex: 1; min-height: 0; overflow-x: scroll; overflow-y: hidden; padding: 6px 6px 12px; scrollbar-color: var(--muted) var(--surface-2); }
|
|
152
182
|
@supports selector(::-webkit-scrollbar) { .columns { scrollbar-color: auto; } }
|
|
153
183
|
.columns::-webkit-scrollbar { height: 12px; }
|
|
154
184
|
.columns::-webkit-scrollbar-track { background: var(--surface-2); }
|
|
155
185
|
.columns::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 6px; }
|
|
156
186
|
.column { flex: 1 0 ${String(boardSizing.minimumColumnWidth)}px; min-width: ${String(boardSizing.minimumColumnWidth)}px; max-height: 100%; display: flex; flex-direction: column; overflow: hidden; padding: 10px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface-2); }
|
|
157
|
-
.column-name { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin: 0; padding: 4px 0 10px; color: var(--muted); font:
|
|
187
|
+
.column-name { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin: 0; padding: 4px 0 10px; color: var(--muted); font: 600 13px/1.5 var(--body-font); }
|
|
188
|
+
.column-count { font-variant-numeric: tabular-nums; }
|
|
158
189
|
.column-name > span:first-child { flex: 1; }
|
|
159
190
|
.column-cards { min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
|
|
160
191
|
.column.collapsed { flex: 0 0 ${String(boardSizing.collapsedColumnWidth)}px; min-width: ${String(boardSizing.collapsedColumnWidth)}px; padding: 6px; }
|
|
161
192
|
.collapsed .column-name { writing-mode: vertical-rl; padding: 0; }
|
|
162
|
-
.column-name button, .
|
|
163
|
-
.
|
|
193
|
+
header button, .phone button, .column-name button, .add-card, .add-card-form button { font: 500 13px/1.4 var(--body-font); color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin: 0; }
|
|
194
|
+
header button:hover, .phone button:hover, .column-name button:hover, .add-card:hover, .add-card-form button:hover { background: var(--surface-2); }
|
|
164
195
|
.add-card, .add-card-form button { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); margin: 4px 8px 4px 0; }
|
|
165
|
-
.add-card { width: 100%; text-align: left; }
|
|
196
|
+
.add-card { width: 100%; text-align: left; margin: 4px 0; }
|
|
166
197
|
.add-card-form { padding: 8px 0; overflow-wrap: anywhere; }
|
|
167
198
|
.add-card-form label { display: block; color: var(--ink); margin-bottom: 8px; }
|
|
168
199
|
.add-card-form input, .add-card-form textarea { display: block; width: 100%; min-width: 0; box-sizing: border-box; padding: 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; color: var(--ink); background: var(--surface); }
|
|
169
200
|
.add-card-form textarea { resize: vertical; }
|
|
170
201
|
.add-card-form button:disabled { opacity: 0.6; cursor: default; }
|
|
171
202
|
.add-card-form p { font-size: 12px; margin: 8px 0; }
|
|
172
|
-
.card { display: grid; gap: 6px; margin-bottom: 10px; padding: 12px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line)
|
|
203
|
+
.card { display: grid; gap: 6px; margin-bottom: 10px; padding: 12px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); overflow-wrap: anywhere; background: var(--surface); }
|
|
173
204
|
.card:hover { outline: 1px solid var(--accent-strong); }
|
|
174
205
|
.card-run { display: grid; gap: 4px; min-width: 0; color: inherit; text-decoration: none; }
|
|
175
206
|
.card-run strong { font-family: var(--heading-font); font-weight: 700; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
|
|
176
207
|
.completion-mark { font-size: 12px; }
|
|
177
|
-
.card-step, .card-review, .card-cost
|
|
208
|
+
.card-step, .card-review, .card-cost { font: 400 12px/1.6 var(--body-font); font-variant-numeric: tabular-nums; }
|
|
209
|
+
.card small { font: 400 11px/1.6 var(--code-font); }
|
|
178
210
|
.card-step, .card-review { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
179
211
|
.card-step { color: var(--muted); }
|
|
180
212
|
.card-step.active { color: var(--accent-strong); }
|
|
181
213
|
.card-review { color: var(--muted); }
|
|
182
214
|
.review-pill { display: inline-block; padding: 1px 5px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line); }
|
|
183
|
-
.decision-mark { width: fit-content; padding: 3px 7px; border-radius: 6px; background: linear-gradient(var(--warn-tint), var(--warn-tint)), var(--surface); color: var(--warn); font:
|
|
215
|
+
.decision-mark { width: fit-content; padding: 3px 7px; border-radius: 6px; background: linear-gradient(var(--warn-tint), var(--warn-tint)), var(--surface); color: var(--warn); font: 600 12px/1.6 var(--body-font); }
|
|
184
216
|
.column.stopped { background: var(--surface); box-shadow: inset 0 0 0 1px var(--bad), inset 0 0 0 100vmax var(--bad-tint); }
|
|
217
|
+
.column.stopped.collapsed { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
|
|
185
218
|
.stopped .column-name { color: var(--bad); background: var(--surface); border-radius: 6px; }
|
|
186
|
-
.stopped .card { background: linear-gradient(var(--bad-tint), var(--bad-tint)), var(--surface); box-shadow: inset 0 0 0 1px var(--bad)
|
|
219
|
+
.stopped .card { background: linear-gradient(var(--bad-tint), var(--bad-tint)), var(--surface); box-shadow: inset 0 0 0 1px var(--bad); }
|
|
187
220
|
.back { display: block; width: fit-content; margin: 16px 0; }
|
|
188
221
|
.icon { font-weight: 700; color: var(--muted); }
|
|
189
222
|
.good .icon, .phase.done .mark, p.good { color: var(--accent-strong); }
|
|
@@ -261,6 +294,7 @@ export function pageDocument(actionToken = null) {
|
|
|
261
294
|
`const actionToken = ${JSON.stringify(actionToken)};`,
|
|
262
295
|
...functions.map((item) => item.toString()),
|
|
263
296
|
watchCardClient,
|
|
297
|
+
watchPhoneClient,
|
|
264
298
|
watchClient,
|
|
265
299
|
].join("\n");
|
|
266
300
|
return [
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { WorkflowStage } from "../workflow-declaration.ts";
|
|
2
|
+
import type { WatchPhase, WatchPullRequest } from "./watch-render.ts";
|
|
3
|
+
export declare const pullRequestSteps: {
|
|
3
4
|
name: string;
|
|
4
5
|
operation: string;
|
|
5
6
|
}[];
|
|
6
7
|
export declare function decisionOf(events: readonly unknown[]): string;
|
|
7
|
-
export declare function
|
|
8
|
+
export declare function pullRequestStepOf(event: unknown): {
|
|
9
|
+
name: string;
|
|
10
|
+
operation: string;
|
|
11
|
+
} | undefined;
|
|
12
|
+
export declare function stageOf(event: unknown, stages: readonly WorkflowStage[]): WorkflowStage | undefined;
|
|
13
|
+
export declare function phasesOf(events: readonly unknown[], workflow?: {
|
|
14
|
+
readonly pullRequest?: WatchPullRequest | null;
|
|
15
|
+
readonly stages?: readonly WorkflowStage[] | undefined;
|
|
16
|
+
}): WatchPhase[];
|
|
@@ -5,8 +5,7 @@ const endings = [
|
|
|
5
5
|
];
|
|
6
6
|
const review = { open: "gate.opened", close: "gate.decided" };
|
|
7
7
|
const effect = { open: "effect.requested", close: "effect.reported" };
|
|
8
|
-
const
|
|
9
|
-
export const issueSteps = [
|
|
8
|
+
export const pullRequestSteps = [
|
|
10
9
|
{ name: "Work tree", operation: "github-prepare" },
|
|
11
10
|
{ name: "Agent turn", operation: "claude-turn" },
|
|
12
11
|
{ name: "Pull request", operation: "github-open-pr" },
|
|
@@ -79,24 +78,82 @@ function operationOf(event) {
|
|
|
79
78
|
return [];
|
|
80
79
|
}
|
|
81
80
|
}
|
|
81
|
+
export function pullRequestStepOf(event) {
|
|
82
|
+
const scope = operationOf(record(event));
|
|
83
|
+
return pullRequestSteps.find((step) => step.operation === scope[4] ||
|
|
84
|
+
(step.name === "Code review" && scope[3] === "review") ||
|
|
85
|
+
(step.name === "Merge" && scope[3] === "merge"));
|
|
86
|
+
}
|
|
87
|
+
function stepEffects(events, context) {
|
|
88
|
+
const { step, round } = context;
|
|
89
|
+
const repeated = roundOperations.includes(step.operation);
|
|
90
|
+
const currentTurn = events.findLastIndex((event) => event["type"] === effect.open && operationOf(event)[4] === "claude-turn");
|
|
91
|
+
const requested = new Set(events
|
|
92
|
+
.slice(currentTurn + 1)
|
|
93
|
+
.filter((event) => event["type"] === effect.open)
|
|
94
|
+
.map((event) => record(event["payload"])["operationId"]));
|
|
95
|
+
return events.filter((event) => {
|
|
96
|
+
if (pullRequestStepOf(event) !== step)
|
|
97
|
+
return false;
|
|
98
|
+
if (!repeated)
|
|
99
|
+
return true;
|
|
100
|
+
const scope = operationOf(event);
|
|
101
|
+
return roundOperations.includes(String(scope[4]))
|
|
102
|
+
? scope[1] === round
|
|
103
|
+
: requested.has(record(event["payload"])["operationId"]);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export function stageOf(event, stages) {
|
|
107
|
+
const fields = record(event);
|
|
108
|
+
if ([effect.open, effect.close].includes(String(fields["type"]))) {
|
|
109
|
+
const operation = operationOf(fields)[4];
|
|
110
|
+
return stages.find((stage) => stage.operations?.some((name) => name === operation));
|
|
111
|
+
}
|
|
112
|
+
const payload = record(fields["payload"]);
|
|
113
|
+
return (stages.find((stage) => stage.gateIds?.some((name) => name === payload["gateId"])) ??
|
|
114
|
+
stages.find((stage) => stage.gateKinds?.some((name) => name === payload["gateKind"])));
|
|
115
|
+
}
|
|
116
|
+
function declaredSpans(events, stages) {
|
|
117
|
+
return stages.map((stage) => {
|
|
118
|
+
const index = events.findLastIndex((event) => [effect.open, review.open].includes(String(event["type"])) &&
|
|
119
|
+
stageOf(event, stages) === stage);
|
|
120
|
+
const opening = events[index];
|
|
121
|
+
const pair = opening?.["type"] === review.open ? review : effect;
|
|
122
|
+
const identity = pair === review ? "gateId" : "operationId";
|
|
123
|
+
const key = record(opening?.["payload"])[identity];
|
|
124
|
+
const closing = events
|
|
125
|
+
.slice(index + 1)
|
|
126
|
+
.findLast((event) => event["type"] === pair.close &&
|
|
127
|
+
key !== undefined &&
|
|
128
|
+
record(event["payload"])[identity] === key);
|
|
129
|
+
const payload = record(closing?.["payload"]);
|
|
130
|
+
const failed = unfinished.includes(String(payload["outcome"])) ||
|
|
131
|
+
payload["decision"] === "denied";
|
|
132
|
+
return {
|
|
133
|
+
name: stage.label,
|
|
134
|
+
startedAt: timeOf(opening),
|
|
135
|
+
endedAt: timeOf(closing),
|
|
136
|
+
ending: failed ? "failed" : "done",
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
}
|
|
82
140
|
function currentRound(events) {
|
|
83
141
|
const requested = events.findLast((event) => event["type"] === effect.open && operationOf(event)[4] === "claude-turn");
|
|
84
142
|
const round = operationOf(requested)[1];
|
|
85
143
|
return typeof round === "number" ? round : 1;
|
|
86
144
|
}
|
|
87
|
-
function spans(events,
|
|
88
|
-
if (
|
|
145
|
+
function spans(events, workflow) {
|
|
146
|
+
if (workflow.stages !== undefined)
|
|
147
|
+
return [...admission(events), ...declaredSpans(events, workflow.stages)];
|
|
148
|
+
if (workflow.pullRequest == null)
|
|
89
149
|
return ticketSpans(events);
|
|
90
150
|
const effects = events.filter((event) => [effect.open, effect.close].includes(String(event["type"])));
|
|
91
151
|
const round = currentRound(effects);
|
|
92
152
|
return [
|
|
93
153
|
...admission(events),
|
|
94
|
-
...
|
|
154
|
+
...pullRequestSteps.map((step) => {
|
|
95
155
|
const repeated = roundOperations.includes(step.operation);
|
|
96
|
-
const own = effects
|
|
97
|
-
const scope = operationOf(event);
|
|
98
|
-
return scope[4] === step.operation && (!repeated || scope[1] === round);
|
|
99
|
-
});
|
|
156
|
+
const own = stepEffects(effects, { step, round });
|
|
100
157
|
const last = own.findLast((event) => event["type"] === effect.close);
|
|
101
158
|
const outcome = String(record(last?.["payload"])["outcome"]);
|
|
102
159
|
return {
|
|
@@ -132,9 +189,9 @@ function advanced(phases) {
|
|
|
132
189
|
? { ...item, state: "active" }
|
|
133
190
|
: item);
|
|
134
191
|
}
|
|
135
|
-
export function phasesOf(events,
|
|
192
|
+
export function phasesOf(events, workflow = {}) {
|
|
136
193
|
const known = events.map(record);
|
|
137
|
-
const steps = spans(known,
|
|
194
|
+
const steps = spans(known, workflow);
|
|
138
195
|
const [end] = ends(known);
|
|
139
196
|
if (end !== undefined)
|
|
140
197
|
return [...steps.map((span) => phase(span, "failed")), end];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const watchPhoneClient = "\nasync function phoneLoad() {\n const sent = Date.now();\n const sequence = ++state.phoneSequence;\n try {\n const reply = await fetch(\"phone.json\", { cache: \"no-store\" });\n const phone = reply.ok ? await reply.json() : null;\n if (phone !== null && sequence > state.phoneApplied) {\n state.phoneApplied = sequence;\n state.phone = phone;\n state.phoneLoadedAt = sent;\n }\n } catch {}\n draw();\n}\nasync function phonePost(action, body = {}) {\n state.phoneBusy = true;\n state.phoneMessage = \"\";\n draw();\n let reply;\n try {\n const response = await fetch(\"actions/phone/\" + action, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\", \"x-cloving-token\": actionToken },\n body: JSON.stringify(body),\n });\n reply = response.ok ? await response.json() : { error: { detail: \"The watch page refused the request. Refresh the page.\" } };\n } catch {\n reply = { error: { detail: \"The watch tool does not answer.\" } };\n }\n state.phoneBusy = false;\n state.phoneMessage = reply.error?.detail ?? reply.warning ?? \"\";\n return reply;\n}\nfunction phoneSession(now) {\n const pairing = state.phonePairing;\n const live = state.phone?.pairing ?? null;\n const ended = live === null && state.phoneLoadedAt > (pairing?.at ?? 0);\n if (pairing !== null && (ended || Date.parse(pairing.expiresAt) <= Date.parse(now))) state.phonePairing = null;\n const accepted = state.phoneAccepted;\n const device = (state.phone?.devices ?? []).find((item) => item.deviceId === accepted?.deviceId);\n const shown = device?.state === \"connected\" && device.removedAt === null;\n return { live, connected: shown ? device.name : null };\n}\nfunction phoneControls(now) {\n if (actionToken === null) return undefined;\n const { live, connected } = phoneSession(now);\n return {\n pairing: state.phonePairing,\n request: live?.request ?? null,\n stage: live?.stage ?? null,\n connected,\n refusal: state.phone?.refusal ?? null,\n reason: state.phone?.reason ?? null,\n devices: state.phone?.devices ?? [],\n busy: state.phoneBusy,\n message: state.phoneMessage,\n async onPair() {\n state.phoneAccepted = null;\n const reply = await phonePost(\"pair\");\n if (!reply.error) state.phonePairing = { ...reply, at: Date.now() };\n await phoneLoad();\n },\n async onCancel() {\n state.phonePairing = null;\n await phonePost(\"cancel\");\n await phoneLoad();\n },\n async onAccept() {\n state.phoneAccepted = live?.request ?? null;\n await phonePost(\"accept\", { pairingId: live?.pairingId });\n await phoneLoad();\n },\n async onDeny() {\n await phonePost(\"deny\", { pairingId: live?.pairingId });\n await phoneLoad();\n },\n async onRemove(deviceId) {\n await phonePost(\"remove\", { deviceId });\n await phoneLoad();\n },\n };\n}\n";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export const watchPhoneClient = `
|
|
2
|
+
async function phoneLoad() {
|
|
3
|
+
const sent = Date.now();
|
|
4
|
+
const sequence = ++state.phoneSequence;
|
|
5
|
+
try {
|
|
6
|
+
const reply = await fetch("phone.json", { cache: "no-store" });
|
|
7
|
+
const phone = reply.ok ? await reply.json() : null;
|
|
8
|
+
if (phone !== null && sequence > state.phoneApplied) {
|
|
9
|
+
state.phoneApplied = sequence;
|
|
10
|
+
state.phone = phone;
|
|
11
|
+
state.phoneLoadedAt = sent;
|
|
12
|
+
}
|
|
13
|
+
} catch {}
|
|
14
|
+
draw();
|
|
15
|
+
}
|
|
16
|
+
async function phonePost(action, body = {}) {
|
|
17
|
+
state.phoneBusy = true;
|
|
18
|
+
state.phoneMessage = "";
|
|
19
|
+
draw();
|
|
20
|
+
let reply;
|
|
21
|
+
try {
|
|
22
|
+
const response = await fetch("actions/phone/" + action, {
|
|
23
|
+
method: "POST",
|
|
24
|
+
headers: { "content-type": "application/json", "x-cloving-token": actionToken },
|
|
25
|
+
body: JSON.stringify(body),
|
|
26
|
+
});
|
|
27
|
+
reply = response.ok ? await response.json() : { error: { detail: "The watch page refused the request. Refresh the page." } };
|
|
28
|
+
} catch {
|
|
29
|
+
reply = { error: { detail: "The watch tool does not answer." } };
|
|
30
|
+
}
|
|
31
|
+
state.phoneBusy = false;
|
|
32
|
+
state.phoneMessage = reply.error?.detail ?? reply.warning ?? "";
|
|
33
|
+
return reply;
|
|
34
|
+
}
|
|
35
|
+
function phoneSession(now) {
|
|
36
|
+
const pairing = state.phonePairing;
|
|
37
|
+
const live = state.phone?.pairing ?? null;
|
|
38
|
+
const ended = live === null && state.phoneLoadedAt > (pairing?.at ?? 0);
|
|
39
|
+
if (pairing !== null && (ended || Date.parse(pairing.expiresAt) <= Date.parse(now))) state.phonePairing = null;
|
|
40
|
+
const accepted = state.phoneAccepted;
|
|
41
|
+
const device = (state.phone?.devices ?? []).find((item) => item.deviceId === accepted?.deviceId);
|
|
42
|
+
const shown = device?.state === "connected" && device.removedAt === null;
|
|
43
|
+
return { live, connected: shown ? device.name : null };
|
|
44
|
+
}
|
|
45
|
+
function phoneControls(now) {
|
|
46
|
+
if (actionToken === null) return undefined;
|
|
47
|
+
const { live, connected } = phoneSession(now);
|
|
48
|
+
return {
|
|
49
|
+
pairing: state.phonePairing,
|
|
50
|
+
request: live?.request ?? null,
|
|
51
|
+
stage: live?.stage ?? null,
|
|
52
|
+
connected,
|
|
53
|
+
refusal: state.phone?.refusal ?? null,
|
|
54
|
+
reason: state.phone?.reason ?? null,
|
|
55
|
+
devices: state.phone?.devices ?? [],
|
|
56
|
+
busy: state.phoneBusy,
|
|
57
|
+
message: state.phoneMessage,
|
|
58
|
+
async onPair() {
|
|
59
|
+
state.phoneAccepted = null;
|
|
60
|
+
const reply = await phonePost("pair");
|
|
61
|
+
if (!reply.error) state.phonePairing = { ...reply, at: Date.now() };
|
|
62
|
+
await phoneLoad();
|
|
63
|
+
},
|
|
64
|
+
async onCancel() {
|
|
65
|
+
state.phonePairing = null;
|
|
66
|
+
await phonePost("cancel");
|
|
67
|
+
await phoneLoad();
|
|
68
|
+
},
|
|
69
|
+
async onAccept() {
|
|
70
|
+
state.phoneAccepted = live?.request ?? null;
|
|
71
|
+
await phonePost("accept", { pairingId: live?.pairingId });
|
|
72
|
+
await phoneLoad();
|
|
73
|
+
},
|
|
74
|
+
async onDeny() {
|
|
75
|
+
await phonePost("deny", { pairingId: live?.pairingId });
|
|
76
|
+
await phoneLoad();
|
|
77
|
+
},
|
|
78
|
+
async onRemove(deviceId) {
|
|
79
|
+
await phonePost("remove", { deviceId });
|
|
80
|
+
await phoneLoad();
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
`;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type Shown } from "./watch-element.ts";
|
|
2
|
+
export interface PhonePicture {
|
|
3
|
+
readonly size: number;
|
|
4
|
+
readonly path: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PhonePairing {
|
|
7
|
+
readonly link: string;
|
|
8
|
+
readonly expiresAt: string;
|
|
9
|
+
readonly picture: PhonePicture;
|
|
10
|
+
}
|
|
11
|
+
export interface PhoneRequest {
|
|
12
|
+
readonly deviceId: string;
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly platform: string;
|
|
15
|
+
readonly code: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PhoneDevice {
|
|
18
|
+
readonly deviceId: string;
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly platform: string;
|
|
21
|
+
readonly state: string;
|
|
22
|
+
readonly removedAt: string | null;
|
|
23
|
+
}
|
|
24
|
+
export interface PhoneControls {
|
|
25
|
+
readonly pairing: PhonePairing | null;
|
|
26
|
+
readonly request: PhoneRequest | null;
|
|
27
|
+
readonly stage: string | null;
|
|
28
|
+
readonly connected: string | null;
|
|
29
|
+
readonly refusal: string | null;
|
|
30
|
+
readonly reason: string | null;
|
|
31
|
+
readonly devices: readonly PhoneDevice[];
|
|
32
|
+
readonly busy: boolean;
|
|
33
|
+
readonly message: string;
|
|
34
|
+
readonly onPair: () => void;
|
|
35
|
+
readonly onCancel: () => void;
|
|
36
|
+
readonly onAccept: () => void;
|
|
37
|
+
readonly onDeny: () => void;
|
|
38
|
+
readonly onRemove: (deviceId: string) => void;
|
|
39
|
+
}
|
|
40
|
+
export declare function timeLeft(expiresAt: string, now: string): string;
|
|
41
|
+
export declare function refusalText(code: string): string;
|
|
42
|
+
export declare function PhoneCode(props: {
|
|
43
|
+
readonly picture: PhonePicture;
|
|
44
|
+
}): Shown;
|
|
45
|
+
export declare function phoneButton(label: string, onClick: () => void): Shown;
|
|
46
|
+
export declare function PhoneAsk(props: {
|
|
47
|
+
readonly phone: PhoneControls;
|
|
48
|
+
}): Shown;
|
|
49
|
+
export declare function PhoneList(props: {
|
|
50
|
+
readonly phone: PhoneControls;
|
|
51
|
+
}): Shown;
|
|
52
|
+
export declare function phoneNotices(phone: PhoneControls): Shown;
|
|
53
|
+
export declare function PhonePanel(props: {
|
|
54
|
+
readonly phone: PhoneControls;
|
|
55
|
+
readonly now: string;
|
|
56
|
+
}): Shown;
|