@linxiraos/pi-tui 1.3.1 → 1.4.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/CHANGELOG.md CHANGED
@@ -1,182 +1,8 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [1.3.1] - 2026-10-19
4
-
5
- ### Breaking Changes
6
-
7
- - Removed `KeyEventType` export from public API
8
- - `Editor` constructor now requires `TUI` as first parameter: `new Editor(tui, theme)`. This enables automatic vertical scrolling when content exceeds terminal height. ([#732](https://github.com/badlogic/pi-mono/issues/732))
9
- - Removed `Key` helper object from public API; use string literals like `"ctrl+c"` instead of `Key.ctrl("c")`
10
-
11
- ### Added
12
-
13
- - Added `ComposerPreferences.completeScrollback` (default `false`): rows a growing HUD or dialog pushes off screen go straight to scrollback instead of being held back until it shrinks ([#15692](https://github.com/can1357/oh-my-pi/pull/15692) by [@Ilm-Alan](https://github.com/Ilm-Alan))
14
- - `AssistantMessageComponent`'s native turn footer leads with a Copy icon (`zeta.turn.copy`) and a dot instead of the clock icon; it copies the answer's text and shows when the host handles transcript actions
15
- - Add backslash+enter newline fallback for terminals without Kitty protocol
16
- - Overlay compositing via `TUI.showOverlay()` and `TUI.hideOverlay()` for `ctx.ui.custom()` with `{ overlay: true }`
17
- - Kitty keyboard protocol flag 2 support for key release events (`isKeyRelease()`, `isKeyRepeat()`, `KeyEventType`)
18
- - `setKittyProtocolActive()`, `isKittyProtocolActive()` for Kitty protocol state management
19
- - `kittyProtocolActive` property on Terminal interface to query Kitty protocol state
20
- - `Component.wantsKeyRelease` property to opt-in to key release events (default false)
21
- - Input component `onEscape` callback for handling escape key presses
22
- - Emergency terminal restore to prevent corrupted state on crashes
23
- - Overhauled UI with welcome screen and powerline footer
24
- - Theme-configurable HTML export colors
25
- - `ctx.ui.theme` getter for styling status text with theme colors
26
- - Added `PI_TUI_WRITE_LOG` environment variable to capture raw ANSI output for debugging
27
- - Added legacy Alt+letter handling and Alt+D delete word forward support in the editor keymap. ([#810](https://github.com/badlogic/pi-mono/pull/810) by [@Perlence](https://github.com/Perlence))
28
- - `showOverlay()` now returns `OverlayHandle` with `hide()`, `setHidden(boolean)`, `isHidden()` for programmatic visibility control ([#667](https://github.com/badlogic/pi-mono/pull/667) by [@nicobailon](https://github.com/nicobailon))
29
- - New exported types: `OverlayAnchor`, `OverlayHandle`, `OverlayMargin`, `OverlayOptions`, `SizeValue` ([#667](https://github.com/badlogic/pi-mono/pull/667) by [@nicobailon](https://github.com/nicobailon))
30
- - `truncateToWidth()` now accepts optional `pad` parameter to pad result with spaces to exactly `maxWidth` ([#667](https://github.com/badlogic/pi-mono/pull/667) by [@nicobailon](https://github.com/nicobailon))
31
- - **Experimental:** Overlay compositing for `ctx.ui.custom()` with `{ overlay: true }` option ([#558](https://github.com/badlogic/pi-mono/pull/558) by [@nicobailon](https://github.com/nicobailon))
32
- - `EditorComponent` interface for custom editor implementations
33
- - `StdinBuffer` class to split batched stdin into individual sequences (adapted from [OpenTUI](https://github.com/anomalyco/opentui), MIT license)
34
- - `Editor.getExpandedText()` method that returns text with paste markers expanded to their actual content ([#444](https://github.com/badlogic/pi-mono/pull/444) by [@aliou](https://github.com/aliou))
35
- - Added mermaid block extraction and deduplication utilities (extractMermaidBlocks)
36
- - Added `Alt+Delete` as a delete-word-forward shortcut
37
- - Added configurable code block indentation for Markdown rendering
38
- - Added undo support in the editor via `Ctrl+-`.
39
- - Added configurable code block indentation for Markdown rendering.
40
- - Added `Alt+Delete` as a delete-word-forward shortcut.
41
- - Added `isPageUp()` and `isPageDown()` helper functions
42
- - Added `SizeValue` type for CSS-like overlay sizing (absolute or percentage strings like `"50%"`)
43
- - Added `OverlayHandle` interface with `hide()`, `setHidden()`, `isHidden()` methods for overlay visibility control
44
- - Added `visible` callback to `OverlayOptions` for dynamic visibility based on terminal dimensions
45
- - Added `pad` parameter to `truncateToWidth()` for padding result with spaces to exact width
46
- - `StdinBuffer` class to split batched stdin into individual sequences
47
- - Added `isCtrlY` helper function for detecting Ctrl+Y keyboard input
48
- - Added configurable editor keybindings with typed key identifiers and action matching
49
- - Added word-wrapped editor rendering for long lines
50
- - Added `getText()` method to Text component for retrieving current text content
51
- - Added `fullRedraws` readonly property to TUI class for tracking full screen redraws
52
- - Added `showHardwareCursor` getter and setter to control cursor visibility while keeping IME positioning active. ([#800](https://github.com/badlogic/pi-mono/pull/800) by [@ghoulr](https://github.com/ghoulr))
53
- - Added Emacs-style kill ring editing with yank and yank-pop keybindings. ([#810](https://github.com/badlogic/pi-mono/pull/810) by [@Perlence](https://github.com/Perlence))
54
- - `EditorOptions` with optional `paddingX` for horizontal content padding, plus `getPaddingX()`/`setPaddingX()` methods ([#791](https://github.com/badlogic/pi-mono/pull/791) by [@ferologics](https://github.com/ferologics))
55
- - Expanded keymap coverage for terminal compatibility: added support for Home/End keys in tmux, additional modifier combinations, and improved key sequence parsing ([#752](https://github.com/badlogic/pi-mono/pull/752) by [@richardgill](https://github.com/richardgill))
56
- - `OverlayOptions.visible` callback for responsive overlays - receives terminal dimensions, return false to hide ([#667](https://github.com/badlogic/pi-mono/pull/667) by [@nicobailon](https://github.com/nicobailon))
57
- - `pageUp` and `pageDown` key support with `selectPageUp`/`selectPageDown` editor actions ([#662](https://github.com/badlogic/pi-mono/pull/662) by [@aliou](https://github.com/aliou))
58
- - `fuzzyFilter()` and `fuzzyMatch()` utilities for fuzzy text matching
59
- - Slash command autocomplete now uses fuzzy matching instead of prefix matching
60
- - Added setAutocompleteMaxVisible() configuration (3-20 items)
61
- - Added image detection to terminal capabilities (containsImage method)
62
- - Added stdin monitoring to detect stalled input events and log warnings
63
- - Added `pageUp` and `pageDown` key support with `selectPageUp`/`selectPageDown` editor actions
64
- - Add `getExpandedText()` to editor for expanding paste markers
65
- - Added `SymbolTheme` interface for customizing UI symbols including cursors, borders, spinners, and box-drawing characters
66
- - Added support for custom spinner frames in the Loader component
67
- - Added `setTopBorder()` method to Editor component for displaying custom status content in the top border
68
- - Added `getWidth()` method to TUI class for retrieving terminal width
69
- - Added rounded corner box-drawing characters to Editor component borders
70
- - Added legacy terminal support for Ctrl+symbol keys (Ctrl+\, Ctrl+], Ctrl+-) and their Ctrl+Alt variants. ([#831](https://github.com/badlogic/pi-mono/pull/831) by [@Perlence](https://github.com/Perlence))
71
- - Kitty keyboard protocol flag 2 support for key release events. New exports: `isKeyRelease(data)`, `isKeyRepeat(data)`, `KeyEventType` type. Terminals supporting Kitty protocol (Kitty, Ghostty, WezTerm) now send proper key-up events.
72
-
73
- ### Changed
74
-
75
- - `UserMessageComponent`'s native hover toolbar (`zeta.user.tools`) leads with Copy and Rewind icon buttons (`copy`, `rewind`) instead of text labels, then a dot and the time, like the turn usage footer
76
- - `ContextUsageView`'s native body (on terminals with `meter`) leads with the tokens used and the room left before auto-compaction, then one stacked bar ticked at the threshold, the breakdown as rows (`zeta.context.cat`, `.cat.free`, `.cat.buffer`: swatch, name, tokens, share; the exact count in the row's `title`) and the snapcompact estimate as labelled rows (`zeta.context.snap`); the blocks meter and legend `kv` are gone, and `contextUsageHead` no longer repeats the window size
77
- - `AskDialogComponent`'s native root is `zeta.editor.ask` (collapsed: `zeta.editor.ask.hidden`, the countdown, the question as `zeta.ask.summary`, Skip and Show): a chosen answer is the `accent`-toned row (a check also carries the check icon) instead of the highlighted one; multi-select Other… is `zeta.ask.other.check`; the question tabs check answered questions and say their keys in the strip's `title`; the countdown moves from the head to the action bar beside Hide; the preview is `zeta.ask.preview`; the Review tab leads with `zeta.ask.notice` and lists answers (`zeta.ask.answers`) by question name with inline code mono and no `(Recommended)` suffix; option descriptions run inline code mono, notes ride the row's detail as `em`; Submit/Next's tooltip names only Enter (and Space on a multi-select)
78
- - `MCPAddWizard`'s native sheet asks one question per step: a phase strip (`zeta.mcpAdd.progress` of `zeta.mcpAdd.phase`, toned done/current/upcoming and `neutral` when no auth was needed), the question and its lead (`zeta.mcpAdd.title`, `zeta.mcpAdd.tag` for optional fields, `zeta.mcpAdd.lead`), then a mono field with a placeholder and its rule or refusal (`zeta.mcpAdd.field`, `tone: "error"`; `zeta.mcpAdd.note`), choice rows with icons and mono tags (`zeta.mcpAdd.choices`), status lines (`zeta.mcpAdd.status`, `zeta.mcpAdd.checks`, `zeta.mcpAdd.error`) or the review rows (`zeta.mcpAdd.summary`). Cancel, Back and Continue / Save server buttons run Ctrl+C, Esc and Enter instead of a key-hint strip. The connection test shows its own busy step, the OAuth client secret field is masked, and the review saves on Enter (no Yes/No choice)
79
- - `ReportPanel`'s native body carries the role `zeta.report.body`
80
- - `HookInputComponent` describes a dock sheet (`zeta.overlay.hook-input` col) like `HookEditorComponent`'s: the title's first line (`zeta.hook-input.title`, the countdown as `zeta.hook-input.timer`) over its further lines (`zeta.hook-input.detail`), the field (`zeta.hook-input.field`, `tone: "error"` while a submit was refused) with its placeholder, and Cancel / Submit buttons that run Esc / Enter; the key legend under the field is terminal-only
81
- - `JobsSheet`'s native body is a master–detail split (`zeta.jobs.split`: `zeta.jobs.master` | `zeta.jobs.detail`): the job list grouped Running / Recent (`zeta.jobs.group` labels), each row a type icon tinted by status with its duration, beside the selected job's status pill, live elapsed and Cancel job (`zeta.jobs.status`), its task title or command (`zeta.jobs.title` / `zeta.jobs.command`), facts (`zeta.jobs.facts`: agent, directory, pids, exit code, artifact) and output (`zeta.jobs.out`, `zeta.jobs.nooutput`); the footer counts running and recent jobs (`zeta.jobs.summary`), and no jobs shows an empty state (`zeta.jobs.empty`). Task jobs no longer draw an `agent` node here
82
- - `BtwHistoryPanel`'s native sheet is centered and reads like a mail reader: the questions as two-line rows (`zeta.btw.history`, list `zeta.btw.list` / `zeta.btw.list.idle` while the answer has the keys) beside the selected thread (`zeta.btw.reader` › `zeta.btw.thread` › `zeta.btw.turn`: `zeta.btw.question` / `zeta.btw.followup`, `zeta.btw.meta`, `zeta.btw.answer`, `zeta.btw.error`), the follow-up field under the last answer (`zeta.btw.composer`), and footer buttons Stop answer, Copy answer, Close and Follow up (Cancel and Send while composing) in place of the focus labels and key-hint strip; an empty history is an `md` sheet (`zeta.btw.empty`)
83
- - The `wait` tool's native job rows (`zeta.wait.job`) are a single `row`: badge, id and label, progress and clock, without the output preview or capture notice beneath
84
- - The native bash run foot reads In background with a live clock (`zeta.run.time` without `stopped`) while a parked job's frames stream (`details.async.state === "running"`, partial), instead of Running
85
- - Moved `wrapTextWithAnsi` export to `@linxiraos/pi-natives` package
86
- - Default editor `newLine` binding now uses `shift+enter` only
87
- - Hardware cursor is now disabled by default for better terminal compatibility. Set `PI_HARDWARE_CURSOR=1` to enable (replaces `PI_NO_HARDWARE_CURSOR=1` which disabled it).
88
- - Migrated key parsing and matching logic to native implementation for improved performance
89
- - Simplified `isKeyRelease()` and `isKeyRepeat()` to use regex pattern matching instead of string inclusion checks
90
- - Refactored `visibleWidth` function to use caching wrapper around new `visibleWidthRaw` implementation for improved performance
91
- - Improved performance of key ID parsing with optimized cache lookup strategy
92
- - Simplified `visibleWidth` calculation to use consistent Bun.stringWidth approach for all string lengths
93
- - Replaced external `fd` binary with native fuzzy path search for `@`-prefixed autocomplete
94
- - Restructured terminal capabilities from interface-based to class-based model
95
- - Improved table column width calculation with word-aware wrapping
96
- - Refactored text utilities to use native WASM implementations for strings >256 chars with JS fast path
97
- - Added Ctrl+Backspace as a delete-word-backward keybinding and improved modified backspace matching
98
- - Migrated file system operations from synchronous to asynchronous APIs in autocomplete provider for non-blocking I/O
99
- - Migrated node module imports from named to namespace imports across all packages for consistency with project guidelines
100
- - Normalized keybinding definitions to lowercase internally
101
- - Improved fuzzy matching to handle alphanumeric swaps.
102
- - Normalized keybinding definitions to lowercase internally.
103
- - Changed `showOverlay()` to return `OverlayHandle` for controlling overlay visibility
104
- - Removed `widthPercent`, `maxHeightPercent`, `rowPercent`, `colPercent` from `OverlayOptions` (use percentage strings instead)
105
- - Improved file autocomplete to show directory listing when typing `@` with no query, and fall back to prefix matching when fuzzy search returns no results
106
- - Terminal startup now queries Kitty protocol support before enabling event reporting
107
- - Changed cursor style from block to thin blinking bar (▏) at end of line
108
- - Editor component now uses word wrapping instead of character-level wrapping for better readability ([#382](https://github.com/badlogic/pi-mono/pull/382) by [@nickseelert](https://github.com/nickseelert))
109
- - Renamed `EllipsisKind` enum to `Ellipsis` for clearer API naming
110
- - Changed hardcoded ellipsis character from theme-configurable to literal "…" in editor truncation
111
- - Improved blockquote rendering with text wrapping in Markdown component
112
- - Expanded Kitty keyboard protocol coverage for non-Latin layouts and legacy Alt sequences
113
- - Improved cursor positioning with safer bounds checking
114
- - Updated editor layout to respect configurable padding
115
- - Refactored scrolling logic for better viewport management
3
+ ## [1.4.0] - 2026-10-21
116
4
 
117
- ### Fixed
118
-
119
- - Fixed table charts picking the wrong label and measure columns when numbers group thousands with spaces (`1 988`, `17 083`); they now read like `1,988` ([#16175](https://github.com/can1357/oh-my-pi/issues/16175))
120
- - Fixed terminal capability replies relayed through win32-input-mode appearing as typed input in WSL terminals ([#16137](https://github.com/can1357/oh-my-pi/issues/16137))
121
- - Fixed the status-bar activity spinner and turn timer freezing until the next keypress when the working-row loader is stopped mid-turn; an open turn window now repaints the status line on its own timer ([#16109](https://github.com/can1357/oh-my-pi/pull/16109) by [@tommymorgan](https://github.com/tommymorgan)).
122
- - Fixed pasting sometimes inserting a block of base64 text instead of the pasted text in terminals that deliver pastes through the Kitty clipboard protocol (OSC 5522), most often with dictation apps that paste for you; a slow paste now arrives whole, and keys typed while a paste never finishes are given back instead of lost ([#16170](https://github.com/can1357/oh-my-pi/pull/16170) by [@H4vC](https://github.com/H4vC))
123
- - Fixed a streaming table bouncing everything below it up and down while its last cell was still being written ([#16116](https://github.com/can1357/oh-my-pi/pull/16116) by [@galtamam-cmyk](https://github.com/galtamam-cmyk))
124
- - Fixed inline images in iTerm2 being sized for the wrong cell shape, which left charts smeared or offset ([#16118](https://github.com/can1357/oh-my-pi/pull/16118) by [@galtamam-cmyk](https://github.com/galtamam-cmyk))
125
- - Remove trailing space padding from Text, Markdown, and TruncatedText components when no background color is set (fixes copied text including unwanted whitespace)
126
- - Fixed Ctrl+Enter sequences to insert new lines in the editor
127
- - Fixed `fd` tool detection to automatically find `fd` or `fdfind` in PATH when not explicitly configured
128
- - Fixed editor multi-line insertion handling and lastAction tracking ([#945](https://github.com/badlogic/pi-mono/pull/945) by [@Perlence](https://github.com/Perlence))
129
- - Fixed editor word wrapping to reserve a cursor column ([#934](https://github.com/badlogic/pi-mono/pull/934) by [@Perlence](https://github.com/Perlence))
130
- - Fixed editor word wrapping to use single-pass backtracking for whitespace handling ([#924](https://github.com/badlogic/pi-mono/pull/924) by [@Perlence](https://github.com/Perlence))
131
- - Fixed Kitty image ID allocation and cleanup to prevent image ID collisions between modules
132
- - Fixed viewport tracking and cursor positioning for overlays and content shrink scenarios
133
- - Autocomplete now allows searches with `/` characters (e.g., `folder1/folder2`) ([#882](https://github.com/badlogic/pi-mono/pull/882) by [@richardgill](https://github.com/richardgill))
134
- - Directory completions for `@` file attachments no longer add trailing space, allowing continued autocomplete into subdirectories
135
- - `visibleWidth()` and `extractAnsiCode()` now handle APC escape sequences (`ESC _ ... BEL`), fixing width calculation and string slicing for strings containing cursor markers
136
- - SelectList now handles multi-line descriptions by replacing newlines with spaces ([#728](https://github.com/badlogic/pi-mono/pull/728) by [@richardgill](https://github.com/richardgill))
137
- - Reset ANSI styles after each rendered line to prevent style leakage
138
- - Cursor position tracking when content shrinks with unchanged remaining lines
139
- - TUI renders with wrong dimensions after suspend/resume if terminal was resized while suspended ([#599](https://github.com/badlogic/pi-mono/issues/599))
140
- - Pasted content containing Kitty key release patterns (e.g., `:3F` in MAC addresses) was incorrectly filtered out ([#623](https://github.com/badlogic/pi-mono/pull/623) by [@ogulcancelik](https://github.com/ogulcancelik))
141
- - `visibleWidth()` now strips OSC 8 hyperlink sequences, fixing text wrapping for clickable links ([#396](https://github.com/badlogic/pi-mono/pull/396) by [@Cursivez](https://github.com/Cursivez))
142
-
143
- Older entries are archived in [packages/tui/CHANGELOG.md@9caccab691ce](https://github.com/can1357/oh-my-pi/blob/9caccab691ce575007f4b6bcbaf8f944723d5457/packages/tui/CHANGELOG.md).
144
- Older entries are archived in [packages/tui/CHANGELOG.md@58141d4e5fa8](https://github.com/can1357/oh-my-pi/blob/58141d4e5fa892166024e2168866c45e0baacde3/packages/tui/CHANGELOG.md).
145
- - Corrected editor end-of-line cursor rendering assertion to use includes() instead of endsWith()
146
- - Fixed potential errors during emergency terminal restore when terminal is already dead
147
- - Fixed autocomplete race condition by tracking request ID to prevent stale suggestion results
148
- - Added legacy terminal support for `Ctrl+` symbol key combinations
149
- - Added legacy terminal support for `Ctrl+` symbol key combinations.
150
- - Fixed backspace handling with additional codepoint support
151
- - Fixed Alt+letter key combinations for better recognition
152
- - TUI now filters out key release events by default, preventing double-processing of keys
153
- - `matchesKey()` now correctly matches Kitty protocol sequences for unmodified letter keys
154
- - Crash when pasting text with trailing whitespace exceeding terminal width through Markdown rendering
155
- - Slash command menu now only triggers when the editor input is otherwise empty ([#904](https://github.com/badlogic/pi-mono/issues/904))
156
- - Center-anchored overlays now stay vertically centered when resizing the terminal taller after a shrink ([#950](https://github.com/badlogic/pi-mono/pull/950) by [@nicobailon](https://github.com/nicobailon))
157
- - Shift+Space, Shift+Backspace, and Shift+Delete now work correctly in Kitty-protocol terminals (Kitty, WezTerm, etc.) instead of being silently ignored ([#411](https://github.com/badlogic/pi-mono/pull/411) by [@nathyong](https://github.com/nathyong))
158
- - Improved Kitty terminal key sequence parsing to correctly handle text field codepoints in CSI-u sequences
159
- - Fixed handling of private use Unicode codepoints (U+E000 to U+F8FF) in Kitty key decoding to prevent invalid character interpretation
160
- - Simplified terminal write error handling to mark terminal as dead on any write failure
161
- - Fixed multi-line strings in renderOutputBlock causing width overflow
162
- - Fixed slash command autocomplete applying stale completion when typing quickly
163
- - Reserved cursor space for zero padding and corrected end-of-line cursor rendering to prevent wrap glitches
164
- - Fixed viewport tracking after partial renders to prevent autocomplete list artifacts
165
- - Rendering optimizations: only re-render changed lines
166
- - Refactor input component to use keybindings manager
167
- - Fixed editor cursor blinking by allowing terminal cursor positioning when enabled.
168
- - Editor no longer corrupts terminal display when text exceeds screen height. Content now scrolls vertically with indicators showing lines above/below the viewport. Max height is 30% of terminal (minimum 5 lines). ([#732](https://github.com/badlogic/pi-mono/issues/732))
169
- - Cursor now moves to end of content on exit, preventing status line from being overwritten ([#629](https://github.com/badlogic/pi-mono/pull/629) by [@tallshort](https://github.com/tallshort))
170
- - Slash command autocomplete now triggers for commands starting with `.`, `-`, or `_` (e.g., `/.land`, `/-foo`) ([#422](https://github.com/badlogic/pi-mono/issues/422))
171
-
172
- ### Removed
173
-
174
- - `SingleResult` (and the task tool's settled payload) carries the failure diagnostics an agent-driven model switch needs: optional `failureClass` (`usage-limit` / `auth` / `account-policy` / `context-overflow` / `transient` / `aborted` / `unknown`), optional `fallbackCandidates` (other selectors this session could run), and optional `modelChange` (`{ source: "spawn-param" | "wake-param", from?, to }`) recording that a caller-supplied model replaced the default one. All three stay absent unless a run actually reports them.
175
- - The welcome/splash brand art is now generated with the standard FIGlet tool instead of being drawn by hand: `ZETA_LOGO` renders the mark `Z` (the ASCII form of `Ζ`), `ZETA_WORDMARK` renders `Zeta` (both in the standard `ANSI Shadow` font) and `ZETA_SUBLINE` renders the `Linxira-Zeta` identity line in `mini`, with the version under the wordmark. `bun scripts/brand/generate-logo-art.ts` regenerates the three constants from the vendored fonts, and the brand guard fails on any hand-edited glyph.
176
- - Removed `ellipsis` property from `SymbolTheme` interface
177
- - Removed `extractAnsiCode` function from public API
178
- - Removed TUI layout engine exports from public API (BoxNode, ColumnNode, LayoutNode, etc.)
179
- - Removed `visibleWidth` benchmark file in favor of Kitty sequence benchmarking
5
+ - Added a `zetawork` terminal id that resolves to the Kitty image protocol from the environment alone, so images render in the desktop app's own terminal
180
6
 
181
7
  ## [9.5.0] - 2026-02-01
182
8
 
@@ -361,6 +187,188 @@ Older entries are archived in [packages/tui/CHANGELOG.md@58141d4e5fa8](https://g
361
187
 
362
188
  Initial release under @oh-my-pi scope. See previous releases at [badlogic/pi-mono](https://github.com/badlogic/pi-mono).
363
189
 
190
+ ## [1.3.2] - 2026-10-19
191
+
192
+ - Version line moves to 1.3.2 with the rest of the suite; no user-visible change in this package.
193
+
194
+ ## [1.3.1] - 2026-10-19
195
+
196
+ ### Breaking Changes
197
+
198
+ - Removed `KeyEventType` export from public API
199
+ - `Editor` constructor now requires `TUI` as first parameter: `new Editor(tui, theme)`. This enables automatic vertical scrolling when content exceeds terminal height. ([#732](https://github.com/badlogic/pi-mono/issues/732))
200
+ - Removed `Key` helper object from public API; use string literals like `"ctrl+c"` instead of `Key.ctrl("c")`
201
+
202
+ ### Added
203
+
204
+ - Added `ComposerPreferences.completeScrollback` (default `false`): rows a growing HUD or dialog pushes off screen go straight to scrollback instead of being held back until it shrinks ([#15692](https://github.com/can1357/oh-my-pi/pull/15692) by [@Ilm-Alan](https://github.com/Ilm-Alan))
205
+ - `AssistantMessageComponent`'s native turn footer leads with a Copy icon (`zeta.turn.copy`) and a dot instead of the clock icon; it copies the answer's text and shows when the host handles transcript actions
206
+ - Add backslash+enter newline fallback for terminals without Kitty protocol
207
+ - Overlay compositing via `TUI.showOverlay()` and `TUI.hideOverlay()` for `ctx.ui.custom()` with `{ overlay: true }`
208
+ - Kitty keyboard protocol flag 2 support for key release events (`isKeyRelease()`, `isKeyRepeat()`, `KeyEventType`)
209
+ - `setKittyProtocolActive()`, `isKittyProtocolActive()` for Kitty protocol state management
210
+ - `kittyProtocolActive` property on Terminal interface to query Kitty protocol state
211
+ - `Component.wantsKeyRelease` property to opt-in to key release events (default false)
212
+ - Input component `onEscape` callback for handling escape key presses
213
+ - Emergency terminal restore to prevent corrupted state on crashes
214
+ - Overhauled UI with welcome screen and powerline footer
215
+ - Theme-configurable HTML export colors
216
+ - `ctx.ui.theme` getter for styling status text with theme colors
217
+ - Added `PI_TUI_WRITE_LOG` environment variable to capture raw ANSI output for debugging
218
+ - Added legacy Alt+letter handling and Alt+D delete word forward support in the editor keymap. ([#810](https://github.com/badlogic/pi-mono/pull/810) by [@Perlence](https://github.com/Perlence))
219
+ - `showOverlay()` now returns `OverlayHandle` with `hide()`, `setHidden(boolean)`, `isHidden()` for programmatic visibility control ([#667](https://github.com/badlogic/pi-mono/pull/667) by [@nicobailon](https://github.com/nicobailon))
220
+ - New exported types: `OverlayAnchor`, `OverlayHandle`, `OverlayMargin`, `OverlayOptions`, `SizeValue` ([#667](https://github.com/badlogic/pi-mono/pull/667) by [@nicobailon](https://github.com/nicobailon))
221
+ - `truncateToWidth()` now accepts optional `pad` parameter to pad result with spaces to exactly `maxWidth` ([#667](https://github.com/badlogic/pi-mono/pull/667) by [@nicobailon](https://github.com/nicobailon))
222
+ - **Experimental:** Overlay compositing for `ctx.ui.custom()` with `{ overlay: true }` option ([#558](https://github.com/badlogic/pi-mono/pull/558) by [@nicobailon](https://github.com/nicobailon))
223
+ - `EditorComponent` interface for custom editor implementations
224
+ - `StdinBuffer` class to split batched stdin into individual sequences (adapted from [OpenTUI](https://github.com/anomalyco/opentui), MIT license)
225
+ - `Editor.getExpandedText()` method that returns text with paste markers expanded to their actual content ([#444](https://github.com/badlogic/pi-mono/pull/444) by [@aliou](https://github.com/aliou))
226
+ - Added mermaid block extraction and deduplication utilities (extractMermaidBlocks)
227
+ - Added `Alt+Delete` as a delete-word-forward shortcut
228
+ - Added configurable code block indentation for Markdown rendering
229
+ - Added undo support in the editor via `Ctrl+-`.
230
+ - Added configurable code block indentation for Markdown rendering.
231
+ - Added `Alt+Delete` as a delete-word-forward shortcut.
232
+ - Added `isPageUp()` and `isPageDown()` helper functions
233
+ - Added `SizeValue` type for CSS-like overlay sizing (absolute or percentage strings like `"50%"`)
234
+ - Added `OverlayHandle` interface with `hide()`, `setHidden()`, `isHidden()` methods for overlay visibility control
235
+ - Added `visible` callback to `OverlayOptions` for dynamic visibility based on terminal dimensions
236
+ - Added `pad` parameter to `truncateToWidth()` for padding result with spaces to exact width
237
+ - `StdinBuffer` class to split batched stdin into individual sequences
238
+ - Added `isCtrlY` helper function for detecting Ctrl+Y keyboard input
239
+ - Added configurable editor keybindings with typed key identifiers and action matching
240
+ - Added word-wrapped editor rendering for long lines
241
+ - Added `getText()` method to Text component for retrieving current text content
242
+ - Added `fullRedraws` readonly property to TUI class for tracking full screen redraws
243
+ - Added `showHardwareCursor` getter and setter to control cursor visibility while keeping IME positioning active. ([#800](https://github.com/badlogic/pi-mono/pull/800) by [@ghoulr](https://github.com/ghoulr))
244
+ - Added Emacs-style kill ring editing with yank and yank-pop keybindings. ([#810](https://github.com/badlogic/pi-mono/pull/810) by [@Perlence](https://github.com/Perlence))
245
+ - `EditorOptions` with optional `paddingX` for horizontal content padding, plus `getPaddingX()`/`setPaddingX()` methods ([#791](https://github.com/badlogic/pi-mono/pull/791) by [@ferologics](https://github.com/ferologics))
246
+ - Expanded keymap coverage for terminal compatibility: added support for Home/End keys in tmux, additional modifier combinations, and improved key sequence parsing ([#752](https://github.com/badlogic/pi-mono/pull/752) by [@richardgill](https://github.com/richardgill))
247
+ - `OverlayOptions.visible` callback for responsive overlays - receives terminal dimensions, return false to hide ([#667](https://github.com/badlogic/pi-mono/pull/667) by [@nicobailon](https://github.com/nicobailon))
248
+ - `pageUp` and `pageDown` key support with `selectPageUp`/`selectPageDown` editor actions ([#662](https://github.com/badlogic/pi-mono/pull/662) by [@aliou](https://github.com/aliou))
249
+ - `fuzzyFilter()` and `fuzzyMatch()` utilities for fuzzy text matching
250
+ - Slash command autocomplete now uses fuzzy matching instead of prefix matching
251
+ - Added setAutocompleteMaxVisible() configuration (3-20 items)
252
+ - Added image detection to terminal capabilities (containsImage method)
253
+ - Added stdin monitoring to detect stalled input events and log warnings
254
+ - Added `pageUp` and `pageDown` key support with `selectPageUp`/`selectPageDown` editor actions
255
+ - Add `getExpandedText()` to editor for expanding paste markers
256
+ - Added `SymbolTheme` interface for customizing UI symbols including cursors, borders, spinners, and box-drawing characters
257
+ - Added support for custom spinner frames in the Loader component
258
+ - Added `setTopBorder()` method to Editor component for displaying custom status content in the top border
259
+ - Added `getWidth()` method to TUI class for retrieving terminal width
260
+ - Added rounded corner box-drawing characters to Editor component borders
261
+ - Added legacy terminal support for Ctrl+symbol keys (Ctrl+\, Ctrl+], Ctrl+-) and their Ctrl+Alt variants. ([#831](https://github.com/badlogic/pi-mono/pull/831) by [@Perlence](https://github.com/Perlence))
262
+ - Kitty keyboard protocol flag 2 support for key release events. New exports: `isKeyRelease(data)`, `isKeyRepeat(data)`, `KeyEventType` type. Terminals supporting Kitty protocol (Kitty, Ghostty, WezTerm) now send proper key-up events.
263
+
264
+ ### Changed
265
+
266
+ - `UserMessageComponent`'s native hover toolbar (`zeta.user.tools`) leads with Copy and Rewind icon buttons (`copy`, `rewind`) instead of text labels, then a dot and the time, like the turn usage footer
267
+ - `ContextUsageView`'s native body (on terminals with `meter`) leads with the tokens used and the room left before auto-compaction, then one stacked bar ticked at the threshold, the breakdown as rows (`zeta.context.cat`, `.cat.free`, `.cat.buffer`: swatch, name, tokens, share; the exact count in the row's `title`) and the snapcompact estimate as labelled rows (`zeta.context.snap`); the blocks meter and legend `kv` are gone, and `contextUsageHead` no longer repeats the window size
268
+ - `AskDialogComponent`'s native root is `zeta.editor.ask` (collapsed: `zeta.editor.ask.hidden`, the countdown, the question as `zeta.ask.summary`, Skip and Show): a chosen answer is the `accent`-toned row (a check also carries the check icon) instead of the highlighted one; multi-select Other… is `zeta.ask.other.check`; the question tabs check answered questions and say their keys in the strip's `title`; the countdown moves from the head to the action bar beside Hide; the preview is `zeta.ask.preview`; the Review tab leads with `zeta.ask.notice` and lists answers (`zeta.ask.answers`) by question name with inline code mono and no `(Recommended)` suffix; option descriptions run inline code mono, notes ride the row's detail as `em`; Submit/Next's tooltip names only Enter (and Space on a multi-select)
269
+ - `MCPAddWizard`'s native sheet asks one question per step: a phase strip (`zeta.mcpAdd.progress` of `zeta.mcpAdd.phase`, toned done/current/upcoming and `neutral` when no auth was needed), the question and its lead (`zeta.mcpAdd.title`, `zeta.mcpAdd.tag` for optional fields, `zeta.mcpAdd.lead`), then a mono field with a placeholder and its rule or refusal (`zeta.mcpAdd.field`, `tone: "error"`; `zeta.mcpAdd.note`), choice rows with icons and mono tags (`zeta.mcpAdd.choices`), status lines (`zeta.mcpAdd.status`, `zeta.mcpAdd.checks`, `zeta.mcpAdd.error`) or the review rows (`zeta.mcpAdd.summary`). Cancel, Back and Continue / Save server buttons run Ctrl+C, Esc and Enter instead of a key-hint strip. The connection test shows its own busy step, the OAuth client secret field is masked, and the review saves on Enter (no Yes/No choice)
270
+ - `ReportPanel`'s native body carries the role `zeta.report.body`
271
+ - `HookInputComponent` describes a dock sheet (`zeta.overlay.hook-input` col) like `HookEditorComponent`'s: the title's first line (`zeta.hook-input.title`, the countdown as `zeta.hook-input.timer`) over its further lines (`zeta.hook-input.detail`), the field (`zeta.hook-input.field`, `tone: "error"` while a submit was refused) with its placeholder, and Cancel / Submit buttons that run Esc / Enter; the key legend under the field is terminal-only
272
+ - `JobsSheet`'s native body is a master–detail split (`zeta.jobs.split`: `zeta.jobs.master` | `zeta.jobs.detail`): the job list grouped Running / Recent (`zeta.jobs.group` labels), each row a type icon tinted by status with its duration, beside the selected job's status pill, live elapsed and Cancel job (`zeta.jobs.status`), its task title or command (`zeta.jobs.title` / `zeta.jobs.command`), facts (`zeta.jobs.facts`: agent, directory, pids, exit code, artifact) and output (`zeta.jobs.out`, `zeta.jobs.nooutput`); the footer counts running and recent jobs (`zeta.jobs.summary`), and no jobs shows an empty state (`zeta.jobs.empty`). Task jobs no longer draw an `agent` node here
273
+ - `BtwHistoryPanel`'s native sheet is centered and reads like a mail reader: the questions as two-line rows (`zeta.btw.history`, list `zeta.btw.list` / `zeta.btw.list.idle` while the answer has the keys) beside the selected thread (`zeta.btw.reader` › `zeta.btw.thread` › `zeta.btw.turn`: `zeta.btw.question` / `zeta.btw.followup`, `zeta.btw.meta`, `zeta.btw.answer`, `zeta.btw.error`), the follow-up field under the last answer (`zeta.btw.composer`), and footer buttons Stop answer, Copy answer, Close and Follow up (Cancel and Send while composing) in place of the focus labels and key-hint strip; an empty history is an `md` sheet (`zeta.btw.empty`)
274
+ - The `wait` tool's native job rows (`zeta.wait.job`) are a single `row`: badge, id and label, progress and clock, without the output preview or capture notice beneath
275
+ - The native bash run foot reads In background with a live clock (`zeta.run.time` without `stopped`) while a parked job's frames stream (`details.async.state === "running"`, partial), instead of Running
276
+ - Moved `wrapTextWithAnsi` export to `@linxiraos/pi-natives` package
277
+ - Default editor `newLine` binding now uses `shift+enter` only
278
+ - Hardware cursor is now disabled by default for better terminal compatibility. Set `PI_HARDWARE_CURSOR=1` to enable (replaces `PI_NO_HARDWARE_CURSOR=1` which disabled it).
279
+ - Migrated key parsing and matching logic to native implementation for improved performance
280
+ - Simplified `isKeyRelease()` and `isKeyRepeat()` to use regex pattern matching instead of string inclusion checks
281
+ - Refactored `visibleWidth` function to use caching wrapper around new `visibleWidthRaw` implementation for improved performance
282
+ - Improved performance of key ID parsing with optimized cache lookup strategy
283
+ - Simplified `visibleWidth` calculation to use consistent Bun.stringWidth approach for all string lengths
284
+ - Replaced external `fd` binary with native fuzzy path search for `@`-prefixed autocomplete
285
+ - Restructured terminal capabilities from interface-based to class-based model
286
+ - Improved table column width calculation with word-aware wrapping
287
+ - Refactored text utilities to use native WASM implementations for strings >256 chars with JS fast path
288
+ - Added Ctrl+Backspace as a delete-word-backward keybinding and improved modified backspace matching
289
+ - Migrated file system operations from synchronous to asynchronous APIs in autocomplete provider for non-blocking I/O
290
+ - Migrated node module imports from named to namespace imports across all packages for consistency with project guidelines
291
+ - Normalized keybinding definitions to lowercase internally
292
+ - Improved fuzzy matching to handle alphanumeric swaps.
293
+ - Normalized keybinding definitions to lowercase internally.
294
+ - Changed `showOverlay()` to return `OverlayHandle` for controlling overlay visibility
295
+ - Removed `widthPercent`, `maxHeightPercent`, `rowPercent`, `colPercent` from `OverlayOptions` (use percentage strings instead)
296
+ - Improved file autocomplete to show directory listing when typing `@` with no query, and fall back to prefix matching when fuzzy search returns no results
297
+ - Terminal startup now queries Kitty protocol support before enabling event reporting
298
+ - Changed cursor style from block to thin blinking bar (▏) at end of line
299
+ - Editor component now uses word wrapping instead of character-level wrapping for better readability ([#382](https://github.com/badlogic/pi-mono/pull/382) by [@nickseelert](https://github.com/nickseelert))
300
+ - Renamed `EllipsisKind` enum to `Ellipsis` for clearer API naming
301
+ - Changed hardcoded ellipsis character from theme-configurable to literal "…" in editor truncation
302
+ - Improved blockquote rendering with text wrapping in Markdown component
303
+ - Expanded Kitty keyboard protocol coverage for non-Latin layouts and legacy Alt sequences
304
+ - Improved cursor positioning with safer bounds checking
305
+ - Updated editor layout to respect configurable padding
306
+ - Refactored scrolling logic for better viewport management
307
+
308
+ ### Fixed
309
+
310
+ - Fixed table charts picking the wrong label and measure columns when numbers group thousands with spaces (`1 988`, `17 083`); they now read like `1,988` ([#16175](https://github.com/can1357/oh-my-pi/issues/16175))
311
+ - Fixed terminal capability replies relayed through win32-input-mode appearing as typed input in WSL terminals ([#16137](https://github.com/can1357/oh-my-pi/issues/16137))
312
+ - Fixed the status-bar activity spinner and turn timer freezing until the next keypress when the working-row loader is stopped mid-turn; an open turn window now repaints the status line on its own timer ([#16109](https://github.com/can1357/oh-my-pi/pull/16109) by [@tommymorgan](https://github.com/tommymorgan)).
313
+ - Fixed pasting sometimes inserting a block of base64 text instead of the pasted text in terminals that deliver pastes through the Kitty clipboard protocol (OSC 5522), most often with dictation apps that paste for you; a slow paste now arrives whole, and keys typed while a paste never finishes are given back instead of lost ([#16170](https://github.com/can1357/oh-my-pi/pull/16170) by [@H4vC](https://github.com/H4vC))
314
+ - Fixed a streaming table bouncing everything below it up and down while its last cell was still being written ([#16116](https://github.com/can1357/oh-my-pi/pull/16116) by [@galtamam-cmyk](https://github.com/galtamam-cmyk))
315
+ - Fixed inline images in iTerm2 being sized for the wrong cell shape, which left charts smeared or offset ([#16118](https://github.com/can1357/oh-my-pi/pull/16118) by [@galtamam-cmyk](https://github.com/galtamam-cmyk))
316
+ - Remove trailing space padding from Text, Markdown, and TruncatedText components when no background color is set (fixes copied text including unwanted whitespace)
317
+ - Fixed Ctrl+Enter sequences to insert new lines in the editor
318
+ - Fixed `fd` tool detection to automatically find `fd` or `fdfind` in PATH when not explicitly configured
319
+ - Fixed editor multi-line insertion handling and lastAction tracking ([#945](https://github.com/badlogic/pi-mono/pull/945) by [@Perlence](https://github.com/Perlence))
320
+ - Fixed editor word wrapping to reserve a cursor column ([#934](https://github.com/badlogic/pi-mono/pull/934) by [@Perlence](https://github.com/Perlence))
321
+ - Fixed editor word wrapping to use single-pass backtracking for whitespace handling ([#924](https://github.com/badlogic/pi-mono/pull/924) by [@Perlence](https://github.com/Perlence))
322
+ - Fixed Kitty image ID allocation and cleanup to prevent image ID collisions between modules
323
+ - Fixed viewport tracking and cursor positioning for overlays and content shrink scenarios
324
+ - Autocomplete now allows searches with `/` characters (e.g., `folder1/folder2`) ([#882](https://github.com/badlogic/pi-mono/pull/882) by [@richardgill](https://github.com/richardgill))
325
+ - Directory completions for `@` file attachments no longer add trailing space, allowing continued autocomplete into subdirectories
326
+ - `visibleWidth()` and `extractAnsiCode()` now handle APC escape sequences (`ESC _ ... BEL`), fixing width calculation and string slicing for strings containing cursor markers
327
+ - SelectList now handles multi-line descriptions by replacing newlines with spaces ([#728](https://github.com/badlogic/pi-mono/pull/728) by [@richardgill](https://github.com/richardgill))
328
+ - Reset ANSI styles after each rendered line to prevent style leakage
329
+ - Cursor position tracking when content shrinks with unchanged remaining lines
330
+ - TUI renders with wrong dimensions after suspend/resume if terminal was resized while suspended ([#599](https://github.com/badlogic/pi-mono/issues/599))
331
+ - Pasted content containing Kitty key release patterns (e.g., `:3F` in MAC addresses) was incorrectly filtered out ([#623](https://github.com/badlogic/pi-mono/pull/623) by [@ogulcancelik](https://github.com/ogulcancelik))
332
+ - `visibleWidth()` now strips OSC 8 hyperlink sequences, fixing text wrapping for clickable links ([#396](https://github.com/badlogic/pi-mono/pull/396) by [@Cursivez](https://github.com/Cursivez))
333
+
334
+ Older entries are archived in [packages/tui/CHANGELOG.md@9caccab691ce](https://github.com/can1357/oh-my-pi/blob/9caccab691ce575007f4b6bcbaf8f944723d5457/packages/tui/CHANGELOG.md).
335
+ Older entries are archived in [packages/tui/CHANGELOG.md@58141d4e5fa8](https://github.com/can1357/oh-my-pi/blob/58141d4e5fa892166024e2168866c45e0baacde3/packages/tui/CHANGELOG.md).
336
+ - Corrected editor end-of-line cursor rendering assertion to use includes() instead of endsWith()
337
+ - Fixed potential errors during emergency terminal restore when terminal is already dead
338
+ - Fixed autocomplete race condition by tracking request ID to prevent stale suggestion results
339
+ - Added legacy terminal support for `Ctrl+` symbol key combinations
340
+ - Added legacy terminal support for `Ctrl+` symbol key combinations.
341
+ - Fixed backspace handling with additional codepoint support
342
+ - Fixed Alt+letter key combinations for better recognition
343
+ - TUI now filters out key release events by default, preventing double-processing of keys
344
+ - `matchesKey()` now correctly matches Kitty protocol sequences for unmodified letter keys
345
+ - Crash when pasting text with trailing whitespace exceeding terminal width through Markdown rendering
346
+ - Slash command menu now only triggers when the editor input is otherwise empty ([#904](https://github.com/badlogic/pi-mono/issues/904))
347
+ - Center-anchored overlays now stay vertically centered when resizing the terminal taller after a shrink ([#950](https://github.com/badlogic/pi-mono/pull/950) by [@nicobailon](https://github.com/nicobailon))
348
+ - Shift+Space, Shift+Backspace, and Shift+Delete now work correctly in Kitty-protocol terminals (Kitty, WezTerm, etc.) instead of being silently ignored ([#411](https://github.com/badlogic/pi-mono/pull/411) by [@nathyong](https://github.com/nathyong))
349
+ - Improved Kitty terminal key sequence parsing to correctly handle text field codepoints in CSI-u sequences
350
+ - Fixed handling of private use Unicode codepoints (U+E000 to U+F8FF) in Kitty key decoding to prevent invalid character interpretation
351
+ - Simplified terminal write error handling to mark terminal as dead on any write failure
352
+ - Fixed multi-line strings in renderOutputBlock causing width overflow
353
+ - Fixed slash command autocomplete applying stale completion when typing quickly
354
+ - Reserved cursor space for zero padding and corrected end-of-line cursor rendering to prevent wrap glitches
355
+ - Fixed viewport tracking after partial renders to prevent autocomplete list artifacts
356
+ - Rendering optimizations: only re-render changed lines
357
+ - Refactor input component to use keybindings manager
358
+ - Fixed editor cursor blinking by allowing terminal cursor positioning when enabled.
359
+ - Editor no longer corrupts terminal display when text exceeds screen height. Content now scrolls vertically with indicators showing lines above/below the viewport. Max height is 30% of terminal (minimum 5 lines). ([#732](https://github.com/badlogic/pi-mono/issues/732))
360
+ - Cursor now moves to end of content on exit, preventing status line from being overwritten ([#629](https://github.com/badlogic/pi-mono/pull/629) by [@tallshort](https://github.com/tallshort))
361
+ - Slash command autocomplete now triggers for commands starting with `.`, `-`, or `_` (e.g., `/.land`, `/-foo`) ([#422](https://github.com/badlogic/pi-mono/issues/422))
362
+
363
+ ### Removed
364
+
365
+ - `SingleResult` (and the task tool's settled payload) carries the failure diagnostics an agent-driven model switch needs: optional `failureClass` (`usage-limit` / `auth` / `account-policy` / `context-overflow` / `transient` / `aborted` / `unknown`), optional `fallbackCandidates` (other selectors this session could run), and optional `modelChange` (`{ source: "spawn-param" | "wake-param", from?, to }`) recording that a caller-supplied model replaced the default one. All three stay absent unless a run actually reports them.
366
+ - The welcome/splash brand art is now generated with the standard FIGlet tool instead of being drawn by hand: `ZETA_LOGO` renders the mark `Z` (the ASCII form of `Ζ`), `ZETA_WORDMARK` renders `Zeta` (both in the standard `ANSI Shadow` font) and `ZETA_SUBLINE` renders the `Linxira-Zeta` identity line in `mini`, with the version under the wordmark. `bun scripts/brand/generate-logo-art.ts` regenerates the three constants from the vendored fonts, and the brand guard fails on any hand-edited glyph.
367
+ - Removed `ellipsis` property from `SymbolTheme` interface
368
+ - Removed `extractAnsiCode` function from public API
369
+ - Removed TUI layout engine exports from public API (BoxNode, ColumnNode, LayoutNode, etc.)
370
+ - Removed `visibleWidth` benchmark file in favor of Kitty sequence benchmarking
371
+
364
372
  ## [1.3.0] - 2026-10-18
365
373
 
366
374
  ### Breaking Changes
@@ -1,10 +1,13 @@
1
- import { type SessionSelectorEntry, type SessionHistoryMatcher } from "../overlays/session-selector.js";
1
+ import { type ResumeSourceLike, type SessionHistoryMatcher, type SessionSelectorEntry } from "../overlays/session-selector.js";
2
+ import type { ResumeTreeSource } from "../overlays/resume-tree.js";
2
3
  /** Persistence and history capabilities supplied by the session-owning host. */
3
4
  export interface SessionPickerHost<T extends SessionSelectorEntry = SessionSelectorEntry> {
4
5
  loadPinnedIds?(): Promise<ReadonlySet<string>>;
5
6
  loadHistoryMatcher?(): SessionHistoryMatcher;
6
7
  deleteSession?(session: T): Promise<boolean>;
7
8
  loadAllSessions?(): Promise<T[]>;
9
+ /** Builds the three-level resume source for the standalone `--resume` tree. */
10
+ loadResumeSource?(deleteMode: "trash" | "permanent", workspacePath?: string): Promise<ResumeTreeSource | undefined>;
8
11
  }
9
12
  /** Presentation and capability controls for the standalone session picker. */
10
13
  export interface SessionPickerOptions<T extends SessionSelectorEntry = SessionSelectorEntry> {
@@ -16,6 +19,15 @@ export interface SessionPickerOptions<T extends SessionSelectorEntry = SessionSe
16
19
  allowGlobalScope?: boolean;
17
20
  historySearch?: boolean;
18
21
  pinnedIds?: ReadonlySet<string>;
22
+ /** Opt into the three-level resume tree; `deleteMode` words the confirm step. */
23
+ resume?: {
24
+ deleteMode: "trash" | "permanent";
25
+ workspacePath?: string;
26
+ };
27
+ /** The host's resume model; when set, the native picker renders the project tree. */
28
+ resumeSource?: ResumeSourceLike;
29
+ /** Delete wording: in-session moves to trash, `--resume` deletes permanently. */
30
+ deleteMode?: "trash" | "permanent";
19
31
  }
20
32
  /**
21
33
  * Show the TUI session selector and return the selected session, or null if