@wrongstack/tui 0.284.1 → 0.285.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.
Files changed (239) hide show
  1. package/dist/app-initial-state.d.ts +26 -0
  2. package/dist/app-initial-state.d.ts.map +1 -0
  3. package/dist/app-reducer.d.ts +5 -0
  4. package/dist/app-reducer.d.ts.map +1 -0
  5. package/dist/app-state.d.ts +1801 -0
  6. package/dist/app-state.d.ts.map +1 -0
  7. package/dist/app.d.ts +579 -0
  8. package/dist/app.d.ts.map +1 -0
  9. package/dist/clipboard.d.ts +2 -0
  10. package/dist/clipboard.d.ts.map +1 -0
  11. package/dist/components/agents-monitor.d.ts +49 -0
  12. package/dist/components/agents-monitor.d.ts.map +1 -0
  13. package/dist/components/animation-style.d.ts +51 -0
  14. package/dist/components/animation-style.d.ts.map +1 -0
  15. package/dist/components/audit-panel.d.ts +9 -0
  16. package/dist/components/audit-panel.d.ts.map +1 -0
  17. package/dist/components/auth-panel-model.d.ts +150 -0
  18. package/dist/components/auth-panel-model.d.ts.map +1 -0
  19. package/dist/components/auth-panel.d.ts +8 -0
  20. package/dist/components/auth-panel.d.ts.map +1 -0
  21. package/dist/components/autonomy-picker.d.ts +15 -0
  22. package/dist/components/autonomy-picker.d.ts.map +1 -0
  23. package/dist/components/brain-decision-prompt.d.ts +28 -0
  24. package/dist/components/brain-decision-prompt.d.ts.map +1 -0
  25. package/dist/components/brain-panel.d.ts +16 -0
  26. package/dist/components/brain-panel.d.ts.map +1 -0
  27. package/dist/components/checkpoint-timeline.d.ts +19 -0
  28. package/dist/components/checkpoint-timeline.d.ts.map +1 -0
  29. package/dist/components/confirm-prompt.d.ts +26 -0
  30. package/dist/components/confirm-prompt.d.ts.map +1 -0
  31. package/dist/components/continue-confirm-panel.d.ts +47 -0
  32. package/dist/components/continue-confirm-panel.d.ts.map +1 -0
  33. package/dist/components/coordinator-panel.d.ts +11 -0
  34. package/dist/components/coordinator-panel.d.ts.map +1 -0
  35. package/dist/components/design-picker.d.ts +14 -0
  36. package/dist/components/design-picker.d.ts.map +1 -0
  37. package/dist/components/enhance-panel.d.ts +36 -0
  38. package/dist/components/enhance-panel.d.ts.map +1 -0
  39. package/dist/components/esc-confirm-prompt.d.ts +17 -0
  40. package/dist/components/esc-confirm-prompt.d.ts.map +1 -0
  41. package/dist/components/f-key-picker.d.ts +13 -0
  42. package/dist/components/f-key-picker.d.ts.map +1 -0
  43. package/dist/components/file-picker.d.ts +8 -0
  44. package/dist/components/file-picker.d.ts.map +1 -0
  45. package/dist/components/fleet-monitor.d.ts +60 -0
  46. package/dist/components/fleet-monitor.d.ts.map +1 -0
  47. package/dist/components/fleet-panel.d.ts +69 -0
  48. package/dist/components/fleet-panel.d.ts.map +1 -0
  49. package/dist/components/goal-panel.d.ts +17 -0
  50. package/dist/components/goal-panel.d.ts.map +1 -0
  51. package/dist/components/help-overlay.d.ts +27 -0
  52. package/dist/components/help-overlay.d.ts.map +1 -0
  53. package/dist/components/help-panel.d.ts +16 -0
  54. package/dist/components/help-panel.d.ts.map +1 -0
  55. package/dist/components/history/assistant.d.ts +61 -0
  56. package/dist/components/history/assistant.d.ts.map +1 -0
  57. package/dist/components/history/banner.d.ts +13 -0
  58. package/dist/components/history/banner.d.ts.map +1 -0
  59. package/dist/components/history/code-block.d.ts +217 -0
  60. package/dist/components/history/code-block.d.ts.map +1 -0
  61. package/dist/components/history/entry.d.ts +19 -0
  62. package/dist/components/history/entry.d.ts.map +1 -0
  63. package/dist/components/history/index.d.ts +21 -0
  64. package/dist/components/history/index.d.ts.map +1 -0
  65. package/dist/components/history/replay.d.ts +44 -0
  66. package/dist/components/history/replay.d.ts.map +1 -0
  67. package/dist/components/history/types.d.ts +146 -0
  68. package/dist/components/history/types.d.ts.map +1 -0
  69. package/dist/components/history/utils.d.ts +65 -0
  70. package/dist/components/history/utils.d.ts.map +1 -0
  71. package/dist/components/history.d.ts +2 -0
  72. package/dist/components/history.d.ts.map +1 -0
  73. package/dist/components/input.d.ts +57 -0
  74. package/dist/components/input.d.ts.map +1 -0
  75. package/dist/components/kanban-panel.d.ts +7 -0
  76. package/dist/components/kanban-panel.d.ts.map +1 -0
  77. package/dist/components/key-hint-bar.d.ts +31 -0
  78. package/dist/components/key-hint-bar.d.ts.map +1 -0
  79. package/dist/components/live-activity-strip.d.ts +39 -0
  80. package/dist/components/live-activity-strip.d.ts.map +1 -0
  81. package/dist/components/mailbox-panel.d.ts +40 -0
  82. package/dist/components/mailbox-panel.d.ts.map +1 -0
  83. package/dist/components/mcp-picker.d.ts +18 -0
  84. package/dist/components/mcp-picker.d.ts.map +1 -0
  85. package/dist/components/mode-picker.d.ts +17 -0
  86. package/dist/components/mode-picker.d.ts.map +1 -0
  87. package/dist/components/model-picker.d.ts +32 -0
  88. package/dist/components/model-picker.d.ts.map +1 -0
  89. package/dist/components/phase-monitor.d.ts +33 -0
  90. package/dist/components/phase-monitor.d.ts.map +1 -0
  91. package/dist/components/phase-panel.d.ts +22 -0
  92. package/dist/components/phase-panel.d.ts.map +1 -0
  93. package/dist/components/plan-panel.d.ts +17 -0
  94. package/dist/components/plan-panel.d.ts.map +1 -0
  95. package/dist/components/plugin-picker.d.ts +22 -0
  96. package/dist/components/plugin-picker.d.ts.map +1 -0
  97. package/dist/components/process-list.d.ts +14 -0
  98. package/dist/components/process-list.d.ts.map +1 -0
  99. package/dist/components/project-picker.d.ts +21 -0
  100. package/dist/components/project-picker.d.ts.map +1 -0
  101. package/dist/components/prompt-picker.d.ts +31 -0
  102. package/dist/components/prompt-picker.d.ts.map +1 -0
  103. package/dist/components/provider-colors.d.ts +40 -0
  104. package/dist/components/provider-colors.d.ts.map +1 -0
  105. package/dist/components/queue-panel.d.ts +16 -0
  106. package/dist/components/queue-panel.d.ts.map +1 -0
  107. package/dist/components/resume-picker.d.ts +16 -0
  108. package/dist/components/resume-picker.d.ts.map +1 -0
  109. package/dist/components/scrollable-history.d.ts +60 -0
  110. package/dist/components/scrollable-history.d.ts.map +1 -0
  111. package/dist/components/sdd-board-overlay.d.ts +15 -0
  112. package/dist/components/sdd-board-overlay.d.ts.map +1 -0
  113. package/dist/components/send-mode-picker.d.ts +64 -0
  114. package/dist/components/send-mode-picker.d.ts.map +1 -0
  115. package/dist/components/sessions-panel.d.ts +46 -0
  116. package/dist/components/sessions-panel.d.ts.map +1 -0
  117. package/dist/components/settings-picker.d.ts +371 -0
  118. package/dist/components/settings-picker.d.ts.map +1 -0
  119. package/dist/components/shadow-panel.d.ts +13 -0
  120. package/dist/components/shadow-panel.d.ts.map +1 -0
  121. package/dist/components/shell-command-warning.d.ts +9 -0
  122. package/dist/components/shell-command-warning.d.ts.map +1 -0
  123. package/dist/components/slash-menu.d.ts +9 -0
  124. package/dist/components/slash-menu.d.ts.map +1 -0
  125. package/dist/components/status-bar.d.ts +378 -0
  126. package/dist/components/status-bar.d.ts.map +1 -0
  127. package/dist/components/statusline-picker.d.ts +55 -0
  128. package/dist/components/statusline-picker.d.ts.map +1 -0
  129. package/dist/components/suggestions.d.ts +9 -0
  130. package/dist/components/suggestions.d.ts.map +1 -0
  131. package/dist/components/todos-monitor.d.ts +13 -0
  132. package/dist/components/todos-monitor.d.ts.map +1 -0
  133. package/dist/components/tools-picker.d.ts +20 -0
  134. package/dist/components/tools-picker.d.ts.map +1 -0
  135. package/dist/components/worktree-monitor.d.ts +23 -0
  136. package/dist/components/worktree-monitor.d.ts.map +1 -0
  137. package/dist/components/worktree-panel.d.ts +21 -0
  138. package/dist/components/worktree-panel.d.ts.map +1 -0
  139. package/dist/f-key-panels.d.ts +46 -0
  140. package/dist/f-key-panels.d.ts.map +1 -0
  141. package/dist/file-search.d.ts +3 -0
  142. package/dist/file-search.d.ts.map +1 -0
  143. package/dist/fn-keys.d.ts +20 -0
  144. package/dist/fn-keys.d.ts.map +1 -0
  145. package/dist/git-info.d.ts +20 -0
  146. package/dist/git-info.d.ts.map +1 -0
  147. package/dist/heap-watchdog.d.ts +41 -0
  148. package/dist/heap-watchdog.d.ts.map +1 -0
  149. package/dist/highlight.d.ts +30 -0
  150. package/dist/highlight.d.ts.map +1 -0
  151. package/dist/hit-test.d.ts +75 -0
  152. package/dist/hit-test.d.ts.map +1 -0
  153. package/dist/hooks/use-auth-panel.d.ts +38 -0
  154. package/dist/hooks/use-auth-panel.d.ts.map +1 -0
  155. package/dist/hooks/use-autonomous-coordinator.d.ts +21 -0
  156. package/dist/hooks/use-autonomous-coordinator.d.ts.map +1 -0
  157. package/dist/hooks/use-brain-events.d.ts +7 -0
  158. package/dist/hooks/use-brain-events.d.ts.map +1 -0
  159. package/dist/hooks/use-director-fleet-bridge.d.ts +17 -0
  160. package/dist/hooks/use-director-fleet-bridge.d.ts.map +1 -0
  161. package/dist/hooks/use-file-search.d.ts +42 -0
  162. package/dist/hooks/use-file-search.d.ts.map +1 -0
  163. package/dist/hooks/use-input-history-persistence.d.ts +14 -0
  164. package/dist/hooks/use-input-history-persistence.d.ts.map +1 -0
  165. package/dist/hooks/use-mode-picker.d.ts +15 -0
  166. package/dist/hooks/use-mode-picker.d.ts.map +1 -0
  167. package/dist/hooks/use-paste-handling.d.ts +30 -0
  168. package/dist/hooks/use-paste-handling.d.ts.map +1 -0
  169. package/dist/hooks/use-picker-keys.d.ts +58 -0
  170. package/dist/hooks/use-picker-keys.d.ts.map +1 -0
  171. package/dist/hooks/use-prompt-picker.d.ts +28 -0
  172. package/dist/hooks/use-prompt-picker.d.ts.map +1 -0
  173. package/dist/hooks/use-queue-manager.d.ts +26 -0
  174. package/dist/hooks/use-queue-manager.d.ts.map +1 -0
  175. package/dist/hooks/use-statusline-hidden-sync.d.ts +14 -0
  176. package/dist/hooks/use-statusline-hidden-sync.d.ts.map +1 -0
  177. package/dist/hooks/use-statusline-state.d.ts +44 -0
  178. package/dist/hooks/use-statusline-state.d.ts.map +1 -0
  179. package/dist/hooks/use-stream-chip-expiration.d.ts +25 -0
  180. package/dist/hooks/use-stream-chip-expiration.d.ts.map +1 -0
  181. package/dist/hooks/use-subagent-events.d.ts +8 -0
  182. package/dist/hooks/use-subagent-events.d.ts.map +1 -0
  183. package/dist/hooks/use-token-counter-refresh.d.ts +30 -0
  184. package/dist/hooks/use-token-counter-refresh.d.ts.map +1 -0
  185. package/dist/hooks/use-tui-controllers.d.ts +31 -0
  186. package/dist/hooks/use-tui-controllers.d.ts.map +1 -0
  187. package/dist/hooks/use-tui-event-bridge.d.ts +29 -0
  188. package/dist/hooks/use-tui-event-bridge.d.ts.map +1 -0
  189. package/dist/hooks/use-working-dir-chip.d.ts +8 -0
  190. package/dist/hooks/use-working-dir-chip.d.ts.map +1 -0
  191. package/dist/index.d.ts +11 -910
  192. package/dist/index.d.ts.map +1 -0
  193. package/dist/index.js +2633 -2188
  194. package/dist/index.js.map +7 -1
  195. package/dist/ink.d.ts +20 -0
  196. package/dist/ink.d.ts.map +1 -0
  197. package/dist/input-editing.d.ts +76 -0
  198. package/dist/input-editing.d.ts.map +1 -0
  199. package/dist/input-tokens.d.ts +65 -0
  200. package/dist/input-tokens.d.ts.map +1 -0
  201. package/dist/kill-slash.d.ts +3 -0
  202. package/dist/kill-slash.d.ts.map +1 -0
  203. package/dist/markdown-table.d.ts +45 -0
  204. package/dist/markdown-table.d.ts.map +1 -0
  205. package/dist/markdown.d.ts +47 -0
  206. package/dist/markdown.d.ts.map +1 -0
  207. package/dist/mouse.d.ts +73 -0
  208. package/dist/mouse.d.ts.map +1 -0
  209. package/dist/on-panel-open.d.ts +62 -0
  210. package/dist/on-panel-open.d.ts.map +1 -0
  211. package/dist/paste-accumulator.d.ts +19 -0
  212. package/dist/paste-accumulator.d.ts.map +1 -0
  213. package/dist/ps-slash.d.ts +7 -0
  214. package/dist/ps-slash.d.ts.map +1 -0
  215. package/dist/queue-slash.d.ts +24 -0
  216. package/dist/queue-slash.d.ts.map +1 -0
  217. package/dist/reducers/fleet.d.ts +16 -0
  218. package/dist/reducers/fleet.d.ts.map +1 -0
  219. package/dist/reducers/helpers.d.ts +38 -0
  220. package/dist/reducers/helpers.d.ts.map +1 -0
  221. package/dist/rehydrate-history.d.ts +40 -0
  222. package/dist/rehydrate-history.d.ts.map +1 -0
  223. package/dist/run-tui.d.ts +507 -0
  224. package/dist/run-tui.d.ts.map +1 -0
  225. package/dist/slash-command-search.d.ts +10 -0
  226. package/dist/slash-command-search.d.ts.map +1 -0
  227. package/dist/steering-preamble.d.ts +25 -0
  228. package/dist/steering-preamble.d.ts.map +1 -0
  229. package/dist/submit-history.d.ts +17 -0
  230. package/dist/submit-history.d.ts.map +1 -0
  231. package/dist/terminal-title.d.ts +12 -0
  232. package/dist/terminal-title.d.ts.map +1 -0
  233. package/dist/theme.d.ts +91 -0
  234. package/dist/theme.d.ts.map +1 -0
  235. package/dist/thinking-word.d.ts +26 -0
  236. package/dist/thinking-word.d.ts.map +1 -0
  237. package/dist/tool-glyph.d.ts +18 -0
  238. package/dist/tool-glyph.d.ts.map +1 -0
  239. package/package.json +8 -9
