@aiwayds/dsh-tui-pi 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +175 -41
  2. package/lib/agent-manager.d.ts +125 -0
  3. package/lib/agent-manager.js +298 -0
  4. package/lib/agent-manager.js.map +1 -0
  5. package/lib/agents.d.ts +30 -0
  6. package/lib/agents.js +468 -0
  7. package/lib/agents.js.map +1 -0
  8. package/lib/append-system.d.ts +2 -0
  9. package/lib/append-system.js +1 -1
  10. package/lib/append-system.js.map +1 -1
  11. package/lib/dsh-events.d.ts +12 -0
  12. package/lib/editor.d.ts +58 -0
  13. package/lib/editor.js +92 -0
  14. package/lib/editor.js.map +1 -1
  15. package/lib/footer.d.ts +8 -0
  16. package/lib/footer.js +8 -0
  17. package/lib/footer.js.map +1 -1
  18. package/lib/hotkeys.d.ts +93 -0
  19. package/lib/hotkeys.js +305 -0
  20. package/lib/hotkeys.js.map +1 -0
  21. package/lib/index.js +301 -29
  22. package/lib/index.js.map +1 -1
  23. package/lib/keymap.d.ts +177 -0
  24. package/lib/keymap.js +189 -0
  25. package/lib/keymap.js.map +1 -0
  26. package/lib/live-widgets.d.ts +29 -24
  27. package/lib/live-widgets.js +78 -45
  28. package/lib/live-widgets.js.map +1 -1
  29. package/lib/panels.d.ts +177 -0
  30. package/lib/panels.js +331 -0
  31. package/lib/panels.js.map +1 -0
  32. package/lib/selectors.d.ts +12 -1
  33. package/lib/selectors.js +1 -1
  34. package/lib/selectors.js.map +1 -1
  35. package/lib/session.d.ts +25 -0
  36. package/lib/session.js +137 -10
  37. package/lib/session.js.map +1 -1
  38. package/lib/settings.d.ts +1 -2
  39. package/lib/subagent-policy.d.ts +58 -0
  40. package/lib/subagent-policy.js +137 -0
  41. package/lib/subagent-policy.js.map +1 -0
  42. package/lib/subagent-viewer.d.ts +49 -0
  43. package/lib/subagent-viewer.js +523 -0
  44. package/lib/subagent-viewer.js.map +1 -0
  45. package/lib/theme/index.js +4 -0
  46. package/lib/theme/index.js.map +1 -1
  47. package/lib/theme/palette.d.ts +21 -3
  48. package/lib/theme/palette.js +27 -6
  49. package/lib/theme/palette.js.map +1 -1
  50. package/lib/theme-settings.d.ts +39 -4
  51. package/lib/theme-settings.js +69 -12
  52. package/lib/theme-settings.js.map +1 -1
  53. package/lib/tui.d.ts +23 -9
  54. package/lib/tui.js +99 -8
  55. package/lib/tui.js.map +1 -1
  56. package/package.json +3 -4
  57. package/patches/@earendil-works__pi-tui.patch +206 -2
  58. package/scripts/dev-install.mjs +87 -0
  59. package/scripts/link-dsh-closure.mjs +85 -0
@@ -9,13 +9,12 @@
9
9
  * renders zero rows while empty and grows to its content while the model
10
10
  * has todos.
11
11
  * - `activityDoc` — the lastRequest container below the editor
12
- * (`ui.lastRequest`): the ` ↳ <last request>` line (persisting across
12
+ * (`ui.lastRequest`): the ` ● <last request>` line (persisting across
13
13
  * agent churn) followed by one compact line PER RUNNING agent. NO box
14
- * chrome, NO `● Agents` header, NO connector and NO provider — just
15
- * ` ↳ ⠋ <name> · ↻N≤M · 562 token (4%) · 13.6s`, the ` ↳ ` prefix
16
- * nesting one column right of the request line's ` ↳ ` (a tree level
17
- * under the last request) so the agent NAMES align under that level.
18
- * Auto height — it
14
+ * chrome, NO `● Agents` header, NO provider — just
15
+ * `├─ ⠋ <name> · ↻N≤M · 21k/1m · 13.6s · <latest output>`, the `├─ ` /
16
+ * `└─ ` prefix in the same column as the todo rows and the request ` ● `
17
+ * (the last running agent closes the list with `└─ `). Auto height — it
19
18
  * collapses to zero rows when both the last-request line is cleared and no
