@wrongstack/tui 0.287.0 → 0.291.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 (102) hide show
  1. package/dist/app-initial-state.d.ts +22 -3
  2. package/dist/app-initial-state.d.ts.map +1 -1
  3. package/dist/app-props.d.ts +622 -0
  4. package/dist/app-props.d.ts.map +1 -0
  5. package/dist/app-reducer.d.ts.map +1 -1
  6. package/dist/app-state.d.ts +74 -11
  7. package/dist/app-state.d.ts.map +1 -1
  8. package/dist/app.d.ts +4 -595
  9. package/dist/app.d.ts.map +1 -1
  10. package/dist/components/agents-monitor.d.ts.map +1 -1
  11. package/dist/components/animation-style.d.ts +29 -0
  12. package/dist/components/animation-style.d.ts.map +1 -1
  13. package/dist/components/auth-panel.d.ts.map +1 -1
  14. package/dist/components/clear-confirm-panel.d.ts +35 -0
  15. package/dist/components/clear-confirm-panel.d.ts.map +1 -0
  16. package/dist/components/confirm-prompt.d.ts +2 -1
  17. package/dist/components/confirm-prompt.d.ts.map +1 -1
  18. package/dist/components/enhance-panel.d.ts +11 -3
  19. package/dist/components/enhance-panel.d.ts.map +1 -1
  20. package/dist/components/exit-confirm-panel.d.ts +28 -0
  21. package/dist/components/exit-confirm-panel.d.ts.map +1 -0
  22. package/dist/components/fleet-panel.d.ts +1 -0
  23. package/dist/components/fleet-panel.d.ts.map +1 -1
  24. package/dist/components/history/banner.d.ts.map +1 -1
  25. package/dist/components/history/entry.d.ts +6 -1
  26. package/dist/components/history/entry.d.ts.map +1 -1
  27. package/dist/components/history/index.d.ts +2 -2
  28. package/dist/components/history/index.d.ts.map +1 -1
  29. package/dist/components/history/replay.d.ts +14 -38
  30. package/dist/components/history/replay.d.ts.map +1 -1
  31. package/dist/components/history/types.d.ts +19 -0
  32. package/dist/components/history/types.d.ts.map +1 -1
  33. package/dist/components/history.d.ts +1 -1
  34. package/dist/components/history.d.ts.map +1 -1
  35. package/dist/components/kanban-panel.d.ts +72 -1
  36. package/dist/components/kanban-panel.d.ts.map +1 -1
  37. package/dist/components/phase-panel.d.ts +1 -1
  38. package/dist/components/phase-panel.d.ts.map +1 -1
  39. package/dist/components/plugin-picker.d.ts.map +1 -1
  40. package/dist/components/powerline-rail.d.ts.map +1 -1
  41. package/dist/components/process-list.d.ts.map +1 -1
  42. package/dist/components/scrollable-history.d.ts +1 -1
  43. package/dist/components/scrollable-history.d.ts.map +1 -1
  44. package/dist/components/settings-picker.d.ts +6 -3
  45. package/dist/components/settings-picker.d.ts.map +1 -1
  46. package/dist/components/slash-confirm-panel.d.ts +14 -0
  47. package/dist/components/slash-confirm-panel.d.ts.map +1 -0
  48. package/dist/components/status-bar-chips.d.ts.map +1 -1
  49. package/dist/components/status-bar.d.ts +25 -22
  50. package/dist/components/status-bar.d.ts.map +1 -1
  51. package/dist/components/statusline-picker.d.ts +6 -4
  52. package/dist/components/statusline-picker.d.ts.map +1 -1
  53. package/dist/components/tools-picker.d.ts.map +1 -1
  54. package/dist/components/worktree-monitor.d.ts +1 -1
  55. package/dist/components/worktree-panel.d.ts +1 -1
  56. package/dist/esc-close-panels.d.ts +42 -0
  57. package/dist/esc-close-panels.d.ts.map +1 -0
  58. package/dist/exit-slash.d.ts +40 -0
  59. package/dist/exit-slash.d.ts.map +1 -0
  60. package/dist/f-key-panels.d.ts +16 -1
  61. package/dist/f-key-panels.d.ts.map +1 -1
  62. package/dist/heap-watchdog.d.ts.map +1 -1
  63. package/dist/height-cache.d.ts +5 -0
  64. package/dist/height-cache.d.ts.map +1 -1
  65. package/dist/history-retention.d.ts +20 -0
  66. package/dist/history-retention.d.ts.map +1 -0
  67. package/dist/hooks/use-auth-panel.d.ts +4 -0
  68. package/dist/hooks/use-auth-panel.d.ts.map +1 -1
  69. package/dist/hooks/use-director-fleet-bridge.d.ts +6 -5
  70. package/dist/hooks/use-director-fleet-bridge.d.ts.map +1 -1
  71. package/dist/hooks/use-exit-command.d.ts +55 -0
  72. package/dist/hooks/use-exit-command.d.ts.map +1 -0
  73. package/dist/hooks/use-fleet-generation-gate.d.ts +37 -0
  74. package/dist/hooks/use-fleet-generation-gate.d.ts.map +1 -0
  75. package/dist/hooks/use-live-todos.d.ts +4 -0
  76. package/dist/hooks/use-live-todos.d.ts.map +1 -0
  77. package/dist/hooks/use-session-interrupt-controller.d.ts +51 -0
  78. package/dist/hooks/use-session-interrupt-controller.d.ts.map +1 -0
  79. package/dist/hooks/use-subagent-events.d.ts +3 -4
  80. package/dist/hooks/use-subagent-events.d.ts.map +1 -1
  81. package/dist/hooks/use-tui-activity.d.ts +2 -1
  82. package/dist/hooks/use-tui-activity.d.ts.map +1 -1
  83. package/dist/hooks/use-tui-event-bridge.d.ts +10 -3
  84. package/dist/hooks/use-tui-event-bridge.d.ts.map +1 -1
  85. package/dist/index.d.ts +7 -7
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +20453 -18161
  88. package/dist/index.js.map +4 -4
  89. package/dist/kanban-audit.d.ts +116 -0
  90. package/dist/kanban-audit.d.ts.map +1 -0
  91. package/dist/kanban-slash.d.ts +178 -0
  92. package/dist/kanban-slash.d.ts.map +1 -0
  93. package/dist/reducers/helpers.d.ts +1 -1
  94. package/dist/reducers/helpers.d.ts.map +1 -1
  95. package/dist/run-tui.d.ts +28 -2
  96. package/dist/run-tui.d.ts.map +1 -1
  97. package/dist/slash-command-search.d.ts +5 -0
  98. package/dist/slash-command-search.d.ts.map +1 -1
  99. package/dist/submit-history.d.ts +9 -6
  100. package/dist/submit-history.d.ts.map +1 -1
  101. package/dist/theme.d.ts.map +1 -1
  102. package/package.json +7 -7
