@wrongstack/tui 1.0.19 → 1.0.26

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 (159) hide show
  1. package/dist/app-action-type.d.ts +85 -1
  2. package/dist/app-key-handler.d.ts +1 -1
  3. package/dist/app-panel-state.d.ts +561 -0
  4. package/dist/app-props.d.ts +21 -1
  5. package/dist/app-reducer.d.ts +1 -1
  6. package/dist/app-state-core-types.d.ts +13 -0
  7. package/dist/app-state.d.ts +8 -534
  8. package/dist/app-status-region.d.ts +2 -1
  9. package/dist/app-ui-state.d.ts +2 -0
  10. package/dist/app-view-contract.d.ts +1 -1
  11. package/dist/app-view-pickers.d.ts +2 -1
  12. package/dist/app-view-state.d.ts +2 -0
  13. package/dist/app.d.ts +2 -2
  14. package/dist/auth-panel-model.d.ts +1 -0
  15. package/dist/background-strip-model.d.ts +65 -0
  16. package/dist/brain-panel-model.d.ts +7 -7
  17. package/dist/chat-search-slash.d.ts +15 -0
  18. package/dist/clipboard.d.ts +14 -1
  19. package/dist/components/agent-monitor-presentation.d.ts +61 -0
  20. package/dist/components/agents-monitor.d.ts +3 -49
  21. package/dist/components/audit-panel.d.ts +2 -1
  22. package/dist/components/auth-panel.d.ts +3 -1
  23. package/dist/components/background-strip.d.ts +20 -0
  24. package/dist/components/brain-panel.d.ts +3 -1
  25. package/dist/components/chat-search-bar.d.ts +19 -0
  26. package/dist/components/checkpoint-timeline.d.ts +7 -3
  27. package/dist/components/confirm-prompt.d.ts +6 -7
  28. package/dist/components/connections-panel.d.ts +2 -1
  29. package/dist/components/context-panel-sections.d.ts +53 -0
  30. package/dist/components/context-panel-types.d.ts +66 -0
  31. package/dist/components/context-panel.d.ts +2 -66
  32. package/dist/components/exit-confirm-panel.d.ts +2 -0
  33. package/dist/components/file-picker.d.ts +2 -1
  34. package/dist/components/help-panel.d.ts +5 -3
  35. package/dist/components/history/code-block.d.ts +2 -136
  36. package/dist/components/history/diff-model.d.ts +143 -0
  37. package/dist/components/history/scroll-controller-types.d.ts +11 -0
  38. package/dist/components/history/scrollbar-rail.d.ts +14 -2
  39. package/dist/components/history/use-history-controller.d.ts +5 -0
  40. package/dist/components/history/utils.d.ts +3 -9
  41. package/dist/components/history/visual-tool-output.d.ts +8 -0
  42. package/dist/components/input.d.ts +1 -1
  43. package/dist/components/kanban-panel-presentation.d.ts +114 -0
  44. package/dist/components/kanban-panel.d.ts +2 -47
  45. package/dist/components/mailbox-panel.d.ts +2 -1
  46. package/dist/components/mcp-picker.d.ts +3 -1
  47. package/dist/components/mode-picker.d.ts +3 -1
  48. package/dist/components/model-picker.d.ts +1 -1
  49. package/dist/components/monitor-shell.d.ts +19 -4
  50. package/dist/components/phase-monitor.d.ts +3 -1
  51. package/dist/components/plugin-picker.d.ts +3 -1
  52. package/dist/components/powerline-rail.d.ts +6 -3
  53. package/dist/components/prompt-picker-model.d.ts +16 -0
  54. package/dist/components/prompt-picker.d.ts +2 -16
  55. package/dist/components/provider-colors.d.ts +2 -12
  56. package/dist/components/refine-countdown-panel.d.ts +4 -3
  57. package/dist/components/resource-menu-model.d.ts +3 -0
  58. package/dist/components/resource-menu.d.ts +3 -3
  59. package/dist/components/scrollable-history.d.ts +1 -1
  60. package/dist/components/send-mode-model.d.ts +44 -0
  61. package/dist/components/send-mode-picker.d.ts +2 -43
  62. package/dist/components/settings-picker-row-list.d.ts +2 -1
  63. package/dist/components/settings-picker.d.ts +3 -1
  64. package/dist/components/shadow-panel.d.ts +2 -1
  65. package/dist/components/sidebar-content.d.ts +1 -47
  66. package/dist/components/sidebar-ipc-icons.d.ts +9 -0
  67. package/dist/components/sidebar-panel-agents.d.ts +10 -0
  68. package/dist/components/sidebar-panel-connections.d.ts +11 -0
  69. package/dist/components/sidebar-panel-coordinator.d.ts +11 -0
  70. package/dist/components/sidebar-panel-fleet.d.ts +16 -0
  71. package/dist/components/sidebar-panel-project.d.ts +12 -0
  72. package/dist/components/sidebar-panel-worktree.d.ts +10 -0
  73. package/dist/components/sidebar-panel-wrong-proxy.d.ts +25 -0
  74. package/dist/components/sidebar-panels-workspace.d.ts +10 -79
  75. package/dist/components/sidebar-presentation.d.ts +98 -0
  76. package/dist/components/sidebar.d.ts +3 -1
  77. package/dist/components/skill-picker.d.ts +2 -1
  78. package/dist/components/slash-confirm-panel.d.ts +2 -0
  79. package/dist/components/slash-menu.d.ts +2 -1
  80. package/dist/components/slash-modal-frame.d.ts +9 -0
  81. package/dist/components/status-bar-rails-async.d.ts +2 -2
  82. package/dist/components/status-bar-types.d.ts +6 -0
  83. package/dist/components/status-bar.d.ts +1 -1
  84. package/dist/components/statusline-picker-model.d.ts +45 -0
  85. package/dist/components/statusline-picker.d.ts +2 -41
  86. package/dist/components/tools-picker.d.ts +3 -1
  87. package/dist/components/user-input-prompt.d.ts +4 -2
  88. package/dist/connection-actions.d.ts +20 -0
  89. package/dist/connections-health.d.ts +8 -1
  90. package/dist/esc-close-panels.d.ts +0 -1
  91. package/dist/f-key-panels.d.ts +4 -0
  92. package/dist/hooks/fork-at-checkpoint.d.ts +25 -0
  93. package/dist/hooks/use-active-theme.d.ts +2 -1
  94. package/dist/hooks/use-app-execution-pipeline.d.ts +1 -1
  95. package/dist/hooks/use-app-panels-state.d.ts +1 -1
  96. package/dist/hooks/use-app-picker-keys.d.ts +5 -2
  97. package/dist/hooks/use-chip-staleness-guard.d.ts +6 -0
  98. package/dist/hooks/use-core-tui-commands.d.ts +7 -2
  99. package/dist/hooks/use-file-search.d.ts +10 -0
  100. package/dist/hooks/use-fleet-generation-gate.d.ts +4 -3
  101. package/dist/hooks/use-panel-controllers.d.ts +1 -1
  102. package/dist/hooks/use-picker-keys-brain-statusline.d.ts +4 -0
  103. package/dist/hooks/use-picker-keys-types.d.ts +1 -0
  104. package/dist/hooks/use-provider-warmup.d.ts +9 -0
  105. package/dist/hooks/use-queue-manager.d.ts +11 -1
  106. package/dist/hooks/use-session-rewind.d.ts +8 -1
  107. package/dist/hooks/use-shadow-panel.d.ts +1 -1
  108. package/dist/hooks/use-sidebar-panel-data.d.ts +7 -5
  109. package/dist/hooks/use-skill-mention-picker.d.ts +6 -0
  110. package/dist/hooks/use-slash-picker.d.ts +1 -1
  111. package/dist/hooks/use-stable-key-handler.d.ts +8 -1
  112. package/dist/hooks/use-status-sync-interval.d.ts +3 -2
  113. package/dist/hooks/use-statusbar-view-model.d.ts +2 -2
  114. package/dist/hooks/use-tui-environment-state.d.ts +3 -0
  115. package/dist/hooks/use-tui-event-bridge.d.ts +12 -0
  116. package/dist/hooks/use-windowed-picker.d.ts +3 -4
  117. package/dist/index.js +29522 -25452
  118. package/dist/ink.d.ts +5 -5
  119. package/dist/input-graphemes.d.ts +4 -0
  120. package/dist/input-key-router.d.ts +2 -0
  121. package/dist/input-tokens.d.ts +10 -0
  122. package/dist/input-validation/action-types.d.ts +1 -1
  123. package/dist/input-validation/limits.d.ts +2 -0
  124. package/dist/input-validation-coordination.d.ts +9 -0
  125. package/dist/input-validation-display.d.ts +9 -0
  126. package/dist/input-validation.d.ts +0 -52
  127. package/dist/kanban-arguments.d.ts +48 -0
  128. package/dist/kanban-command-types.d.ts +53 -0
  129. package/dist/kanban-reports.d.ts +42 -0
  130. package/dist/kanban-slash.d.ts +4 -125
  131. package/dist/key-routes/key-route-background-strip.d.ts +14 -0
  132. package/dist/key-routes/key-route-chat-search.d.ts +24 -0
  133. package/dist/key-routes/key-route-overlay.d.ts +2 -2
  134. package/dist/layout-store.d.ts +2 -2
  135. package/dist/memory-slash-render.d.ts +1 -1
  136. package/dist/message-checkpoint.d.ts +19 -0
  137. package/dist/motion.d.ts +16 -0
  138. package/dist/on-panel-open.d.ts +1 -1
  139. package/dist/picker-text-input.d.ts +4 -0
  140. package/dist/reducers/chat-search.d.ts +11 -0
  141. package/dist/reducers/composer-action-types.d.ts +6 -0
  142. package/dist/reducers/composer-pickers.d.ts +4 -0
  143. package/dist/reducers/composer.d.ts +1 -5
  144. package/dist/reducers/message-jump.d.ts +16 -0
  145. package/dist/reducers/panel-pickers.d.ts +1 -1
  146. package/dist/reducers/workspace-panels.d.ts +1 -1
  147. package/dist/resume-session-tree.d.ts +8 -0
  148. package/dist/rewind-prompt.d.ts +24 -0
  149. package/dist/run-tui-options.d.ts +24 -5
  150. package/dist/scroll-anchor.d.ts +6 -0
  151. package/dist/statusline-palette.d.ts +4 -0
  152. package/dist/submit-controller.d.ts +1 -1
  153. package/dist/submit-slash-command.d.ts +67 -0
  154. package/dist/theme-utils.d.ts +1 -1
  155. package/dist/transcript-search.d.ts +38 -0
  156. package/dist/ui-contracts.d.ts +2 -1
  157. package/dist/use-app-controller.d.ts +157 -0
  158. package/dist/use-controller-key-pipeline.d.ts +217 -0
  159. package/package.json +7 -7