20
19
  * agent runs.
21
20
  *
@@ -38,6 +37,19 @@ import { clipToWidth, visibleWidth } from "./text.js";
38
37
  export const AGENT_TICK_MS = 100;
39
38
  /** Braille spinner cycle; the frame index advances once per tick. */
40
39
  export const AGENT_SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
40
+ /**
41
+ * Compact human-readable size: 1_500_000 → `1.5m`, 20_965 → `20k`, 999 → `999`.
42
+ * Millions keep one decimal (a trailing `.0` dropped), thousands floor to `k`.
43
+ */
44
+ export function fmtCompact(n) {
45
+ if (n >= 1_000_000) {
46
+ const m = n / 1_000_000;
47
+ return `${Number.isInteger(m) ? String(m) : m.toFixed(1).replace(/\.0$/, '')}m`;
48
+ }
49
+ if (n >= 1_000)
50
+ return `${Math.floor(n / 1_000)}k`;
51
+ return String(n);
52
+ }
41
53
  /** One bordered row of the Todos panel: `│ ` + inner + ` │` (no trailing RESET). */
42
54
  function borderedRow(boxWidth, borderFg, inner) {
43
55
  const pad = Math.max(0, boxWidth - 4 - visibleWidth(inner));
@@ -60,7 +72,7 @@ export class LiveWidgets {
60
72
  todosText;
61
73
  /** The merged running-agent Text in `activityDoc`, replaced on rebuild. */
62
74
  agentsText;
63
- /** The ` ↳ <last request>` Text in `activityDoc` (persists across churn). */
75
+ /** The ` ● <last request>` Text in `activityDoc` (persists across churn). */
64
76
  requestText;
65
77
  /** Plain clipped last-request text backing `requestText` (for setTheme). */
66
78
  requestDisplay;
@@ -69,7 +81,7 @@ export class LiveWidgets {
69
81
  /**
70
82
  * @param todosDoc The dock slot ABOVE the chat input — the Todos boxed
71
83
  * panel lives here.
72
- * @param activityDoc The lastRequest container BELOW the editor — the ` ↳ `
84
+ * @param activityDoc The lastRequest container BELOW the editor — the ` ● `
73
85
  * last-request line plus the compact running-agent lines live here.
74
86
  */
75
87
  constructor(todosDoc, activityDoc, theme, requestRender) {
@@ -79,7 +91,7 @@ export class LiveWidgets {
79
91
  this.requestRender = requestRender;
80
92
  }
81
93
  /**
82
- * Render the ` ↳ <text>` last-request line in `activityDoc`, UNDER which the
94
+ * Render the ` ● <text>` last-request line in `activityDoc`, UNDER which the
83
95
  * running-agent lines appear. `undefined` (or blank) removes the line. Same
84
96
  * styling as before the merge: `fgMuted` prefix, but the text is clipped to
85
97
  * the terminal width (`columns - 5`) so it ALWAYS renders on one row and
@@ -95,14 +107,14 @@ export class LiveWidgets {
95
107
  }
96
108
  return;
97
109
  }
98
- // One-row budget: paddingX=1 on each side (2 cols) + the ` ↳ ` prefix (3
110
+ // One-row budget: paddingX=1 on each side (2 cols) + the ` ● ` prefix (3
99
111
  // cols) → the plain `display` must fit `columns - 5`. Non-TTY fallback
100
112
  // keeps the old 200-col behavior.
101
113
  const budget = Math.max(1, (process.stdout.columns ?? 200) - 5);
102
114
  const display = clipToWidth(text, budget);
103
115
  if (this.requestText === undefined) {
104
116
  this.requestText = new Text('', 1, 0);
105
- // Keep the ↳ line ABOVE the running-agent lines regardless of whether
117
+ // Keep the ● line ABOVE the running-agent lines regardless of whether
106
118
  // they already render (no insert-at on a plain Container — remove and
107
119
  // re-add both in the right order).
108
120
  if (this.agentsText !== undefined)
@@ -112,7 +124,7 @@ export class LiveWidgets {
112
124
  this.activityDoc.addChild(this.agentsText);
113
125
  }
114
126
  this.requestDisplay = display;
115
- this.requestText.setText(ansiFg(this.theme.palette.fgMuted) + ` ↳ ${display}` + RESET);
127
+ this.requestText.setText(ansiFg(this.theme.palette.fgMuted) + ` ● ${display}` + RESET);
116
128
  this.requestRender();
117
129
  }
118
130
  /** Replace the todos snapshot (`todo/write` events and replay). */
@@ -136,22 +148,22 @@ export class LiveWidgets {
136
148
  this.spinnerFrame += 1;
137
149
  this.rebuild();
138
150
  }
139
- /** Recolor the widget (Todos panel, ↳ line and agent lines) under a theme
151
+ /** Recolor the widget (Todos panel, ● line and agent lines) under a theme
140
152
  * hot-switch (no-op on the same bundle). */
141
153
  setTheme(theme) {
142
154
  if (theme === this.theme)
143
155
  return;
144
156
  this.theme = theme;
145
157
  this.rebuild();
146
- // The ↳ line is not part of rebuild() (it persists independent of the
158
+ // The request line is not part of rebuild() (it persists independent of the
147
159
  // agent lines); recolor it here from the cached plain text.
148
160
  if (this.requestDisplay !== undefined && this.requestText !== undefined) {
149
- this.requestText.setText(ansiFg(this.theme.palette.fgMuted) + ` ↳ ${this.requestDisplay}` + RESET);
161
+ this.requestText.setText(ansiFg(this.theme.palette.fgMuted) + ` ● ${this.requestDisplay}` + RESET);
150
162
  }
151
163
  }
152
164
  /**
153
165
  * Drop everything except the last-request echo (`/new`): clears the Todos
154
- * panel and the running-agent lines, keeps the ` ↳ ` line. The bridge also
166
+ * panel and the running-agent lines, keeps the ` ● ` line. The bridge also
155
167
  * fires `renderAgents([])`.
156
168
  */
157
169
  clear() {
@@ -171,9 +183,9 @@ export class LiveWidgets {
171
183
  /**
172
184
  * Rebuild the two live surfaces:
173
185
  * - `todosDoc`: one bordered Todos panel (or nothing when all completed).
174
- * - `activityDoc`: the ` ↳ ` line (managed separately, persists) followed
186
+ * - `activityDoc`: the ` ● ` line (managed separately, persists) followed
175
187
  * by ONE Text holding the compact running-agent lines joined by '\n'
176
- * (or nothing when no agent runs — the slot collapses to the ↳ line).
188
+ * (or nothing when no agent runs — the slot collapses to the ● line).
177
189
  * Clear-when-done: the Todos panel hides once every todo is completed (the
178
190
  * model writes the whole-list snapshot and rarely clears it — an
179
191
  * all-completed list is the end-of-work signal); the agent lines hide once
@@ -193,14 +205,14 @@ export class LiveWidgets {
193
205
  }
194
206
  const running = this.liveAgents.filter(view => view.outcome === undefined);
195
207
  if (running.length > 0) {
196
- const lines = running.map(view => this.compactAgentLine(view));
208
+ const lines = running.map((view, i) => this.compactAgentLine(view, i === running.length - 1));
197
209
  const text = lines.join('\n');
198
210
  if (this.agentsText !== undefined) {
199
211
  this.agentsText.setText(text);
200
212
  }
201
213
  else {
202
214
  this.agentsText = new Text(text, 1, 0);
203
- // Append under the ↳ line when it is present (plain Container appends).
215
+ // Append under the ● line when it is present (plain Container appends).
204
216
  this.activityDoc.addChild(this.agentsText);
205
217
  }
206
218
  }
@@ -251,23 +263,23 @@ export class LiveWidgets {
251
263
  return lines;
252
264
  }
253
265
  /**
254
- * One compact running-agent line for the last-request area: ` ↳ ` prefix
255
- * (nesting one column right of the ` ↳ ` request text, like a tree level
256
- * under the last request) + spinner + the agent NAME
257
- * (`view.label`, matching the boxed panel's main line) + the exact meta that
258
- * main line showed (`↻retries≤max`, `N token (%)`, elapsed). NO box chrome,
259
- * NO connector, NO provider — the name is the prominent element. The label
260
- * is the only unbounded field; it is clipped against a budget measured from
261
- * the terminal width so the whole plain line (prefix included) fits, then
262
- * the assembled plain line is clipped to the terminal width BEFORE any ANSI
263
- * is applied (clipToWidth counts SGR fragments as visible columns — style
264
- * last). The provider (`view.provider`) is dropped from this line.
266
+ * One compact running-agent line for the last-request area, todo-style:
267
+ * `├─ `/`└─ ` connector (same column as the todo rows and the request
268
+ * ` ● `) + spinner + the agent NAME (`view.label`, matching the boxed
269
+ * panel's main line) + the exact meta that main line showed (`↻retries≤max`,
270
+ * compact `tokens[/contextWindow]`, elapsed) + the child's latest output
271
+ * line when one exists (` · <tail>`, so the user sees it is alive). NO box
272
+ * chrome, NO provider — the name is the prominent element; the last running
273
+ * agent closes the list with `└─ `. The label is the only unbounded field;
274
+ * it is clipped against a budget measured from the terminal width so the
275
+ * whole plain line (prefix included) fits, then the assembled plain line is
276
+ * clipped to the terminal width BEFORE any ANSI is applied (clipToWidth
277
+ * counts SGR fragments as visible columns — style last).
265
278
  */
266
- compactAgentLine(view) {
267
- // two spaces + ↳ + space: nests one column right of the request line's
268
- // ` ↳ ` (the request renders as paddingX(1) + ` ↳ `), like a tree level
269
- // under the last request, so the agent names align under that level.
270
- const PREFIX = ' ↳ ';
279
+ compactAgentLine(view, isLast) {
280
+ // Todo-style tree connector: `├─ ` for non-final rows, `└─ ` for the last
281
+ // running agent — aligned with the todo rows and the request ` ● `.
282
+ const PREFIX = isLast ? '└─ ' : '├─ ';
271
283
  const width = Math.max(1, process.stdout.columns ?? 80);
272
284
  const glyph = AGENT_SPINNER_FRAMES[this.spinnerFrame % AGENT_SPINNER_FRAMES.length];
273
285
  const metaParts = [];
@@ -275,20 +287,39 @@ export class LiveWidgets {
275
287
  metaParts.push(view.maxRetries === undefined ? `↻${view.retries}` : `↻${view.retries}≤${view.maxRetries}`);
276
288
  }
277
289
  if (view.tokens > 0) {
278
- const pct = typeof view.contextWindow === 'number' && view.contextWindow > 0
279
- ? ` (${Math.round(view.tokens / view.contextWindow * 100)}%)`
290
+ // Compact tokens[/contextWindow]: `21k/1m` — no percent, no "token".
291
+ const ctx = typeof view.contextWindow === 'number' && view.contextWindow > 0
292
+ ? `/${fmtCompact(view.contextWindow)}`
280
293
  : '';
281
- metaParts.push(`${view.tokens} token${pct}`);
294
+ metaParts.push(`${fmtCompact(view.tokens)}${ctx}`);
282
295
  }
283
296
  const elapsed = (Date.now() - view.startedAt) / 1000;
284
297
  metaParts.push(`${elapsed.toFixed(1)}s`);
285
- const metaPlain = ' · ' + metaParts.join(' · ');
286
- // Defensive: never render an empty name — fall back to the child id.
298
+ let metaPlain = ' · ' + metaParts.join(' · ');
299
+ // Tail: the child's latest visible output line, appended after the elapsed
300
+ // column so the user knows it is alive. Budget ≤30% of the terminal width
301
+ // (clamped 20..60 cols); when the folded line is wider, clip to
302
+ // tailBudget-2 and end with `..` (clipToWidth's own `…` is stripped).
303
+ const lastLine = view.lastLine;
304
+ if (lastLine !== undefined && lastLine !== '') {
305
+ const folded = lastLine.replace(/\s+/g, ' ').trim();
306
+ if (folded !== '') {
307
+ const tailBudget = Math.min(60, Math.max(20, Math.floor(width * 0.3)));
308
+ if (visibleWidth(folded) > tailBudget) {
309
+ const clipped = clipToWidth(folded, tailBudget - 2).replace(/…$/, '');
310
+ metaPlain += ` · ${clipped}..`;
311
+ }
312
+ else {
313
+ metaPlain += ` · ${folded}`;
314
+ }
315
+ }
316
+ }
317
+ // Defensive: never render an empty name — fall back to `subagent`.
287
318
  const rawLabel = clipPanelLine(view.label, 0).replace(/\r/g, '').trim();
288
319
  const namePlain = rawLabel === ''
289
- ? `subagent ${(view.childId ?? '').slice(0, 8)}`
320
+ ? 'subagent'
290
321
  : rawLabel;
291
- // Fixed chrome: prefix (4) + spinner (1) + following space (1) + a safety
322
+ // Fixed chrome: prefix (3) + spinner (1) + following space (1) + a safety
292
323
  // column. The label takes the remainder of the width budget after meta.
293
324
  const fixed = visibleWidth(PREFIX) + 1 + 1 + 1;
294
325
  const nameBudget = width - fixed - visibleWidth(metaPlain);
@@ -297,11 +328,13 @@ export class LiveWidgets {
297
328
  const plain = PREFIX + glyph + ' ' + nameClipped + metaPlain;
298
329
  const clipped = clipToWidth(plain, width);
299
330
  // Style segments from the (clipped, guaranteed-identical-when-it-fits)
300
- // plain pieces: spinner muted, NAME default (prominent), meta subtle.
331
+ // plain pieces: connector subtle, spinner muted, NAME default (prominent),
332
+ // meta (incl. the tail) subtle.
333
+ const connector = ansiFg(this.theme.palette.fgSubtle) + PREFIX + RESET;
301
334
  const spinner = ansiFg(this.theme.palette.fgMuted) + glyph + RESET;
302
335
  const metaStyled = ansiFg(this.theme.palette.fgSubtle) + metaPlain + RESET;
303
336
  const nameStyled = ansiFg(this.theme.palette.fgDefault) + nameClipped + RESET;
304
- const base = PREFIX + spinner + ' ' + nameStyled + metaStyled;
337
+ const base = connector + spinner + ' ' + nameStyled + metaStyled;
305
338
  // If clipping truncated the plain line (pathological meta), re-clip the
306
339
  // assembled styled line's visible width too; otherwise base is exact.
307
340
  if (visibleWidth(clipped) < visibleWidth(plain)) {
@@ -1 +1 @@
1
- {"version":3,"file":"live-widgets.js","sourceRoot":"","sources":["../src/live-widgets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC3E,OAAO,EAAE,MAAM,EAAE,KAAK,EAAiB,MAAM,kBAAkB,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAErD,4EAA4E;AAC5E,MAAM,CAAC,MAA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AAC,GAAG,KAAK,GAAG,KAAK,CAAA;QAClE,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,GAAG,KAAK,CAAA;QAC1E,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,WAAW,GAAG,KAAK,CAAA;QAC7E,MAAM,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,GAAG,GAAG,UAAU,GAAG,UAAU,CAAA;QAChE,wEAAwE;QACxE,sEAAsE;QACtE,IAAI,YAAY,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAChD,wEAAwE;YACxE,sDAAsD;YACtD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,KAAK,CAAA;QAC7D,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
@@ -0,0 +1,177 @@
1
+ /**
2
+ * Reusable select-panel framework — the shared building blocks behind every
3
+ * picker/browser overlay in this TUI (agents table, field windows, viewers,
4
+ * and future migrations of the /model, /settings and /resume surfaces).
5
+ *
6
+ * What lives here:
7
+ *
8
+ * - `padCell` / `columnWidths` — width-exact table cells (clip + pad by
9
+ * VISIBLE columns, CJK-safe) and fixed+flex column layout. Cells are
10
+ * padded so columns align even when row content has different widths —
11
+ * the classic "table rows are misaligned" bug is a missing pad, not a
12
+ * missing clip.
13
+ * - `ListController` — pure navigation state (index/scroll/viewport) with
14
+ * up/down/pageUp/pageDown and viewport clamping; unit-testable, reused by
15
+ * every panel.
16
+ * - `TablePanel` — a self-drawn table: header row + data rows + navigation
17
+ * + scroll info + selection highlight.
18
+ * - `FieldPanel` — a title + read-only content block + editable field rows
19
+ * (Enter edits the focused row, optional single-key shortcuts).
20
+ * - `ViewerPanel` — a read-only line viewer with a line cap.
21
+ * - `PanelHost` — overlay lifecycle: swap to a new overlay (show-new-then-
22
+ * hide-old, no focus flash), teardown on showOverlay failure, one host
23
+ * per interactive flow.
24
+ */
25
+ import { type Component, type OverlayHandle, type TUI } from '@earendil-works/pi-tui';
26
+ import { type TuiTheme } from './theme/index.ts';
27
+ /** Row marker slot width (▸ or two spaces). */
28
+ export declare const MARKER_W = 2;
29
+ /** Column separator between table cells (box-drawing, matches the frame). */
30
+ export declare const TABLE_SEP = " \u2502 ";
31
+ /**
32
+ * Clip `text` to `width` visible columns and pad it with spaces to exactly
33
+ * `width` columns — the width-exact cell primitive. `align` controls where
34
+ * the padding goes.
35
+ */
36
+ export declare function padCell(text: string, width: number, align?: 'left' | 'right'): string;
37
+ /** One table column definition. Exactly one column may be `flex`. */
38
+ export interface TableColumn {
39
+ key: string;
40
+ title: string;
41
+ /** Fixed visible width; ignored on the flex column. */
42
+ width?: number;
43
+ align?: 'left' | 'right';
44
+ /** The flex column takes whatever the fixed columns leave over. */
45
+ flex?: boolean;
46
+ }
47
+ /**
48
+ * Resolve visible widths for every column: fixed columns keep their width,
49
+ * the single flex column gets the remainder (with a floor), separators are
50
+ * counted between columns.
51
+ */
52
+ export declare function columnWidths(total: number, columns: readonly TableColumn[]): number[];
53
+ /** Pure navigation state shared by all panels (unit-testable). */
54
+ export declare class ListController {
55
+ index: number;
56
+ scroll: number;
57
+ readonly maxVisible: number;
58
+ private readonly length;
59
+ constructor(length: () => number, maxVisible?: number);
60
+ up(): void;
61
+ down(): void;
62
+ pageUp(): void;
63
+ pageDown(): void;
64
+ setIndex(index: number): void;
65
+ private clampScroll;
66
+ }
67
+ /** Render the ▸/spaces row marker for the selected row. */
68
+ export declare function rowMarker(selected: boolean): string;
69
+ /** Scroll info suffix, e.g. ` (3/40)` — only when the list overflows. */
70
+ export declare function scrollInfo(controller: ListController, length: number): string;
71
+ /** Shared theme fns used by every panel (fg color wrappers). */
72
+ export interface PanelThemeFns {
73
+ accent(text: string): string;
74
+ muted(text: string): string;
75
+ subtle(text: string): string;
76
+ attention(text: string): string;
77
+ }
78
+ /** Build the standard fg wrappers from a TuiTheme. */
79
+ export declare function panelThemeFns(theme: TuiTheme): PanelThemeFns;
80
+ /** Shared navigation keys; returns true when `data` was consumed. */
81
+ export declare function handleListKeys(data: string, controller: ListController, length: number): boolean;
82
+ /** Options for a TablePanel. */
83
+ export interface TablePanelOptions<T> {
84
+ columns: readonly TableColumn[];
85
+ rows: readonly T[];
86
+ /** Cell text for one row/column pair (plain text, clipped+padded by us). */
87
+ renderCell(row: T, column: TableColumn): string;
88
+ onSelect(row: T): void;
89
+ onCancel(): void;
90
+ footer?: string;
91
+ preselect?: number;
92
+ }
93
+ /**
94
+ * A self-drawn table panel: header row, aligned data rows, navigation with
95
+ * viewport clamping, selection highlight, scroll info and a footer hint.
96
+ */
97
+ export declare class TablePanel<T> implements Component {
98
+ private readonly theme;
99
+ private readonly options;
100
+ private readonly controller;
101
+ constructor(theme: TuiTheme, options: TablePanelOptions<T>);
102
+ invalidate(): void;
103
+ render(width: number): string[];
104
+ handleInput(data: string): void;
105
+ }
106
+ /** One field row of a FieldPanel. */
107
+ export interface FieldRow {
108
+ key: string;
109
+ value: string;
110
+ editable?: boolean;
111
+ }
112
+ /** Options for a FieldPanel. */
113
+ export interface FieldPanelOptions {
114
+ /** First line (may carry ANSI styling, e.g. a colored title). */
115
+ title: string;
116
+ /** Read-only content block between the title and the field rows. */
117
+ content?: readonly string[];
118
+ fields: readonly FieldRow[];
119
+ onEdit(index: number): void;
120
+ onCancel(): void;
121
+ footer?: string;
122
+ /** Single-key shortcuts (e.g. m/t/d) mapped to the same actions. */
123
+ shortcuts?: Readonly<Record<string, () => void>>;
124
+ /** Live status line (attention-colored) shown above the footer. */
125
+ status?: () => string | undefined;
126
+ }
127
+ /**
128
+ * A field panel: title, an optional read-only content block, navigable
129
+ * editable field rows (Enter edits the focused row), shortcuts, a status
130
+ * line and a footer hint.
131
+ */
132
+ export declare class FieldPanel implements Component {
133
+ private readonly theme;
134
+ private readonly options;
135
+ private readonly controller;
136
+ private readonly keyWidth;
137
+ constructor(theme: TuiTheme, options: FieldPanelOptions);
138
+ invalidate(): void;
139
+ render(width: number): string[];
140
+ handleInput(data: string): void;
141
+ }
142
+ /** Options for a ViewerPanel. */
143
+ export interface ViewerPanelOptions {
144
+ title: string;
145
+ lines: readonly string[];
146
+ /** Maximum rendered lines (default 40); overflow is reported. */
147
+ maxLines?: number;
148
+ footer?: string;
149
+ onClose(): void;
150
+ }
151
+ /** A read-only line viewer with a line cap (Esc/Enter closes). */
152
+ export declare class ViewerPanel implements Component {
153
+ private readonly theme;
154
+ private readonly options;
155
+ constructor(theme: TuiTheme, options: ViewerPanelOptions);
156
+ invalidate(): void;
157
+ render(width: number): string[];
158
+ handleInput(data: string): void;
159
+ }
160
+ /** Overlay size literal accepted by `TUI.showOverlay`. */
161
+ export type PanelSize = number | `${number}%`;
162
+ /**
163
+ * Overlay lifecycle for one interactive flow: swap overlays (show the next
164
+ * before hiding the previous — no focus flash), tear down cleanly on a
165
+ * showOverlay failure, and hand the keyboard back through `onError` when a
166
+ * half-mounted overlay must not strand it.
167
+ */
168
+ export declare class PanelHost {
169
+ private readonly tui;
170
+ private readonly theme;
171
+ private readonly onError;
172
+ private current;
173
+ constructor(tui: TUI, theme: TuiTheme, onError?: (message: string) => void);
174
+ /** Show `component`, hiding the previous overlay. Returns undefined on failure. */
175
+ open(component: Component, width?: PanelSize, maxHeight?: PanelSize): OverlayHandle | undefined;
176
+ close(): void;
177
+ }