@wrongstack/tui 0.68.0 → 0.77.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/README.md CHANGED
@@ -76,21 +76,7 @@ process.exit(exitCode);
76
76
  | `Esc` | Close any picker / dialog / agents monitor |
77
77
  | `Ctrl+L` | Clear screen (TUI keeps state — equivalent to scrolling) |
78
78
 
79
- ### Mouse mode (`--mouse`)
80
-
81
- With `--mouse` the TUI takes over terminal mouse tracking (forces alt-screen; native wheel-scroll and text selection are suspended until `/mouse off`). Then:
82
-
83
- - **Wheel** scrolls chat history, or moves the selection in an open picker.
84
- - **Click or drag the right-edge scrollbar** to jump/scrub the chat viewport to any position.
85
- - **Click inside the input** to move the caret (single- and multi-line).
86
- - **Click** a picker item to select + confirm it (single click).
87
- - **Click** the permission dialog's `[y]/[n]/[a]/[d]` buttons.
88
- - **Click** a `/rewind` checkpoint to select it; click again to rewind.
89
- - **Click** the status-bar model chip to open the model picker, or the `∞ MODE` chip to open the autonomy picker.
90
- - **Click** a `/settings` row to focus it; click again to cycle its value.
91
- - **Click** the lower region to dismiss an open monitor (`Ctrl+F/G/T/P`) or the `?` help overlay (parity with `Esc`).
92
-
93
- Keyboard shortcuts (always available in managed/alt-screen mode, not just `--mouse`):
79
+ Keyboard shortcuts (always available in managed/alt-screen mode):
94
80
  - **PgUp/PgDn** — page scroll through chat history.
95
81
  - **Home/End** — jump to top/bottom of chat history (when input is empty); move cursor to start/end of line (when typing).
96
82
  - **Ctrl+Home/End** — jump to top/bottom of chat history (always, even when typing).
package/dist/index.d.ts CHANGED
@@ -13,6 +13,28 @@ interface ProviderOption {
13
13
  modelsLabel?: string;
14
14
  }
15
15
 
16
+ interface Settings {
17
+ mode: 'off' | 'suggest' | 'auto';
18
+ delayMs: number;
19
+ titleAnimation: boolean;
20
+ yolo: boolean;
21
+ streamFleet: boolean;
22
+ chime: boolean;
23
+ confirmExit: boolean;
24
+ nextPrediction: boolean;
25
+ featureMcp: boolean;
26
+ featurePlugins: boolean;
27
+ featureMemory: boolean;
28
+ featureSkills: boolean;
29
+ featureModelsRegistry: boolean;
30
+ contextAutoCompact: boolean;
31
+ contextStrategy: 'hybrid' | 'intelligent' | 'selective';
32
+ logLevel: 'error' | 'warn' | 'info' | 'debug' | 'trace';
33
+ auditLevel: 'minimal' | 'standard' | 'full';
34
+ indexOnStart: boolean;
35
+ maxIterations: number;
36
+ }
37
+
16
38
  interface RunTuiOptions {
17
39
  agent: Agent;
18
40
  slashRegistry: SlashCommandRegistry;
@@ -81,7 +103,7 @@ interface RunTuiOptions {
81
103
  projectRoot?: string;
82
104
  /** Render into the terminal's alternate screen buffer (like vim/less/htop).
83
105
  * Default: false — native scrollback stays live so chat history is
84
- * scrollable via mouse wheel / Shift+PgUp, which matches the user's
106
+ * scrollable (wheel / Shift+PgUp), which matches the user's
85
107
  * "this is a chat app, let me scroll the chat" intuition. Pass true
86
108
  * (or run with `--alt-screen`) for the full-screen mode that owns the
87
109
  * terminal and prevents resize/overlay leaks of the live region —
@@ -90,13 +112,19 @@ interface RunTuiOptions {
90
112
  */
91
113
  altScreen?: boolean;
92
114
  /**
93
- * Enable full mouse support: clickable list items in menus/pickers and
94
- * in-app mouse-wheel scrolling of the chat history. Opt-in (default false)
95
- * because enabling terminal mouse tracking disables the terminal's own
96
- * wheel-scroll and text-selection/copy. When true this FORCES alt-screen
97
- * on (the app must own the screen to render its scroll viewport).
115
+ * Terminal title animation on/off. Defaults to true. When false, the
116
+ * OSC-0 window/tab title stays static (the app name only, no spinner).
117
+ * Controlled via /settings Terminal title animation.
98
118
  */
99
- mouse?: boolean;
119
+ titleAnimation?: boolean;
120
+ /** Play terminal bell (\\x07) when agent run completes. */
121
+ chime?: boolean;
122
+ /** Show "confirm exit" message on first Ctrl+C instead of "exit". */
123
+ confirmExit?: boolean;
124
+ /** Active agent mode label shown in the status bar (e.g. "teach", "brief"). */
125
+ modeLabel?: string;
126
+ /** Live getter for the agent mode label so the status bar updates after /mode. */
127
+ getModeLabel?: () => string;
100
128
  /**
101
129
  * Called right after we exit the alt-screen on a clean shutdown. The
102
130
  * CLI uses this to print a one-line "session saved to …" hint into
@@ -140,6 +168,16 @@ interface RunTuiOptions {
140
168
  enabled: boolean;
141
169
  setEnabled: (enabled: boolean) => void;
142
170
  };
171
+ /**
172
+ * Controller for the `/enhance on|off` prompt-refinement toggle. The App
173
+ * installs a dispatch-backed `setEnabled` here on mount so the slash command
174
+ * (run in the CLI process) flips the TUI's reducer flag. Mirrors
175
+ * `fleetStreamController`.
176
+ */
177
+ enhanceController?: {
178
+ enabled: boolean;
179
+ setEnabled: (enabled: boolean) => void;
180
+ };
143
181
  /**
144
182
  * Controller for status bar hidden items. App installs a dispatch-backed
145
183
  * setter on mount so the /statusline slash command can update the TUI's
@@ -199,18 +237,12 @@ interface RunTuiOptions {
199
237
  * Read the persisted autonomy settings (defaultMode, autoProceedDelayMs).
200
238
  * Used by the SettingsPicker in the TUI on mount and after Ctrl+S toggle.
201
239
  */
202
- getSettings?: () => {
203
- mode: 'off' | 'suggest' | 'auto';
204
- delayMs: number;
205
- };
240
+ getSettings?: () => Settings;
206
241
  /**
207
- * Persist autonomy settings changes. Returns null on success, or an
242
+ * Persist settings changes. Returns null on success, or an
208
243
  * error string on failure (so the TUI can display it as a hint).
209
244
  */
210
- saveSettings?: (s: {
211
- mode: 'off' | 'suggest' | 'auto';
212
- delayMs: number;
213
- }) => string | null | Promise<string | null>;
245
+ saveSettings?: (s: Settings) => string | null | Promise<string | null>;
214
246
  /**
215
247
  * Predict likely next steps after a completed turn. The CLI wires this from
216
248
  * the session provider and the `/next` toggle; it returns [] when prediction
@@ -223,4 +255,4 @@ interface RunTuiOptions {
223
255
  }
224
256
  declare function runTui(opts: RunTuiOptions): Promise<number>;
225
257
 
226
- export { type RunTuiOptions, runTui };
258
+ export { type RunTuiOptions, type Settings, runTui };