@@ -0,0 +1,561 @@
1
+ import type { StatuslineDensities, StatuslineLines, StatuslineOrder } from '@wrongstack/core/statusline';
2
+ import type { ContentBlock, DesignKitEntry, FleetChatVerbosity, SkillEntry, TokenSavingTier } from '@wrongstack/core/types';
3
+ import type { ResumeSessionEntry, SlashCommandMatch } from './app-state-core-types.js';
4
+ import type { AuthPanelState } from './auth-panel-model.js';
5
+ import type { BrainLogEntry, BrainRiskLevel } from './brain-contracts.js';
6
+ import type { BrainPanelSettings } from './brain-panel-model.js';
7
+ import type { AuditLevel, CacheTtl, CompactorStrategy, ContextMode, LogLevel, ReasoningEffort, SettingsMode, StatuslineMode, ToolResultViewMode } from './settings-contracts.js';
8
+ import type { AutonomyOption, ChipMeta, HelpEntry, LiveSessionEntry, McpPickerItem, ModeOption, PanelPositionMap, PluginPickerItem, ProjectPickerItem, PromptPickEntry, ProviderOption, SendMode, ShadowState, StatuslineItem, ToolPickerItem } from './ui-contracts.js';
9
+ export type PanelState = {
10
+ /**
11
+ * Context snapshot captured at Esc time, replayed into the STEERING
12
+ * preamble so the model sees exactly what it was mid-doing when the
13
+ * user pulled the cord. Cleared together with `steeringPending`.
14
+ * Without this the model has to guess from chat scrollback which
15
+ * tools were live — and it can't see subagent state at all.
16
+ */
17
+ steerSnapshot: {
18
+ runningTools: string[];
19
+ subagents: Array<{
20
+ label: string;
21
+ status: string;
22
+ tool?: string | undefined;
23
+ }>;
24
+ subagentsTerminated: number;
25
+ partialAssistantText: string;
26
+ } | null;
27
+ /**
28
+ * Tool-result inspect overlay. Holds the clicked card's ids; the view
29
+ * resolves the full (untruncated) payload from live history / stream.
30
+ * Null when closed.
31
+ */
32
+ inspectOverlay: {
33
+ entryId: number;
34
+ entryIds?: readonly number[] | undefined;
35
+ scroll: number;
36
+ } | null;
37
+ /**
38
+ * Transcript search bar (Alt+F / `/chat-search`). `selectedEntryId` is the
39
+ * current hit; `jumpSeq` increments whenever the view should scroll that
40
+ * hit into view. Null when the bar is closed.
41
+ */
42
+ chatSearch: {
43
+ query: string;
44
+ selectedEntryId: number | null;
45
+ jumpSeq: number;
46
+ } | null;
47
+ /**
48
+ * Alt+↑ / Alt+↓ user-message navigation: the user entry last jumped to, and
49
+ * a counter that bumps on every jump so the view scrolls it into view.
50
+ */
51
+ messageJump: {
52
+ entryId: number | null;
53
+ seq: number;
54
+ };
55
+ picker: {
56
+ open: boolean;
57
+ query: string;
58
+ matches: string[];
59
+ selected: number;
60
+ };
61
+ /** Slash command picker — open while typing a / command. */
62
+ slashPicker: {
63
+ open: boolean;
64
+ query: string;
65
+ matches: SlashCommandMatch[];
66
+ selected: number;
67
+ };
68
+ /** Two-step model picker (provider → model) — opened by `/model`. */
69
+ modelPicker: {
70
+ open: boolean;
71
+ step: 'provider' | 'model';
72
+ providerOptions: ProviderOption[];
73
+ modelOptions: string[];
74
+ /** Filtered list shown in step 2 (same as modelOptions when searchQuery is empty). */
75
+ filteredOptions: string[];
76
+ selected: number;
77
+ pickedProviderId?: string | undefined;
78
+ hint?: string | undefined;
79
+ /** Live search filter in step 2. */
80
+ searchQuery: string;
81
+ /**
82
+ * Reasoning effort chosen for the FOCUSED model with ←/→. `'default'`
83
+ * (the sentinel every navigation resets to) means "leave the persisted
84
+ * effort alone", which is what Enter did before the strip existed.
85
+ */
86
+ effort: string;
87
+ /**
88
+ * 'switch' — Enter switches the SESSION model (the /model command).
89
+ * 'pick' — generic reusable selection: Enter just RETURNS the choice
90
+ * to whoever called requestModelPick (Brain pool/voters/judge,
91
+ * future callers); other panels stay open underneath.
92
+ */
93
+ purpose: 'switch' | 'pick';
94
+ /** Overlay title override for 'pick' invocations. */
95
+ title?: string | undefined;
96
+ };
97
+ /** Single-step autonomy mode picker — opened by `/autonomy`. */
98
+ autonomyPicker: {
99
+ open: boolean;
100
+ options: AutonomyOption[];
101
+ selected: number;
102
+ hint?: string | undefined;
103
+ };
104
+ /** Single-step theme picker — opened by `/theme`. Lists every preset and
105
+ * applies the chosen one instantly (in-place palette mutation + persist). */
106
+ themePicker: {
107
+ open: boolean;
108
+ selected: number;
109
+ hint?: string | undefined;
110
+ };
111
+ /** Agent mode picker — opened by `/mode`. Selects teach/brief/code-reviewer/etc. */
112
+ modePicker: {
113
+ open: boolean;
114
+ modes: ModeOption[];
115
+ selected: number;
116
+ hint?: string | undefined;
117
+ };
118
+ /** Skill picker — lists discoverable skills and details the focused row. */
119
+ skillPicker: {
120
+ mention?: import('@wrongstack/core/skill-mentions').SkillMention | undefined;
121
+ open: boolean;
122
+ entries: SkillEntry[];
123
+ selected: number;
124
+ hint?: string | undefined;
125
+ };
126
+ /** Design Studio kit picker — opened by `/design`. */
127
+ designPicker: {
128
+ open: boolean;
129
+ kits: DesignKitEntry[];
130
+ selected: number;
131
+ /** Target stack applied on selection. */
132
+ stack: string;
133
+ };
134
+ /** Prompt library picker — opened by a bare `/prompt`. Browse + category filter + insert. */
135
+ promptPicker: {
136
+ open: boolean;
137
+ all: PromptPickEntry[];
138
+ /** ['all', '🕘 recent'?, '★ favorites'?, ...distinct categories]. */
139
+ categories: string[];
140
+ /** Recently-used slugs (most-recent first) backing the "🕘 recent" view. */
141
+ recentSlugs: string[];
142
+ catIndex: number;
143
+ selected: number;
144
+ };
145
+ /** Session resume picker — opened by `/resume`. Lists recent sessions with metadata. */
146
+ resumePicker: {
147
+ open: boolean;
148
+ sessions: ResumeSessionEntry[];
149
+ selected: number;
150
+ /** True while the resume operation is in flight (fetching + replaying). */
151
+ busy: boolean;
152
+ hint?: string | undefined;
153
+ /** Error message if the resume operation failed. */
154
+ error?: string | undefined;
155
+ };
156
+ /** Settings editor — opened by `/settings` or Ctrl+S. */
157
+ settingsPicker: {
158
+ open: boolean;
159
+ /** Focused row index. */
160
+ field: number;
161
+ /**
162
+ * Mirror of the persisted `Settings.lastSettingsField` — kept in the
163
+ * runtime slice so the reducer can read it during `settingsOpen`
164
+ * without re-loading the full Settings shape, and so the auto-save
165
+ * effect (see app.tsx) can write it back when the user navigates.
166
+ */
167
+ lastSettingsField: number;
168
+ mode: SettingsMode;
169
+ delayMs: number;
170
+ titleAnimation: boolean;
171
+ yolo: boolean;
172
+ fleetChat: FleetChatVerbosity;
173
+ chime: boolean;
174
+ confirmExit: boolean;
175
+ nextPrediction: boolean;
176
+ featureMcp: boolean;
177
+ featurePlugins: boolean;
178
+ featureMemory: boolean;
179
+ featureSkills: boolean;
180
+ featureModelsRegistry: boolean;
181
+ tokenSavingTier: TokenSavingTier;
182
+ allowOutsideProjectRoot: boolean;
183
+ contextAutoCompact: boolean;
184
+ contextStrategy: CompactorStrategy;
185
+ contextMode: ContextMode;
186
+ maxConcurrent: number;
187
+ logLevel: LogLevel;
188
+ auditLevel: AuditLevel;
189
+ indexOnStart: boolean;
190
+ /** Multi-file diff summary footer cutoff. 0 = off; positive = min file count. */
191
+ multiDiffSummaryThreshold: number;
192
+ maxIterations: number;
193
+ /** Maximum auto-proceed iterations (0 = unlimited). */
194
+ autoProceedMaxIterations: number;
195
+ /** Prompt refinement preview countdown (ms). */
196
+ enhanceDelayMs: number;
197
+ /** Pre-refine grace period (seconds). 0 = skip countdown entirely. */
198
+ preRefineSeconds: number;
199
+ /** Master toggle for the prompt refiner (mirrors Settings.enhanceEnabled). */
200
+ enhanceEnabled: boolean;
201
+ /** Refined-prompt language preference (mirrors Settings.enhanceLanguage). */
202
+ enhanceLanguage: 'original' | 'english';
203
+ /** Raw SSE stream debugging toggle. */
204
+ debugStream: boolean;
205
+ /** Statusline density mode. */
206
+ statuslineMode: StatuslineMode;
207
+ /** Reasoning mode: auto | on | off. */
208
+ reasoningMode: 'auto' | 'on' | 'off';
209
+ /** Reasoning effort level. */
210
+ reasoningEffort: ReasoningEffort;
211
+ /**
212
+ * Effort levels the ACTIVE model documents (models.dev reasoningConfig),
213
+ * injected by the host at /settings-open time. Absent = vocabulary
214
+ * undocumented; the effort cycle then covers the full canonical set.
215
+ */
216
+ reasoningEffortLevels?: string[] | undefined;
217
+ /** Preserve thinking across turns. */
218
+ reasoningPreserve: boolean;
219
+ /** Single word shown in the TUI rainbow working-state chip. */
220
+ thinkingWord: string;
221
+ /** True while free-text editing the thinking word (Enter on its row). */
222
+ thinkingWordEditing: boolean;
223
+ /** In-progress text buffer while `thinkingWordEditing`. */
224
+ thinkingWordDraft: string;
225
+ /**
226
+ * Show the "Model Reasoning" collapsible blocks in chat history.
227
+ * Separate from thinkingWord (status-bar chip) and reasoningMode
228
+ * (API-level provisioning). Default: true.
229
+ */
230
+ showModelReasoning: boolean;
231
+ /** Global default for all committed tool-result cards. */
232
+ toolResultViewMode: ToolResultViewMode;
233
+ /** Agent swarm panel placement: 'bottom' (lower region), 'sidebar' (right sidebar), or 'off'. Default: 'bottom'. */
234
+ showAgentSwarmPanel: import('./app-settings-type.js').AgentSwarmPanelMode;
235
+ /** Right sidebar visibility (mirrors Settings.showSidebar). Default: true. */
236
+ showSidebar: boolean;
237
+ /**
238
+ * Per-panel position map mirrored from the persisted Settings shape.
239
+ * Each F-key panel can be set to 'bottom' (F-key behavior, the default)
240
+ * or 'sidebar' (rendered in the right sidebar). When a panel is set to
241
+ * 'sidebar' AND its F-key toggle is on, the bottom view hides and the
242
+ * sidebar shows the panel twin instead. When the F-key is off, neither
243
+ * surface shows the panel.
244
+ */
245
+ panelPositions: PanelPositionMap;
246
+ /** Show SAGE Memory Inject blocks in tool results. Default: false (hidden). */
247
+ showSageMemoryInject: boolean;
248
+ /** Minimum relation strength for SAGE memory injection. Default: 0.85. */
249
+ sageMemoryInjectThreshold: number;
250
+ /** Register the leader's agent-callable `nextsteps` tool. Default: false. */
251
+ nextStepsTool: boolean;
252
+ /** When true, read tool includes codebase-index symbols alongside file content. */
253
+ readSymbols: boolean;
254
+ /** Prompt cache TTL. */
255
+ cacheTtl: CacheTtl;
256
+ /** Where to persist settings: 'global' or 'project'. */
257
+ configScope: 'global' | 'project';
258
+ /**
259
+ * Animation style for the working/thinking chip in the status bar. One
260
+ * of the styles exported by `components/animation-style.tsx`, plus the
261
+ * meta-mode `'cycle'` that rotates through the variant styles every
262
+ * `CYCLE_INTERVAL_SECONDS`. Persisted on every ←/→ change in `/settings`.
263
+ */
264
+ animationStyle: 'rainbow' | 'wave' | 'pulse' | 'dots' | 'breathe' | 'static' | 'cycle';
265
+ /**
266
+ * WrongProxy / WrongTrace: master switch. When true AND the daemon at
267
+ * `wrongProxyUrl` is reachable, every provider's base URL is rewritten
268
+ * through `${wrongProxyUrl}/proxy/<host><path>`. openai-codex is
269
+ * excluded by spec. Mirrors `Settings.wrongProxyEnabled` and the
270
+ * `tools.wrongProxy.enabled` config key. Picker field 59.
271
+ */
272
+ wrongProxyEnabled: boolean;
273
+ /**
274
+ * WrongProxy / WrongTrace URL. Default `http://localhost:3444`. The
275
+ * CLI's periodic probe targets `<wrongProxyUrl>/api/health`; a 2xx
276
+ * response flips the runtime's `active` flag. Picker field 60.
277
+ */
278
+ wrongProxyUrl: string;
279
+ /** True while free-text editing the WrongProxy URL (Enter on its row). */
280
+ wrongProxyUrlEditing: boolean;
281
+ /** In-progress text buffer while `wrongProxyUrlEditing`. */
282
+ wrongProxyUrlDraft: string;
283
+ /** Whether the process circuit breaker gates bash/exec. */
284
+ breakerEnabled: boolean;
285
+ /** Auto kill/reset delay (ms) when the breaker trips. 0 = manual recovery. */
286
+ breakerAutoKillResetMs: number;
287
+ /**
288
+ * Live filter for the row-search modal (entered via `/`). Empty
289
+ * string means filter is inactive. Non-empty means the user is
290
+ * typing a search query and only matching rows are visible.
291
+ * Cleared on picker close and on Esc-out-of-filter.
292
+ */
293
+ filter: string;
294
+ hint?: string | undefined;
295
+ };
296
+ /** Statusline editor — opened by `/statusline`. */
297
+ statuslinePicker: {
298
+ open: boolean;
299
+ /** Focused field index. */
300
+ field: number;
301
+ /** Current hidden-items list (user-toggled off chips). */
302
+ hiddenItems: StatuslineItem[];
303
+ /**
304
+ * Chips that are temporarily visible due to data/events, with expiration
305
+ * metadata. When a chip expires it is removed from this list. User-toggled
306
+ * chips stay visible via their data being truthy — they are NOT here.
307
+ */
308
+ visibleChips: ChipMeta[];
309
+ /** Per-chip line assignment being edited (mirrors statusline.json v3). */
310
+ lines: StatuslineLines;
311
+ /** Per-chip density pin being edited. */
312
+ densities: StatuslineDensities;
313
+ /** Custom left-to-right chip order being edited. */
314
+ order: StatuslineOrder;
315
+ /** Text filter over chip names/descriptions. */
316
+ filter: string;
317
+ /** True while `/` is capturing filter keystrokes. */
318
+ filtering: boolean;
319
+ /**
320
+ * True once the editor holds the live layout (seeded on open, or made
321
+ * true by any layout edit). The app only mirrors the editor's layout
322
+ * back into the live statusline while this is set, so a caller that
323
+ * opens the picker WITHOUT seeding it can never publish an empty layout
324
+ * over the user's saved one.
325
+ */
326
+ layoutSeeded: boolean;
327
+ hint?: string | undefined;
328
+ };
329
+ /** Plugin toggle editor — opened by `/plugin menu` or `/settings plugins`. */
330
+ pluginPicker: {
331
+ open: boolean;
332
+ items: PluginPickerItem[];
333
+ selected: number;
334
+ busy: boolean;
335
+ hint?: string | undefined;
336
+ };
337
+ /** MCP server picker — opened by `/mcp`. */
338
+ mcpPicker: {
339
+ open: boolean;
340
+ items: McpPickerItem[];
341
+ selected: number;
342
+ busy: boolean;
343
+ hint?: string | undefined;
344
+ };
345
+ /** Tool picker — opened by `/tools`. */
346
+ toolsPicker: {
347
+ open: boolean;
348
+ items: ToolPickerItem[];
349
+ selected: number;
350
+ busy: boolean;
351
+ hint?: string | undefined;
352
+ filter?: string | undefined;
353
+ };
354
+ /** Brain panel — opened by `/brain`. */
355
+ brainPanel: {
356
+ open: boolean;
357
+ riskLevel: BrainRiskLevel;
358
+ log: BrainLogEntry[];
359
+ selected: number;
360
+ hint?: string | undefined;
361
+ /** Settings-editor state (only meaningful when a BrainPanelHost is wired). */
362
+ view: 'settings' | 'log';
363
+ settings?: BrainPanelSettings | undefined;
364
+ /** Settings-view row cursor. */
365
+ row: number;
366
+ busy: boolean;
367
+ };
368
+ /** Help panel — opened by `/help`. */
369
+ helpPanel: {
370
+ open: boolean;
371
+ entries: HelpEntry[];
372
+ selected: number;
373
+ filter: string;
374
+ hint?: string | undefined;
375
+ detailScroll?: number | undefined;
376
+ };
377
+ /** Shadow Agent panel — opened by `/shadow`. */
378
+ shadowPanel: {
379
+ open: boolean;
380
+ shadow: ShadowState;
381
+ hint?: string | undefined;
382
+ };
383
+ /** Interactive API-key / OAuth manager — opened by `/auth`. */
384
+ authPanel: AuthPanelState;
385
+ /** Project switcher panel — opened by F1 or `/project`. */
386
+ projectPicker: {
387
+ open: boolean;
388
+ /** Original unfiltered items. Never mutated after open. */
389
+ allItems: ProjectPickerItem[];
390
+ /** Currently displayed items (filtered from allItems). Navigation targets this list. */
391
+ items: ProjectPickerItem[];
392
+ selected: number;
393
+ filter: string;
394
+ hint?: string | undefined;
395
+ };
396
+ /** F-key panel picker — opened by `/f`. Keyboard-navigable list of F1–F12 panels. */
397
+ fKeyPicker: {
398
+ open: boolean;
399
+ selected: number;
400
+ };
401
+ /** Pending tool confirmations — queue to handle multiple tools requesting confirmation. */
402
+ confirmQueue: {
403
+ toolUseId: string;
404
+ toolName: string;
405
+ input: unknown;
406
+ suggestedPattern: string;
407
+ resolve: (decision: 'yes' | 'no' | 'always' | 'always-exact' | 'always-command' | 'always-tool' | 'deny') => void;
408
+ /** True when the call was classified destructive. */
409
+ destructive: boolean;
410
+ boundaryReason?: string | undefined;
411
+ /** Real write destinations from `Tool.writeTargets`, when declared (VULN-001 Phase 2). */
412
+ writeTargets?: string[] | undefined;
413
+ }[];
414
+ /**
415
+ * Active bare-"continue" confirmation panel. Set when the user typed a lone
416
+ * "continue"/"devam"/"go on" and the runtime resolved it to a concrete next
417
+ * step. Makes the resolution — and its drift risk — visible before it is
418
+ * sent: a grounded resolution (todo / suggestion) auto-proceeds after a
419
+ * short countdown; an `open` resolution (no queued task, model will pick the
420
+ * step itself) requires an explicit keypress. Resolves to
421
+ * proceed / edit / cancel and `submit()` continues. Null when none pending.
422
+ */
423
+ continueConfirm: {
424
+ /** One-line summary shown in the panel header (e.g. "▶ Continue → todo: …"). */
425
+ label: string;
426
+ /** The full instruction that will be injected in place of "continue". */
427
+ instruction: string;
428
+ /** Where the resolution came from — drives copy + risk styling. */
429
+ source: 'todo' | 'suggestion' | 'open';
430
+ /** True for todo/suggestion (low drift); false for the `open` guess. */
431
+ grounded: boolean;
432
+ resolve: (decision: 'proceed' | 'edit' | 'cancel') => void;
433
+ } | null;
434
+ /**
435
+ * Pending destructive `/clear` confirmation. Unlike ordinary yes/no
436
+ * prompts this requires the user to type the full uppercase word `YES`.
437
+ */
438
+ clearConfirm: {
439
+ leaderActive: boolean;
440
+ subagentCount: number;
441
+ value: string;
442
+ resolve: (decision: boolean) => void;
443
+ } | null;
444
+ /**
445
+ * Pending `/exit` confirmation. Mirrors the `/clear` invariant: while a
446
+ * leader run or any subagent is in flight, `/exit` must not terminate the
447
+ * TUI silently. The panel asks for an Enter/Esc acknowledgement so the
448
+ * user can decide to abort the in-flight work first. When nothing is
449
+ * running, `/exit` resolves true without ever opening this panel.
450
+ */
451
+ exitConfirm: {
452
+ leaderActive: boolean;
453
+ subagentCount: number;
454
+ backgroundCount?: number | undefined;
455
+ resolve: (decision: boolean) => void;
456
+ } | null;
457
+ /** Generic slash-command confirmation rendered inside the TUI. */
458
+ slashConfirm: {
459
+ question: string;
460
+ defaultYes: boolean;
461
+ resolve: (decision: boolean | null) => void;
462
+ } | null;
463
+ /**
464
+ * Pending ESC-interrupt confirmation. Null when none is pending.
465
+ * When `confirmExit` is enabled and Esc is pressed mid-iteration, the
466
+ * snapshot is captured and `escConfirm` opens instead of immediately
467
+ * aborting. The prompt shows "Abort work and redirect?"
468
+ * (or similar) and waits for y/n/Esc.
469
+ */
470
+ escConfirm: {
471
+ snapshot: NonNullable<PanelState['steerSnapshot']>;
472
+ } | null;
473
+ /**
474
+ * Fallback model overlay — shown when `provider.fallback_pending` fires.
475
+ * The overlay displays a countdown and the candidate model list, letting
476
+ * the user manually pick a model or wait for auto-switch. Null when no
477
+ * fallback gate is pending.
478
+ */
479
+ fallbackOverlay: {
480
+ requestId: string;
481
+ from: {
482
+ providerId: string;
483
+ model: string;
484
+ };
485
+ status: number;
486
+ candidates: Array<{
487
+ providerId: string;
488
+ model: string;
489
+ }>;
490
+ autoSwitchSeconds: number;
491
+ selected: number;
492
+ } | null;
493
+ /**
494
+ * Mid-run send-mode picker. Set when the user submits a plain message while
495
+ * the agent is busy and `midRunSendPicker` is enabled — the picker asks how
496
+ * to deliver the text (queue / by-the-way / steer). The `resolve` callback
497
+ * is awaited inside `submit()` (same Promise pattern as `enhance`); on
498
+ * `'cancel'` (Esc) the caller restores the draft to the composer instead
499
+ * of sending — nothing is queued. Null when no picker is pending.
500
+ */
501
+ sendModePicker: {
502
+ selected: number;
503
+ text: string;
504
+ displayText: string;
505
+ blocks: ContentBlock[];
506
+ pasteContent?: string | undefined;
507
+ resolve: (decision: SendMode | 'cancel') => void;
508
+ } | null;
509
+ /** When true, the queue panel is shown (F7). */
510
+ queuePanelOpen: boolean;
511
+ /** When true, the audit (side effects) overlay is shown (/audit). */
512
+ auditPanelOpen: boolean;
513
+ /** When true, the plan panel is shown (F5). */
514
+ planPanelOpen: boolean;
515
+ /** When true, the project kanban panel is shown. */
516
+ kanbanPanelOpen: boolean;
517
+ /** When true, the goal panel is shown (F9). */
518
+ goalPanelOpen: boolean;
519
+ goalKanbanPanelOpen: boolean;
520
+ /** When true, the interactive context monitor is shown (`/context`). */
521
+ contextPanelOpen: boolean;
522
+ /** When true, the interactive service connections health panel is shown (`/connections`). */
523
+ connectionsPanelOpen: boolean;
524
+ /** When true, the sessions panel is shown (F10). */
525
+ sessionsPanelOpen: boolean;
526
+ /** Live session data for the sessions panel (F10). */
527
+ sessionsPanel: {
528
+ sessions: LiveSessionEntry[];
529
+ busy: boolean;
530
+ /** Selected index for arrow-key navigation. -1 when nothing selected. */
531
+ selected: number;
532
+ };
533
+ /**
534
+ * Pending session resume confirmation. When set, the F10 panel shows a
535
+ * "Press Enter to confirm resume, Esc to cancel" prompt. Set by the first
536
+ * Enter on a same-project session; the second Enter triggers the actual
537
+ * onResumeSession call.
538
+ */
539
+ sessionResumeConfirm: {
540
+ sessionId: string;
541
+ sessionName: string;
542
+ } | null;
543
+ /**
544
+ * A fork from the checkpoint timeline, waiting for the resume machinery
545
+ * (use-app-picker-keys) to branch the session there and switch to it.
546
+ */
547
+ forkRequest?: {
548
+ promptIndex: number;
549
+ } | null | undefined;
550
+ /** Checkpoint timeline overlay — null when closed. */
551
+ rewindOverlay: {
552
+ checkpoints: Array<{
553
+ promptIndex: number;
554
+ promptPreview: string;
555
+ ts: string;
556
+ fileCount: number;
557
+ }>;
558
+ selected: number;
559
+ } | null;
560
+ };
561
+ //# sourceMappingURL=app-panel-state.d.ts.map
@@ -54,6 +54,12 @@ export interface AppProps {
54
54
  banner?: boolean | undefined;
55
55
  /** Persists the queue across crashes; rehydrated on mount, written on every mutation. */
56
56
  queueStore?: QueueStore | undefined;
57
+ /**
58
+ * The queue store of another session. With it, `/resume` brings that
59
+ * session's queue along (the WebUI keeps its queue in the same file) and
60
+ * leaves the previous session's on disk.
61
+ */
62
+ queueStoreFor?: ((sessionId: string) => QueueStore | undefined) | undefined;
57
63
  /**
58
64
  * Mirrors the queue's display texts (head first) to the host on every
59
65
  * queue change, so a running agent can be told what's waiting (queue
@@ -390,6 +396,12 @@ export interface AppProps {
390
396
  * `(update available)` next to the version chip when this is set, so
391
397
  * users notice without having to read the stderr notice. */
392
398
  updateAvailable?: boolean | undefined;
399
+ /**
400
+ * The standalone executable's background update: called with the version
401
+ * once it is downloaded, verified and waiting to be swapped in when this
402
+ * session exits. The status bar's version chip then says so.
403
+ */
404
+ subscribeUpdateReady?: ((listener: (version: string) => void) => () => void) | undefined;
393
405
  /**
394
406
  * Snapshot the keyed providers (and their model lists) for the
395
407
  * `/model` picker. Called every time the picker opens, so the result
@@ -501,6 +513,14 @@ export interface AppProps {
501
513
  * optionally by the startup rehydration path.
502
514
  */
503
515
  listSessions?: ((limit?: number) => Promise<ResumeSessionEntry[]>) | undefined;
516
+ /**
517
+ * Branch a session at a checkpoint (the conversation before that prompt)
518
+ * into a new session, leaving the original as it is. Returns the new id;
519
+ * the TUI then resumes it. The working tree is shared, not copied.
520
+ */
521
+ forkSession?: ((sessionId: string, checkpointPromptIndex: number) => Promise<{
522
+ id: string;
523
+ }>) | undefined;
504
524
  /**
505
525
  * Goal text passed from `--goal "..."` on the command line. When set,
506
526
  * the App mounts, renders the banner, then automatically dispatches
@@ -526,7 +546,7 @@ export interface AppProps {
526
546
  * Called when the user selects a project or action in the project picker.
527
547
  * The host CLI handles project switching (stopping agents, spawning new session).
528
548
  */
529
- onProjectSelect?: ((key: string, kind: 'project' | 'action') => void) | undefined;
549
+ onProjectSelect?: ((key: string, kind: 'project' | 'action') => void | string | null | Promise<void | string | null>) | undefined;
530
550
  /**
531
551
  * Request the TUI to exit with a specific code. When a project is selected in
532
552
  * the F1 picker, this is called to trigger a clean exit before the host CLI
@@ -1,7 +1,7 @@
1
1
  import type { Action } from './app-action-type.js';
2
2
  import type { State } from './app-state.js';
3
- export type { DraftEntry, FleetEntry, GoalSummary, QueueItem, ResumeSessionEntry, Settings, SlashCommandMatch, State, } from './app-state.js';
4
3
  export type { Action } from './app-action-type.js';
4
+ export type { DraftEntry, FleetEntry, GoalSummary, QueueItem, ResumeSessionEntry, Settings, SlashCommandMatch, State, } from './app-state.js';
5
5
  export { firstSelectable, pruneToolInput, skipDivider } from './reducers/helpers.js';
6
6
  export declare function reducer(state: State, action: Action): State;
7
7
  //# sourceMappingURL=app-reducer.d.ts.map
@@ -38,6 +38,19 @@ export interface ResumeSessionEntry {
38
38
  toolCallCount: number;
39
39
  toolErrorCount: number;
40
40
  outcome?: 'completed' | 'error' | 'timeout' | 'aborted' | undefined;
41
+ /** Parent session id when this session is a fork; the picker nests it. */
42
+ forkedFrom?: string | undefined;
43
+ /**
44
+ * Set when the session belongs to another git worktree of this repository
45
+ * (its own project directory). Choosing it switches to that worktree first.
46
+ */
47
+ worktree?: {
48
+ root: string;
49
+ name: string;
50
+ branch?: string | undefined;
51
+ } | undefined;
52
+ /** Tree connector (`├─ `, `└─ `) the picker draws; set when the picker opens. */
53
+ treePrefix?: string | undefined;
41
54
  /** The current session — marked so the picker can disallow resuming into itself. */
42
55
  isCurrent?: boolean | undefined;
43
56
  /**