tumwater 0.2.0 → 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/README.md +27 -13
- package/dist/build-info.json +2 -2
- package/dist/src/agent/agent-args.js +8 -9
- package/dist/src/agent/agent-backend.js +8 -6
- package/dist/src/agent/backend-traits.js +42 -25
- package/dist/src/agent/claude/claude-account.js +71 -204
- package/dist/src/agent/claude/claude-args.js +9 -6
- package/dist/src/agent/claude/claude-backend.js +10 -10
- package/dist/src/agent/claude/claude-env.js +1 -1
- package/dist/src/agent/claude/claude-stream.js +4 -3
- package/dist/src/agent/claude/claude-write-guard.js +49 -0
- package/dist/src/agent/claude/write-guard-hook.js +13 -0
- package/dist/src/agent/codex/codex-account.js +119 -0
- package/dist/src/agent/codex/codex-args.js +181 -0
- package/dist/src/agent/codex/codex-backend.js +279 -0
- package/dist/src/agent/codex/codex-catalog.js +97 -0
- package/dist/src/agent/codex/codex-env.js +18 -0
- package/dist/src/agent/codex/codex-hook-trust.js +246 -0
- package/dist/src/agent/codex/codex-patch-paths.js +36 -0
- package/dist/src/agent/codex/codex-rollout.js +179 -0
- package/dist/src/agent/codex/codex-stream.js +402 -0
- package/dist/src/agent/codex/codex-write-guard.js +86 -0
- package/dist/src/agent/codex/write-guard-hook.js +12 -0
- package/dist/src/agent/image-input.js +29 -24
- package/dist/src/agent/notes-shim.js +11 -12
- package/dist/src/agent/opencode/opencode-args.js +0 -1
- package/dist/src/agent/opencode/opencode-backend.js +12 -9
- package/dist/src/agent/opencode/opencode-catalog.js +55 -29
- package/dist/src/agent/opencode/opencode-config.js +19 -14
- package/dist/src/agent/opencode/opencode-env.js +0 -1
- package/dist/src/agent/opencode/opencode-session-id.js +1 -2
- package/dist/src/agent/opencode/opencode-stream.js +1 -1
- package/dist/src/agent/opencode/write-guard-plugin/index.js +48 -0
- package/dist/src/agent/role-notes-write.js +5 -6
- package/dist/src/agent/run-agent.js +465 -448
- package/dist/src/agent/run-settle.js +214 -0
- package/dist/src/agent/session-ledger.js +86 -16
- package/dist/src/agent/subscription-account.js +220 -0
- package/dist/src/agent/write-guard.js +148 -0
- package/dist/src/backlog/backlog-archive.js +246 -55
- package/dist/src/backlog/backlog-cli-view.js +280 -0
- package/dist/src/backlog/backlog-cli.js +85 -274
- package/dist/src/backlog/backlog-commit.js +4 -5
- package/dist/src/backlog/backlog-eligibility.js +175 -242
- package/dist/src/backlog/backlog-index.js +149 -0
- package/dist/src/backlog/backlog-md.js +54 -6
- package/dist/src/backlog/backlog-parts.js +254 -0
- package/dist/src/backlog/backlog-release.js +117 -0
- package/dist/src/backlog/backlog-render.js +27 -0
- package/dist/src/backlog/backlog-structure.js +99 -156
- package/dist/src/backlog/backlog-write.js +40 -127
- package/dist/src/backlog/backlog.js +21 -6
- package/dist/src/backlog/question-answer.js +21 -15
- package/dist/src/baseline/main-baseline.js +89 -20
- package/dist/src/baseline/main-culprit.js +94 -0
- package/dist/src/baseline/main-guardrails.js +209 -0
- package/dist/src/baseline/main-red.js +139 -32
- package/dist/src/baseline/main-revert.js +133 -0
- package/dist/src/baseline/main-watch.js +184 -0
- package/dist/src/brief/brief-edit.js +9 -11
- package/dist/src/brief/brief.js +31 -51
- package/dist/src/budget/budget.js +30 -20
- package/dist/src/budget/fallback-breaker.js +26 -27
- package/dist/src/build/build-check-detect.js +23 -15
- package/dist/src/build/build-check-events.js +25 -6
- package/dist/src/build/build-check-report.js +49 -9
- package/dist/src/build/build-check-scoped.js +18 -11
- package/dist/src/build/build-check.js +2 -1
- package/dist/src/build/build-info.js +2 -3
- package/dist/src/build/build-stage.js +9 -14
- package/dist/src/build/dep-install.js +1 -2
- package/dist/src/change/change-data.js +123 -31
- package/dist/src/change/change-render.js +46 -5
- package/dist/src/cli/brief-command.js +3 -4
- package/dist/src/cli/cli-args.js +118 -33
- package/dist/src/cli/cli-command-args.js +46 -18
- package/dist/src/cli/cli-editor.js +2 -1
- package/dist/src/cli/cli-flag-specs.js +150 -45
- package/dist/src/cli/cli-init.js +51 -0
- package/dist/src/cli/cli-marker-commands.js +4 -4
- package/dist/src/cli/cli-query-commands.js +308 -590
- package/dist/src/cli/cli-repo-gate.js +11 -1
- package/dist/src/cli/cli-role-command.js +420 -0
- package/dist/src/cli/cli-start-summary.js +160 -0
- package/dist/src/cli/{cli-run.js → cli-start.js} +165 -237
- package/dist/src/cli/completion.js +149 -22
- package/dist/src/cli/config-commands.js +41 -18
- package/dist/src/cli/follow-view.js +75 -0
- package/dist/src/cli/help.js +189 -73
- package/dist/src/cli/log-commands.js +148 -82
- package/dist/src/cli/question-commands.js +205 -10
- package/dist/src/cli.js +106 -43
- package/dist/src/collections.js +26 -10
- package/dist/src/concurrency/check-permit.js +20 -3
- package/dist/src/concurrency/lock.js +17 -13
- package/dist/src/concurrency/provider-lease.js +44 -8
- package/dist/src/concurrency/semaphore.js +102 -26
- package/dist/src/config/config-aliases.js +0 -1
- package/dist/src/config/config-editable-keys.js +13 -1
- package/dist/src/config/config-fallbacks.js +93 -56
- package/dist/src/config/config-field-checks.js +40 -10
- package/dist/src/config/config-keys.js +30 -8
- package/dist/src/config/config-live.js +63 -24
- package/dist/src/config/config-request.js +137 -0
- package/dist/src/config/config-schema.js +31 -24
- package/dist/src/config/config-selector-checks.js +123 -0
- package/dist/src/config/config-validation-agents.js +80 -0
- package/dist/src/config/config-validation-model.js +116 -0
- package/dist/src/config/config-validation.js +141 -199
- package/dist/src/config/config-views.js +127 -53
- package/dist/src/config/config-write-core.js +135 -0
- package/dist/src/config/config-write.js +131 -264
- package/dist/src/config/config.js +48 -38
- package/dist/src/config/model-selector.js +34 -34
- package/dist/src/doctor/doctor-backlog-bugs.js +287 -0
- package/dist/src/doctor/doctor-backlog-plans.js +263 -0
- package/dist/src/doctor/doctor-backlog.js +100 -496
- package/dist/src/doctor/doctor-check-names.js +81 -0
- package/dist/src/doctor/doctor-checks.js +52 -579
- package/dist/src/doctor/doctor-claude-checks.js +145 -0
- package/dist/src/doctor/doctor-codex-checks.js +279 -0
- package/dist/src/doctor/doctor-contention-checks.js +380 -0
- package/dist/src/doctor/doctor-holds.js +82 -66
- package/dist/src/doctor/doctor-install.js +2 -1
- package/dist/src/doctor/doctor-model-checks.js +236 -402
- package/dist/src/doctor/doctor-notify.js +3 -4
- package/dist/src/doctor/doctor-opencode-checks.js +162 -0
- package/dist/src/doctor/doctor-orphans.js +182 -63
- package/dist/src/doctor/doctor-project-checks.js +303 -0
- package/dist/src/doctor/doctor.js +121 -77
- package/dist/src/doctor/image-probe.js +21 -8
- package/dist/src/doctor/outcome.js +3 -2
- package/dist/src/doctor/probe.js +7 -11
- package/dist/src/events/event-format.js +181 -86
- package/dist/src/events/event-labels.js +12 -5
- package/dist/src/events/event-legacy.js +39 -15
- package/dist/src/events/event-read.js +39 -39
- package/dist/src/events/event-tally.js +16 -0
- package/dist/src/events/event-window.js +60 -24
- package/dist/src/events/events.js +30 -13
- package/dist/src/events/notify.js +7 -7
- package/dist/src/failure/failure-cluster.js +12 -12
- package/dist/src/failure/failure-data.js +56 -56
- package/dist/src/failure/failure-render.js +31 -23
- package/dist/src/failure/failure-state-change.js +17 -12
- package/dist/src/failure/time-spend.js +99 -35
- package/dist/src/files/files.js +111 -35
- package/dist/src/files/json-files.js +3 -3
- package/dist/src/files/json-object.js +28 -7
- package/dist/src/files/stat-cache.js +2 -2
- package/dist/src/files/tail.js +1 -1
- package/dist/src/gates/bootstrap-gates.js +4 -5
- package/dist/src/gates/budget-gates.js +177 -84
- package/dist/src/gates/disk-gate.js +1 -1
- package/dist/src/gates/gate-polls.js +108 -58
- package/dist/src/gates/maintenance-quota.js +10 -13
- package/dist/src/gates/pause-gates.js +28 -10
- package/dist/src/gates/readiness.js +7 -3
- package/dist/src/gates/role-cap-gates.js +8 -8
- package/dist/src/gates/startup-gate.js +94 -32
- package/dist/src/gates/streak-gate.js +54 -30
- package/dist/src/git/commit-message.js +77 -46
- package/dist/src/git/git-diff.js +16 -10
- package/dist/src/git/git-run.js +79 -38
- package/dist/src/git/git.js +36 -34
- package/dist/src/git/slot-salvage.js +253 -0
- package/dist/src/git/slots-state.js +6 -6
- package/dist/src/git/worktree-pool.js +132 -38
- package/dist/src/git/worktree-use.js +4 -11
- package/dist/src/git/worktree.js +94 -37
- package/dist/src/gui/gui-admin-endpoints.js +96 -0
- package/dist/src/gui/gui-args.js +79 -8
- package/dist/src/gui/gui-backlog-commands.js +42 -18
- package/dist/src/gui/gui-backlog-endpoints.js +155 -0
- package/dist/src/gui/gui-command.js +8 -13
- package/dist/src/gui/gui-config-commands.js +94 -72
- package/dist/src/gui/gui-endpoint-commands.js +4 -3
- package/dist/src/gui/gui-endpoint-common.js +4 -4
- package/dist/src/gui/gui-endpoints.js +11 -380
- package/dist/src/gui/gui-history-endpoints.js +301 -0
- package/dist/src/gui/gui-operator-commands.js +108 -13
- package/dist/src/gui/gui-prompt-commands.js +11 -14
- package/dist/src/gui/gui-report-endpoints.js +90 -0
- package/dist/src/gui/gui-server.js +11 -4
- package/dist/src/gui/gui-team-commands.js +7 -7
- package/dist/src/gui/http-body.js +1 -1
- package/dist/src/history/history-data.js +122 -234
- package/dist/src/history/history-queued.js +147 -0
- package/dist/src/history/history-render.js +42 -22
- package/dist/src/history/history.js +193 -49
- package/dist/src/inbox/inbox-attachments.js +29 -30
- package/dist/src/inbox/inbox-cancel.js +10 -11
- package/dist/src/inbox/inbox-edit.js +9 -9
- package/dist/src/inbox/inbox-submit.js +18 -18
- package/dist/src/inbox/inbox-top.js +25 -9
- package/dist/src/inbox/inbox.js +42 -43
- package/dist/src/inbox/pending-prompt.js +26 -26
- package/dist/src/inbox/prompt-commands.js +62 -49
- package/dist/src/inbox/prompt-not-before.js +2 -2
- package/dist/src/init/init-templates.js +1 -2
- package/dist/src/init/init.js +28 -23
- package/dist/src/merge/backlog-conflicts.js +215 -35
- package/dist/src/merge/merge-batch.js +14 -8
- package/dist/src/merge/merge-cancel.js +53 -0
- package/dist/src/merge/merge-check-failures.js +44 -22
- package/dist/src/merge/merge-core.js +81 -32
- package/dist/src/merge/merge-diff.js +5 -4
- package/dist/src/merge/merge-drain.js +150 -11
- package/dist/src/merge/merge-git.js +177 -38
- package/dist/src/merge/merge-pipeline.js +15 -3
- package/dist/src/merge/merge-post-review.js +90 -0
- package/dist/src/merge/merge-queue-render.js +49 -11
- package/dist/src/merge/merge-queue.js +31 -15
- package/dist/src/merge/merge-requeue.js +102 -0
- package/dist/src/merge/merge-slot.js +61 -16
- package/dist/src/merge/merge-stack.js +33 -11
- package/dist/src/merge/merge-to-main.js +86 -27
- package/dist/src/merge/merge-top.js +69 -0
- package/dist/src/merge/merge-verify.js +12 -10
- package/dist/src/notes-cli.js +30 -15
- package/dist/src/operator/operator-commands.js +192 -81
- package/dist/src/operator/operator-intent.js +69 -42
- package/dist/src/operator/operator-requests.js +35 -40
- package/dist/src/operator/retire.js +5 -6
- package/dist/src/operator/revert.js +142 -34
- package/dist/src/orchestrator/orchestrator-launch.js +60 -52
- package/dist/src/orchestrator/orchestrator-poll.js +320 -0
- package/dist/src/orchestrator/orchestrator-scheduling.js +68 -369
- package/dist/src/orchestrator/orchestrator.js +128 -369
- package/dist/src/orchestrator/retention.js +42 -8
- package/dist/src/orchestrator/scheduling-admit.js +116 -0
- package/dist/src/orchestrator/scheduling-scope.js +201 -0
- package/dist/src/orchestrator/scheduling-skip.js +185 -0
- package/dist/src/orchestrator/startup-migration-steps.js +8 -7
- package/dist/src/orchestrator/startup-migrations.js +11 -7
- package/dist/src/paths.js +116 -49
- package/dist/src/pi/command-shape.js +12 -1
- package/dist/src/pi/pi-args.js +6 -4
- package/dist/src/pi/pi-backend.js +6 -6
- package/dist/src/pi/pi-bin.js +54 -63
- package/dist/src/pi/pi-listed-models.js +53 -0
- package/dist/src/pi/pi-models.js +63 -30
- package/dist/src/pi/pi-run-result.js +1 -1
- package/dist/src/pi/pi-settings.js +1 -1
- package/dist/src/pi/pi-stream.js +6 -6
- package/dist/src/pi/pi-watchdogs.js +18 -19
- package/dist/src/pi-extension/bounded-output.js +5 -3
- package/dist/src/pi-extension/context-budget.js +2 -2
- package/dist/src/pi-extension/context-shake.js +1 -1
- package/dist/src/pi-extension/context-window.js +0 -1
- package/dist/src/pi-extension/full-output.js +3 -10
- package/dist/src/pi-extension/strip-thinking.js +0 -1
- package/dist/src/pi-extension/trim-system-prompt.js +3 -4
- package/dist/src/pi-extension/write-guard.js +37 -0
- package/dist/src/process/launch-services.js +1 -2
- package/dist/src/process/node-bin.js +16 -0
- package/dist/src/process/process-group.js +8 -18
- package/dist/src/process/process.js +41 -2
- package/dist/src/process/run-marker.js +18 -6
- package/dist/src/process/supervisor.js +22 -21
- package/dist/src/prompt/dialect.js +17 -2
- package/dist/src/prompt/gate-notes.js +203 -0
- package/dist/src/prompt/gate-prompts.js +121 -211
- package/dist/src/prompt/notes-backlog.js +181 -0
- package/dist/src/prompt/principles.js +1 -2
- package/dist/src/prompt/prompt-followup.js +19 -14
- package/dist/src/prompt/prompt.js +129 -204
- package/dist/src/redeploy/redeploy-policy.js +24 -19
- package/dist/src/redeploy/redeploy-probes.js +1 -1
- package/dist/src/redeploy/redeploy.js +2 -3
- package/dist/src/redeploy/redeployer.js +20 -20
- package/dist/src/redeploy/self-reload.js +2 -1
- package/dist/src/report/report-data.js +161 -77
- package/dist/src/report/report-fold.js +129 -52
- package/dist/src/report/report-main-red.js +55 -0
- package/dist/src/report/report-render.js +133 -64
- package/dist/src/report/report-types.js +1 -0
- package/dist/src/report/report.js +26 -9
- package/dist/src/request-timeouts.js +2 -2
- package/dist/src/review/known-flakes.js +100 -1
- package/dist/src/review/post-merge-review.js +106 -0
- package/dist/src/review/protected-edits.js +4 -5
- package/dist/src/review/review-followup.js +8 -8
- package/dist/src/review/review-precheck.js +66 -23
- package/dist/src/review/review-run.js +395 -0
- package/dist/src/review/review-verdict.js +2 -2
- package/dist/src/review/review.js +155 -360
- package/dist/src/review/secret-leaks.js +36 -16
- package/dist/src/review/suite-rerun.js +0 -1
- package/dist/src/roles/legacy-role-migration.js +80 -7
- package/dist/src/roles/role-catalog.js +69 -12
- package/dist/src/roles/role-guidance.js +55 -20
- package/dist/src/roles/role-labels.js +1 -2
- package/dist/src/roles/role-render.js +67 -50
- package/dist/src/roles/role-view.js +59 -47
- package/dist/src/roles/roles.js +31 -31
- package/dist/src/roles/runner-ids.js +97 -0
- package/dist/src/run/acceptance-greps.js +119 -0
- package/dist/src/run/feedback-filings.js +51 -0
- package/dist/src/{tick → run}/qa-coverage.js +9 -27
- package/dist/src/{tick/tick-apply.js → run/run-apply.js} +95 -94
- package/dist/src/run/run-detail-data.js +179 -0
- package/dist/src/run/run-detail-render.js +98 -0
- package/dist/src/run/run-detail.js +168 -0
- package/dist/src/{tick/tick-finalize.js → run/run-finalize.js} +72 -60
- package/dist/src/{tick/tick-outcome.js → run/run-outcome.js} +6 -7
- package/dist/src/{tick/tick-prompt.js → run/run-prompt.js} +108 -73
- package/dist/src/{tick/tick-resume.js → run/run-resume.js} +55 -26
- package/dist/src/{tick/tick-stage.js → run/run-stage.js} +108 -50
- package/dist/src/{tick/tick-timing.js → run/run-timing.js} +43 -41
- package/dist/src/{tick/tick-usage.js → run/run-usage.js} +45 -37
- package/dist/src/{tick/tick-verdict.js → run/run-verdict.js} +91 -56
- package/dist/src/run/selfcheck-digest.js +40 -0
- package/dist/src/run/stage-backlog-checks.js +249 -0
- package/dist/src/run/stage-check.js +172 -0
- package/dist/src/run/stage-path-checks.js +730 -0
- package/dist/src/{loop → runner}/leftover.js +80 -25
- package/dist/src/{loop → runner}/model-fallback.js +12 -12
- package/dist/src/runner/revision.js +202 -0
- package/dist/src/{loop/loop-fallback.js → runner/runner-fallback.js} +8 -8
- package/dist/src/runner/runner-outcome.js +107 -0
- package/dist/src/{loop/loop-pi.js → runner/runner-pi.js} +140 -131
- package/dist/src/{loop/loop-recovery.js → runner/runner-recovery.js} +21 -15
- package/dist/src/{loop/loop-tick.js → runner/runner-run.js} +218 -240
- package/dist/src/{loop/loop-state.js → runner/runner-state-load.js} +61 -114
- package/dist/src/runner/runner-state.js +102 -0
- package/dist/src/{loop/loop.js → runner/runner.js} +123 -120
- package/dist/src/scheduling/backoff.js +38 -38
- package/dist/src/scheduling/claims.js +35 -22
- package/dist/src/scheduling/once-round.js +22 -22
- package/dist/src/scheduling/quiet-hours.js +5 -6
- package/dist/src/scheduling/scheduling.js +74 -64
- package/dist/src/scheduling/work-merged-cache.js +2 -2
- package/dist/src/status/status-budget.js +55 -47
- package/dist/src/status/status-data.js +43 -16
- package/dist/src/status/status-inbox.js +2 -2
- package/dist/src/status/status-install.js +0 -1
- package/dist/src/status/status-polls.js +28 -28
- package/dist/src/status/status-roles.js +39 -13
- package/dist/src/team/error-storm.js +8 -8
- package/dist/src/team/failure-spread.js +2 -2
- package/dist/src/team/orchestrator-info.js +15 -9
- package/dist/src/team/reclaim.js +5 -6
- package/dist/src/team/team-hold.js +7 -7
- package/dist/src/team/team-polls.js +91 -50
- package/dist/src/team/team-state.js +8 -2
- package/dist/src/text/datetime.js +63 -17
- package/dist/src/text/format.js +48 -11
- package/dist/src/text/markdown.js +8 -5
- package/dist/src/text/phrases.js +57 -23
- package/dist/src/text/suggest.js +1 -1
- package/dist/src/text/text.js +67 -13
- package/dist/src/ui/badges.js +65 -37
- package/dist/src/ui/gui/gui-client-backlog.js +292 -0
- package/dist/src/ui/gui/gui-client-boot.js +32 -26
- package/dist/src/ui/gui/gui-client-composer.js +8 -9
- package/dist/src/ui/gui/gui-client-drawer-config.js +212 -0
- package/dist/src/ui/gui/gui-client-drawer.js +126 -285
- package/dist/src/ui/gui/gui-client-feed.js +271 -0
- package/dist/src/ui/gui/gui-client-history.js +434 -67
- package/dist/src/ui/gui/gui-client-labels.js +1 -2
- package/dist/src/ui/gui/gui-client-markdown.js +1 -2
- package/dist/src/ui/gui/gui-client-model.js +27 -36
- package/dist/src/ui/gui/gui-client-operator.js +55 -51
- package/dist/src/ui/gui/gui-client-pending.js +227 -23
- package/dist/src/ui/gui/gui-client-report-chart.js +464 -0
- package/dist/src/ui/gui/gui-client-report.js +87 -427
- package/dist/src/ui/gui/{gui-client-loops.js → gui-client-roles.js} +43 -44
- package/dist/src/ui/gui/gui-client-settings.js +56 -4
- package/dist/src/ui/gui/gui-client-team.js +25 -465
- package/dist/src/ui/gui/gui-client.js +27 -25
- package/dist/src/ui/gui/gui-icons.js +0 -2
- package/dist/src/ui/gui/gui-page.js +9 -7
- package/dist/src/ui/gui/gui-styles.js +34 -34
- package/dist/src/ui/progress-data.js +9 -11
- package/dist/src/ui/{tick-progress-model.js → run-progress-model.js} +31 -31
- package/dist/src/ui/status-model.js +133 -125
- package/dist/src/ui/status-payload.js +136 -49
- package/dist/src/ui/status-render.js +101 -82
- package/dist/src/ui/team-alerts.js +248 -57
- package/dist/src/ui/tone.js +5 -6
- package/dist/src/ui/transcript-run.js +58 -0
- package/dist/src/ui/transcript-tail.js +28 -20
- package/dist/src/ui/transcript.js +63 -23
- package/dist/src/ui/tui/tui-app.js +0 -1
- package/dist/src/ui/tui/tui-backlog.js +51 -14
- package/dist/src/ui/tui/tui-editor-answer.js +27 -31
- package/dist/src/ui/tui/tui-editor-attach.js +3 -5
- package/dist/src/ui/tui/tui-editor-backends.js +132 -0
- package/dist/src/ui/tui/tui-editor-brief.js +10 -12
- package/dist/src/ui/tui/tui-editor-budget.js +35 -31
- package/dist/src/ui/tui/tui-editor-claude-reserve.js +24 -0
- package/dist/src/ui/tui/tui-editor-concurrency.js +24 -0
- package/dist/src/ui/tui/tui-editor-config.js +86 -0
- package/dist/src/ui/tui/tui-editor-entry.js +36 -47
- package/dist/src/ui/tui/tui-editor-fallback.js +31 -0
- package/dist/src/ui/tui/tui-editor-instances.js +37 -0
- package/dist/src/ui/tui/tui-editor-instructions.js +136 -0
- package/dist/src/ui/tui/tui-editor-interval.js +11 -9
- package/dist/src/ui/tui/tui-editor-model.js +29 -0
- package/dist/src/ui/tui/tui-editor-notes.js +3 -5
- package/dist/src/ui/tui/tui-editor-notify.js +25 -0
- package/dist/src/ui/tui/tui-editor-pause.js +48 -59
- package/dist/src/ui/tui/tui-editor-prompt.js +11 -16
- package/dist/src/ui/tui/tui-editor-provider-caps.js +27 -0
- package/dist/src/ui/tui/tui-editor-queued.js +5 -9
- package/dist/src/ui/tui/tui-editor-quiet.js +99 -35
- package/dist/src/ui/tui/tui-editor-retire.js +4 -6
- package/dist/src/ui/tui/tui-editor-role-key.js +76 -0
- package/dist/src/ui/tui/tui-editor-role-model.js +28 -0
- package/dist/src/ui/tui/tui-editor-search.js +45 -33
- package/dist/src/ui/tui/tui-editor-session.js +60 -34
- package/dist/src/ui/tui/tui-editor-slots.js +23 -0
- package/dist/src/ui/tui/tui-editors.js +35 -2
- package/dist/src/ui/tui/tui-frame.js +56 -11
- package/dist/src/ui/tui/tui-history.js +8 -9
- package/dist/src/ui/tui/tui-input.js +13 -11
- package/dist/src/ui/tui/tui-keymap.js +0 -1
- package/dist/src/ui/tui/tui-keys.js +24 -9
- package/dist/src/ui/tui/tui-pane-activity.js +14 -11
- package/dist/src/ui/tui/tui-pane-backlog.js +171 -126
- package/dist/src/ui/tui/tui-pane-brief.js +0 -1
- package/dist/src/ui/tui/tui-pane-ctx.js +2 -2
- package/dist/src/ui/tui/tui-pane-health.js +58 -8
- package/dist/src/ui/tui/tui-pane-history.js +402 -82
- package/dist/src/ui/tui/tui-pane-pending.js +308 -13
- package/dist/src/ui/tui/tui-pane-queued.js +71 -55
- package/dist/src/ui/tui/tui-pane-report.js +46 -14
- package/dist/src/ui/tui/tui-pane-session.js +25 -6
- package/dist/src/ui/tui/tui-pane-transcript.js +111 -37
- package/dist/src/ui/tui/tui-pane.js +80 -23
- package/dist/src/ui/tui/tui-panes.js +100 -30
- package/dist/src/ui/tui/tui.js +14 -14
- package/dist/src/verdict/fix-claim.js +82 -32
- package/dist/src/verdict/no-change.js +4 -4
- package/dist/src/verdict/refusal.js +40 -16
- package/dist/src/verdict/reply-contract.js +42 -31
- package/dist/src/version.js +0 -1
- package/package.json +2 -1
- package/dist/src/loop/revision.js +0 -70
- package/dist/src/roles/loop-ids.js +0 -77
- package/dist/src/tick/stage-check.js +0 -419
- package/dist/src/tick/telemetry-digest.js +0 -25
- package/dist/src/tick/tick-detail-data.js +0 -108
- package/dist/src/tick/tick-detail.js +0 -163
- package/dist/src/ui/gui/gui-client-sound.js +0 -53
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/** The read-only CLI shells of `tumwater bug` and `tumwater plan` — `--list` (active and
|
|
2
|
+
* `--done`, with `--grep`) and `--show` — split from backlog-cli.ts, which keeps the writing
|
|
3
|
+
* shells (file, cancel, release, top, edit). Neither shell gates on a ready repo, commits, or
|
|
4
|
+
* wakes a role. cli.ts reaches them through listAndAnnounce and showAndAnnounce. */
|
|
5
|
+
import { fail, say, sayJson } from "../cli/cli-output.js";
|
|
6
|
+
import { parseCountFlag, parsePositionFlag, rejectRepeatFlag } from "../cli/cli-args.js";
|
|
7
|
+
import { DONE_DATE_RE, FIXED_DATE_RE, completionDate, donePlanEntries, fixedBugEntries, openBugEntries, plannedPlanEntries, ageInDays, entryAgeSuffix, entryMatches, filingDate, } from "./backlog.js";
|
|
8
|
+
import { backlogHolds, backlogInProgress, holdMark, inProgressMark } from "./backlog-eligibility.js";
|
|
9
|
+
import { groupBlockedSeries, partsLabel } from "./backlog-structure.js";
|
|
10
|
+
import { rejectUnknownArgs } from "../cli/cli-flag-specs.js";
|
|
11
|
+
import { refuseTeamWorkspace } from "../cli/cli-repo-gate.js";
|
|
12
|
+
import { sectionNoun, showEntry } from "./backlog-write.js";
|
|
13
|
+
/** Ascending positions as runs: consecutive ones join with an en dash (`13–17`), runs separate
|
|
14
|
+
* with commas (`13–15, 18`). */
|
|
15
|
+
function positionRuns(positions) {
|
|
16
|
+
const runs = [];
|
|
17
|
+
for (let i = 0; i < positions.length;) {
|
|
18
|
+
let j = i;
|
|
19
|
+
while (j + 1 < positions.length && positions[j + 1] === positions[j] + 1)
|
|
20
|
+
j++;
|
|
21
|
+
runs.push(j > i ? `${positions[i]}–${positions[j]}` : `${positions[i]}`);
|
|
22
|
+
i = j + 1;
|
|
23
|
+
}
|
|
24
|
+
return runs.join(", ");
|
|
25
|
+
}
|
|
26
|
+
/** The shared shell of the `bug --list` and `plan --list` CLI cases — the read half of the
|
|
27
|
+
* operator queue whose `--edit`/`--cancel` flags address entries by position. Reads the same
|
|
28
|
+
* entries, in the same file order, that locateEntry numbers for `--edit`/`--cancel`, pairs
|
|
29
|
+
* each with its eligibility hold (backlogHolds), and prints them numbered from 1, or the
|
|
30
|
+
* command's `no …` line on an empty or missing file. Like `tumwater backlog` and `tumwater
|
|
31
|
+
* questions` it is read-only: no requireReadyRepo gate and no wake. `--list` and `--json` are
|
|
32
|
+
* the two booleans this shell consumes (repeats refused), `--help`/`-h` is tolerated, and any
|
|
33
|
+
* positional or other flag is refused through rejectUnknownArgs.
|
|
34
|
+
*
|
|
35
|
+
* `--grep <text>` searches the active entries too: it keeps the entries whose heading or
|
|
36
|
+
* body contains the text (case-insensitive), each under its unfiltered number so a printed
|
|
37
|
+
* position still reaches `--show`/`--edit`/`--cancel` — the active twin of the finished
|
|
38
|
+
* entries' `--done --grep`.
|
|
39
|
+
*
|
|
40
|
+
* `--ready` keeps the entries with no hold under their unfiltered numbers (composes with
|
|
41
|
+
* `--grep` and `--json`; refused with `--done`, whose entries carry no holds).
|
|
42
|
+
*
|
|
43
|
+
* `--done [-n <count>] [--grep <text>]` (each once; `-n` and `--grep` need `--done`) lists the
|
|
44
|
+
* newest finished entries instead (BUGS.md ## Fixed or PLANS.md ## Done, numbered, default 10)
|
|
45
|
+
* with `older` counting those left out; --json carries each entry's `position` and
|
|
46
|
+
* `completedOn` heading date. `--grep` keeps the entries whose heading or body contains the
|
|
47
|
+
* text (case-insensitive); each keeps its unfiltered number, so it is the `--show <n> --done`
|
|
48
|
+
* number, and `older` counts matches left out. `plan --list` prose
|
|
49
|
+
* groups a series' blocked parts into one line (groupBlockedSeries). */
|
|
50
|
+
export function listAndAnnounce(root, args, command, fileName, sectionTitle) {
|
|
51
|
+
let json = false;
|
|
52
|
+
let list = false;
|
|
53
|
+
let done = false;
|
|
54
|
+
let ready = false;
|
|
55
|
+
let count = null;
|
|
56
|
+
let grep = null;
|
|
57
|
+
const rest = [];
|
|
58
|
+
for (let i = 0; i < args.length; i++) {
|
|
59
|
+
const arg = args[i];
|
|
60
|
+
if (arg === "--grep") {
|
|
61
|
+
rejectRepeatFlag(grep !== null, "--grep");
|
|
62
|
+
const text = args[++i];
|
|
63
|
+
if (text === undefined || text === "") {
|
|
64
|
+
fail(`--grep needs text (usage: tumwater ${command} --list --grep <text>)`);
|
|
65
|
+
}
|
|
66
|
+
grep = text;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (arg === "--done") {
|
|
70
|
+
rejectRepeatFlag(done, "--done");
|
|
71
|
+
done = true;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (arg === "--ready") {
|
|
75
|
+
rejectRepeatFlag(ready, "--ready");
|
|
76
|
+
ready = true;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (arg === "-n") {
|
|
80
|
+
rejectRepeatFlag(count !== null, "-n");
|
|
81
|
+
count = parseCountFlag("-n", args[++i]);
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (arg === "--list") {
|
|
85
|
+
rejectRepeatFlag(list, "--list");
|
|
86
|
+
list = true;
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (arg === "--json") {
|
|
90
|
+
rejectRepeatFlag(json, "--json");
|
|
91
|
+
json = true;
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (arg === "--help" || arg === "-h")
|
|
95
|
+
continue;
|
|
96
|
+
rest.push(arg);
|
|
97
|
+
}
|
|
98
|
+
// rejectUnknownArgs names a stray positional and an unknown flag with this command's (empty)
|
|
99
|
+
// valid-flag list: the vocabulary a list invocation accepts is exactly --list and --json,
|
|
100
|
+
// both consumed above.
|
|
101
|
+
rejectUnknownArgs(command, rest, []);
|
|
102
|
+
refuseTeamWorkspace(root);
|
|
103
|
+
if (count !== null && !done)
|
|
104
|
+
fail("-n needs --done (it limits the finished entries listed)");
|
|
105
|
+
// BUGS.md's `## Open` is the one section whose noun is "bug"; every other caller is a plan.
|
|
106
|
+
if (ready && done)
|
|
107
|
+
fail("--ready needs the active list (finished entries carry no holds)");
|
|
108
|
+
const bugSection = sectionTitle === "Open";
|
|
109
|
+
if (done) {
|
|
110
|
+
const numbered = (bugSection ? fixedBugEntries(root) : donePlanEntries(root)).map((entry, i) => ({
|
|
111
|
+
entry,
|
|
112
|
+
position: i + 1,
|
|
113
|
+
}));
|
|
114
|
+
const pattern = grep;
|
|
115
|
+
const matches = pattern === null ? numbered : numbered.filter((m) => entryMatches(m.entry, pattern));
|
|
116
|
+
const limit = count ?? 10;
|
|
117
|
+
const shown = matches.slice(0, limit);
|
|
118
|
+
const older = matches.length - shown.length;
|
|
119
|
+
if (json) {
|
|
120
|
+
const dateRe = bugSection ? FIXED_DATE_RE : DONE_DATE_RE;
|
|
121
|
+
sayJson({
|
|
122
|
+
entries: shown.map(({ entry: e, position }) => ({
|
|
123
|
+
position,
|
|
124
|
+
title: e.title,
|
|
125
|
+
body: e.body,
|
|
126
|
+
completedOn: completionDate(e.title, dateRe),
|
|
127
|
+
})),
|
|
128
|
+
older,
|
|
129
|
+
});
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const what = bugSection ? "fixed bugs" : "done plans";
|
|
133
|
+
if (shown.length === 0) {
|
|
134
|
+
say(pattern === null ? `no ${what}` : `no ${what} match "${pattern}"`);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const lines = shown.map((m) => `${m.position}. ${m.entry.title}`);
|
|
138
|
+
if (older > 0)
|
|
139
|
+
lines.push(`(${older} older; -n ${matches.length} shows more)`);
|
|
140
|
+
const header = pattern === null ? `${what} in ${fileName}, newest first:` : `${what} in ${fileName} matching "${pattern}", newest first:`;
|
|
141
|
+
say(`${header}\n${lines.join("\n")}`);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const entries = bugSection ? openBugEntries(root) : plannedPlanEntries(root);
|
|
145
|
+
const holds = backlogHolds(root);
|
|
146
|
+
const entryHolds = bugSection ? holds.bugs : holds.plans;
|
|
147
|
+
const inProgress = backlogInProgress(root);
|
|
148
|
+
const entryRunners = bugSection ? inProgress.bugs : inProgress.plans;
|
|
149
|
+
// Numbering is the unfiltered 1-based position `--edit`/`--cancel`/`--show <n>` address;
|
|
150
|
+
// `--grep` keeps each match's original position so a printed number still reaches them.
|
|
151
|
+
const numbered = entries.map((entry, i) => ({ entry, position: i + 1 }));
|
|
152
|
+
const matches = grep === null ? numbered : numbered.filter((m) => entryMatches(m.entry, grep));
|
|
153
|
+
const kept = ready ? matches.filter((m) => (entryHolds[m.position - 1] ?? null) === null) : matches;
|
|
154
|
+
const hidden = matches.length - kept.length;
|
|
155
|
+
if (json) {
|
|
156
|
+
sayJson({
|
|
157
|
+
entries: kept.map(({ entry, position }) => {
|
|
158
|
+
const since = filingDate(entry.title);
|
|
159
|
+
return {
|
|
160
|
+
position,
|
|
161
|
+
title: entry.title,
|
|
162
|
+
body: entry.body,
|
|
163
|
+
hold: entryHolds[position - 1] ?? null,
|
|
164
|
+
inProgress: entryRunners[position - 1] ?? null,
|
|
165
|
+
// The filing stamp the entry's own heading carries, and how many days it has waited
|
|
166
|
+
// since then (both present only when the heading names a stamp — an undated entry
|
|
167
|
+
// keeps the pre-existing shape with neither key).
|
|
168
|
+
...(since === null ? {} : { since, ageDays: ageInDays(since) }),
|
|
169
|
+
};
|
|
170
|
+
}),
|
|
171
|
+
});
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const noun = sectionNoun(sectionTitle);
|
|
175
|
+
if (grep === null && entries.length === 0) {
|
|
176
|
+
say(`no ${noun}s`);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (matches.length === 0) {
|
|
180
|
+
say(`no ${noun}s match "${grep}"`);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (ready && kept.length === 0) {
|
|
184
|
+
say(`no ${noun}s ready (${hidden} held; run \`tumwater ${command} --list\` to see them)`);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const hiddenNote = `(${hidden} held entries hidden; run \`tumwater ${command} --list\` to see them)`;
|
|
188
|
+
const line = (entry, i) => `${entry.title}${holdMark(entryHolds[i] ?? null)}${inProgressMark(entryRunners[i] ?? null)}${entryAgeSuffix(entry.title)}`;
|
|
189
|
+
if (bugSection) {
|
|
190
|
+
const bugLines = kept.map(({ entry, position }) => `${position}. ${line(entry, position - 1)}`);
|
|
191
|
+
if (hidden > 0)
|
|
192
|
+
bugLines.push(hiddenNote);
|
|
193
|
+
say(`${noun}s in ${fileName}:\n${bugLines.join("\n")}`);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
// Plans: a series' blocked parts show as one line naming their positions, as the prompt's
|
|
197
|
+
// backlog index does; numbering is unchanged so --show/--edit/--cancel <n> reach every part.
|
|
198
|
+
const rows = kept.map(({ entry, position }) => ({
|
|
199
|
+
position,
|
|
200
|
+
title: entry.title,
|
|
201
|
+
hold: entryHolds[position - 1] ?? null,
|
|
202
|
+
claimer: entryRunners[position - 1] ?? undefined,
|
|
203
|
+
}));
|
|
204
|
+
let grouped = false;
|
|
205
|
+
const lines = groupBlockedSeries(rows).map((g) => {
|
|
206
|
+
if (g.kind === "row")
|
|
207
|
+
return `${g.row.position}. ${line(g.row, g.row.position - 1)}`;
|
|
208
|
+
grouped = true;
|
|
209
|
+
return `${positionRuns(g.rows.map((r) => r.position))}. ${g.series}, ${g.rows.length} blocked parts (${partsLabel(g.rows)}) [blocked: each waits on an earlier part]`;
|
|
210
|
+
});
|
|
211
|
+
if (grouped)
|
|
212
|
+
lines.push("(each blocked series is one line; --show <n> prints a part, --json lists every entry)");
|
|
213
|
+
if (hidden > 0)
|
|
214
|
+
lines.push(hiddenNote);
|
|
215
|
+
say(`${noun}s in ${fileName}:\n${lines.join("\n")}`);
|
|
216
|
+
}
|
|
217
|
+
/** The shell of `bug --show` and `plan --show`: `--show <n>` (once), an optional `--json`
|
|
218
|
+
* and `--done` (each once; `--done` shows the Nth newest finished entry, as `--list --done`
|
|
219
|
+
* numbers them, with its heading stamp kept and `completedOn` in --json),
|
|
220
|
+
* `--help`/`-h` tolerated, anything else refused through rejectUnknownArgs. Read-only like
|
|
221
|
+
* `--list`: no repo gate, commit, or wake. Prose is the title, a blank line, then the body, so
|
|
222
|
+
* stdout is the file `--edit <n> --file` takes back. */
|
|
223
|
+
export function showAndAnnounce(root, args, command) {
|
|
224
|
+
let position = null;
|
|
225
|
+
let json = false;
|
|
226
|
+
let done = false;
|
|
227
|
+
const rest = [];
|
|
228
|
+
for (let i = 0; i < args.length; i++) {
|
|
229
|
+
const arg = args[i];
|
|
230
|
+
if (arg === "--done") {
|
|
231
|
+
rejectRepeatFlag(done, "--done");
|
|
232
|
+
done = true;
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
if (arg === "--json") {
|
|
236
|
+
rejectRepeatFlag(json, "--json");
|
|
237
|
+
json = true;
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
if (arg === "--show") {
|
|
241
|
+
rejectRepeatFlag(position !== null, "--show");
|
|
242
|
+
position = parsePositionFlag("--show", args[i + 1], "--show 2");
|
|
243
|
+
i++;
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
if (arg === "--help" || arg === "-h")
|
|
247
|
+
continue;
|
|
248
|
+
rest.push(arg);
|
|
249
|
+
}
|
|
250
|
+
rejectUnknownArgs(command, rest, []);
|
|
251
|
+
refuseTeamWorkspace(root);
|
|
252
|
+
if (position === null)
|
|
253
|
+
fail(`--show needs a position (usage: tumwater ${command} --show <n>)`);
|
|
254
|
+
if (done) {
|
|
255
|
+
const bug = command === "bug";
|
|
256
|
+
const all = bug ? fixedBugEntries(root) : donePlanEntries(root);
|
|
257
|
+
const entry = all[position - 1];
|
|
258
|
+
if (entry === undefined) {
|
|
259
|
+
const range = all.length > 0 ? ` — valid: 1-${all.length}` : "";
|
|
260
|
+
fail(`no ${bug ? "fixed bug" : "done plan"} at position ${position} (${all.length} in ${bug ? "BUGS.md" : "PLANS.md"})${range}`);
|
|
261
|
+
}
|
|
262
|
+
if (json) {
|
|
263
|
+
const dateRe = bug ? FIXED_DATE_RE : DONE_DATE_RE;
|
|
264
|
+
sayJson({ position, title: entry.title, body: entry.body, completedOn: completionDate(entry.title, dateRe) });
|
|
265
|
+
}
|
|
266
|
+
else
|
|
267
|
+
say(renderShownEntry({ title: entry.title, body: entry.body }));
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const shown = showEntry(root, command, position);
|
|
271
|
+
if (json)
|
|
272
|
+
sayJson(shown);
|
|
273
|
+
else
|
|
274
|
+
say(renderShownEntry(shown));
|
|
275
|
+
}
|
|
276
|
+
/** The prose `--show` prints: the title, a blank line, then the body (the title alone when the
|
|
277
|
+
* body is empty). */
|
|
278
|
+
export function renderShownEntry(shown) {
|
|
279
|
+
return shown.body === "" ? shown.title : `${shown.title}\n\n${shown.body}`;
|
|
280
|
+
}
|