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