@@ -1,4 +1,5 @@
1
- import type { FleetChatVerbosity, Message } from '@wrongstack/core';
1
+ import type { AutonomyAgentStatus } from './components/history/types.js';
2
+ import type { FleetChatVerbosity, Message, SessionEvent } from '@wrongstack/core';
2
3
  import type { State } from './app-state.js';
3
4
  export type RestoredToolCall = {
4
5
  name: string;
@@ -9,7 +10,19 @@ export type RestoredToolCall = {
9
10
  outputTokens?: number | undefined;
10
11
  outputLines?: number | undefined;
11
12
  };
12
- export declare function buildRestoredEntries(messages: Message[] | undefined, restoredToolCalls?: RestoredToolCall[] | undefined): State['entries'];
13
+ export declare function buildRestoredEntries(messages: Message[] | undefined, restoredToolCalls?: RestoredToolCall[] | undefined, restoredEvents?: SessionEvent[] | undefined): State['entries'];
14
+ /**
15
+ * Rebuild the checkpoint list from a resumed session's events.
16
+ *
17
+ * The live list is fed by the `checkpoint.written` EventBus bridge, which only
18
+ * fires for checkpoints written by THIS process — so without this a resumed
19
+ * session starts with an empty list and `/rewind` reports "no checkpoints"
20
+ * despite a JSONL full of them.
21
+ *
22
+ * `fileCount` is a live-only stat computed when the checkpoint is written; the
23
+ * JSONL does not carry it, so restored rows report 0.
24
+ */
25
+ export declare function buildRestoredCheckpoints(restoredEvents?: SessionEvent[] | undefined): State['checkpoints'];
13
26
  export interface CreateInitialStateOptions {
14
27
  banner: boolean;
15
28
  appVersion?: string | undefined;
@@ -18,10 +31,16 @@ export interface CreateInitialStateOptions {
18
31
  cwd: string;
19
32
  family?: string | undefined;
20
33
  keyTail?: string | undefined;
34
+ /** Current session id (e.g. "sess_01KXV6…"). Static for the session lifetime. */
35
+ sessionId?: string | undefined;
36
+ /** Background autonomy agents to display in the banner. */
37
+ autonomyAgents?: ReadonlyArray<AutonomyAgentStatus> | undefined;
21
38
  restoredEntries: State['entries'];
39
+ /** Checkpoints rebuilt from a resumed session's events. Empty for a fresh session. */
40
+ restoredCheckpoints?: State['checkpoints'] | undefined;
22
41
  enhanceEnabled: boolean;
23
42
  initialAgentsMonitorOpen?: boolean | undefined;
24
- /** Boot-time fleet-chat verbosity (from persisted config). Default 'compact'. */
43
+ /** Boot-time fleet-chat verbosity (from persisted config). Default 'off'. */
25
44
  initialFleetChat?: FleetChatVerbosity | undefined;
26
45
  }
27
46
  export declare function createInitialState(options: CreateInitialStateOptions): State;
@@ -1 +1 @@
1
- {"version":3,"file":"app-initial-state.d.ts","sourceRoot":"","sources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ACjF,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,2DAA2D;IAC3D,cAAc,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAC;IAChE,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAClC,sFAAsF;IACtF,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;IACvD,cAAc,EAAE,OAAO,CAAC;IACxB,wBAAwB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/C,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;CACnD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,KAAK,CAqO5E"}
@@ -0,0 +1,622 @@
1
+ import type { Agent, AttachmentStore, AutonomyStage, CoordinatorEvent, Director, EventBus, FleetChatVerbosity, Message, QueueStore, SlashCommandRegistry, TokenCounter, TokenSavingTier } from '@wrongstack/core';
2
+ import type { VisionAdapters } from '@wrongstack/runtime/vision';
3
+ import type { SddLifecycleResult, SddRunControl } from '@wrongstack/sdd';
4
+ import type React from 'react';
5
+ import type { ResumeSessionEntry, Settings } from './app-reducer.js';
6
+ import type { AgentTranscriptReader } from './components/agents-monitor.js';
7
+ import type { AuthPanelHost } from './components/auth-panel-model.js';
8
+ import type { BrainRiskLevel } from './components/brain-panel.js';
9
+ import type { HistoryEntry } from './components/history.js';
10
+ import type { McpPickerItem } from './components/mcp-picker.js';
11
+ import type { ProviderOption } from './components/model-picker.js';
12
+ import type { PluginPickerItem } from './components/plugin-picker.js';
13
+ import type { StatuslineItem } from './components/statusline-picker.js';
14
+ import type { ToolPickerItem } from './components/tools-picker.js';
15
+ import type { SessionInterruptController } from './hooks/use-session-interrupt-controller.js';
16
+ /**
17
+ * Props for the TUI `<App>` shell.
18
+ *
19
+ * Extracted from app.tsx (which is line-capped by the hotspot guardrail) —
20
+ * this is the host↔TUI contract, not app logic, so it reads better on its
21
+ * own. `app.tsx` re-exports `AppProps` for consumers importing it from
22
+ * '@wrongstack/tui' / '../src/app.js'.
23
+ */
24
+ export interface AppProps {
25
+ agent: Agent;
26
+ slashRegistry: SlashCommandRegistry;
27
+ /** Host-owned mutable bridge for slash commands that need masked input. */
28
+ secretInputController?: {
29
+ readSecret(prompt: string): Promise<string>;
30
+ readText?(prompt: string): Promise<string>;
31
+ } | undefined;
32
+ attachments: AttachmentStore;
33
+ events: EventBus;
34
+ tokenCounter?: TokenCounter | undefined;
35
+ visionAdapters?: VisionAdapters | undefined;
36
+ /** Resolve current model vision support. Falls back to provider capability when omitted. */
37
+ supportsVision?: (() => boolean | Promise<boolean>) | undefined;
38
+ model: string;
39
+ banner?: boolean | undefined;
40
+ /** Persists the queue across crashes; rehydrated on mount, written on every mutation. */
41
+ queueStore?: QueueStore | undefined;
42
+ /**
43
+ * Mirrors the queue's display texts (head first) to the host on every
44
+ * queue change, so a running agent can be told what's waiting (queue
45
+ * awareness — see core's queued-messages.ts). Display state is unaffected.
46
+ */
47
+ onQueueChange?: ((items: string[]) => void) | undefined;
48
+ /** Reflects the policy's --yolo flag for the status bar's "⚠ YOLO" chip. */
49
+ yolo?: boolean | undefined;
50
+ /** Play terminal bell when an agent run completes. */
51
+ chime?: boolean | undefined;
52
+ /** When true, the first Ctrl+C aborts work and shows "confirm exit" rather than "exit". */
53
+ confirmExit?: boolean | undefined;
54
+ /** Live on/off control for the animated terminal title. Lets `/settings`
55
+ * toggle the title animation within the running session. */
56
+ titleController?: {
57
+ setEnabled: (on: boolean) => void;
58
+ } | undefined;
59
+ /**
60
+ * Token-saving mode tier. Rendered as a `💾 <tier>` chip on the status bar
61
+ * line 2 (hidden when tier is `'off'`) so the user knows which system-prompt
62
+ * compactness level is active. The tool count chip next to it always
63
+ * reflects the tier's registered (non-omitted) tool count.
64
+ */
65
+ tokenSavingMode?: TokenSavingTier | undefined;
66
+ /** Number of registered tools, displayed on the status bar line 2. */
67
+ toolCount?: number | undefined;
68
+ /**
69
+ * Global mouse tracking. When true, SGR mouse reporting stays on for the
70
+ * whole session. When false (default), the App still enables it *only* while
71
+ * a selectable overlay (model/autonomy/settings/slash/@ picker) is open, so
72
+ * the wheel scrolls the picker selection without sacrificing native
73
+ * scrollback in the chat. See mouse.ts for the trade-off.
74
+ */
75
+ mouse?: boolean | undefined;
76
+ /**
77
+ * Startup terminal capability profile — color depth, mouse protocol level,
78
+ * and title-set support. Probe results are stable throughout the session
79
+ * (locked in at boot). Drives feature-gates so the TUI degrades gracefully
80
+ * on legacy, non-TTY, or restricted-terminal environments.
81
+ */
82
+ capability?: import('@wrongstack/core').TerminalCapability | undefined;
83
+ /**
84
+ * When true, free-text prompts are run through the prompt refiner
85
+ * ("did you mean this?") before reaching the main agent. Default on;
86
+ * toggled live via the `/enhance` slash command + `enhanceController`.
87
+ */
88
+ enhanceEnabled?: boolean | undefined;
89
+ /**
90
+ * Shared controller for the `/enhance on|off` toggle. The TUI rebinds
91
+ * `setEnabled` on mount to a dispatch-backed setter so the slash command
92
+ * (handled in the CLI) flips the reducer flag. Mirrors `fleetStreamController`.
93
+ */
94
+ enhanceController?: {
95
+ enabled: boolean;
96
+ setEnabled: (enabled: boolean) => void;
97
+ } | undefined;
98
+ /**
99
+ * When true (default), submitting a plain message while the agent is busy
100
+ * pops the send-mode picker (queue / by-the-way / steer) instead of silently
101
+ * queueing. Toggled live via `/queue picker on|off`; persisted to
102
+ * `autonomy.midRunSendPicker`.
103
+ */
104
+ midRunSendPicker?: boolean | undefined;
105
+ /** Auto-send countdown (ms) for the refinement preview panel. Default 4000. */
106
+ enhanceDelayMs?: number | undefined;
107
+ /**
108
+ * Returns a capability-gated low-effort reasoning hint for the prompt
109
+ * refiner (or undefined when nothing can be safely reduced). Forwarded to
110
+ * `enhanceUserPrompt` so a slow reasoning model does not burn thinking
111
+ * tokens on this shallow rewrite. Absent → the refiner sends no reasoning
112
+ * field, exactly as before.
113
+ */
114
+ getEnhancerReasoning?: (() => import('@wrongstack/core').ReasoningRequest | undefined) | undefined;
115
+ /**
116
+ * Build a Provider for a (providerId, modelId) pair WITHOUT switching the
117
+ * session — used to retry a failed refinement on the fallback/another model
118
+ * ephemerally. Returns undefined when the host can't build the provider
119
+ * (missing key, unknown id), in which case that recovery option is skipped.
120
+ */
121
+ buildEnhancerProvider?: ((providerId: string, modelId: string) => Promise<import('@wrongstack/core').Provider | undefined>) | undefined;
122
+ /**
123
+ * Resolve the one-key "retry with another model" fallback ref
124
+ * (`provider/model`) offered on a refine failure, or undefined when none is
125
+ * configured/derivable. Recomputed per call so `/fallback` and `/model`
126
+ * changes are reflected.
127
+ */
128
+ getEnhanceFallbackRef?: (() => string | undefined) | undefined;
129
+ /** Resolve the dedicated refiner target (`provider/model`) for the initial attempt. */
130
+ getConfiguredRefinerRef?: (() => string | undefined) | undefined;
131
+ /**
132
+ * Query the live YOLO state from the permission policy. Called after
133
+ * every slash-command dispatch so `/yolo off` (which mutates the
134
+ * policy inside the CLI) is immediately reflected in the status bar.
135
+ * Mirrors the `agent.ctx.model` → `setLiveModel` pattern used for
136
+ * provider/model sync.
137
+ */
138
+ getYolo?: (() => boolean) | undefined;
139
+ /** Set the live YOLO state from TUI-owned controls such as ConfirmPrompt. */
140
+ onYolo?: ((enabled: boolean) => boolean) | undefined;
141
+ /** Query the live autonomy mode. */
142
+ getAutonomy?: (() => 'off' | 'suggest' | 'auto' | 'eternal' | 'eternal-parallel') | undefined;
143
+ /** Query the live agent mode label for the status bar (e.g. "teach"). */
144
+ getModeLabel?: (() => string) | undefined;
145
+ /**
146
+ * Get all available agent modes (teach/brief/code-reviewer/etc.) with
147
+ * their names, descriptions, and the currently active one. Used by the
148
+ * `/mode` picker to populate the interactive selection list.
149
+ */
150
+ getModes?: (() => Promise<{
151
+ modes: import('@wrongstack/core').Mode[];
152
+ activeId: string | null;
153
+ }>) | undefined;
154
+ /** Switch to a different agent mode by id (e.g. "teach", "brief"). */
155
+ switchMode?: ((modeId: string) => Promise<string | null>) | undefined;
156
+ /**
157
+ * Access the eternal-autonomy engine. When autonomy mode goes to
158
+ * 'eternal' the TUI drives `runOneIteration()` from a post-slash hook
159
+ * so the engine and TUI never race for the shared Context.
160
+ */
161
+ getEternalEngine?: (() => import('@wrongstack/core').EternalAutonomyEngine | null) | undefined;
162
+ /**
163
+ * Access the parallel-eternal engine. When autonomy mode goes to
164
+ * 'eternal-parallel' the TUI drives `runOneIteration()` from a post-slash
165
+ * hook so the engine and TUI never race for the shared Context.
166
+ */
167
+ getParallelEngine?: (() => import('@wrongstack/core').ParallelEternalEngine | null) | undefined;
168
+ /**
169
+ * Access the active SDD parallel run's control surface (or null). The SIGINT
170
+ * handler uses it to stop a running `/sdd parallel` on the first Ctrl+C — the
171
+ * run has its own coordinator, so it is otherwise unreachable from there.
172
+ */
173
+ getSddRun?: (() => SddRunControl | null) | undefined;
174
+ /**
175
+ * Apply a post-run SDD lifecycle op (clean / rollback / destroy) from the host.
176
+ * Drives board overlay keys c / z / x so they work after the run finished.
177
+ */
178
+ onSddLifecycle?: ((op: 'cleanup_worktrees' | 'rollback' | 'destroy', opts?: {
179
+ revertMerged?: boolean;
180
+ }) => Promise<SddLifecycleResult>) | undefined;
181
+ /**
182
+ * Subscribe to live per-iteration events from the eternal engine. The
183
+ * TUI installs this on mount to render each iteration as a timeline
184
+ * entry the moment it lands — strictly more responsive than reading
185
+ * goal.json after the fact.
186
+ */
187
+ subscribeEternalIteration?: ((fn: (entry: import('@wrongstack/core').JournalEntry) => void) => () => void) | undefined;
188
+ /**
189
+ * Subscribe to per-iteration stage transitions from the autonomy engines.
190
+ * Drives `state.eternalStage` used by the status bar to show the
191
+ * engine's current location.
192
+ */
193
+ subscribeEternalStage?: ((fn: (stage: AutonomyStage) => void) => () => void) | undefined;
194
+ /**
195
+ * Subscribe to Goal phase/task events from the PhaseOrchestrator.
196
+ * Drives `state.goalRun` used by the PhaseMonitor component.
197
+ * Handlers receive the event name and payload from PhaseEventMap.
198
+ */
199
+ subscribeGoal?: ((handler: (event: string, payload: unknown) => void) => () => void) | undefined;
200
+ /**
201
+ * Read the persisted autonomy settings (defaultMode, autoProceedDelayMs).
202
+ * Used by the SettingsPicker in the TUI on mount and after Ctrl+S toggle.
203
+ */
204
+ /** Settings shape — shared between getSettings and saveSettings. */
205
+ getSettings?: (() => Settings) | undefined;
206
+ /**
207
+ * Persist settings changes. Returns null on success, or an
208
+ * error string on failure (so the TUI can display it as a hint).
209
+ */
210
+ saveSettings?: ((s: Settings) => string | null | Promise<string | null>) | undefined;
211
+ /** Load toggleable plugin rows for the interactive plugin picker. */
212
+ getPluginItems?: (() => PluginPickerItem[]) | undefined;
213
+ /** Toggle one plugin from the interactive picker and return the refreshed rows. */
214
+ onPluginToggle?: ((name: string) => Promise<{
215
+ items: PluginPickerItem[];
216
+ message?: string | undefined;
217
+ error?: string | undefined;
218
+ }>) | undefined;
219
+ /** Load MCP server rows for the interactive MCP picker. */
220
+ getMcpServers?: (() => McpPickerItem[]) | undefined;
221
+ /** Toggle one MCP server (enable/disable) from the interactive picker. */
222
+ onMcpToggle?: ((name: string) => Promise<{
223
+ items: McpPickerItem[];
224
+ message?: string | undefined;
225
+ error?: string | undefined;
226
+ }>) | undefined;
227
+ /** Restart one MCP server from the interactive picker. */
228
+ onMcpRestart?: ((name: string) => Promise<{
229
+ items: McpPickerItem[];
230
+ message?: string | undefined;
231
+ error?: string | undefined;
232
+ }>) | undefined;
233
+ /** Load tool rows for the interactive tool picker. */
234
+ getToolsItems?: (() => ToolPickerItem[]) | undefined;
235
+ /** Toggle one tool (enable/disable) from the interactive tool picker. */
236
+ onToolToggle?: ((name: string) => Promise<{
237
+ items: ToolPickerItem[];
238
+ message?: string | undefined;
239
+ error?: string | undefined;
240
+ }>) | undefined;
241
+ /** Get current brain risk level and decision log. */
242
+ getBrainData?: (() => {
243
+ riskLevel: BrainRiskLevel;
244
+ log: Array<{
245
+ kind: string;
246
+ question: string;
247
+ outcome: string;
248
+ age: string;
249
+ }>;
250
+ }) | undefined;
251
+ /** Set brain risk ceiling. */
252
+ onBrainRiskLevel?: ((level: BrainRiskLevel) => string | undefined) | undefined;
253
+ /** Full Brain settings editor bridge (live apply + persist). */
254
+ brainPanelHost?: import('./components/brain-panel-model.js').BrainPanelHost | undefined;
255
+ /** Get current Shadow Agent state. */
256
+ getShadowData?: (() => {
257
+ activeId: string | null;
258
+ running: boolean;
259
+ model: string;
260
+ intervalMs: number;
261
+ }) | undefined;
262
+ /** Start Shadow Agent. Returns message or error. */
263
+ onShadowStart?: (() => Promise<string | undefined>) | undefined;
264
+ /** Stop Shadow Agent. Returns message or error. */
265
+ onShadowStop?: (() => Promise<string | undefined>) | undefined;
266
+ /**
267
+ * Host for the interactive `/auth` panel (provider/key management, OAuth
268
+ * sign-in, local-server add). Provided by the CLI; when absent, `/auth`
269
+ * falls back to its plain-text output.
270
+ */
271
+ authHost?: AuthPanelHost | undefined;
272
+ /**
273
+ * Predict likely next steps after a completed turn (/next). The CLI owns the
274
+ * gating (toggle + autonomy off) and returns [] when disabled, so the App can
275
+ * call it unconditionally on a done turn. Display-only — never executed.
276
+ */
277
+ predictNext?: ((input: {
278
+ userRequest: string;
279
+ assistantSummary: string;
280
+ }) => Promise<string[]>) | undefined;
281
+ /**
282
+ * Called after each agent turn with the assistant's final output text.
283
+ * The host parses "<nextsteps>" or "💡 Next steps" suggestions from the text and stores
284
+ * them in the shared suggestion store so `/next 1`, `/next 1 2 3` work.
285
+ */
286
+ onSuggestionsParsed?: ((finalText: string) => void) | undefined;
287
+ /**
288
+ * Retrieve current suggestions from the shared suggestion store.
289
+ * Used by the TUI for next-steps auto-submit countdown in 'auto' mode.
290
+ */
291
+ getSuggestions?: (() => string[]) | undefined;
292
+ /**
293
+ * Retrieve current auto suggestions (items with auto="true" attribute).
294
+ * Used by YOLO+auto mode for automatic next-step submission.
295
+ */
296
+ getAutoSuggestions?: (() => string[]) | undefined;
297
+ /**
298
+ * Autonomy next prompt template for YOLO+auto mode. Contains {{suggestion}} placeholder.
299
+ */
300
+ autonomyNextPrompt?: string | undefined;
301
+ /**
302
+ * Store suggestions in the shared suggestion store. Used by the Entry
303
+ * component after parsing "<nextsteps>" or "💡 Next steps" from assistant output so the
304
+ * /next command and auto-submit countdown can access them.
305
+ */
306
+ setSuggestions?: ((steps: string[]) => void) | undefined;
307
+ /**
308
+ * SDD session context getter. When an SDD session is active, returns
309
+ * the AI prompt context to inject into user messages so the model
310
+ * knows it's in a spec-building conversation.
311
+ */
312
+ getSDDContext?: (() => Promise<string | null>) | undefined;
313
+ /**
314
+ * Process AI output for SDD auto-detection (spec, tasks, plan).
315
+ * Called after every agent.run() completes. Returns displayable
316
+ * status messages (e.g. "✓ Spec detected and saved!").
317
+ */
318
+ onSDDOutput?: ((output: string) => Promise<string[]>) | undefined;
319
+ /** Surfaced in the startup banner. Falls back to "dev" when omitted. */
320
+ appVersion?: string | undefined;
321
+ /** Provider id shown in the banner ("openai", "anthropic", …). Defaults to "agent". */
322
+ provider?: string | undefined;
323
+ /** Wire family for the configured provider — rendered under provider in the banner. */
324
+ family?: string | undefined;
325
+ /** Last 3 chars of the active API key, shown in the banner for "did I pick the right key?" verification. */
326
+ keyTail?: string | undefined;
327
+ /** Background autonomy agents to display in the banner (Brain, Shadow,
328
+ * Kanban, Mailbox, Memory, etc.). */
329
+ autonomyAgents?: import('./components/history/types.js').AutonomyAgentStatus[] | undefined;
330
+ /**
331
+ * Snapshot the keyed providers (and their model lists) for the
332
+ * `/model` picker. Called every time the picker opens, so the result
333
+ * stays in sync with config edits / new aliases. Async because the
334
+ * host may need to load the models.dev catalog.
335
+ */
336
+ getPickableProviders?: (() => Promise<ProviderOption[]>) | undefined;
337
+ /**
338
+ * Apply a (provider, model) pair after the picker confirms. Returns
339
+ * an error message on failure; null on success. The host owns the
340
+ * actual Provider construction + Context mutation.
341
+ */
342
+ switchProviderAndModel?: ((providerId: string, modelId: string) => string | null | Promise<string | null>) | undefined;
343
+ /**
344
+ * Apply an autonomy mode after the picker confirms. Returns
345
+ * an error string on failure; null on success.
346
+ */
347
+ switchAutonomy?: ((mode: 'off' | 'suggest' | 'auto' | 'eternal' | 'eternal-parallel') => string | null) | undefined;
348
+ /**
349
+ * Real max-context token budget for the *active model*, resolved by the
350
+ * CLI via the ModelsRegistry. The provider object only knows its family
351
+ * default (e.g. anthropic = 200k) which is wrong for variants like the
352
+ * 1M-context Opus model. The status bar's context chip uses this when
353
+ * provided and falls back to the provider baseline otherwise.
354
+ */
355
+ effectiveMaxContext?: number | undefined;
356
+ /** Absolute project root for goal.json loading. */
357
+ projectRoot?: string | undefined;
358
+ onExit: (code: number) => void;
359
+ /** Called when /clear is dispatched — the TUI should wipe its history entries (but keep the banner). */
360
+ onClearHistory?: ((dispatch: React.Dispatch<{
361
+ type: 'clearHistory';
362
+ model?: string | undefined;
363
+ provider?: string | undefined;
364
+ } | {
365
+ type: 'resetContextChip';
366
+ } | {
367
+ type: 'streamReset';
368
+ } | {
369
+ type: 'toolStreamClear';
370
+ }>) => void) | undefined;
371
+ /**
372
+ * Called on `/clear` to physically wipe the terminal (visible screen +
373
+ * native scrollback) before the chat history is reset. Without this, the
374
+ * `clearHistory` remount only reprints the banner *below* the old chat,
375
+ * which stays reachable in scrollback. Owned by `run-tui` because it needs
376
+ * the live Ink instance to reset frame tracking and avoid a smeared status
377
+ * bar. No-op outside the TUI.
378
+ */
379
+ clearTerminal?: (() => void) | undefined;
380
+ /**
381
+ * Called when the user selects a session in the /resume picker. The host
382
+ * loads the session JSONL, replays history entries, rebuilds the agent
383
+ * context, and returns the hydrated history entries + nextId for display.
384
+ * Returns null when resume fails (session not found, corrupt JSONL, etc.).
385
+ *
386
+ * The returned entries replace the TUI's current entries in a single
387
+ * `replaceHistory` dispatch, so the user sees the prior conversation
388
+ * exactly as it appeared during live interaction.
389
+ */
390
+ onResumeSession?: ((sessionId: string) => Promise<{
391
+ entries: HistoryEntry[];
392
+ nextId: number;
393
+ sessionId: string;
394
+ } | null>) | undefined;
395
+ /**
396
+ * List recent session summaries for the /resume picker. The host reads
397
+ * from the session store and returns ResumeSessionEntry-shaped data.
398
+ * Used both by the /resume slash command (to populate the picker) and
399
+ * optionally by the startup rehydration path.
400
+ */
401
+ listSessions?: ((limit?: number) => Promise<ResumeSessionEntry[]>) | undefined;
402
+ /**
403
+ * Goal text passed from `--goal "..."` on the command line. When set,
404
+ * the App mounts, renders the banner, then automatically dispatches
405
+ * a synthetic `/goal <text>` so the user lands in goal mode without
406
+ * having to type the slash command. Mutually advisory with `initialSteer`
407
+ * — `initialGoal` wins if both are present.
408
+ */
409
+ initialGoal?: string | undefined;
410
+ /**
411
+ * Initial user message passed from `--ask "..."` on the command line.
412
+ * Submitted verbatim as the first turn (no preamble) so users can
413
+ * launch the TUI and pre-populate one turn from a shell alias / script.
414
+ */
415
+ initialAsk?: string | undefined;
416
+ /** Directory for session JSONL files. Passed to App for /rewind. */
417
+ sessionsDir?: string | undefined;
418
+ /**
419
+ * Load project picker items from the global manifest.
420
+ * Called each time the project picker panel opens (F1).
421
+ */
422
+ getProjectPickerItems?: (() => Promise<import('./components/project-picker.js').ProjectPickerItem[]>) | undefined;
423
+ /**
424
+ * Called when the user selects a project or action in the project picker.
425
+ * The host CLI handles project switching (stopping agents, spawning new session).
426
+ */
427
+ onProjectSelect?: ((key: string, kind: 'project' | 'action') => void) | undefined;
428
+ /**
429
+ * Request the TUI to exit with a specific code. When a project is selected in
430
+ * the F1 picker, this is called to trigger a clean exit before the host CLI
431
+ * spawns a new wstack process in the target project directory.
432
+ */
433
+ requestExit?: ((code: number) => void) | undefined;
434
+ /**
435
+ * Load live session data from the cross-process SessionRegistry.
436
+ * Called when the sessions panel opens (F10).
437
+ */
438
+ getLiveSessions?: (() => Promise<import('./components/sessions-panel.js').LiveSessionEntry[]>) | undefined;
439
+ /**
440
+ * Called when the user selects a session from a DIFFERENT project
441
+ * in the F10 sessions panel. Spawns a new wstack terminal in the
442
+ * target project directory. Same-project sessions use onResumeSession.
443
+ */
444
+ onSwitchToSession?: ((sessionId: string, projectRoot: string, projectName: string) => void) | undefined;
445
+ /** Live director for fleet panel rendering. Null when director mode is off. */
446
+ director: Director | null;
447
+ /**
448
+ * Read the CURRENT director. Unlike the static `director` prop (captured at
449
+ * boot, null in non---director sessions), this sees a director the fleet
450
+ * host built lazily on the first delegate/spawn. Fleet teardown paths
451
+ * (Ctrl+C, Esc, /steer) resolve through this.
452
+ */
453
+ getDirector?: (() => Director | null) | undefined;
454
+ /** Optional roster for human-readable subagent names. */
455
+ fleetRoster?: Record<string, {
456
+ name: string;
457
+ }> | undefined;
458
+ /**
459
+ * Shared controller for the `/fleet stream on|off` and `/agents chat`
460
+ * slash commands. The App installs dispatch-backed setters on mount so
461
+ * the commands can flip the reducer's `fleetChat` mode from the CLI
462
+ * surface. Also seeds the boot value of `state.fleetChat` (cli-main
463
+ * creates it from the persisted config).
464
+ */
465
+ fleetStreamController?: {
466
+ enabled: boolean;
467
+ setEnabled: (enabled: boolean) => void;
468
+ mode: FleetChatVerbosity;
469
+ setMode: (mode: FleetChatVerbosity) => void;
470
+ } | undefined;
471
+ /**
472
+ * Read-only per-subagent transcript access for the F3 agents monitor.
473
+ * The CLI passes AgentMonitorService (structurally compatible); absent
474
+ * in embedded/test surfaces, where the detail card falls back to the
475
+ * streaming-tail snippet.
476
+ */
477
+ agentTranscripts?: AgentTranscriptReader | undefined;
478
+ /**
479
+ * Shared controller for the `/interrupt` slash command. The App installs the
480
+ * real `abortLeader` on mount so the command can abort the in-flight leader
481
+ * run (slash commands don't get the RunController). The fleet teardown is the
482
+ * command's own `onFleetKill`.
483
+ */
484
+ interruptController?: SessionInterruptController | undefined;
485
+ /**
486
+ * Controller for status bar hidden items. App installs a dispatch-backed
487
+ * setter on mount so the /statusline slash command can update the TUI's
488
+ * visible bar without a round-trip. The initial value is loaded from
489
+ * the config file before App mounts.
490
+ */
491
+ statuslineHiddenItems: StatuslineItem[];
492
+ setStatuslineHiddenItems: (items: StatuslineItem[]) => void;
493
+ /**
494
+ * Atomically persists statusline hidden items to disk. Used by the
495
+ * statusline picker so each toggle is immediately durable.
496
+ */
497
+ saveStatuslineHiddenItems: (items: StatuslineItem[]) => Promise<void>;
498
+ /**
499
+ * Controller for the agents monitor overlay. App installs a dispatch-backed
500
+ * setter on mount so the `/agents on|off` slash command can toggle the
501
+ * overlay without a round-trip.
502
+ */
503
+ agentsMonitorController?: {
504
+ visible: boolean;
505
+ setVisible: (visible: boolean) => void;
506
+ } | undefined;
507
+ /**
508
+ * Mutable ref for opening TUI panels from slash commands. The slash commands
509
+ * call `onPanelOpen.current(action)` to open panels. The App sets
510
+ * `onPanelOpen.current` to its actual dispatch function on mount.
511
+ */
512
+ onPanelOpen?: {
513
+ current: ((action: string) => boolean) | null;
514
+ } | undefined;
515
+ /** Active agent mode label shown in the status bar (e.g. "teach", "brief"). */
516
+ modeLabel?: string | undefined;
517
+ /**
518
+ * Called ONCE on mount by the App to install its debug-stream telemetry
519
+ * callback. The callback receives throttled DebugStreamStats every ~200 ms
520
+ * while the stream debug feature is active. The App dispatches to its
521
+ * reducer; the StatusBar renders the stats on line 3. When omitted (headless
522
+ * CLI/no TTY), debug stats go to stderr via the default callback.
523
+ */
524
+ registerDebugStreamCallback?: ((cb: (stats: {
525
+ chunkCount: number;
526
+ lastChunkSize: number;
527
+ lastDeltaMs: number;
528
+ totalBytes: number;
529
+ lastChunkAt: string;
530
+ }) => void) => void) | undefined;
531
+ /**
532
+ * Called on App unmount (via useEffect cleanup). Restores the debug-stream
533
+ * callback to the default stderr writer so non-TUI invocations continue to
534
+ * print debug lines.
535
+ */
536
+ restoreDebugStreamCallback?: (() => void) | undefined;
537
+ /**
538
+ * Messages restored from a previous session. When provided (non-empty),
539
+ * the TUI renders the prior conversation as history entries so a resumed
540
+ * session shows its full chat context, not just the LLM's internal state.
541
+ */
542
+ restoredMessages?: Message[] | undefined;
543
+ /**
544
+ * Tool execution records from a previous session, keyed by tool_use id.
545
+ * Used to render tool entries (name, duration, ok/error) in the TUI on
546
+ * resume. Events are `tool_call_end` records from the session JSONL.
547
+ */
548
+ restoredToolCalls?: Array<{
549
+ name: string;
550
+ id: string;
551
+ durationMs: number;
552
+ ok: boolean;
553
+ outputBytes?: number | undefined;
554
+ outputTokens?: number | undefined;
555
+ outputLines?: number | undefined;
556
+ }> | undefined;
557
+ /**
558
+ * Raw prior-session JSONL events. When provided, the resumed history is
559
+ * rebuilt with the canonical renderer (tool I/O + interleaved audit markers)
560
+ * instead of meta-only tool chips. Omitted → legacy fallback.
561
+ */
562
+ restoredEvents?: import('@wrongstack/core').SessionEvent[] | undefined;
563
+ /**
564
+ * When true, the agents monitor (F3) is open by default at TUI startup.
565
+ * Used by the `wrongstack quick` command to show agents panel immediately.
566
+ */
567
+ initialAgentsMonitorOpen?: boolean | undefined;
568
+ /**
569
+ * Subscribe to live events from the AutonomousCoordinator. Returns an unsubscribe
570
+ * function. TUI uses this to drive the coordinator panel live view.
571
+ */
572
+ subscribeCoordinatorEvents?: ((fn: (event: CoordinatorEvent) => void) => () => void) | undefined;
573
+ /** Start the AutonomousCoordinator with the given goal text. */
574
+ onCoordinatorStart?: ((goal: string) => void) | undefined;
575
+ /** Stop the AutonomousCoordinator. */
576
+ onCoordinatorStop?: (() => void) | undefined;
577
+ /** Whether the AutonomousCoordinator is currently running. */
578
+ coordinatorRunning?: boolean | undefined;
579
+ /** List available coordinator tasks the current terminal can claim. */
580
+ onCoordinatorTasks?: (() => Promise<Array<{
581
+ id: string;
582
+ title: string;
583
+ priority: string;
584
+ tags: string[];
585
+ }> | null>) | undefined;
586
+ /** Claim a coordinator task. Returns description on success. */
587
+ onCoordinatorClaim?: ((taskId: string) => Promise<string | null | {
588
+ description: string;
589
+ }>) | undefined;
590
+ /** Mark a claimed task as completed. */
591
+ onCoordinatorComplete?: ((taskId: string, result?: string) => Promise<string | null>) | undefined;
592
+ /** Mark a claimed task as failed. */
593
+ onCoordinatorFail?: ((taskId: string, error: string) => Promise<string | null>) | undefined;
594
+ /** Get coordinator stats for status display. */
595
+ onCoordinatorStatus?: (() => Promise<{
596
+ goals: {
597
+ total: number;
598
+ done: number;
599
+ pending: number;
600
+ failed: number;
601
+ };
602
+ dag: {
603
+ running: number;
604
+ ready: number;
605
+ done: number;
606
+ failed: number;
607
+ };
608
+ auction: {
609
+ pending: number;
610
+ inProgress: number;
611
+ };
612
+ } | null>) | undefined;
613
+ /**
614
+ * Unique client identifier (e.g. `tui@<uuid>`) used to tag `client.status`
615
+ * events emitted to the EventBus for the WebUI FleetHQ map HUD. When omitted,
616
+ * the App skips status emission.
617
+ */
618
+ clientId?: string | undefined;
619
+ /** Access the persistent memory store for listing and inspecting memories. */
620
+ memoryStore?: import('@wrongstack/core').MemoryStore | undefined;
621
+ }
622
+ //# sourceMappingURL=app-props.d.ts.map