@linxiraos/pi-tui 1.4.1 → 1.4.2

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 (2) hide show
  1. package/CHANGELOG.md +178 -174
  2. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -1,180 +1,8 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [1.4.1] - 2026-10-23
4
-
5
- - An attached TUI renders the backend's builtin-command output (`command_output`) in its status line and keeps client-only commands, pickers and mirrored switches local
6
-
7
- ### Breaking Changes
8
-
9
- - Removed `KeyEventType` export from public API
10
- - `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))
11
- - Removed `Key` helper object from public API; use string literals like `"ctrl+c"` instead of `Key.ctrl("c")`
12
-
13
- ### Added
14
-
15
- - Added `symbols` property to `EditorTheme`, `MarkdownTheme`, and `SelectListTheme` interfaces for component-level symbol customization
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
- - `SettingsListOptions` with `enableSearch` for fuzzy filtering in `SettingsList` ([#643](https://github.com/badlogic/pi-mono/pull/643) by [@ninlds](https://github.com/ninlds))
73
- - `Editor.insertTextAtCursor(text)` method for programmatic text insertion ([#419](https://github.com/badlogic/pi-mono/issues/419))
74
- - `EditorKeybindingsManager` for configurable editor keybindings. Components now use `matchesKey()` and keybindings manager instead of individual `isXxx()` functions. ([#405](https://github.com/badlogic/pi-mono/pull/405) by [@hjanuschka](https://github.com/hjanuschka))
3
+ ## [1.4.2] - 2026-10-24
75
4
 
76
- ### Changed
77
-
78
- - `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
79
- - `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
80
- - `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)
81
- - `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)
82
- - `ReportPanel`'s native body carries the role `zeta.report.body`
83
- - `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
84
- - `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
85
- - `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`)
86
- - 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
87
- - 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
88
- - Moved `wrapTextWithAnsi` export to `@linxiraos/pi-natives` package
89
- - Default editor `newLine` binding now uses `shift+enter` only
90
- - 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).
91
- - Migrated key parsing and matching logic to native implementation for improved performance
92
- - Simplified `isKeyRelease()` and `isKeyRepeat()` to use regex pattern matching instead of string inclusion checks
93
- - Refactored `visibleWidth` function to use caching wrapper around new `visibleWidthRaw` implementation for improved performance
94
- - Improved performance of key ID parsing with optimized cache lookup strategy
95
- - Simplified `visibleWidth` calculation to use consistent Bun.stringWidth approach for all string lengths
96
- - Replaced external `fd` binary with native fuzzy path search for `@`-prefixed autocomplete
97
- - Restructured terminal capabilities from interface-based to class-based model
98
- - Improved table column width calculation with word-aware wrapping
99
- - Refactored text utilities to use native WASM implementations for strings >256 chars with JS fast path
100
- - Added Ctrl+Backspace as a delete-word-backward keybinding and improved modified backspace matching
101
- - Migrated file system operations from synchronous to asynchronous APIs in autocomplete provider for non-blocking I/O
102
- - Migrated node module imports from named to namespace imports across all packages for consistency with project guidelines
103
- - Normalized keybinding definitions to lowercase internally
104
- - Improved fuzzy matching to handle alphanumeric swaps.
105
- - Normalized keybinding definitions to lowercase internally.
106
- - Changed `showOverlay()` to return `OverlayHandle` for controlling overlay visibility
107
- - Removed `widthPercent`, `maxHeightPercent`, `rowPercent`, `colPercent` from `OverlayOptions` (use percentage strings instead)
108
- - Improved file autocomplete to show directory listing when typing `@` with no query, and fall back to prefix matching when fuzzy search returns no results
109
- - Terminal startup now queries Kitty protocol support before enabling event reporting
110
- - Changed cursor style from block to thin blinking bar (▏) at end of line
111
- - 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))
112
- - Renamed `EllipsisKind` enum to `Ellipsis` for clearer API naming
113
- - Changed hardcoded ellipsis character from theme-configurable to literal "…" in editor truncation
114
- - Improved blockquote rendering with text wrapping in Markdown component
115
- - Expanded Kitty keyboard protocol coverage for non-Latin layouts and legacy Alt sequences
116
- - Improved cursor positioning with safer bounds checking
117
- - Updated editor layout to respect configurable padding
118
- - Refactored scrolling logic for better viewport management
119
- - Key detection refactored: consolidated `is*()` functions into generic `matchesKey(data, keyId)` function that accepts key identifiers like `"ctrl+c"`, `"shift+enter"`, `"alt+left"`, etc.
120
-
121
- ### Fixed
122
-
123
- - Fixed width overflow protection in overlay compositing to prevent TUI crashes
124
- - Key presses no longer dropped when batched with other events over SSH
125
- - Fixed `fd` tool detection to automatically find `fd` or `fdfind` in PATH when not explicitly configured
126
- - Fixed editor multi-line insertion handling and lastAction tracking ([#945](https://github.com/badlogic/pi-mono/pull/945) by [@Perlence](https://github.com/Perlence))
127
- - Fixed editor word wrapping to reserve a cursor column ([#934](https://github.com/badlogic/pi-mono/pull/934) by [@Perlence](https://github.com/Perlence))
128
- - 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))
129
- - Fixed Kitty image ID allocation and cleanup to prevent image ID collisions between modules
130
- - Fixed viewport tracking and cursor positioning for overlays and content shrink scenarios
131
- - 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))
132
- - Directory completions for `@` file attachments no longer add trailing space, allowing continued autocomplete into subdirectories
133
- - `visibleWidth()` and `extractAnsiCode()` now handle APC escape sequences (`ESC _ ... BEL`), fixing width calculation and string slicing for strings containing cursor markers
134
- - 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))
135
- - Reset ANSI styles after each rendered line to prevent style leakage
136
- - Cursor position tracking when content shrinks with unchanged remaining lines
137
- - TUI renders with wrong dimensions after suspend/resume if terminal was resized while suspended ([#599](https://github.com/badlogic/pi-mono/issues/599))
138
- - 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))
139
- - `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))
140
-
141
- Older entries are archived in [packages/tui/CHANGELOG.md@9caccab691ce](https://github.com/can1357/oh-my-pi/blob/9caccab691ce575007f4b6bcbaf8f944723d5457/packages/tui/CHANGELOG.md).
142
- Older entries are archived in [packages/tui/CHANGELOG.md@58141d4e5fa8](https://github.com/can1357/oh-my-pi/blob/58141d4e5fa892166024e2168866c45e0baacde3/packages/tui/CHANGELOG.md).
143
- - Corrected editor end-of-line cursor rendering assertion to use includes() instead of endsWith()
144
- - Fixed potential errors during emergency terminal restore when terminal is already dead
145
- - Fixed autocomplete race condition by tracking request ID to prevent stale suggestion results
146
- - Added legacy terminal support for `Ctrl+` symbol key combinations
147
- - Added legacy terminal support for `Ctrl+` symbol key combinations.
148
- - Fixed backspace handling with additional codepoint support
149
- - Fixed Alt+letter key combinations for better recognition
150
- - TUI now filters out key release events by default, preventing double-processing of keys
151
- - `matchesKey()` now correctly matches Kitty protocol sequences for unmodified letter keys
152
- - Crash when pasting text with trailing whitespace exceeding terminal width through Markdown rendering
153
- - Slash command menu now only triggers when the editor input is otherwise empty ([#904](https://github.com/badlogic/pi-mono/issues/904))
154
- - 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))
155
- - 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))
156
- - Improved Kitty terminal key sequence parsing to correctly handle text field codepoints in CSI-u sequences
157
- - Fixed handling of private use Unicode codepoints (U+E000 to U+F8FF) in Kitty key decoding to prevent invalid character interpretation
158
- - Simplified terminal write error handling to mark terminal as dead on any write failure
159
- - Fixed multi-line strings in renderOutputBlock causing width overflow
160
- - Fixed slash command autocomplete applying stale completion when typing quickly
161
- - Reserved cursor space for zero padding and corrected end-of-line cursor rendering to prevent wrap glitches
162
- - Fixed viewport tracking after partial renders to prevent autocomplete list artifacts
163
- - Rendering optimizations: only re-render changed lines
164
- - Refactor input component to use keybindings manager
165
- - Fixed editor cursor blinking by allowing terminal cursor positioning when enabled.
166
- - 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))
167
- - 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))
168
- - Slash command autocomplete now triggers for commands starting with `.`, `-`, or `_` (e.g., `/.land`, `/-foo`) ([#422](https://github.com/badlogic/pi-mono/issues/422))
169
-
170
- ### Removed
171
-
172
- - 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.
173
- - Removed `ellipsis` property from `SymbolTheme` interface
174
- - Removed `extractAnsiCode` function from public API
175
- - Removed TUI layout engine exports from public API (BoxNode, ColumnNode, LayoutNode, etc.)
176
- - Removed `visibleWidth` benchmark file in favor of Kitty sequence benchmarking
177
- - Removed `truncateToWidth`, `sliceWithWidth`, and `extractSegments` functions from public API (now re-exported directly from @linxiraos/pi-natives)
5
+ - Version alignment with the 1.4.2 release line (no behavioral changes).
178
6
 
179
7
  ## [9.5.0] - 2026-02-01
180
8
 
@@ -353,6 +181,182 @@ Older entries are archived in [packages/tui/CHANGELOG.md@58141d4e5fa8](https://g
353
181
 
354
182
  Initial release under @oh-my-pi scope. See previous releases at [badlogic/pi-mono](https://github.com/badlogic/pi-mono).
355
183
 
184
+ ## [1.4.1] - 2026-10-23
185
+
186
+ - An attached TUI renders the backend's builtin-command output (`command_output`) in its status line and keeps client-only commands, pickers and mirrored switches local
187
+
188
+ ### Breaking Changes
189
+
190
+ - Removed `KeyEventType` export from public API
191
+ - `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))
192
+ - Removed `Key` helper object from public API; use string literals like `"ctrl+c"` instead of `Key.ctrl("c")`
193
+
194
+ ### Added
195
+
196
+ - Added `symbols` property to `EditorTheme`, `MarkdownTheme`, and `SelectListTheme` interfaces for component-level symbol customization
197
+ - Overlay compositing via `TUI.showOverlay()` and `TUI.hideOverlay()` for `ctx.ui.custom()` with `{ overlay: true }`
198
+ - Kitty keyboard protocol flag 2 support for key release events (`isKeyRelease()`, `isKeyRepeat()`, `KeyEventType`)
199
+ - `setKittyProtocolActive()`, `isKittyProtocolActive()` for Kitty protocol state management
200
+ - `kittyProtocolActive` property on Terminal interface to query Kitty protocol state
201
+ - `Component.wantsKeyRelease` property to opt-in to key release events (default false)
202
+ - Input component `onEscape` callback for handling escape key presses
203
+ - Emergency terminal restore to prevent corrupted state on crashes
204
+ - Overhauled UI with welcome screen and powerline footer
205
+ - Theme-configurable HTML export colors
206
+ - `ctx.ui.theme` getter for styling status text with theme colors
207
+ - Added `PI_TUI_WRITE_LOG` environment variable to capture raw ANSI output for debugging
208
+ - 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))
209
+ - `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))
210
+ - New exported types: `OverlayAnchor`, `OverlayHandle`, `OverlayMargin`, `OverlayOptions`, `SizeValue` ([#667](https://github.com/badlogic/pi-mono/pull/667) by [@nicobailon](https://github.com/nicobailon))
211
+ - `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))
212
+ - **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))
213
+ - `EditorComponent` interface for custom editor implementations
214
+ - `StdinBuffer` class to split batched stdin into individual sequences (adapted from [OpenTUI](https://github.com/anomalyco/opentui), MIT license)
215
+ - `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))
216
+ - Added mermaid block extraction and deduplication utilities (extractMermaidBlocks)
217
+ - Added `Alt+Delete` as a delete-word-forward shortcut
218
+ - Added configurable code block indentation for Markdown rendering
219
+ - Added undo support in the editor via `Ctrl+-`.
220
+ - Added configurable code block indentation for Markdown rendering.
221
+ - Added `Alt+Delete` as a delete-word-forward shortcut.
222
+ - Added `isPageUp()` and `isPageDown()` helper functions
223
+ - Added `SizeValue` type for CSS-like overlay sizing (absolute or percentage strings like `"50%"`)
224
+ - Added `OverlayHandle` interface with `hide()`, `setHidden()`, `isHidden()` methods for overlay visibility control
225
+ - Added `visible` callback to `OverlayOptions` for dynamic visibility based on terminal dimensions
226
+ - Added `pad` parameter to `truncateToWidth()` for padding result with spaces to exact width
227
+ - `StdinBuffer` class to split batched stdin into individual sequences
228
+ - Added `isCtrlY` helper function for detecting Ctrl+Y keyboard input
229
+ - Added configurable editor keybindings with typed key identifiers and action matching
230
+ - Added word-wrapped editor rendering for long lines
231
+ - Added `getText()` method to Text component for retrieving current text content
232
+ - Added `fullRedraws` readonly property to TUI class for tracking full screen redraws
233
+ - 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))
234
+ - 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))
235
+ - `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))
236
+ - 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))
237
+ - `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))
238
+ - `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))
239
+ - `fuzzyFilter()` and `fuzzyMatch()` utilities for fuzzy text matching
240
+ - Slash command autocomplete now uses fuzzy matching instead of prefix matching
241
+ - Added setAutocompleteMaxVisible() configuration (3-20 items)
242
+ - Added image detection to terminal capabilities (containsImage method)
243
+ - Added stdin monitoring to detect stalled input events and log warnings
244
+ - Added `pageUp` and `pageDown` key support with `selectPageUp`/`selectPageDown` editor actions
245
+ - Add `getExpandedText()` to editor for expanding paste markers
246
+ - Added `SymbolTheme` interface for customizing UI symbols including cursors, borders, spinners, and box-drawing characters
247
+ - Added support for custom spinner frames in the Loader component
248
+ - Added `setTopBorder()` method to Editor component for displaying custom status content in the top border
249
+ - Added `getWidth()` method to TUI class for retrieving terminal width
250
+ - Added rounded corner box-drawing characters to Editor component borders
251
+ - 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))
252
+ - 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.
253
+ - `SettingsListOptions` with `enableSearch` for fuzzy filtering in `SettingsList` ([#643](https://github.com/badlogic/pi-mono/pull/643) by [@ninlds](https://github.com/ninlds))
254
+ - `Editor.insertTextAtCursor(text)` method for programmatic text insertion ([#419](https://github.com/badlogic/pi-mono/issues/419))
255
+ - `EditorKeybindingsManager` for configurable editor keybindings. Components now use `matchesKey()` and keybindings manager instead of individual `isXxx()` functions. ([#405](https://github.com/badlogic/pi-mono/pull/405) by [@hjanuschka](https://github.com/hjanuschka))
256
+
257
+ ### Changed
258
+
259
+ - `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
260
+ - `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
261
+ - `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)
262
+ - `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)
263
+ - `ReportPanel`'s native body carries the role `zeta.report.body`
264
+ - `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
265
+ - `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
266
+ - `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`)
267
+ - 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
268
+ - 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
269
+ - Moved `wrapTextWithAnsi` export to `@linxiraos/pi-natives` package
270
+ - Default editor `newLine` binding now uses `shift+enter` only
271
+ - 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).
272
+ - Migrated key parsing and matching logic to native implementation for improved performance
273
+ - Simplified `isKeyRelease()` and `isKeyRepeat()` to use regex pattern matching instead of string inclusion checks
274
+ - Refactored `visibleWidth` function to use caching wrapper around new `visibleWidthRaw` implementation for improved performance
275
+ - Improved performance of key ID parsing with optimized cache lookup strategy
276
+ - Simplified `visibleWidth` calculation to use consistent Bun.stringWidth approach for all string lengths
277
+ - Replaced external `fd` binary with native fuzzy path search for `@`-prefixed autocomplete
278
+ - Restructured terminal capabilities from interface-based to class-based model
279
+ - Improved table column width calculation with word-aware wrapping
280
+ - Refactored text utilities to use native WASM implementations for strings >256 chars with JS fast path
281
+ - Added Ctrl+Backspace as a delete-word-backward keybinding and improved modified backspace matching
282
+ - Migrated file system operations from synchronous to asynchronous APIs in autocomplete provider for non-blocking I/O
283
+ - Migrated node module imports from named to namespace imports across all packages for consistency with project guidelines
284
+ - Normalized keybinding definitions to lowercase internally
285
+ - Improved fuzzy matching to handle alphanumeric swaps.
286
+ - Normalized keybinding definitions to lowercase internally.
287
+ - Changed `showOverlay()` to return `OverlayHandle` for controlling overlay visibility
288
+ - Removed `widthPercent`, `maxHeightPercent`, `rowPercent`, `colPercent` from `OverlayOptions` (use percentage strings instead)
289
+ - Improved file autocomplete to show directory listing when typing `@` with no query, and fall back to prefix matching when fuzzy search returns no results
290
+ - Terminal startup now queries Kitty protocol support before enabling event reporting
291
+ - Changed cursor style from block to thin blinking bar (▏) at end of line
292
+ - 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))
293
+ - Renamed `EllipsisKind` enum to `Ellipsis` for clearer API naming
294
+ - Changed hardcoded ellipsis character from theme-configurable to literal "…" in editor truncation
295
+ - Improved blockquote rendering with text wrapping in Markdown component
296
+ - Expanded Kitty keyboard protocol coverage for non-Latin layouts and legacy Alt sequences
297
+ - Improved cursor positioning with safer bounds checking
298
+ - Updated editor layout to respect configurable padding
299
+ - Refactored scrolling logic for better viewport management
300
+ - Key detection refactored: consolidated `is*()` functions into generic `matchesKey(data, keyId)` function that accepts key identifiers like `"ctrl+c"`, `"shift+enter"`, `"alt+left"`, etc.
301
+
302
+ ### Fixed
303
+
304
+ - Fixed width overflow protection in overlay compositing to prevent TUI crashes
305
+ - Key presses no longer dropped when batched with other events over SSH
306
+ - Fixed `fd` tool detection to automatically find `fd` or `fdfind` in PATH when not explicitly configured
307
+ - Fixed editor multi-line insertion handling and lastAction tracking ([#945](https://github.com/badlogic/pi-mono/pull/945) by [@Perlence](https://github.com/Perlence))
308
+ - Fixed editor word wrapping to reserve a cursor column ([#934](https://github.com/badlogic/pi-mono/pull/934) by [@Perlence](https://github.com/Perlence))
309
+ - 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))
310
+ - Fixed Kitty image ID allocation and cleanup to prevent image ID collisions between modules
311
+ - Fixed viewport tracking and cursor positioning for overlays and content shrink scenarios
312
+ - 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))
313
+ - Directory completions for `@` file attachments no longer add trailing space, allowing continued autocomplete into subdirectories
314
+ - `visibleWidth()` and `extractAnsiCode()` now handle APC escape sequences (`ESC _ ... BEL`), fixing width calculation and string slicing for strings containing cursor markers
315
+ - 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))
316
+ - Reset ANSI styles after each rendered line to prevent style leakage
317
+ - Cursor position tracking when content shrinks with unchanged remaining lines
318
+ - TUI renders with wrong dimensions after suspend/resume if terminal was resized while suspended ([#599](https://github.com/badlogic/pi-mono/issues/599))
319
+ - 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))
320
+ - `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))
321
+
322
+ Older entries are archived in [packages/tui/CHANGELOG.md@9caccab691ce](https://github.com/can1357/oh-my-pi/blob/9caccab691ce575007f4b6bcbaf8f944723d5457/packages/tui/CHANGELOG.md).
323
+ Older entries are archived in [packages/tui/CHANGELOG.md@58141d4e5fa8](https://github.com/can1357/oh-my-pi/blob/58141d4e5fa892166024e2168866c45e0baacde3/packages/tui/CHANGELOG.md).
324
+ - Corrected editor end-of-line cursor rendering assertion to use includes() instead of endsWith()
325
+ - Fixed potential errors during emergency terminal restore when terminal is already dead
326
+ - Fixed autocomplete race condition by tracking request ID to prevent stale suggestion results
327
+ - Added legacy terminal support for `Ctrl+` symbol key combinations
328
+ - Added legacy terminal support for `Ctrl+` symbol key combinations.
329
+ - Fixed backspace handling with additional codepoint support
330
+ - Fixed Alt+letter key combinations for better recognition
331
+ - TUI now filters out key release events by default, preventing double-processing of keys
332
+ - `matchesKey()` now correctly matches Kitty protocol sequences for unmodified letter keys
333
+ - Crash when pasting text with trailing whitespace exceeding terminal width through Markdown rendering
334
+ - Slash command menu now only triggers when the editor input is otherwise empty ([#904](https://github.com/badlogic/pi-mono/issues/904))
335
+ - 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))
336
+ - 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))
337
+ - Improved Kitty terminal key sequence parsing to correctly handle text field codepoints in CSI-u sequences
338
+ - Fixed handling of private use Unicode codepoints (U+E000 to U+F8FF) in Kitty key decoding to prevent invalid character interpretation
339
+ - Simplified terminal write error handling to mark terminal as dead on any write failure
340
+ - Fixed multi-line strings in renderOutputBlock causing width overflow
341
+ - Fixed slash command autocomplete applying stale completion when typing quickly
342
+ - Reserved cursor space for zero padding and corrected end-of-line cursor rendering to prevent wrap glitches
343
+ - Fixed viewport tracking after partial renders to prevent autocomplete list artifacts
344
+ - Rendering optimizations: only re-render changed lines
345
+ - Refactor input component to use keybindings manager
346
+ - Fixed editor cursor blinking by allowing terminal cursor positioning when enabled.
347
+ - 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))
348
+ - 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))
349
+ - Slash command autocomplete now triggers for commands starting with `.`, `-`, or `_` (e.g., `/.land`, `/-foo`) ([#422](https://github.com/badlogic/pi-mono/issues/422))
350
+
351
+ ### Removed
352
+
353
+ - 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.
354
+ - Removed `ellipsis` property from `SymbolTheme` interface
355
+ - Removed `extractAnsiCode` function from public API
356
+ - Removed TUI layout engine exports from public API (BoxNode, ColumnNode, LayoutNode, etc.)
357
+ - Removed `visibleWidth` benchmark file in favor of Kitty sequence benchmarking
358
+ - Removed `truncateToWidth`, `sliceWithWidth`, and `extractSegments` functions from public API (now re-exported directly from @linxiraos/pi-natives)
359
+
356
360
  ## [1.4.0] - 2026-10-21
357
361
 
358
362
  - 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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@linxiraos/pi-tui",
4
- "version": "1.4.1",
4
+ "version": "1.4.2",
5
5
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
6
6
  "homepage": "https://linxira-os.github.io/zeta/",
7
7
  "author": "Linxira-OS",
@@ -38,14 +38,14 @@
38
38
  "gen:glyphs": "bun scripts/gen-glyphs.ts"
39
39
  },
40
40
  "dependencies": {
41
- "@linxiraos/pi-omptype": "1.4.1",
42
- "@linxiraos/pi-agent-core": "1.4.1",
43
- "@linxiraos/pi-ai": "1.4.1",
44
- "@linxiraos/pi-catalog": "1.4.1",
45
- "@linxiraos/pi-natives": "1.4.1",
46
- "@linxiraos/pi-utils": "1.4.1",
47
- "@linxiraos/pi-wire": "1.4.1",
48
- "@linxiraos/pi-snapcompact": "1.4.1"
41
+ "@linxiraos/pi-omptype": "1.4.2",
42
+ "@linxiraos/pi-agent-core": "1.4.2",
43
+ "@linxiraos/pi-ai": "1.4.2",
44
+ "@linxiraos/pi-catalog": "1.4.2",
45
+ "@linxiraos/pi-natives": "1.4.2",
46
+ "@linxiraos/pi-utils": "1.4.2",
47
+ "@linxiraos/pi-wire": "1.4.2",
48
+ "@linxiraos/pi-snapcompact": "1.4.2"
49
49
  },
50
50
  "devDependencies": {
51
51
  "kitty-vt-wasm": "^0.2.0"