tumwater 0.4.2 → 0.4.4
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 +6 -6
- package/dist/build-info.json +2 -2
- package/dist/src/agent/agent-backend.js +6 -6
- package/dist/src/agent/{run-agent.js → agent-run.js} +27 -13
- package/dist/src/agent/{run-settle.js → agent-settle.js} +48 -24
- package/dist/src/agent/{run-spawn.js → agent-spawn.js} +21 -12
- package/dist/src/agent/{run-stream.js → agent-stream.js} +4 -4
- package/dist/src/agent/backend-traits.js +2 -2
- package/dist/src/agent/claude/claude-account.js +6 -27
- package/dist/src/agent/claude/claude-backend.js +3 -3
- package/dist/src/agent/claude/claude-env.js +27 -31
- package/dist/src/agent/claude/claude-stream.js +111 -54
- package/dist/src/agent/codex/codex-account.js +8 -0
- package/dist/src/agent/codex/codex-args.js +5 -5
- package/dist/src/agent/codex/codex-backend.js +2 -2
- package/dist/src/agent/codex/codex-env.js +28 -15
- package/dist/src/agent/codex/codex-hook-trust.js +39 -20
- package/dist/src/agent/codex/codex-rollout.js +93 -56
- package/dist/src/agent/codex/codex-stream.js +1 -1
- package/dist/src/agent/env-scrub.js +18 -0
- package/dist/src/agent/image-input.js +68 -11
- package/dist/src/agent/notes-shim.js +2 -2
- package/dist/src/agent/opencode/opencode-backend.js +26 -24
- package/dist/src/agent/opencode/opencode-catalog.js +85 -36
- package/dist/src/agent/opencode/opencode-config.js +32 -14
- package/dist/src/agent/opencode/opencode-env.js +12 -13
- package/dist/src/agent/opencode/opencode-stream.js +47 -25
- package/dist/src/agent/session-ledger.js +23 -27
- package/dist/src/agent/subscription-account.js +2 -83
- package/dist/src/backlog/backlog-archive.js +3 -4
- package/dist/src/backlog/backlog-cli-view.js +81 -41
- package/dist/src/backlog/backlog-cli.js +57 -26
- package/dist/src/backlog/backlog-eligibility.js +56 -122
- package/dist/src/backlog/backlog-md.js +5 -5
- package/dist/src/backlog/backlog-parts.js +65 -27
- package/dist/src/backlog/{question-answer.js → backlog-question-answer.js} +1 -1
- package/dist/src/backlog/backlog-release.js +12 -12
- package/dist/src/backlog/backlog-structure.js +114 -61
- package/dist/src/backlog/backlog.js +3 -2
- package/dist/src/baseline/main-baseline.js +148 -84
- package/dist/src/baseline/main-guardrails.js +2 -2
- package/dist/src/baseline/main-watch.js +84 -50
- package/dist/src/brief/brief.js +26 -13
- package/dist/src/budget/budget-fallback-view.js +100 -243
- package/dist/src/budget/budget-wiring.js +29 -65
- package/dist/src/budget/budget.js +4 -5
- package/dist/src/budget/fallback-breaker.js +2 -2
- package/dist/src/build/build-check-detect.js +43 -14
- package/dist/src/build/build-check-events.js +2 -2
- package/dist/src/build/build-check-report.js +10 -0
- package/dist/src/build/build-check-scoped.js +40 -18
- package/dist/src/build/build-check.js +13 -5
- package/dist/src/build/build-stage.js +6 -4
- package/dist/src/change/change-data.js +1 -4
- package/dist/src/cli/cli-command-args.js +89 -52
- package/dist/src/cli/cli-completion-command.js +75 -0
- package/dist/src/cli/{config-commands.js → cli-config-commands.js} +82 -71
- package/dist/src/cli/cli-doctor-command.js +103 -0
- package/dist/src/cli/cli-flag-specs.js +42 -22
- package/dist/src/cli/cli-init.js +36 -14
- package/dist/src/cli/{log-commands.js → cli-log-commands.js} +43 -23
- package/dist/src/cli/{notify-command.js → cli-notify-command.js} +2 -2
- package/dist/src/cli/cli-query-commands.js +2 -2
- package/dist/src/cli/{question-commands.js → cli-question-commands.js} +86 -60
- package/dist/src/cli/cli-repo-gate.js +2 -2
- package/dist/src/cli/cli-role-command.js +2 -41
- package/dist/src/cli/cli-start-summary.js +4 -3
- package/dist/src/cli/cli-start-supervisor.js +190 -0
- package/dist/src/cli/cli-start.js +94 -244
- package/dist/src/cli/completion.js +85 -49
- package/dist/src/cli/follow-view.js +20 -2
- package/dist/src/cli/help.js +6 -13
- package/dist/src/cli.js +70 -176
- package/dist/src/collections.js +39 -27
- package/dist/src/concurrency/check-slots.js +70 -0
- package/dist/src/concurrency/lock.js +23 -1
- package/dist/src/concurrency/run-permit.js +49 -0
- package/dist/src/concurrency/semaphore.js +46 -250
- package/dist/src/config/config-editable-keys.js +4 -7
- package/dist/src/config/config-fallbacks.js +81 -101
- package/dist/src/config/config-field-checks.js +66 -37
- package/dist/src/config/config-keys.js +66 -40
- package/dist/src/config/config-live.js +4 -28
- package/dist/src/config/{model-selector.js → config-model-selector.js} +4 -4
- package/dist/src/config/config-request.js +163 -102
- package/dist/src/config/config-schema.js +10 -12
- package/dist/src/config/config-selector-checks.js +1 -1
- package/dist/src/config/config-validation-agents.js +2 -2
- package/dist/src/config/config-validation-roles.js +8 -72
- package/dist/src/config/config-validation.js +4 -39
- package/dist/src/config/config-views.js +26 -50
- package/dist/src/config/config-write.js +128 -102
- package/dist/src/config/config.js +5 -14
- package/dist/src/doctor/doctor-backlog-bugs.js +7 -6
- package/dist/src/doctor/doctor-backlog-plans.js +53 -120
- package/dist/src/doctor/doctor-backlog.js +16 -14
- package/dist/src/doctor/doctor-check-names.js +3 -6
- package/dist/src/doctor/doctor-checks.js +8 -8
- package/dist/src/doctor/doctor-claude-checks.js +70 -36
- package/dist/src/doctor/doctor-codex-checks.js +6 -6
- package/dist/src/doctor/doctor-contention-checks.js +57 -117
- package/dist/src/doctor/doctor-fallback-checks.js +48 -26
- package/dist/src/doctor/doctor-holds.js +8 -47
- package/dist/src/doctor/doctor-install.js +1 -1
- package/dist/src/doctor/doctor-launch-services.js +1 -1
- package/dist/src/doctor/doctor-model-checks.js +178 -94
- package/dist/src/doctor/doctor-notify.js +2 -2
- package/dist/src/doctor/doctor-opencode-checks.js +5 -4
- package/dist/src/doctor/doctor-orphans.js +122 -21
- package/dist/src/doctor/{outcome.js → doctor-outcome.js} +7 -0
- package/dist/src/doctor/doctor-pi-checks.js +2 -2
- package/dist/src/doctor/doctor-principles.js +3 -3
- package/dist/src/doctor/doctor-project-checks.js +24 -11
- package/dist/src/doctor/doctor-role-notes.js +1 -1
- package/dist/src/doctor/doctor.js +8 -11
- package/dist/src/events/event-format.js +44 -64
- package/dist/src/events/event-labels.js +1 -5
- package/dist/src/events/event-legacy.js +3 -5
- package/dist/src/events/{notify.js → event-notify.js} +6 -6
- package/dist/src/events/event-read.js +1 -1
- package/dist/src/events/event-window.js +1 -1
- package/dist/src/events/events.js +8 -0
- package/dist/src/failure/failure-cluster.js +9 -18
- package/dist/src/failure/failure-data.js +12 -8
- package/dist/src/failure/failure-render.js +46 -36
- package/dist/src/failure/failure-state-change.js +54 -120
- package/dist/src/failure/{time-spend.js → failure-time-spend.js} +117 -84
- package/dist/src/files/files.js +30 -0
- package/dist/src/files/json-object.js +8 -8
- package/dist/src/files/stat-cache.js +12 -8
- package/dist/src/gates/budget-gates.js +85 -84
- package/dist/src/gates/gate-polls.js +32 -74
- package/dist/src/gates/pause-gates.js +16 -2
- package/dist/src/gates/readiness.js +1 -1
- package/dist/src/gates/role-cap-gates.js +44 -35
- package/dist/src/gates/{startup-gate.js → startup-gates.js} +9 -8
- package/dist/src/gates/{streak-gate.js → streak-gates.js} +75 -52
- package/dist/src/git/git-diff.js +6 -2
- package/dist/src/git/git.js +75 -45
- package/dist/src/git/worktree-pool.js +3 -6
- package/dist/src/gui/gui-admin-endpoints.js +3 -3
- package/dist/src/gui/gui-args.js +12 -0
- package/dist/src/gui/gui-backlog-commands.js +4 -4
- package/dist/src/gui/gui-backlog-endpoints.js +61 -41
- package/dist/src/gui/gui-command.js +43 -24
- package/dist/src/gui/gui-config-commands.js +2 -64
- package/dist/src/gui/gui-endpoint-commands.js +1 -1
- package/dist/src/gui/gui-endpoint-common.js +19 -1
- package/dist/src/gui/gui-history-endpoints.js +100 -52
- package/dist/src/gui/gui-operator-commands.js +43 -48
- package/dist/src/gui/gui-prompt-commands.js +25 -25
- package/dist/src/gui/gui-report-endpoints.js +1 -1
- package/dist/src/gui/gui-server.js +1 -2
- package/dist/src/gui/gui-team-commands.js +2 -1
- package/dist/src/history/history-data.js +71 -44
- package/dist/src/history/history-queued.js +49 -27
- package/dist/src/history/history.js +54 -36
- package/dist/src/inbox/prompt-commands.js +59 -42
- package/dist/src/init/init.js +88 -40
- package/dist/src/merge/merge-backlog-conflicts.js +1 -1
- package/dist/src/merge/merge-check-failures.js +12 -9
- package/dist/src/merge/merge-core.js +7 -32
- package/dist/src/merge/merge-drain.js +11 -13
- package/dist/src/merge/merge-pipeline.js +6 -7
- package/dist/src/merge/merge-post-review-drain.js +11 -14
- package/dist/src/merge/merge-queue-render.js +3 -3
- package/dist/src/merge/merge-requeue.js +1 -1
- package/dist/src/merge/merge-slot.js +0 -8
- package/dist/src/merge/merge-stack.js +17 -18
- package/dist/src/merge/merge-to-main.js +13 -58
- package/dist/src/merge/merge-verify.js +12 -21
- package/dist/src/notes-cli.js +52 -42
- package/dist/src/operator/operator-commands.js +80 -47
- package/dist/src/operator/operator-intent.js +3 -3
- package/dist/src/orchestrator/orchestrator-launch.js +31 -63
- package/dist/src/orchestrator/orchestrator-poll.js +44 -69
- package/dist/src/orchestrator/orchestrator-scheduling.js +5 -9
- package/dist/src/orchestrator/orchestrator.js +8 -21
- package/dist/src/orchestrator/scheduling-admit.js +101 -68
- package/dist/src/orchestrator/scheduling-scope.js +18 -27
- package/dist/src/orchestrator/scheduling-skip.js +10 -14
- package/dist/src/orchestrator/startup-migrations.js +1 -1
- package/dist/src/paths.js +10 -9
- package/dist/src/pi/pi-args.js +5 -2
- package/dist/src/pi/pi-backend.js +2 -2
- package/dist/src/pi/pi-bin.js +3 -3
- package/dist/src/pi/pi-event-line.js +28 -1
- package/dist/src/pi/pi-listed-models.js +13 -0
- package/dist/src/pi/pi-models.js +43 -29
- package/dist/src/pi/pi-settings.js +43 -20
- package/dist/src/pi/pi-stream.js +41 -8
- package/dist/src/pi/pi-watchdogs.js +43 -15
- package/dist/src/pi/pi.js +2 -2
- package/dist/src/pi-extension/context-shake.js +32 -20
- package/dist/src/pi-extension/kill-guard.js +69 -0
- package/dist/src/process/process-group.js +51 -26
- package/dist/src/process/process.js +20 -12
- package/dist/src/process/run-marker.js +33 -15
- package/dist/src/process/supervisor.js +40 -28
- package/dist/src/prompt/dialect.js +1 -1
- package/dist/src/prompt/gate-notes.js +2 -2
- package/dist/src/prompt/gate-prompts.js +1 -44
- package/dist/src/prompt/notes-backlog.js +66 -37
- package/dist/src/prompt/principles.js +6 -4
- package/dist/src/prompt/prompt-followup.js +12 -4
- package/dist/src/prompt/prompt.js +88 -38
- package/dist/src/redeploy/redeployer.js +21 -1
- package/dist/src/report/report-data.js +53 -37
- package/dist/src/report/report-fold.js +16 -9
- package/dist/src/report/report-render.js +21 -194
- package/dist/src/report/report-since-data.js +4 -3
- package/dist/src/report/report-since-render.js +173 -0
- package/dist/src/report/report-usage-fold.js +8 -8
- package/dist/src/report/report.js +46 -22
- package/dist/src/review/diff-rules.js +35 -21
- package/dist/src/review/post-merge-review-render.js +9 -3
- package/dist/src/review/post-merge-review.js +48 -41
- package/dist/src/review/review-precheck.js +14 -4
- package/dist/src/review/review.js +48 -170
- package/dist/src/review/secret-leaks.js +26 -16
- package/dist/src/roles/legacy-role-migration.js +6 -3
- package/dist/src/roles/role-catalog.js +11 -3
- package/dist/src/roles/role-guidance.js +16 -12
- package/dist/src/roles/role-render.js +7 -46
- package/dist/src/roles/role-view.js +10 -33
- package/dist/src/run/acceptance-greps.js +88 -45
- package/dist/src/run/ci-parity.js +19 -8
- package/dist/src/run/run-apply.js +12 -15
- package/dist/src/run/run-detail-data.js +121 -68
- package/dist/src/run/run-detail-render.js +92 -35
- package/dist/src/run/run-detail.js +72 -41
- package/dist/src/run/run-prompt.js +63 -50
- package/dist/src/run/run-resume.js +76 -29
- package/dist/src/run/run-stage.js +141 -90
- package/dist/src/run/run-timing.js +8 -2
- package/dist/src/run/run-usage.js +31 -1
- package/dist/src/run/run-verdict.js +128 -50
- package/dist/src/run/stage-check.js +60 -50
- package/dist/src/run/stage-checks-shared.js +28 -0
- package/dist/src/run/stage-name-checks.js +111 -92
- package/dist/src/run/stage-path-checks.js +69 -42
- package/dist/src/run/stage-prose-checks.js +55 -40
- package/dist/src/runner/{leftover.js → runner-leftover.js} +9 -26
- package/dist/src/runner/runner-outcome.js +7 -2
- package/dist/src/runner/runner-pi.js +9 -22
- package/dist/src/runner/runner-recovery.js +5 -13
- package/dist/src/runner/{revision.js → runner-revision.js} +1 -2
- package/dist/src/runner/runner-run.js +103 -50
- package/dist/src/runner/runner-state-load.js +18 -28
- package/dist/src/runner/runner-state.js +0 -14
- package/dist/src/runner/runner.js +41 -25
- package/dist/src/scheduling/backoff.js +8 -3
- package/dist/src/scheduling/claim-entries.js +2 -1
- package/dist/src/scheduling/claims.js +0 -4
- package/dist/src/scheduling/scheduling.js +53 -66
- package/dist/src/status/status-budget.js +4 -43
- package/dist/src/status/status-data.js +35 -39
- package/dist/src/status/status-role-notes.js +2 -2
- package/dist/src/status/status-roles.js +9 -18
- package/dist/src/team/{error-storm.js → team-error-storm.js} +1 -1
- package/dist/src/team/{failure-spread.js → team-failure-spread.js} +5 -5
- package/dist/src/team/team-hold.js +105 -70
- package/dist/src/team/{orchestrator-info.js → team-orchestrator-info.js} +55 -36
- package/dist/src/team/team-polls.js +53 -201
- package/dist/src/team/{reclaim.js → team-reclaim.js} +61 -31
- package/dist/src/team/team-state.js +4 -13
- package/dist/src/text/datetime.js +16 -7
- package/dist/src/text/markdown.js +1 -1
- package/dist/src/text/phrases.js +29 -15
- package/dist/src/text/suggest.js +1 -1
- package/dist/src/text/text.js +6 -5
- package/dist/src/ui/alert-feeds.js +46 -111
- package/dist/src/ui/badges.js +17 -88
- package/dist/src/ui/gui/gui-client-boot.js +2 -8
- package/dist/src/ui/gui/gui-client-composer.js +1 -1
- package/dist/src/ui/gui/gui-client-drawer-config.js +8 -33
- package/dist/src/ui/gui/gui-client-drawer.js +1 -1
- package/dist/src/ui/gui/gui-client-feed.js +1 -1
- package/dist/src/ui/gui/gui-client-history.js +28 -14
- package/dist/src/ui/gui/gui-client-model.js +0 -12
- package/dist/src/ui/gui/gui-client-operator.js +7 -5
- package/dist/src/ui/gui/gui-client-pending.js +7 -6
- package/dist/src/ui/gui/gui-client-report-chart.js +5 -5
- package/dist/src/ui/gui/gui-client-report.js +1 -1
- package/dist/src/ui/gui/gui-client-roles.js +0 -1
- package/dist/src/ui/gui/gui-client-settings.js +43 -84
- package/dist/src/ui/gui/gui-client-team.js +12 -6
- package/dist/src/ui/gui/gui-client.js +7 -1
- package/dist/src/ui/progress-data.js +107 -44
- package/dist/src/ui/run-progress-model.js +20 -4
- package/dist/src/ui/status-model.js +2 -24
- package/dist/src/ui/status-payload.js +11 -30
- package/dist/src/ui/status-render.js +13 -24
- package/dist/src/ui/team-alert-backlog.js +14 -204
- package/dist/src/ui/team-alert-shared.js +6 -29
- package/dist/src/ui/team-alert-status.js +9 -170
- package/dist/src/ui/team-alert-tail.js +19 -215
- package/dist/src/ui/team-alerts.js +8 -15
- package/dist/src/ui/transcript-run.js +27 -16
- package/dist/src/ui/tui/tui-backlog.js +2 -2
- package/dist/src/ui/tui/tui-editor-answer.js +12 -10
- package/dist/src/ui/tui/tui-editor-attach.js +4 -3
- package/dist/src/ui/tui/tui-editor-backends.js +4 -3
- package/dist/src/ui/tui/tui-editor-brief.js +6 -9
- package/dist/src/ui/tui/tui-editor-budget.js +4 -3
- package/dist/src/ui/tui/tui-editor-config.js +80 -68
- package/dist/src/ui/tui/tui-editor-entry.js +12 -20
- package/dist/src/ui/tui/tui-editor-pause.js +51 -57
- package/dist/src/ui/tui/tui-editor-prompt.js +9 -13
- package/dist/src/ui/tui/tui-editor-queued.js +11 -14
- package/dist/src/ui/tui/tui-editor-quiet.js +4 -3
- package/dist/src/ui/tui/tui-editor-release.js +4 -3
- package/dist/src/ui/tui/tui-editor-retire.js +7 -7
- package/dist/src/ui/tui/tui-editor-role-enabled.js +4 -3
- package/dist/src/ui/tui/tui-editor-role-file.js +4 -4
- package/dist/src/ui/tui/tui-editor-role-key.js +4 -3
- package/dist/src/ui/tui/tui-editor-role-model.js +97 -15
- package/dist/src/ui/tui/tui-editor-search.js +4 -3
- package/dist/src/ui/tui/tui-editor-session.js +17 -4
- package/dist/src/ui/tui/tui-editors.js +5 -10
- package/dist/src/ui/tui/tui-frame.js +182 -134
- package/dist/src/ui/tui/tui-guard.js +20 -0
- package/dist/src/ui/tui/tui-input.js +167 -98
- package/dist/src/ui/tui/tui-keymap.js +51 -29
- package/dist/src/ui/tui/tui-keys.js +1 -1
- package/dist/src/ui/tui/tui-pane-activity.js +5 -4
- package/dist/src/ui/tui/tui-pane-backlog.js +74 -36
- package/dist/src/ui/tui/tui-pane-ctx.js +1 -1
- package/dist/src/ui/tui/tui-pane-health.js +252 -230
- package/dist/src/ui/tui/tui-pane-history.js +67 -74
- package/dist/src/ui/tui/tui-pane-pending.js +288 -247
- package/dist/src/ui/tui/tui-pane-queued.js +25 -27
- package/dist/src/ui/tui/tui-pane-report.js +2 -1
- package/dist/src/ui/tui/tui-pane-session.js +15 -10
- package/dist/src/ui/tui/tui-pane-transcript.js +19 -31
- package/dist/src/ui/tui/tui-pane.js +14 -11
- package/dist/src/ui/tui/tui-panes.js +38 -33
- package/dist/src/ui/tui/tui.js +4 -7
- package/dist/src/verdict/fix-claim.js +107 -56
- package/dist/src/verdict/refusal.js +1 -1
- package/dist/src/verdict/reply-contract.js +3 -4
- package/package.json +5 -5
- package/dist/src/concurrency/provider-lease.js +0 -105
- package/dist/src/review/review-followup.js +0 -87
- package/dist/src/review/review-run.js +0 -395
- package/dist/src/runner/model-fallback.js +0 -76
- package/dist/src/runner/runner-fallback.js +0 -66
- package/dist/src/ui/tui/tui-editor-claude-reserve.js +0 -24
- package/dist/src/ui/tui/tui-editor-provider-caps.js +0 -27
- /package/dist/src/cli/{brief-command.js → cli-brief-command.js} +0 -0
- /package/dist/src/doctor/{probe.js → doctor-probe.js} +0 -0
- /package/dist/src/gates/{disk-gate.js → disk-gates.js} +0 -0
- /package/dist/src/operator/{retire.js → operator-retire.js} +0 -0
- /package/dist/src/operator/{revert.js → operator-revert.js} +0 -0
|
@@ -3,31 +3,36 @@ import { betweenWindow } from "../../cli/cli-args.js";
|
|
|
3
3
|
import { HISTORY_DEFAULT_RUNS, HISTORY_MAX_RUNS, historyClass, readRunRows, readRunRowsSince, summarizeRunRows, summarizeRunRowsByModel, runRowsMatchingGrep, runRowsOnModels, } from "../../history/history-data.js";
|
|
4
4
|
import { renderModelSummary, renderSummary } from "../../history/history-render.js";
|
|
5
5
|
import { historyPaneText } from "./tui-history.js";
|
|
6
|
+
import { guardError } from "./tui-guard.js";
|
|
6
7
|
import { readRunDetail } from "../../run/run-detail-data.js";
|
|
7
8
|
import { renderRunDetail, runTranscriptLines } from "../../run/run-detail-render.js";
|
|
8
|
-
import { revertFollowUp, runRevertSha } from "../../operator/revert.js";
|
|
9
|
+
import { revertFollowUp, runRevertSha } from "../../operator/operator-revert.js";
|
|
9
10
|
import { shortSha } from "../../text/format.js";
|
|
10
11
|
import { plural } from "../../text/phrases.js";
|
|
11
12
|
import { pageMarkdownBody } from "./tui-backlog.js";
|
|
12
13
|
import { pageDir } from "./tui-keymap.js";
|
|
13
14
|
import { promptLineFree } from "./tui-pane-ctx.js";
|
|
14
|
-
import {
|
|
15
|
+
import { flashReject } from "./tui-guard.js";
|
|
16
|
+
import { paneAtHead, nextInCycle, cycleLabel, steppedWindowBounds, HISTORY_WINDOWS, HISTORY_RESULTS } from "./tui-pane-session.js";
|
|
15
17
|
/** The bounds `readRunRowsSince` reads for a trailing window of `windowMs` stepped `step` window
|
|
16
18
|
* lengths back: step 0 (or no window) is the trailing window, step k the window (k+1)*len to k*len
|
|
17
|
-
* ago, the `history --since --until` pair.
|
|
19
|
+
* ago, the `history --since --until` pair. The step math delegates to the panes' shared
|
|
20
|
+
* `steppedWindowBounds`, mapping its absent `undefined` upper bound back to this signature's
|
|
21
|
+
* `null` (the collectors' default either way, and what readRunRowsSince's own tests pin), so the
|
|
22
|
+
* History and Usage/Failures panes cannot drift on what a stepped window means. */
|
|
18
23
|
export function historyWindowBounds(windowMs, step) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return { sinceMs: (step + 1) * windowMs, untilMs: step * windowMs };
|
|
24
|
+
const b = steppedWindowBounds(windowMs, step);
|
|
25
|
+
return { sinceMs: b.sinceMs, untilMs: b.untilMs ?? null };
|
|
22
26
|
}
|
|
23
27
|
/** The History pane (view roleIds.length + 4) of the TUI (src/ui/tui/tui.tsx): the session
|
|
24
|
-
* window (Ctrl+S), outcome filter (Ctrl+O),
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* window (Ctrl+S), outcome filter (Ctrl+O), model filter (Ctrl+X), summary toggle (Ctrl+Y),
|
|
29
|
+
* exact-role scope (Ctrl+G), free-text search (`/`), the one-press newest-failure jump
|
|
30
|
+
* (Ctrl+L), and the Ctrl+N completed-run trail (Ctrl+P steps it to older runs, Ctrl+R cycles
|
|
31
|
+
* its agent transcript, Ctrl+W shows its commit patch, Ctrl+V twice reverts the shown run's
|
|
32
|
+
* merged change), each with its cache and body window. With the trail off, Ctrl+P steps the
|
|
33
|
+
* window back by its own length (the `history --since --until` window) and Ctrl+S returns to
|
|
34
|
+
* the trailing window. Split out of the pane-navigation monolith; it owns the pane's
|
|
35
|
+
* window/result/model/summary/scope/search/trail state and the arms that touch them. */
|
|
31
36
|
export function createHistoryPane(session) {
|
|
32
37
|
// The History pane's session trailing window (Ctrl+S), a HISTORY_WINDOWS length or null for
|
|
33
38
|
// the default newest-N read. Session-only like the view/scroll state; the next Ctrl+T into
|
|
@@ -82,6 +87,20 @@ export function createHistoryPane(session) {
|
|
|
82
87
|
let trailRun = null;
|
|
83
88
|
let reverting = false; // a revert preview or commit is in flight; a held Ctrl+V starts no second
|
|
84
89
|
let trailGen = 0; // bumped at every trail read or reset; a stat resolution applies only to its own gen
|
|
90
|
+
/** Drop the on-screen run trail and its snapshot: the shared teardown the pane's three
|
|
91
|
+
* History-only exits run — the Ctrl+N toggle-off arm, the Ctrl+L newest-failure jump, and
|
|
92
|
+
* the pane's reset on a view cycle. It bumps trailGen so an in-flight stat resolution from
|
|
93
|
+
* the closed trail cannot repaint the pane. */
|
|
94
|
+
const dropTrail = () => {
|
|
95
|
+
trailGen++;
|
|
96
|
+
trailMode = false;
|
|
97
|
+
trailCache = null;
|
|
98
|
+
trailIndex = 0;
|
|
99
|
+
trailTranscript = "off";
|
|
100
|
+
trailPatch = false;
|
|
101
|
+
trailPatchText = null;
|
|
102
|
+
trailGrep = null;
|
|
103
|
+
};
|
|
85
104
|
/** The pane's row selection: scope, then window, then search, then outcome class — the order
|
|
86
105
|
* `tumwater history` applies them. Returns the raw read's coverage flag, the count after the
|
|
87
106
|
* search (so an empty body can blame the filter that emptied the set: `afterGrep > 0` means
|
|
@@ -179,18 +198,16 @@ export function createHistoryPane(session) {
|
|
|
179
198
|
// or on a throw, which is flashed): the two outputs `tumwater history --transcript` prints.
|
|
180
199
|
const loadTranscript = () => {
|
|
181
200
|
trailTranscriptText = null;
|
|
182
|
-
|
|
201
|
+
const run = trailRun;
|
|
202
|
+
if (run === null || trailTranscript === "off")
|
|
183
203
|
return;
|
|
184
|
-
|
|
185
|
-
const { found, note } = runTranscriptLines(session.root,
|
|
204
|
+
guardError(session, () => {
|
|
205
|
+
const { found, note } = runTranscriptLines(session.root, run.role, run.run, run.detail, {
|
|
186
206
|
includePrompts: trailTranscript === "prompts",
|
|
187
207
|
grep: trailGrep ?? undefined,
|
|
188
208
|
});
|
|
189
209
|
trailTranscriptText = found.length > 0 ? found.join("\n") : note;
|
|
190
|
-
}
|
|
191
|
-
catch (err) {
|
|
192
|
-
session.flashError(err);
|
|
193
|
-
}
|
|
210
|
+
});
|
|
194
211
|
};
|
|
195
212
|
// Resolve one async trail part (the run commit's stat or patch) through the session, and, if
|
|
196
213
|
// the trail is still current (`trailMode`, not superseded by a newer `trailGen`, and `keep`
|
|
@@ -310,7 +327,7 @@ export function createHistoryPane(session) {
|
|
|
310
327
|
}
|
|
311
328
|
const followUp = revertFollowUp(r.subject);
|
|
312
329
|
session.flashMessage(`reverted ${shortSha(sha)}: main is now ${shortSha(r.headSha)}${followUp === null ? "" : `; ${followUp}`}`);
|
|
313
|
-
}, (
|
|
330
|
+
}, flashReject(session)).finally(() => {
|
|
314
331
|
reverting = false;
|
|
315
332
|
session.armedRevert = null;
|
|
316
333
|
session.requestRender();
|
|
@@ -335,7 +352,7 @@ export function createHistoryPane(session) {
|
|
|
335
352
|
session.revertArmed = p.sha;
|
|
336
353
|
session.flashMessage(`press Ctrl+V again to revert ${shortSha(p.sha)} ${p.subject} (${plural(p.paths.length, "file")}) on ${p.primary} — any other key cancels`);
|
|
337
354
|
}
|
|
338
|
-
}, (
|
|
355
|
+
}, flashReject(session)).finally(() => {
|
|
339
356
|
reverting = false;
|
|
340
357
|
session.requestRender();
|
|
341
358
|
});
|
|
@@ -357,14 +374,7 @@ export function createHistoryPane(session) {
|
|
|
357
374
|
if (trailMode) {
|
|
358
375
|
// Toggle the trail off (Ctrl+N on the trail view): drop the trail snapshot. The
|
|
359
376
|
// trailGen bump keeps an in-flight stat from the old trail from repainting.
|
|
360
|
-
|
|
361
|
-
trailMode = false;
|
|
362
|
-
trailCache = null;
|
|
363
|
-
trailIndex = 0;
|
|
364
|
-
trailTranscript = "off";
|
|
365
|
-
trailPatch = false;
|
|
366
|
-
trailPatchText = null;
|
|
367
|
-
trailGrep = null;
|
|
377
|
+
dropTrail();
|
|
368
378
|
}
|
|
369
379
|
else {
|
|
370
380
|
// Toggle the trail on: read the pane-scoped newest completed run. A scope holding
|
|
@@ -375,8 +385,7 @@ export function createHistoryPane(session) {
|
|
|
375
385
|
if (loadTrail(() => session.flashMessage(empty)))
|
|
376
386
|
trailMode = true;
|
|
377
387
|
}
|
|
378
|
-
session
|
|
379
|
-
session.requestRender();
|
|
388
|
+
paneAtHead(session);
|
|
380
389
|
return true;
|
|
381
390
|
};
|
|
382
391
|
const historyNewestFailure = (ctx) => {
|
|
@@ -405,22 +414,14 @@ export function createHistoryPane(session) {
|
|
|
405
414
|
historySummary = null;
|
|
406
415
|
// Drop any on-screen trail the way Ctrl+N's toggle-off arm does (the gen bump keeps an
|
|
407
416
|
// in-flight stat from the old trail from repainting).
|
|
408
|
-
|
|
409
|
-
trailMode = false;
|
|
410
|
-
trailCache = null;
|
|
411
|
-
trailIndex = 0;
|
|
412
|
-
trailTranscript = "off";
|
|
413
|
-
trailPatch = false;
|
|
414
|
-
trailPatchText = null;
|
|
415
|
-
trailGrep = null;
|
|
417
|
+
dropTrail();
|
|
416
418
|
recompute();
|
|
417
419
|
// historyWindow null + historyResult "problems": loadTrail reads
|
|
418
420
|
// readRunRows(root, HISTORY_MAX_RUNS, null) and takes .filtered[0] — the newest failing
|
|
419
421
|
// run of any role, exactly what the dashboard's Newest failure button and the CLI open.
|
|
420
422
|
if (loadTrail(() => session.flashMessage("no failing run in the scanned window")))
|
|
421
423
|
trailMode = true;
|
|
422
|
-
session
|
|
423
|
-
session.requestRender();
|
|
424
|
+
paneAtHead(session);
|
|
424
425
|
return true;
|
|
425
426
|
};
|
|
426
427
|
const historyStepBack = (ctx) => {
|
|
@@ -504,8 +505,7 @@ export function createHistoryPane(session) {
|
|
|
504
505
|
loadTrailStat(trailRun.detail);
|
|
505
506
|
composeTrail();
|
|
506
507
|
}
|
|
507
|
-
session
|
|
508
|
-
session.requestRender();
|
|
508
|
+
paneAtHead(session);
|
|
509
509
|
return true;
|
|
510
510
|
};
|
|
511
511
|
const historyRevertArm = (ctx) => {
|
|
@@ -633,29 +633,29 @@ export function createHistoryPane(session) {
|
|
|
633
633
|
}
|
|
634
634
|
return false;
|
|
635
635
|
};
|
|
636
|
+
const ctrlRoutes = {
|
|
637
|
+
n: historyTrailToggle,
|
|
638
|
+
l: historyNewestFailure,
|
|
639
|
+
p: historyStepBack,
|
|
640
|
+
r: historyTranscriptCycle,
|
|
641
|
+
w: historyPatchToggle,
|
|
642
|
+
v: historyRevertArm,
|
|
643
|
+
g: historyScopeCycle,
|
|
644
|
+
s: historyWindowCycle,
|
|
645
|
+
o: historyResultCycle,
|
|
646
|
+
x: historyModelCycle,
|
|
647
|
+
y: historySummaryCycle,
|
|
648
|
+
};
|
|
649
|
+
const ctrlRoute = (key, ctx) => {
|
|
650
|
+
if (!key.ctrl || key.name === undefined)
|
|
651
|
+
return null;
|
|
652
|
+
const route = ctrlRoutes[key.name];
|
|
653
|
+
return route === undefined ? null : route(ctx);
|
|
654
|
+
};
|
|
636
655
|
const handleKey = (key, ctx) => {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
return historyNewestFailure(ctx);
|
|
641
|
-
if (key.ctrl && key.name === "p")
|
|
642
|
-
return historyStepBack(ctx);
|
|
643
|
-
if (key.ctrl && key.name === "r")
|
|
644
|
-
return historyTranscriptCycle(ctx);
|
|
645
|
-
if (key.ctrl && key.name === "w")
|
|
646
|
-
return historyPatchToggle(ctx);
|
|
647
|
-
if (key.ctrl && key.name === "v")
|
|
648
|
-
return historyRevertArm(ctx);
|
|
649
|
-
if (key.ctrl && key.name === "g")
|
|
650
|
-
return historyScopeCycle(ctx);
|
|
651
|
-
if (key.ctrl && key.name === "s")
|
|
652
|
-
return historyWindowCycle(ctx);
|
|
653
|
-
if (key.ctrl && key.name === "o")
|
|
654
|
-
return historyResultCycle(ctx);
|
|
655
|
-
if (key.ctrl && key.name === "x")
|
|
656
|
-
return historyModelCycle(ctx);
|
|
657
|
-
if (key.ctrl && key.name === "y")
|
|
658
|
-
return historySummaryCycle(ctx);
|
|
656
|
+
const ctrl = ctrlRoute(key, ctx);
|
|
657
|
+
if (ctrl !== null)
|
|
658
|
+
return ctrl;
|
|
659
659
|
const page = pageDir(key.name);
|
|
660
660
|
if (page !== null)
|
|
661
661
|
return historyTrailPage(page);
|
|
@@ -666,14 +666,7 @@ export function createHistoryPane(session) {
|
|
|
666
666
|
enter: recompute,
|
|
667
667
|
reset() {
|
|
668
668
|
// A cycle away leaves the run trail (which is History-only) and drops its snapshot too.
|
|
669
|
-
|
|
670
|
-
trailMode = false;
|
|
671
|
-
trailCache = null;
|
|
672
|
-
trailIndex = 0;
|
|
673
|
-
trailTranscript = "off";
|
|
674
|
-
trailPatch = false;
|
|
675
|
-
trailPatchText = null;
|
|
676
|
-
trailGrep = null;
|
|
669
|
+
dropTrail();
|
|
677
670
|
session.revertArmed = null;
|
|
678
671
|
session.armedRevert = null;
|
|
679
672
|
},
|