@@ -0,0 +1,1801 @@
1
+ import type { AutonomyStage, ContentBlock, DesignKitEntry, TokenSavingTier } from '@wrongstack/core';
2
+ import type { SddBoardSnapshot } from '@wrongstack/sdd';
3
+ import type { AuthCatalogRow, AuthConfirmAction, AuthLocalPresetRow, AuthPanelState, AuthPanelView, AuthProviderRow } from './components/auth-panel-model.js';
4
+ import type { AutonomyOption } from './components/autonomy-picker.js';
5
+ import type { HistoryEntry } from './components/history.js';
6
+ import type { ProviderOption } from './components/model-picker.js';
7
+ import type { HelpEntry } from './components/help-panel.js';
8
+ import type { BrainLogEntry, BrainRiskLevel } from './components/brain-panel.js';
9
+ import type { McpPickerItem } from './components/mcp-picker.js';
10
+ import type { PluginPickerItem } from './components/plugin-picker.js';
11
+ import type { ToolPickerItem } from './components/tools-picker.js';
12
+ import type { ShadowState } from './components/shadow-panel.js';
13
+ import type { ProjectPickerItem } from './components/project-picker.js';
14
+ import type { PromptPickEntry } from './components/prompt-picker.js';
15
+ import type { SendMode } from './components/send-mode-picker.js';
16
+ import type { AuditLevel, CacheTtl, CompactorStrategy, ContextMode, LogLevel, ReasoningEffort, SettingsMode, SettingsPickerPatch, StatuslineMode } from './components/settings-picker.js';
17
+ import type { ChipMeta, StatuslineItem } from './components/statusline-picker.js';
18
+ import type { WorktreeRow } from './components/worktree-panel.js';
19
+ export interface QueueItem {
20
+ id: number;
21
+ displayText: string;
22
+ blocks: ContentBlock[];
23
+ }
24
+ /** Per-subagent state tracked live from the FleetBus. */
25
+ export interface FleetEntry {
26
+ id: string;
27
+ name: string;
28
+ provider?: string | undefined;
29
+ model?: string | undefined;
30
+ status: 'idle' | 'running' | 'success' | 'failed' | 'timeout' | 'stopped';
31
+ streamingText: string;
32
+ iterations: number;
33
+ toolCalls: number;
34
+ recentTools: Array<{
35
+ name: string;
36
+ ok?: boolean | undefined;
37
+ durationMs?: number | undefined;
38
+ outputBytes?: number | undefined;
39
+ outputLines?: number | undefined;
40
+ at: number;
41
+ }>;
42
+ recentMessages: Array<{
43
+ text: string;
44
+ at: number;
45
+ }>;
46
+ cost: number;
47
+ startedAt: number;
48
+ lastEventAt: number;
49
+ /**
50
+ * Tool the subagent is currently inside, set on `tool.started` and
51
+ * cleared on `tool.executed`. Lets the FleetPanel render "running →
52
+ * bash" instead of an opaque "running". Undefined when no tool is
53
+ * mid-flight (between iterations, before the first tool, or after
54
+ * the last tool of a run).
55
+ */
56
+ currentTool?: {
57
+ name: string;
58
+ startedAt: number;
59
+ } | undefined;
60
+ /**
61
+ * Absolute path to the per-subagent JSONL transcript on disk, when
62
+ * one was created. Surfaced so the FleetPanel can render `path:`
63
+ * dim under the entry — users grep / tail the file for full
64
+ * visibility into the subagent's run.
65
+ */
66
+ transcriptPath?: string | undefined;
67
+ /**
68
+ * Most recent budget warning: subagent hit a soft limit and the
69
+ * coordinator is auto-extending. Rendered in FleetPanel as:
70
+ * "⚡ hitting tool_calls limit (350/400) — extending"
71
+ * Cleared on the next fleetDone or fleetStart.
72
+ */
73
+ budgetWarning?: {
74
+ kind: string;
75
+ used: number;
76
+ limit: number;
77
+ at: number;
78
+ } | undefined;
79
+ /**
80
+ * Cumulative auto-extension grants for this subagent. Surfaced as a
81
+ * persistent "⚡×N" badge in the monitor and 4th status line so the user
82
+ * can see how often never-die kept the agent alive. Survives across tasks
83
+ * within the same subagent entry (unlike `budgetWarning`, which clears).
84
+ */
85
+ extensions?: number | undefined;
86
+ /**
87
+ * Latest displayed context window fill percentage (0–1, capped at 1).
88
+ * Emitted on every `iteration.completed` via `ctx.pct` event.
89
+ * Rendered as a colored progress bar in the AgentsMonitor.
90
+ */
91
+ ctxPct?: number | undefined;
92
+ /** Estimated total tokens in the context window (from ctx.pct event). */
93
+ ctxTokens?: number | undefined;
94
+ /** Provider's max context window in tokens (from ctx.pct event). */
95
+ ctxMaxTokens?: number | undefined;
96
+ /**
97
+ * Estimated USD cost of the current context tokens. Derived from
98
+ * ctxTokens × provider-specific input pricing when available.
99
+ * Shown in the agents monitor as a per-agent cost breakdown.
100
+ */
101
+ ctxCost?: number | undefined;
102
+ /**
103
+ * Human-readable reason for terminal failure, when known.
104
+ * E.g. "provider_auth", "rate_limit", "timeout", "budget_iterations".
105
+ * Shown in the Fleet timeline and the per-agent card in the agents monitor.
106
+ */
107
+ failureReason?: string | undefined;
108
+ }
109
+ /** A registered slash command matched against the user's current / query. */
110
+ export interface SlashCommandMatch {
111
+ name: string;
112
+ description: string;
113
+ argsHint?: string | undefined;
114
+ matchedAlias?: string | undefined;
115
+ isBuiltin: boolean;
116
+ category: 'Run' | 'Session' | 'Inspect' | 'Agent' | 'Config' | 'App';
117
+ }
118
+ /** Thin view over a SessionSummary for the resume picker. */
119
+ export interface ResumeSessionEntry {
120
+ id: string;
121
+ title: string;
122
+ startedAt: string;
123
+ endedAt?: string | undefined;
124
+ tokenTotal: number;
125
+ iterationCount: number;
126
+ toolCallCount: number;
127
+ toolErrorCount: number;
128
+ outcome?: 'completed' | 'error' | 'timeout' | 'aborted' | undefined;
129
+ /** The current session — marked so the picker can disallow resuming into itself. */
130
+ isCurrent?: boolean | undefined;
131
+ }
132
+ export type DraftEntry = HistoryEntry extends infer T ? T extends {
133
+ id: number;
134
+ } ? Omit<T, 'id'> : never : never;
135
+ export type GoalSummary = {
136
+ goal: string;
137
+ refinedGoal?: string | undefined;
138
+ goalState: 'active' | 'paused' | 'completed' | 'abandoned';
139
+ iterations: number;
140
+ progress?: number | undefined;
141
+ progressNote?: string | undefined;
142
+ progressTrend?: 'accelerating' | 'steady' | 'stalling' | undefined;
143
+ deliverables?: string[] | undefined;
144
+ lastTask?: string | undefined;
145
+ lastStatus?: string | undefined;
146
+ } | null;
147
+ export type State = {
148
+ entries: HistoryEntry[];
149
+ /**
150
+ * Monotonic generation counter for WHOLESALE history replacements
151
+ * (session resume). Ink's <Static> tracks how many items it has already
152
+ * written by INDEX — replacing `entries` with a shorter array makes it
153
+ * silently skip the replayed entries. The History component keys <Static>
154
+ * on this so a replacement remounts it and the replayed transcript
155
+ * actually prints.
156
+ */
157
+ historyGen: number;
158
+ buffer: string;
159
+ cursor: number;
160
+ streamingText: string;
161
+ /**
162
+ * Live tail of the currently streaming tool's stdout/progress text. Mirrors
163
+ * the assistant `streamingText` pattern but is keyed by tool_use id so the
164
+ * tail is cleared automatically when that tool finishes. Only one tool's
165
+ * stream is shown at a time — multi-tool streaming is rare and stacking
166
+ * tails fights for the same screen space.
167
+ */
168
+ toolStream: {
169
+ toolUseId: string;
170
+ name: string;
171
+ text: string;
172
+ startedAt: number;
173
+ } | null;
174
+ status: 'idle' | 'running' | 'streaming' | 'aborting';
175
+ interrupts: number;
176
+ /**
177
+ * Set when the user pressed Esc mid-iteration to interrupt the agent.
178
+ * The NEXT submitted user message gets a STEERING prefix block prepended
179
+ * so the model sees "I interrupted you on purpose — focus on this
180
+ * instead of resuming the prior task". Cleared once that message
181
+ * lands. Distinct from `interrupts` (which is the Ctrl+C exit ladder).
182
+ */
183
+ steeringPending: boolean;
184
+ /**
185
+ * Context snapshot captured at Esc time, replayed into the STEERING
186
+ * preamble so the model sees exactly what it was mid-doing when the
187
+ * user pulled the cord. Cleared together with `steeringPending`.
188
+ * Without this the model has to guess from chat scrollback which
189
+ * tools were live — and it can't see subagent state at all.
190
+ */
191
+ steerSnapshot: {
192
+ runningTools: string[];
193
+ subagents: Array<{
194
+ label: string;
195
+ status: string;
196
+ tool?: string | undefined;
197
+ }>;
198
+ subagentsTerminated: number;
199
+ partialAssistantText: string;
200
+ } | null;
201
+ hint: string;
202
+ brain: {
203
+ state: 'idle' | 'deciding' | 'answered' | 'ask_human' | 'denied';
204
+ source?: string | undefined;
205
+ risk?: 'low' | 'medium' | 'high' | 'critical' | undefined;
206
+ summary?: string | undefined;
207
+ updatedAt?: number | undefined;
208
+ };
209
+ brainPrompt: {
210
+ requestId: string;
211
+ source: string;
212
+ risk: 'low' | 'medium' | 'high' | 'critical';
213
+ question: string;
214
+ context?: string | undefined;
215
+ options?: Array<{
216
+ id: string;
217
+ label: string;
218
+ risk?: string | undefined;
219
+ consequence?: string | undefined;
220
+ recommended?: boolean | undefined;
221
+ }> | undefined;
222
+ } | null;
223
+ nextId: number;
224
+ picker: {
225
+ open: boolean;
226
+ query: string;
227
+ matches: string[];
228
+ selected: number;
229
+ };
230
+ /** Slash command picker — open while typing a / command. */
231
+ slashPicker: {
232
+ open: boolean;
233
+ query: string;
234
+ matches: SlashCommandMatch[];
235
+ selected: number;
236
+ };
237
+ /** Tool calls currently in-flight, by tool_use id. Surface in the status bar. */
238
+ runningTools: Map<string, {
239
+ name: string;
240
+ startedAt: number;
241
+ }>;
242
+ /** FIFO of user messages typed while the agent was running. Drained when idle. */
243
+ queue: QueueItem[];
244
+ nextQueueId: number;
245
+ /** Previous input strings for up/down navigation. */
246
+ inputHistory: string[];
247
+ /** 0 = current buffer (not in history), 1 = most recent, n = nth most recent. */
248
+ historyIndex: number;
249
+ /**
250
+ * Snapshot of the in-progress draft captured the first time the user
251
+ * presses Up to enter history navigation. Restored when they navigate
252
+ * back down to index 0, so peeking at history no longer discards a
253
+ * half-typed prompt. Empty when not navigating. See historyUp/Down in
254
+ * app-reducer.ts.
255
+ */
256
+ historyDraft: string;
257
+ /** Two-step model picker (provider → model) — opened by `/model`. */
258
+ modelPicker: {
259
+ open: boolean;
260
+ step: 'provider' | 'model';
261
+ providerOptions: ProviderOption[];
262
+ modelOptions: string[];
263
+ /** Filtered list shown in step 2 (same as modelOptions when searchQuery is empty). */
264
+ filteredOptions: string[];
265
+ selected: number;
266
+ pickedProviderId?: string | undefined;
267
+ hint?: string | undefined;
268
+ /** Live search filter in step 2. */
269
+ searchQuery: string;
270
+ };
271
+ /** Single-step autonomy mode picker — opened by `/autonomy`. */
272
+ autonomyPicker: {
273
+ open: boolean;
274
+ options: AutonomyOption[];
275
+ selected: number;
276
+ hint?: string | undefined;
277
+ };
278
+ /** Agent mode picker — opened by `/mode`. Selects teach/brief/code-reviewer/etc. */
279
+ modePicker: {
280
+ open: boolean;
281
+ modes: import('./components/mode-picker.js').ModeOption[];
282
+ selected: number;
283
+ hint?: string | undefined;
284
+ };
285
+ /** Design Studio kit picker — opened by `/design`. */
286
+ designPicker: {
287
+ open: boolean;
288
+ kits: DesignKitEntry[];
289
+ selected: number;
290
+ /** Target stack applied on selection. */
291
+ stack: string;
292
+ };
293
+ /** Prompt library picker — opened by a bare `/prompt`. Browse + category filter + insert. */
294
+ promptPicker: {
295
+ open: boolean;
296
+ all: PromptPickEntry[];
297
+ /** ['all', '🕘 recent'?, '★ favorites'?, ...distinct categories]. */
298
+ categories: string[];
299
+ /** Recently-used slugs (most-recent first) backing the "🕘 recent" view. */
300
+ recentSlugs: string[];
301
+ catIndex: number;
302
+ selected: number;
303
+ };
304
+ /** Session resume picker — opened by `/resume`. Lists recent sessions with metadata. */
305
+ resumePicker: {
306
+ open: boolean;
307
+ sessions: ResumeSessionEntry[];
308
+ selected: number;
309
+ /** True while the resume operation is in flight (fetching + replaying). */
310
+ busy: boolean;
311
+ hint?: string | undefined;
312
+ /** Error message if the resume operation failed. */
313
+ error?: string | undefined;
314
+ };
315
+ /** Settings editor — opened by `/settings` or Ctrl+S. */
316
+ settingsPicker: {
317
+ open: boolean;
318
+ /** Focused row index. */
319
+ field: number;
320
+ /**
321
+ * Mirror of the persisted `Settings.lastSettingsField` — kept in the
322
+ * runtime slice so the reducer can read it during `settingsOpen`
323
+ * without re-loading the full Settings shape, and so the auto-save
324
+ * effect (see app.tsx) can write it back when the user navigates.
325
+ */
326
+ lastSettingsField: number;
327
+ mode: SettingsMode;
328
+ delayMs: number;
329
+ titleAnimation: boolean;
330
+ yolo: boolean;
331
+ streamFleet: boolean;
332
+ chime: boolean;
333
+ confirmExit: boolean;
334
+ nextPrediction: boolean;
335
+ featureMcp: boolean;
336
+ featurePlugins: boolean;
337
+ featureMemory: boolean;
338
+ featureSkills: boolean;
339
+ featureModelsRegistry: boolean;
340
+ tokenSavingTier: TokenSavingTier;
341
+ allowOutsideProjectRoot: boolean;
342
+ contextAutoCompact: boolean;
343
+ contextStrategy: CompactorStrategy;
344
+ contextMode: ContextMode;
345
+ maxConcurrent: number;
346
+ logLevel: LogLevel;
347
+ auditLevel: AuditLevel;
348
+ indexOnStart: boolean;
349
+ /** Multi-file diff summary footer cutoff. 0 = off; positive = min file count. */
350
+ multiDiffSummaryThreshold: number;
351
+ maxIterations: number;
352
+ /** Maximum auto-proceed iterations (0 = unlimited). */
353
+ autoProceedMaxIterations: number;
354
+ /** Prompt refinement preview countdown (ms). */
355
+ enhanceDelayMs: number;
356
+ /** Master toggle for the prompt refiner (mirrors Settings.enhanceEnabled). */
357
+ enhanceEnabled: boolean;
358
+ /** Refined-prompt language preference (mirrors Settings.enhanceLanguage). */
359
+ enhanceLanguage: 'original' | 'english';
360
+ /** Raw SSE stream debugging toggle. */
361
+ debugStream: boolean;
362
+ /** Statusline density mode. */
363
+ statuslineMode: StatuslineMode;
364
+ /** Reasoning mode: auto | on | off. */
365
+ reasoningMode: 'auto' | 'on' | 'off';
366
+ /** Reasoning effort level. */
367
+ reasoningEffort: ReasoningEffort;
368
+ /** Preserve thinking across turns. */
369
+ reasoningPreserve: boolean;
370
+ /** Single word shown in the TUI rainbow working-state chip. */
371
+ thinkingWord: string;
372
+ /** True while free-text editing the thinking word (Enter on its row). */
373
+ thinkingWordEditing: boolean;
374
+ /** In-progress text buffer while `thinkingWordEditing`. */
375
+ thinkingWordDraft: string;
376
+ /** Prompt cache TTL. */
377
+ cacheTtl: CacheTtl;
378
+ /** Where to persist settings: 'global' or 'project'. */
379
+ configScope: 'global' | 'project';
380
+ /**
381
+ * Animation style for the working/thinking chip in the status bar. One
382
+ * of the styles exported by `components/animation-style.tsx`, plus the
383
+ * meta-mode `'cycle'` that rotates through the variant styles every
384
+ * `CYCLE_INTERVAL_SECONDS`. Persisted on every ←/→ change in `/settings`.
385
+ */
386
+ animationStyle: 'rainbow' | 'wave' | 'pulse' | 'dots' | 'breathe' | 'cycle';
387
+ /**
388
+ * Live filter for the row-search modal (entered via `/`). Empty
389
+ * string means filter is inactive. Non-empty means the user is
390
+ * typing a search query and only matching rows are visible.
391
+ * Cleared on picker close and on Esc-out-of-filter.
392
+ */
393
+ filter: string;
394
+ hint?: string | undefined;
395
+ };
396
+ /** Statusline editor — opened by `/statusline`. */
397
+ statuslinePicker: {
398
+ open: boolean;
399
+ /** Focused field index. */
400
+ field: number;
401
+ /** Current hidden-items list (user-toggled off chips). */
402
+ hiddenItems: StatuslineItem[];
403
+ /**
404
+ * Chips that are temporarily visible due to data/events, with expiration
405
+ * metadata. When a chip expires it is removed from this list. User-toggled
406
+ * chips stay visible via their data being truthy — they are NOT here.
407
+ */
408
+ visibleChips: ChipMeta[];
409
+ hint?: string | undefined;
410
+ };
411
+ /** Plugin toggle editor — opened by `/plugin menu` or `/settings plugins`. */
412
+ pluginPicker: {
413
+ open: boolean;
414
+ items: PluginPickerItem[];
415
+ selected: number;
416
+ busy: boolean;
417
+ hint?: string | undefined;
418
+ };
419
+ /** MCP server picker — opened by `/mcp`. */
420
+ mcpPicker: {
421
+ open: boolean;
422
+ items: McpPickerItem[];
423
+ selected: number;
424
+ busy: boolean;
425
+ hint?: string | undefined;
426
+ };
427
+ /** Tool picker — opened by `/tools`. */
428
+ toolsPicker: {
429
+ open: boolean;
430
+ items: ToolPickerItem[];
431
+ selected: number;
432
+ busy: boolean;
433
+ hint?: string | undefined;
434
+ filter?: string | undefined;
435
+ };
436
+ /** Brain panel — opened by `/brain`. */
437
+ brainPanel: {
438
+ open: boolean;
439
+ riskLevel: BrainRiskLevel;
440
+ log: BrainLogEntry[];
441
+ selected: number;
442
+ hint?: string | undefined;
443
+ };
444
+ /** Help panel — opened by `/help`. */
445
+ helpPanel: {
446
+ open: boolean;
447
+ entries: HelpEntry[];
448
+ selected: number;
449
+ filter: string;
450
+ hint?: string | undefined;
451
+ };
452
+ /** Shadow Agent panel — opened by `/shadow`. */
453
+ shadowPanel: {
454
+ open: boolean;
455
+ shadow: ShadowState;
456
+ hint?: string | undefined;
457
+ };
458
+ /** Interactive API-key / OAuth manager — opened by `/auth`. */
459
+ authPanel: AuthPanelState;
460
+ /** Project switcher panel — opened by F1 or `/project`. */
461
+ projectPicker: {
462
+ open: boolean;
463
+ /** Original unfiltered items. Never mutated after open. */
464
+ allItems: ProjectPickerItem[];
465
+ /** Currently displayed items (filtered from allItems). Navigation targets this list. */
466
+ items: ProjectPickerItem[];
467
+ selected: number;
468
+ filter: string;
469
+ hint?: string | undefined;
470
+ };
471
+ /** F-key panel picker — opened by `/f`. Keyboard-navigable list of F1–F12 panels. */
472
+ fKeyPicker: {
473
+ open: boolean;
474
+ selected: number;
475
+ };
476
+ /** Pending tool confirmations — queue to handle multiple tools requesting confirmation. */
477
+ confirmQueue: {
478
+ toolUseId: string;
479
+ toolName: string;
480
+ input: unknown;
481
+ suggestedPattern: string;
482
+ resolve: (decision: 'yes' | 'no' | 'always' | 'deny') => void;
483
+ /** True when the call was classified destructive. */
484
+ destructive: boolean;
485
+ }[];
486
+ /**
487
+ * Active warning for the `!<command>` shell shortcut. It resolves before
488
+ * dispatching to `/dev`, so the existing /dev runner stays the single shell
489
+ * execution path.
490
+ */
491
+ shellCommandWarning: {
492
+ command: string;
493
+ resolve: (decision: 'yes' | 'no' | 'dont-show-again') => void;
494
+ } | null;
495
+ /**
496
+ * Active prompt-refinement ("did you mean this?") panel. Set while the
497
+ * EnhancePanel is shown after the refiner rewrites a user message; the
498
+ * panel resolves to one of refined/original/edit and `submit()` continues.
499
+ * Null when no refinement is pending.
500
+ */
501
+ enhance: {
502
+ original: string;
503
+ /** Refined in the user's original language. */
504
+ refined: string;
505
+ /** Refined in English. */
506
+ english: string;
507
+ resolve: (decision: 'refined' | 'english' | 'original' | 'edit') => void;
508
+ } | null;
509
+ /** When true, free-text submits are run through the prompt refiner first. Toggled by `/enhance`. */
510
+ enhanceEnabled: boolean;
511
+ /** True while the refiner LLM call is in flight (before the panel appears). Drives a "refining…" indicator. */
512
+ enhanceBusy: boolean;
513
+ /**
514
+ * Active bare-"continue" confirmation panel. Set when the user typed a lone
515
+ * "continue"/"devam"/"go on" and the runtime resolved it to a concrete next
516
+ * step. Makes the resolution — and its drift risk — visible before it is
517
+ * sent: a grounded resolution (todo / suggestion) auto-proceeds after a
518
+ * short countdown; an `open` resolution (no queued task, model will pick the
519
+ * step itself) requires an explicit keypress. Resolves to
520
+ * proceed / edit / cancel and `submit()` continues. Null when none pending.
521
+ */
522
+ continueConfirm: {
523
+ /** One-line summary shown in the panel header (e.g. "▶ Continue → todo: …"). */
524
+ label: string;
525
+ /** The full instruction that will be injected in place of "continue". */
526
+ instruction: string;
527
+ /** Where the resolution came from — drives copy + risk styling. */
528
+ source: 'todo' | 'suggestion' | 'open';
529
+ /** True for todo/suggestion (low drift); false for the `open` guess. */
530
+ grounded: boolean;
531
+ resolve: (decision: 'proceed' | 'edit' | 'cancel') => void;
532
+ } | null;
533
+ /**
534
+ * Pending ESC-interrupt confirmation. Null when none is pending.
535
+ * When `confirmExit` is enabled and Esc is pressed mid-iteration, the
536
+ * snapshot is captured and `escConfirm` opens instead of immediately
537
+ * aborting. The prompt shows "Abort work and redirect?"
538
+ * (or similar) and waits for y/n/Esc.
539
+ */
540
+ escConfirm: {
541
+ snapshot: NonNullable<State['steerSnapshot']>;
542
+ } | null;
543
+ /**
544
+ * Mid-run send-mode picker. Set when the user submits a plain message while
545
+ * the agent is busy and `midRunSendPicker` is enabled — the picker asks how
546
+ * to deliver the text (queue / by-the-way / steer). The `resolve` callback
547
+ * is awaited inside `submit()` (same Promise pattern as `enhance`); the
548
+ * caller treats `'cancel'` (Esc) as queue so the typed text is never lost.
549
+ * Null when no picker is pending.
550
+ */
551
+ sendModePicker: {
552
+ selected: number;
553
+ text: string;
554
+ displayText: string;
555
+ blocks: ContentBlock[];
556
+ pasteContent?: string | undefined;
557
+ resolve: (decision: SendMode | 'cancel') => void;
558
+ } | null;
559
+ /** Incremented on /clear so the context chip re-reads from agent.ctx tokens. */
560
+ contextChipVersion: number;
561
+ /** Live fleet state: per-subagent entries from FleetBus events. Keyed by subagentId. */
562
+ fleet: Record<string, FleetEntry>;
563
+ /**
564
+ * Leader-loop activity, synthesized for the AgentsMonitor overlay so the
565
+ * user can see leader iteration / tool counts alongside subagent rows.
566
+ * Driven by EventBus `iteration.started`/`iteration.completed`/`tool.started`/`tool.executed`.
567
+ * Always present; renders as AGENT#0 LEADER in the monitor regardless of
568
+ * whether any subagents exist.
569
+ */
570
+ leader: {
571
+ iterations: number;
572
+ toolCalls: number;
573
+ recentTools: Array<{
574
+ name: string;
575
+ ok?: boolean | undefined;
576
+ durationMs?: number | undefined;
577
+ at: number;
578
+ }>;
579
+ currentTool?: {
580
+ name: string;
581
+ startedAt: number;
582
+ } | undefined;
583
+ startedAt: number;
584
+ lastEventAt: number;
585
+ /** True while inside an iteration (between iteration.started and iteration.completed). */
586
+ iterating: boolean;
587
+ /** Latest displayed context window fill fraction (from ctx.pct event, capped at 1). */
588
+ ctxPct?: number | undefined;
589
+ /** Estimated total tokens in context window. */
590
+ ctxTokens?: number | undefined;
591
+ /** Provider max context in tokens. */
592
+ ctxMaxTokens?: number | undefined;
593
+ };
594
+ /** Fleet-wide accumulated cost. */
595
+ fleetCost: number;
596
+ /** Fleet-wide token totals from the usage aggregator, for the monitor gauge. */
597
+ fleetTokens: {
598
+ input: number;
599
+ output: number;
600
+ };
601
+ /** Live concurrency ceiling — updated by /fleet concurrency and concurrency.changed event. */
602
+ fleetConcurrency: number;
603
+ /**
604
+ * When true, subagent text activity is
605
+ * streamed into the main history with an `AGENT#N` prefix. Toggled
606
+ * with `/fleet stream on|off`. Tool calls stay in the live fleet
607
+ * surfaces so chat history remains readable during multi-agent runs.
608
+ */
609
+ streamFleet: boolean;
610
+ /** When true, the full graphical fleet monitor overlay is shown (Ctrl+F). */
611
+ monitorOpen: boolean;
612
+ /** When true, the agents monitor overlay is shown (Ctrl+G). */
613
+ agentsMonitorOpen: boolean;
614
+ /** When true, the keys-&-commands help overlay is shown (`?` on an empty prompt). */
615
+ helpOpen: boolean;
616
+ /** When true, the todos monitor overlay is shown (F6). */
617
+ todosMonitorOpen: boolean;
618
+ /** When true, the queue panel is shown (F7). */
619
+ queuePanelOpen: boolean;
620
+ /** When true, the process list overlay is shown (F8). */
621
+ processListOpen: boolean;
622
+ /** When true, the audit (side effects) overlay is shown (/audit). */
623
+ auditPanelOpen: boolean;
624
+ /** When true, the plan panel is shown (F5). */
625
+ planPanelOpen: boolean;
626
+ /** When true, the project kanban panel is shown. */
627
+ kanbanPanelOpen: boolean;
628
+ /** When true, the goal panel is shown (F9). */
629
+ goalPanelOpen: boolean;
630
+ /** When true, the sessions panel is shown (F10). */
631
+ sessionsPanelOpen: boolean;
632
+ /** Live session data for the sessions panel (F10). */
633
+ sessionsPanel: {
634
+ sessions: import('./components/sessions-panel.js').LiveSessionEntry[];
635
+ busy: boolean;
636
+ /** Selected index for arrow-key navigation. -1 when nothing selected. */
637
+ selected: number;
638
+ };
639
+ /**
640
+ * Pending session resume confirmation. When set, the F10 panel shows a
641
+ * "Press Enter to confirm resume, Esc to cancel" prompt. Set by the first
642
+ * Enter on a same-project session; the second Enter triggers the actual
643
+ * onResumeSession call.
644
+ */
645
+ sessionResumeConfirm: {
646
+ sessionId: string;
647
+ sessionName: string;
648
+ } | null;
649
+ /**
650
+ * Active or completed collaborative debugging session state.
651
+ * Null when no collab session has run. Tracks counts + the event timeline
652
+ * so FleetMonitor can render a live "COLLAB SESSION" banner and per-event
653
+ * entries (bug.found / refactor.plan / critic.evaluation) as they arrive.
654
+ */
655
+ collabSession: {
656
+ /** Null until the first collab subagent spawns; set on first bug.found. */
657
+ sessionId: string | null;
658
+ bugCount: number;
659
+ planCount: number;
660
+ evalCount: number;
661
+ /** Most recent overall verdict when the session completes. */
662
+ overallVerdict: 'approve' | 'needs_revision' | 'reject' | null;
663
+ /** Timeline of collab events for the FleetMonitor overlay. */
664
+ timeline: Array<{
665
+ at: number;
666
+ icon: string;
667
+ color: string;
668
+ text: string;
669
+ }>;
670
+ startedAt: number | null;
671
+ } | null;
672
+ /** Session checkpoints recorded by SessionWriter.writeCheckpoint() events. */
673
+ checkpoints: Array<{
674
+ promptIndex: number;
675
+ promptPreview: string;
676
+ ts: string;
677
+ fileCount: number;
678
+ }>;
679
+ /** Checkpoint timeline overlay — null when closed. */
680
+ rewindOverlay: {
681
+ checkpoints: Array<{
682
+ promptIndex: number;
683
+ promptPreview: string;
684
+ ts: string;
685
+ fileCount: number;
686
+ }>;
687
+ selected: number;
688
+ } | null;
689
+ /** Live iteration-stage of the active autonomy engine. */
690
+ eternalStage: AutonomyStage | null;
691
+ /** Loaded from .wrongstack/goal.json on mount for startup banner. */
692
+ goalSummary: GoalSummary;
693
+ /** AutoPhase orchestrator state — rendered by PhaseMonitor. */
694
+ autoPhase: {
695
+ /** AutoPhase graph title. */
696
+ title: string;
697
+ /** Per-phase task summary, keyed by phaseId. */
698
+ phases: Record<string, {
699
+ name: string;
700
+ status: string;
701
+ completedTasks: number;
702
+ totalTasks: number;
703
+ startedAt?: number | undefined;
704
+ /** Tasks currently executing in this phase, with the agent on each. */
705
+ activeTasks?: Array<{
706
+ taskId: string;
707
+ title: string;
708
+ agent?: string | undefined;
709
+ }> | undefined;
710
+ }>;
711
+ /** Active phase IDs (running phases). */
712
+ runningPhaseIds: string[];
713
+ /** Elapsed ms since graph start — drives the elapsed counter. */
714
+ elapsedMs: number;
715
+ /** True while the monitor overlay is open (Ctrl+P). */
716
+ monitorOpen: boolean;
717
+ } | null;
718
+ /** Live multi-agent SDD board — latest snapshot + overlay open state (Ctrl+B). */
719
+ sddBoard: {
720
+ snapshot: SddBoardSnapshot;
721
+ monitorOpen: boolean;
722
+ /** Focused topological column index, or undefined for the all-columns view. */
723
+ focusColumn?: number | undefined;
724
+ } | null;
725
+ /** Git-worktree isolation state — rendered by WorktreePanel/WorktreeMonitor. */
726
+ worktrees: Record<string, WorktreeRow & {
727
+ baseBranch?: string | undefined;
728
+ }>;
729
+ /** Base branch worktrees fork from (for the monitor header). */
730
+ worktreeBase?: string | undefined;
731
+ /** True while the worktree monitor overlay is open (Ctrl+T). */
732
+ worktreeMonitorOpen: boolean;
733
+ /**
734
+ * AutonomousCoordinator state — live from `subscribeCoordinatorEvents`.
735
+ * Tracks project-level multi-session coordination: goals, tasks, consensus, and knowledge.
736
+ */
737
+ coordinator: {
738
+ /** Active coordination goals. */
739
+ goals: Array<{
740
+ id: string;
741
+ title: string;
742
+ status: 'active' | 'paused' | 'completed' | 'failed';
743
+ progress?: number | undefined;
744
+ /** DEPRECATED — use tasks instead */
745
+ steps?: string[] | undefined;
746
+ tasks: Array<{
747
+ id: string;
748
+ title: string;
749
+ status: 'pending' | 'running' | 'done' | 'failed';
750
+ assignedTo?: string | undefined;
751
+ }>;
752
+ /** Agents/sessions participating in this goal's coordination. */
753
+ participants: string[];
754
+ }>;
755
+ /** Live pending events for the coordinator panel timeline. */
756
+ timeline: Array<{
757
+ at: number;
758
+ kind: 'goal' | 'task' | 'knowledge' | 'consensus' | 'deadlock';
759
+ icon: string;
760
+ text: string;
761
+ }>;
762
+ /** Count of shared knowledge facts across all sessions. */
763
+ knowledgeCount: number;
764
+ /** True while the coordinator monitor overlay is open. */
765
+ monitorOpen: boolean;
766
+ /** Coordinator health: true when connected and processing events. */
767
+ healthy: boolean;
768
+ };
769
+ /**
770
+ * In-app chat scroll state for the scrollable viewport.
771
+ * In the default `<Static>` path these are inert.
772
+ * scrollOffset — rows scrolled up from the bottom; 0 = pinned to newest.
773
+ * totalLines — last measured content height (rows), from onMeasure.
774
+ * viewportRows — last computed viewport height (rows).
775
+ * pendingNewLines — rows added while scrolled up; drives the "↓ N new" hint.
776
+ */
777
+ scrollOffset: number;
778
+ totalLines: number;
779
+ viewportRows: number;
780
+ pendingNewLines: number;
781
+ /**
782
+ * Live debug-stream telemetry rendered in StatusBar line 3 when
783
+ * stream debugging is active. Updated every ~200 ms by the throttled
784
+ * callback from stream-debug-state.ts. Null when disabled or idle.
785
+ */
786
+ debugStreamStats: {
787
+ chunkCount: number;
788
+ lastChunkSize: number;
789
+ lastDeltaMs: number;
790
+ totalBytes: number;
791
+ lastChunkAt: string;
792
+ } | null;
793
+ /**
794
+ * Auto-proceed countdown state, driven by `countdown.tick` events from
795
+ * the host. null when no countdown is active. A tick of 0 clears it.
796
+ */
797
+ countdown: {
798
+ /** Remaining seconds until auto-proceed fires. */
799
+ remainingSeconds: number;
800
+ } | null;
801
+ };
802
+ export type Settings = {
803
+ mode: 'off' | 'suggest' | 'auto';
804
+ delayMs: number;
805
+ titleAnimation: boolean;
806
+ yolo: boolean;
807
+ streamFleet: boolean;
808
+ chime: boolean;
809
+ confirmExit: boolean;
810
+ nextPrediction: boolean;
811
+ featureMcp: boolean;
812
+ featurePlugins: boolean;
813
+ featureMemory: boolean;
814
+ featureSkills: boolean;
815
+ featureModelsRegistry: boolean;
816
+ /** Token-saving tier: off | minimal | light | medium | aggressive. */
817
+ featureTokenSaving: TokenSavingTier;
818
+ /** Allow tools to access paths outside the project root. Default: true (open). */
819
+ allowOutsideProjectRoot: boolean;
820
+ contextAutoCompact: boolean;
821
+ contextStrategy: 'hybrid' | 'intelligent' | 'selective';
822
+ contextMode: ContextMode;
823
+ maxConcurrent: number;
824
+ logLevel: 'error' | 'warn' | 'info' | 'debug' | 'trace';
825
+ auditLevel: 'minimal' | 'standard' | 'full';
826
+ indexOnStart: boolean;
827
+ /** Multi-file diff summary footer cutoff. 0 = off; positive = min file count. */
828
+ multiDiffSummaryThreshold: number;
829
+ /**
830
+ * Settings-picker row the user last navigated to. Carried in the
831
+ * canonical Settings shape so reopening the picker after a session
832
+ * restart lands on the same row they were last tweaking, rather than
833
+ * always resetting to 0. Updated on every `settingsFieldMove` /
834
+ * `settingsFieldSet`; consumed by the `settingsOpen` action.
835
+ */
836
+ lastSettingsField: number;
837
+ maxIterations: number;
838
+ /** Maximum auto-proceed iterations (0 = unlimited). */
839
+ autoProceedMaxIterations: number;
840
+ /** Prompt refinement preview countdown (ms). */
841
+ enhanceDelayMs: number;
842
+ /** Enable/disable prompt refinement. */
843
+ enhanceEnabled: boolean;
844
+ /** Default language for refinement: original or english. */
845
+ enhanceLanguage: 'original' | 'english';
846
+ /**
847
+ * When true (default), submitting a plain message while the agent is busy
848
+ * pops the send-mode picker (queue / by-the-way / steer). Toggled via
849
+ * `/queue picker on|off`; persisted to `autonomy.midRunSendPicker`.
850
+ */
851
+ midRunSendPicker?: boolean | undefined;
852
+ /** Raw SSE stream debugging — hex-dump every byte received from providers. */
853
+ debugStream: boolean;
854
+ /** Skip the confirmation prompt for the `!<command>` shell shortcut. */
855
+ shellBangWarningDontShowAgain?: boolean | undefined;
856
+ /** Statusline density mode. Defaults to detailed. */
857
+ statuslineMode: StatuslineMode;
858
+ /** Reasoning mode: auto (provider default) | on | off. */
859
+ reasoningMode: 'auto' | 'on' | 'off';
860
+ /** Reasoning effort level. */
861
+ reasoningEffort: ReasoningEffort;
862
+ /** Preserve thinking across turns. */
863
+ reasoningPreserve: boolean;
864
+ /** Single word shown in the TUI rainbow working-state chip. */
865
+ thinkingWord: string;
866
+ /** Prompt cache TTL. */
867
+ cacheTtl: CacheTtl;
868
+ /** Where to persist settings: 'global' or 'project'. */
869
+ configScope: 'global' | 'project';
870
+ /**
871
+ * Animation style for the working/thinking chip in the status bar. One of
872
+ * the renderable styles plus the meta-mode `'cycle'` that rotates through
873
+ * the variant styles every `CYCLE_INTERVAL_SECONDS`.
874
+ */
875
+ animationStyle: 'rainbow' | 'wave' | 'pulse' | 'dots' | 'breathe' | 'cycle';
876
+ /** Full mouse mode: in-app managed scroll + clickable UI (SGR tracking on). */
877
+ mouseMode?: boolean | undefined;
878
+ /** Whether the process circuit breaker gates bash/exec. Default false (off). */
879
+ breakerEnabled?: boolean | undefined;
880
+ /** Auto kill/reset delay (ms) when the breaker trips. 0 = manual recovery. */
881
+ breakerAutoKillResetMs?: number | undefined;
882
+ };
883
+ export type Action = {
884
+ type: 'addEntry';
885
+ entry: DraftEntry;
886
+ } | {
887
+ type: 'setBuffer';
888
+ buffer: string;
889
+ cursor: number;
890
+ } | {
891
+ type: 'clearInput';
892
+ } | {
893
+ type: 'clearHistory';
894
+ } | {
895
+ type: 'streamDelta';
896
+ delta: string;
897
+ } | {
898
+ type: 'streamReset';
899
+ } | {
900
+ type: 'status';
901
+ status: State['status'];
902
+ } | {
903
+ type: 'interrupt';
904
+ } | {
905
+ type: 'resetInterrupts';
906
+ }
907
+ /**
908
+ * User pressed Esc mid-iteration — flag the next message for steering
909
+ * AND stash a context snapshot so the preamble can tell the model
910
+ * exactly what it was doing.
911
+ */
912
+ | {
913
+ type: 'steerStart';
914
+ snapshot: State['steerSnapshot'];
915
+ }
916
+ /** Submit handler consumed the steering flag; reset. */
917
+ | {
918
+ type: 'steerConsume';
919
+ } | {
920
+ type: 'hint';
921
+ text: string;
922
+ } | {
923
+ type: 'brainStatus';
924
+ state: State['brain']['state'];
925
+ source?: string | undefined;
926
+ risk?: State['brain']['risk'] | undefined;
927
+ summary?: string | undefined;
928
+ } | {
929
+ type: 'brainPromptSet';
930
+ prompt: NonNullable<State['brainPrompt']>;
931
+ } | {
932
+ type: 'brainPromptClear';
933
+ } | {
934
+ type: 'pickerOpen';
935
+ query: string;
936
+ } | {
937
+ type: 'pickerClose';
938
+ } | {
939
+ type: 'pickerSetMatches';
940
+ query: string;
941
+ matches: string[];
942
+ } | {
943
+ type: 'pickerMove';
944
+ delta: number;
945
+ } | {
946
+ type: 'toolStarted';
947
+ id: string;
948
+ name: string;
949
+ } | {
950
+ type: 'toolEnded';
951
+ id?: string | undefined;
952
+ name?: string | undefined;
953
+ } | {
954
+ type: 'toolStreamAppend';
955
+ toolUseId: string;
956
+ name: string;
957
+ text: string;
958
+ startedAt: number;
959
+ } | {
960
+ type: 'toolStreamClear';
961
+ toolUseId?: string | undefined;
962
+ name?: string | undefined;
963
+ } | {
964
+ type: 'enqueue';
965
+ item: Omit<QueueItem, 'id'>;
966
+ } | {
967
+ type: 'dequeueFirst';
968
+ } | {
969
+ type: 'queueClear';
970
+ } | {
971
+ type: 'queueDelete';
972
+ positions: number[];
973
+ } | {
974
+ type: 'slashPickerOpen';
975
+ query: string;
976
+ matches: SlashCommandMatch[];
977
+ } | {
978
+ type: 'slashPickerClose';
979
+ } | {
980
+ type: 'slashPickerMove';
981
+ delta: number;
982
+ } | {
983
+ type: 'modelPickerOpen';
984
+ providers: ProviderOption[];
985
+ } | {
986
+ type: 'modelPickerClose';
987
+ } | {
988
+ type: 'modelPickerMove';
989
+ delta: number;
990
+ } | {
991
+ type: 'modelPickerPickProvider';
992
+ providerId: string;
993
+ models: string[];
994
+ } | {
995
+ type: 'modelPickerBack';
996
+ } | {
997
+ type: 'modelPickerHint';
998
+ text?: string | undefined;
999
+ }
1000
+ /** Update the search filter in step 2. */
1001
+ | {
1002
+ type: 'modelPickerSearch';
1003
+ query: string;
1004
+ } | {
1005
+ type: 'autonomyPickerOpen';
1006
+ options: AutonomyOption[];
1007
+ } | {
1008
+ type: 'autonomyPickerClose';
1009
+ } | {
1010
+ type: 'autonomyPickerMove';
1011
+ delta: number;
1012
+ } | {
1013
+ type: 'autonomyPickerHint';
1014
+ text?: string | undefined;
1015
+ } | {
1016
+ type: 'modePickerOpen';
1017
+ modes: import('./components/mode-picker.js').ModeOption[];
1018
+ } | {
1019
+ type: 'modePickerClose';
1020
+ } | {
1021
+ type: 'modePickerMove';
1022
+ delta: number;
1023
+ } | {
1024
+ type: 'modePickerHint';
1025
+ text?: string | undefined;
1026
+ } | {
1027
+ type: 'designPickerOpen';
1028
+ kits: DesignKitEntry[];
1029
+ } | {
1030
+ type: 'designPickerClose';
1031
+ } | {
1032
+ type: 'designPickerMove';
1033
+ delta: number;
1034
+ } | {
1035
+ type: 'designPickerStack';
1036
+ stack: string;
1037
+ } | {
1038
+ type: 'promptPickerOpen';
1039
+ all: PromptPickEntry[];
1040
+ categories: string[];
1041
+ recentSlugs: string[];
1042
+ } | {
1043
+ type: 'promptPickerClose';
1044
+ } | {
1045
+ type: 'promptPickerMove';
1046
+ delta: number;
1047
+ } | {
1048
+ type: 'promptPickerCategory';
1049
+ delta: number;
1050
+ } | {
1051
+ type: 'resumePickerOpen';
1052
+ sessions: ResumeSessionEntry[];
1053
+ } | {
1054
+ type: 'resumePickerClose';
1055
+ } | {
1056
+ type: 'resumePickerMove';
1057
+ delta: number;
1058
+ } | {
1059
+ type: 'resumePickerBusy';
1060
+ on: boolean;
1061
+ } | {
1062
+ type: 'resumePickerHint';
1063
+ text?: string | undefined;
1064
+ } | {
1065
+ type: 'resumePickerError';
1066
+ text: string;
1067
+ }
1068
+ /** Replace all history entries with the given hydrated entries from a resumed session. */
1069
+ | {
1070
+ type: 'replaceHistory';
1071
+ entries: HistoryEntry[];
1072
+ nextId: number;
1073
+ } | {
1074
+ type: 'settingsOpen';
1075
+ mode: SettingsMode;
1076
+ delayMs: number;
1077
+ titleAnimation: boolean;
1078
+ yolo: boolean;
1079
+ streamFleet: boolean;
1080
+ chime: boolean;
1081
+ confirmExit: boolean;
1082
+ nextPrediction: boolean;
1083
+ featureMcp: boolean;
1084
+ featurePlugins: boolean;
1085
+ featureMemory: boolean;
1086
+ featureSkills: boolean;
1087
+ featureModelsRegistry: boolean;
1088
+ tokenSavingTier: TokenSavingTier;
1089
+ allowOutsideProjectRoot: boolean;
1090
+ contextAutoCompact: boolean;
1091
+ contextStrategy: CompactorStrategy;
1092
+ contextMode: ContextMode;
1093
+ maxConcurrent: number;
1094
+ logLevel: LogLevel;
1095
+ auditLevel: AuditLevel;
1096
+ indexOnStart: boolean;
1097
+ multiDiffSummaryThreshold: number;
1098
+ /**
1099
+ * Animation style for the working/thinking chip in the status bar.
1100
+ * One of the renderable styles plus the meta-mode `'cycle'`. Persisted
1101
+ * to disk on every ←/→ change in `/settings`.
1102
+ */
1103
+ animationStyle: 'rainbow' | 'wave' | 'pulse' | 'dots' | 'breathe' | 'cycle';
1104
+ /**
1105
+ * Persisted row index for where to land when the picker reopens.
1106
+ * See `Settings.lastSettingsField`.
1107
+ */
1108
+ lastSettingsField: number;
1109
+ maxIterations: number;
1110
+ autoProceedMaxIterations: number;
1111
+ enhanceDelayMs: number;
1112
+ enhanceEnabled: boolean;
1113
+ enhanceLanguage: 'original' | 'english';
1114
+ debugStream: boolean;
1115
+ statuslineMode: StatuslineMode;
1116
+ reasoningMode: 'auto' | 'on' | 'off';
1117
+ reasoningEffort: ReasoningEffort;
1118
+ reasoningPreserve: boolean;
1119
+ thinkingWord: string;
1120
+ cacheTtl: CacheTtl;
1121
+ configScope: 'global' | 'project';
1122
+ } | {
1123
+ type: 'settingsClose';
1124
+ } | {
1125
+ type: 'settingsFieldMove';
1126
+ delta: number;
1127
+ } | {
1128
+ type: 'settingsFieldSet';
1129
+ field: number;
1130
+ } | {
1131
+ type: 'settingsValueChange';
1132
+ delta: number;
1133
+ }
1134
+ /**
1135
+ * Set a settings value directly from a typed patch (used by the
1136
+ * `/settings <chord> <value>` slash command). The patch is produced
1137
+ * by `resolveSettingsFieldValue` in settings-picker.tsx and validated
1138
+ * before dispatch, so the reducer just spreads it.
1139
+ */
1140
+ | {
1141
+ type: 'settingsValueSet';
1142
+ patch: SettingsPickerPatch;
1143
+ }
1144
+ /**
1145
+ * Update the live row-search filter. Empty string clears the filter.
1146
+ * Setting any non-empty value while the filter is empty also implicitly
1147
+ * activates filter mode (the picker renders only matching rows).
1148
+ */
1149
+ | {
1150
+ type: 'settingsFilterSet';
1151
+ filter: string;
1152
+ } | {
1153
+ type: 'settingsHint';
1154
+ text?: string | undefined;
1155
+ }
1156
+ /** Begin free-text editing of the thinking word (Enter on its row). */
1157
+ | {
1158
+ type: 'settingsThinkingEditStart';
1159
+ }
1160
+ /** Replace the in-progress thinking-word draft with the given buffer. */
1161
+ | {
1162
+ type: 'settingsThinkingEditChange';
1163
+ draft: string;
1164
+ }
1165
+ /** Commit the draft as the new thinking word (validated in the reducer). */
1166
+ | {
1167
+ type: 'settingsThinkingEditCommit';
1168
+ }
1169
+ /** Discard the draft and leave edit mode without changing the word. */
1170
+ | {
1171
+ type: 'settingsThinkingEditCancel';
1172
+ } | {
1173
+ type: 'statuslineOpen';
1174
+ hiddenItems: StatuslineItem[];
1175
+ } | {
1176
+ type: 'statuslineClose';
1177
+ } | {
1178
+ type: 'statuslineFieldMove';
1179
+ delta: number;
1180
+ } | {
1181
+ type: 'statuslineFieldSet';
1182
+ field: number;
1183
+ } | {
1184
+ type: 'statuslineToggle';
1185
+ item: StatuslineItem;
1186
+ } | {
1187
+ type: 'statuslineHint';
1188
+ text?: string | undefined;
1189
+ }
1190
+ /**
1191
+ * A chip became visible due to data arriving (e.g., brain decision made,
1192
+ * mailbox messages arrived). Adds it to visibleChips with optional expiration.
1193
+ * If the chip is already in visibleChips, resets its shownAt timestamp.
1194
+ */
1195
+ | {
1196
+ type: 'statuslineChipShow';
1197
+ key: StatuslineItem;
1198
+ expiresIn?: number;
1199
+ }
1200
+ /**
1201
+ * Immediately remove a chip from visibleChips. Used when a stream ends
1202
+ * (brain, mailbox, enhance, debug_stream) so it disappears right away
1203
+ * even if it hasn't expired yet.
1204
+ */
1205
+ | {
1206
+ type: 'statuslineChipExpire';
1207
+ key: StatuslineItem;
1208
+ }
1209
+ /**
1210
+ * Sync visibleChips from the parent (e.g., after /statusline reset).
1211
+ * Replaces the entire visibleChips array.
1212
+ */
1213
+ | {
1214
+ type: 'statuslineVisibleChipsSync';
1215
+ visibleChips: ChipMeta[];
1216
+ } | {
1217
+ type: 'pluginPickerOpen';
1218
+ items?: PluginPickerItem[] | undefined;
1219
+ } | {
1220
+ type: 'pluginPickerClose';
1221
+ } | {
1222
+ type: 'pluginPickerMove';
1223
+ delta: number;
1224
+ } | {
1225
+ type: 'pluginPickerSetItems';
1226
+ items: PluginPickerItem[];
1227
+ } | {
1228
+ type: 'pluginPickerBusy';
1229
+ busy: boolean;
1230
+ } | {
1231
+ type: 'pluginPickerHint';
1232
+ text?: string | undefined;
1233
+ } | {
1234
+ type: 'mcpPickerOpen';
1235
+ items?: McpPickerItem[] | undefined;
1236
+ } | {
1237
+ type: 'mcpPickerClose';
1238
+ } | {
1239
+ type: 'mcpPickerMove';
1240
+ delta: number;
1241
+ } | {
1242
+ type: 'mcpPickerSetItems';
1243
+ items: McpPickerItem[];
1244
+ } | {
1245
+ type: 'mcpPickerBusy';
1246
+ busy: boolean;
1247
+ } | {
1248
+ type: 'mcpPickerHint';
1249
+ text?: string | undefined;
1250
+ } | {
1251
+ type: 'toolsPickerOpen';
1252
+ items?: ToolPickerItem[] | undefined;
1253
+ } | {
1254
+ type: 'toolsPickerClose';
1255
+ } | {
1256
+ type: 'toolsPickerMove';
1257
+ delta: number;
1258
+ } | {
1259
+ type: 'toolsPickerSetItems';
1260
+ items: ToolPickerItem[];
1261
+ } | {
1262
+ type: 'toolsPickerToggle';
1263
+ } | {
1264
+ type: 'toolsPickerBusy';
1265
+ busy: boolean;
1266
+ } | {
1267
+ type: 'toolsPickerHint';
1268
+ text?: string | undefined;
1269
+ } | {
1270
+ type: 'toolsPickerFilter';
1271
+ filter: string;
1272
+ } | {
1273
+ type: 'brainOpen';
1274
+ riskLevel: BrainRiskLevel;
1275
+ log: BrainLogEntry[];
1276
+ } | {
1277
+ type: 'brainClose';
1278
+ } | {
1279
+ type: 'brainMove';
1280
+ delta: number;
1281
+ } | {
1282
+ type: 'brainRiskChange';
1283
+ delta: number;
1284
+ } | {
1285
+ type: 'brainSetLog';
1286
+ log: BrainLogEntry[];
1287
+ } | {
1288
+ type: 'brainHint';
1289
+ text?: string | undefined;
1290
+ } | {
1291
+ type: 'helpOpen';
1292
+ entries: HelpEntry[];
1293
+ } | {
1294
+ type: 'helpClose';
1295
+ } | {
1296
+ type: 'helpMove';
1297
+ delta: number;
1298
+ } | {
1299
+ type: 'helpFilter';
1300
+ filter: string;
1301
+ } | {
1302
+ type: 'helpHint';
1303
+ text?: string | undefined;
1304
+ } | {
1305
+ type: 'shadowOpen';
1306
+ shadow: ShadowState;
1307
+ } | {
1308
+ type: 'shadowClose';
1309
+ } | {
1310
+ type: 'shadowUpdate';
1311
+ shadow: ShadowState;
1312
+ } | {
1313
+ type: 'shadowHint';
1314
+ text?: string | undefined;
1315
+ } | {
1316
+ type: 'authOpen';
1317
+ view?: Extract<AuthPanelView, 'list' | 'oauth'> | undefined;
1318
+ providers?: AuthProviderRow[] | undefined;
1319
+ presets?: AuthLocalPresetRow[] | undefined;
1320
+ } | {
1321
+ type: 'authClose';
1322
+ } | {
1323
+ type: 'authProviders';
1324
+ providers: AuthProviderRow[];
1325
+ } | {
1326
+ type: 'authCatalog';
1327
+ catalog: AuthCatalogRow[];
1328
+ } | {
1329
+ type: 'authView';
1330
+ view: AuthPanelView;
1331
+ providerId?: string | undefined;
1332
+ } | {
1333
+ type: 'authMove';
1334
+ delta: number;
1335
+ } | {
1336
+ type: 'authBusy';
1337
+ busy: boolean;
1338
+ } | {
1339
+ type: 'authHint';
1340
+ text?: string | undefined;
1341
+ } | {
1342
+ type: 'authFilter';
1343
+ filter: string;
1344
+ } | {
1345
+ type: 'authFlowStart';
1346
+ title: string;
1347
+ } | {
1348
+ type: 'authFlowLog';
1349
+ line: string;
1350
+ } | {
1351
+ type: 'authFlowDone';
1352
+ ok: boolean;
1353
+ message?: string | undefined;
1354
+ } | {
1355
+ type: 'authPromptStart';
1356
+ label: string;
1357
+ masked: boolean;
1358
+ } | {
1359
+ type: 'authPromptChange';
1360
+ draft: string;
1361
+ } | {
1362
+ type: 'authPromptEnd';
1363
+ } | {
1364
+ type: 'authConfirmStart';
1365
+ question: string;
1366
+ action: AuthConfirmAction;
1367
+ } | {
1368
+ type: 'authConfirmEnd';
1369
+ } | {
1370
+ type: 'projectPickerOpen';
1371
+ items: ProjectPickerItem[];
1372
+ } | {
1373
+ type: 'projectPickerClose';
1374
+ } | {
1375
+ type: 'projectPickerMove';
1376
+ delta: number;
1377
+ } | {
1378
+ type: 'projectPickerFilter';
1379
+ filter: string;
1380
+ } | {
1381
+ type: 'projectPickerHint';
1382
+ text?: string | undefined;
1383
+ } | {
1384
+ type: 'fKeyPickerOpen';
1385
+ } | {
1386
+ type: 'fKeyPickerClose';
1387
+ } | {
1388
+ type: 'fKeyPickerMove';
1389
+ delta: number;
1390
+ } | {
1391
+ type: 'historyPush';
1392
+ text: string;
1393
+ } | {
1394
+ type: 'historyUp';
1395
+ } | {
1396
+ type: 'historyDown';
1397
+ } | {
1398
+ type: 'setInputHistory';
1399
+ entries: string[];
1400
+ } | {
1401
+ type: 'clearInputHistory';
1402
+ } | {
1403
+ type: 'confirmOpen';
1404
+ info: State['confirmQueue'][0];
1405
+ } | {
1406
+ type: 'confirmClose';
1407
+ } | {
1408
+ type: 'confirmClearAll';
1409
+ } | {
1410
+ type: 'shellCommandWarningOpen';
1411
+ info: NonNullable<State['shellCommandWarning']>;
1412
+ } | {
1413
+ type: 'shellCommandWarningClose';
1414
+ } | {
1415
+ type: 'enhanceOpen';
1416
+ info: NonNullable<State['enhance']>;
1417
+ } | {
1418
+ type: 'enhanceClose';
1419
+ } | {
1420
+ type: 'enhanceSet';
1421
+ enabled: boolean;
1422
+ } | {
1423
+ type: 'enhanceBusy';
1424
+ on: boolean;
1425
+ } | {
1426
+ type: 'continueConfirmOpen';
1427
+ info: NonNullable<State['continueConfirm']>;
1428
+ } | {
1429
+ type: 'continueConfirmClose';
1430
+ }
1431
+ /**
1432
+ * Open the ESC-interrupt confirmation dialog with a context snapshot.
1433
+ * Fired when Esc is pressed mid-iteration and `confirmExit` is enabled.
1434
+ * The snapshot is replayed into `steerStart` on confirmation so the
1435
+ * STEERING preamble can describe the interrupted state to the LLM.
1436
+ */
1437
+ | {
1438
+ type: 'escConfirmOpen';
1439
+ snapshot: NonNullable<State['steerSnapshot']>;
1440
+ }
1441
+ /** Dismiss the ESC-interrupt confirmation (user cancelled). */
1442
+ | {
1443
+ type: 'escConfirmClose';
1444
+ }
1445
+ /** Open the mid-run send-mode picker with the resolved message + resolver. */
1446
+ | {
1447
+ type: 'sendModePickerOpen';
1448
+ info: NonNullable<State['sendModePicker']>;
1449
+ }
1450
+ /** Move the send-mode highlight (wraps). */
1451
+ | {
1452
+ type: 'sendModePickerMove';
1453
+ delta: number;
1454
+ }
1455
+ /** Close the send-mode picker. */
1456
+ | {
1457
+ type: 'sendModePickerClose';
1458
+ } | {
1459
+ type: 'resetContextChip';
1460
+ } | {
1461
+ type: 'fleetSeed';
1462
+ entries: FleetEntry[];
1463
+ cost: number;
1464
+ } | {
1465
+ type: 'fleetSpawn';
1466
+ id: string;
1467
+ name?: string | undefined;
1468
+ provider?: string | undefined;
1469
+ model?: string | undefined;
1470
+ transcriptPath?: string | undefined;
1471
+ } | {
1472
+ type: 'fleetStart';
1473
+ id: string;
1474
+ taskId?: string | undefined;
1475
+ } | {
1476
+ type: 'fleetDelta';
1477
+ id: string;
1478
+ text: string;
1479
+ } | {
1480
+ type: 'fleetMessage';
1481
+ id: string;
1482
+ text: string;
1483
+ } | {
1484
+ type: 'fleetTool';
1485
+ id: string;
1486
+ name?: string | undefined;
1487
+ ok?: boolean | undefined;
1488
+ durationMs?: number | undefined;
1489
+ outputBytes?: number | undefined;
1490
+ outputLines?: number | undefined;
1491
+ }
1492
+ /** tool.started: pin the current tool name for status display. */
1493
+ | {
1494
+ type: 'fleetToolStart';
1495
+ id: string;
1496
+ name: string;
1497
+ }
1498
+ /** tool.executed: clear the current tool (paired with fleetTool). */
1499
+ | {
1500
+ type: 'fleetToolEnd';
1501
+ id: string;
1502
+ } | {
1503
+ type: 'fleetUsage';
1504
+ id: string;
1505
+ input: number;
1506
+ output: number;
1507
+ cacheRead: number;
1508
+ cacheWrite: number;
1509
+ } | {
1510
+ type: 'fleetDone';
1511
+ id: string;
1512
+ status: FleetEntry['status'];
1513
+ iterations: number;
1514
+ toolCalls: number;
1515
+ /** Human-readable failure reason, e.g. "provider_auth", "rate_limit", "timeout". */
1516
+ failureReason?: string | undefined;
1517
+ } | {
1518
+ type: 'fleetRemove';
1519
+ id: string;
1520
+ } | {
1521
+ type: 'fleetBudgetWarning';
1522
+ id: string;
1523
+ kind: string;
1524
+ used: number;
1525
+ limit: number;
1526
+ } | {
1527
+ type: 'fleetBudgetExtended';
1528
+ id: string;
1529
+ totalExtensions: number;
1530
+ } | {
1531
+ type: 'fleetCtxPct';
1532
+ id: string;
1533
+ load: number;
1534
+ tokens: number;
1535
+ maxContext: number;
1536
+ /** Estimated USD cost of the context tokens (optional — computed when pricing known). */
1537
+ ctxCost?: number | undefined;
1538
+ } | {
1539
+ type: 'fleetCost';
1540
+ cost: number;
1541
+ input?: number | undefined;
1542
+ output?: number | undefined;
1543
+ /** Per-subagent usage keyed by subagent id (from the director snapshot). */
1544
+ perAgent?: Record<string, {
1545
+ cost: number;
1546
+ }>;
1547
+ }
1548
+ /** Runtime concurrency ceiling change from CLI /fleet concurrency <n>. */
1549
+ | {
1550
+ type: 'fleetConcurrency';
1551
+ n: number;
1552
+ } | {
1553
+ type: 'leaderIterStart';
1554
+ } | {
1555
+ type: 'leaderIterEnd';
1556
+ } | {
1557
+ type: 'leaderToolStart';
1558
+ name: string;
1559
+ } | {
1560
+ type: 'leaderToolEnd';
1561
+ name: string;
1562
+ ok?: boolean | undefined;
1563
+ durationMs?: number | undefined;
1564
+ } | {
1565
+ type: 'leaderCtxPct';
1566
+ load: number;
1567
+ tokens: number;
1568
+ maxContext: number;
1569
+ } | {
1570
+ type: 'setStreamFleet';
1571
+ enabled: boolean;
1572
+ } | {
1573
+ type: 'toggleMonitor';
1574
+ } | {
1575
+ type: 'toggleAgentsMonitor';
1576
+ } | {
1577
+ type: 'toggleHelp';
1578
+ } | {
1579
+ type: 'toggleTodosMonitor';
1580
+ } | {
1581
+ type: 'toggleQueuePanel';
1582
+ } | {
1583
+ type: 'checkpointReceived';
1584
+ cp: State['checkpoints'][0];
1585
+ } | {
1586
+ type: 'rewindOverlayOpen';
1587
+ } | {
1588
+ type: 'rewindOverlayClose';
1589
+ } | {
1590
+ type: 'rewindOverlayMove';
1591
+ delta: number;
1592
+ } | {
1593
+ type: 'sessionRewound';
1594
+ toPromptIndex: number;
1595
+ } | {
1596
+ type: 'eternalStage';
1597
+ stage: AutonomyStage;
1598
+ } | {
1599
+ type: 'goalSummary';
1600
+ summary: GoalSummary;
1601
+ } | {
1602
+ type: 'autoPhaseInit';
1603
+ title: string;
1604
+ } | {
1605
+ type: 'autoPhasePhaseUpdate';
1606
+ phaseId: string;
1607
+ name: string;
1608
+ status: string;
1609
+ completedTasks: number;
1610
+ totalTasks: number;
1611
+ startedAt?: number | undefined;
1612
+ } | {
1613
+ type: 'autoPhaseRunningPhases';
1614
+ phaseIds: string[];
1615
+ } | {
1616
+ type: 'autoPhaseElapsed';
1617
+ ms: number;
1618
+ } | {
1619
+ type: 'autoPhaseTaskActive';
1620
+ phaseId: string;
1621
+ taskId: string;
1622
+ title: string;
1623
+ agent?: string | undefined;
1624
+ /** True when the task starts, false when it completes/fails. */
1625
+ active: boolean;
1626
+ } | {
1627
+ type: 'autoPhaseMonitorToggle';
1628
+ } | {
1629
+ type: 'autoPhaseReset';
1630
+ } | {
1631
+ type: 'sddBoardSnapshot';
1632
+ snapshot: SddBoardSnapshot;
1633
+ } | {
1634
+ type: 'toggleSddBoardMonitor';
1635
+ } | {
1636
+ type: 'sddBoardFocusNext';
1637
+ } | {
1638
+ type: 'sddBoardFocusPrev';
1639
+ } | {
1640
+ type: 'worktreeUpsert';
1641
+ handleId: string;
1642
+ row: Partial<WorktreeRow & {
1643
+ baseBranch?: string | undefined;
1644
+ }>;
1645
+ baseBranch?: string | undefined;
1646
+ } | {
1647
+ type: 'worktreeRemove';
1648
+ handleId: string;
1649
+ } | {
1650
+ type: 'worktreeMonitorToggle';
1651
+ }
1652
+ /** Scroll by `delta` rows: +up (older), -down (newer). Clamped. */
1653
+ | {
1654
+ type: 'scrollBy';
1655
+ delta: number;
1656
+ } | {
1657
+ type: 'scrollTo';
1658
+ offset: number;
1659
+ }
1660
+ /** Scroll by a viewport page in `dir`. */
1661
+ | {
1662
+ type: 'scrollPage';
1663
+ dir: 'up' | 'down';
1664
+ }
1665
+ /** Jump to the newest output (pinned). */
1666
+ | {
1667
+ type: 'scrollToBottom';
1668
+ }
1669
+ /** Jump to the oldest output. */
1670
+ | {
1671
+ type: 'scrollToTop';
1672
+ }
1673
+ /** Report the measured content height; re-clamps offset + tracks new lines. */
1674
+ | {
1675
+ type: 'setMeasuredLines';
1676
+ totalLines: number;
1677
+ }
1678
+ /** Report the computed viewport height; re-clamps offset. */
1679
+ | {
1680
+ type: 'setViewportRows';
1681
+ rows: number;
1682
+ }
1683
+ /**
1684
+ * Fold a batch of fleet/display actions through the reducer in ONE pass so
1685
+ * a 150ms burst of subagent events produces a single React render instead
1686
+ * of one per event. Order-preserving; only high-frequency display events
1687
+ * are batched (correctness-sensitive events stay immediate).
1688
+ */
1689
+ | {
1690
+ type: 'fleetBatch';
1691
+ actions: Action[];
1692
+ }
1693
+ /** BugHunter emitted a bug.found event on the FleetBus. */
1694
+ | {
1695
+ type: 'collabBugFound';
1696
+ sessionId: string;
1697
+ bugId: string;
1698
+ severity: string;
1699
+ description: string;
1700
+ }
1701
+ /** RefactorPlanner emitted a refactor.plan event on the FleetBus. */
1702
+ | {
1703
+ type: 'collabPlanEmitted';
1704
+ sessionId: string;
1705
+ planId: string;
1706
+ riskScore: string;
1707
+ phaseCount: number;
1708
+ }
1709
+ /** Critic emitted a critic.evaluation event on the FleetBus. */
1710
+ | {
1711
+ type: 'collabEvalComplete';
1712
+ sessionId: string;
1713
+ evalId: string;
1714
+ verdict: string;
1715
+ score: number;
1716
+ }
1717
+ /** Collab session completed — overall verdict is available. */
1718
+ | {
1719
+ type: 'collabSessionDone';
1720
+ sessionId: string;
1721
+ verdict: 'approve' | 'needs_revision' | 'reject';
1722
+ }
1723
+ /** A collab subagent (bug-hunter / refactor-planner / critic) was spawned. */
1724
+ | {
1725
+ type: 'collabSubagentSpawned';
1726
+ subagentId: string;
1727
+ role: string;
1728
+ }
1729
+ /** Toggle the process list overlay (F8). */
1730
+ | {
1731
+ type: 'toggleProcessList';
1732
+ }
1733
+ /** Toggle the audit (side effects) panel. */
1734
+ | {
1735
+ type: 'toggleAuditPanel';
1736
+ }
1737
+ /** Toggle the plan panel (F5). */
1738
+ | {
1739
+ type: 'togglePlanPanel';
1740
+ } | {
1741
+ type: 'toggleKanbanPanel';
1742
+ } | {
1743
+ type: 'toggleGoalPanel';
1744
+ } | {
1745
+ type: 'toggleSessionsPanel';
1746
+ } | {
1747
+ type: 'sessionsPanelSet';
1748
+ sessions: import('./components/sessions-panel.js').LiveSessionEntry[];
1749
+ } | {
1750
+ type: 'sessionsPanelMove';
1751
+ delta: number;
1752
+ } | {
1753
+ type: 'sessionsPanelBusy';
1754
+ on: boolean;
1755
+ } | {
1756
+ type: 'sessionResumeConfirmSet';
1757
+ sessionId: string;
1758
+ sessionName: string;
1759
+ } | {
1760
+ type: 'sessionResumeConfirmClear';
1761
+ }
1762
+ /** Push throttled debug-stream telemetry from the provider's chunk callback. */
1763
+ | {
1764
+ type: 'debugStreamStats';
1765
+ chunkCount: number;
1766
+ lastChunkSize: number;
1767
+ lastDeltaMs: number;
1768
+ totalBytes: number;
1769
+ lastChunkAt: string;
1770
+ }
1771
+ /** Clear debug-stream stats (fired on stream reset / idle). */
1772
+ | {
1773
+ type: 'debugStreamStatsClear';
1774
+ }
1775
+ /** Auto-proceed countdown tick. Upserts the countdown; 0 clears it. */
1776
+ | {
1777
+ type: 'countdownTick';
1778
+ remainingSeconds: number;
1779
+ }
1780
+ /** Auto-proceed countdown ended (completed or aborted). */
1781
+ | {
1782
+ type: 'countdownEnded';
1783
+ }
1784
+ /** Coordinator emitted a live event. */
1785
+ | {
1786
+ type: 'coordinatorEvent';
1787
+ event: {
1788
+ type: string;
1789
+ goalId?: string | undefined;
1790
+ taskId?: string | undefined;
1791
+ knowledgeId?: string | undefined;
1792
+ title?: string | undefined;
1793
+ text?: string | undefined;
1794
+ participants?: string[] | undefined;
1795
+ };
1796
+ }
1797
+ /** Toggle the coordinator monitor overlay. */
1798
+ | {
1799
+ type: 'toggleCoordinatorMonitor';
1800
+ };
1801
+ //# sourceMappingURL=app-state.d.ts.map