Commit graph

266 commits

Author SHA1 Message Date
Mario Zechner
d5fd685901 Enable more biome lints and fix things 2025-12-21 22:56:20 +01:00
Mario Zechner
9c18439c4d Release v0.25.3 2025-12-21 21:01:27 +01:00
Aliou Diallo
8868d623fc
feat(coding-agent): add Ctrl+Z to suspend process (#267)
* feat(tui): add isCtrlZ key detection and resetRenderState method

* feat(coding-agent): add Ctrl+Z handler to suspend process

* docs(coding-agent): add Ctrl+Z to keyboard shortcuts documentation

* feat(tui): add force parameter to requestRender
2025-12-21 20:19:32 +01:00
Aliou Diallo
afedf1707a feat(tui): add isCtrlG key detection 2025-12-21 12:06:57 +01:00
Mario Zechner
299986f06b Release v0.25.2 2025-12-21 02:59:03 +01:00
Mario Zechner
c97702cf91 Release v0.25.1 2025-12-21 02:43:47 +01:00
Mario Zechner
918750eb9e Fix tab completion for absolute paths
- Fix //tmp issue: distinguish slash commands from file paths by checking if anything precedes the /
- Fix symlinks to directories (like /tmp) not getting trailing slash
2025-12-21 02:41:38 +01:00
Mario Zechner
df07a74ad5 Release v0.25.0 2025-12-20 22:02:47 +01:00
Mario Zechner
36e17933d5 feat(ai): add Google Cloud Code Assist provider
- Add new API type 'google-cloud-code-assist' for Gemini CLI / Antigravity auth
- Extract shared Google utilities to google-shared.ts
- Implement streaming provider for Cloud Code Assist endpoint
- Add 7 models: gemini-3-pro-high/low, gemini-3-flash, claude-sonnet/opus, gpt-oss

Models use OAuth authentication and have sh cost (uses Google account quota).
OAuth flow will be implemented in coding-agent in a follow-up.
2025-12-20 10:20:30 +01:00
Mario Zechner
085294b764 Release v0.24.5 2025-12-19 22:09:35 +01:00
Mario Zechner
d2276ab654 fix(tui): fix input buffering in iTerm2 causing delayed keypresses
The cell size query response parser was incorrectly holding back Kitty
keyboard protocol sequences, thinking they might be incomplete cell size
responses. This caused Ctrl+C/Ctrl+D to require multiple presses in iTerm2.

Fixed by only waiting for more data if the buffer doesn't end with a
terminal escape sequence terminator character.
2025-12-19 22:08:36 +01:00
Mario Zechner
f377c3c9c3 Release v0.24.4 2025-12-19 21:54:36 +01:00
Mario Zechner
65c292b7dd Fix outdated editor tests for grapheme-aware cursor movement 2025-12-19 21:41:28 +01:00
Mario Zechner
ad4eb3afa6 Release v0.24.3 2025-12-19 21:36:16 +01:00
Mario Zechner
5095b4eb02 Release v0.24.2 2025-12-19 21:12:53 +01:00
Mario Zechner
84eaad8029 fix(tui): use isBackspace and isEnter helpers in Editor
Fixes Backspace and Enter not working with Caps Lock enabled.
The Kitty protocol sends lock key bits in modifiers which broke
the raw byte detection.
2025-12-19 21:08:24 +01:00
Mario Zechner
cbd20b58a6 fix(tui): add isHome, isEnd, isDelete helpers for Kitty protocol
Extended the Kitty protocol parser to handle functional keys with
~ terminator (Delete, Insert, PageUp, PageDown) and Home/End keys.
Updated editor.ts and input.ts to use the new helpers.
2025-12-19 21:00:20 +01:00
Mario Zechner
716516d61e fix(tui): use isEnter and isBackspace helpers in Input component
Fixes Kitty protocol handling for Enter and Backspace in the Input
component, matching the Editor component fix.
2025-12-19 20:57:03 +01:00
Mario Zechner
50b055f3ae Release v0.24.1 2025-12-19 20:51:44 +01:00
Mario Zechner
b8dd9be3d0 fix(tui): handle emoji deletion and cursor movement correctly
Backspace, Delete, and arrow keys now use Intl.Segmenter to operate
on grapheme clusters instead of individual UTF-16 code units. This
fixes deletion of emojis and other multi-codepoint characters.

fixes #240
2025-12-19 20:39:45 +01:00
Mario Zechner
28c3ffb914 fix(tui): handle Kitty protocol lock key modifiers
Fixes keyboard input in Ghostty on Linux when Num Lock is enabled.
The Kitty protocol includes Caps Lock (64) and Num Lock (128) bits
in modifier values. Now masks out lock bits when matching shortcuts.

Added helper functions: isArrowUp/Down/Left/Right, isEnter, isTab,
isBackspace, isShiftEnter, isAltEnter, isAltLeft/Right, isCtrlLeft/Right

fixes #243
2025-12-19 20:34:20 +01:00
Mario Zechner
16685a36ec Release v0.24.0 2025-12-19 05:21:25 +01:00
Mario Zechner
f92147ffe8 Release v0.23.5 2025-12-19 05:15:34 +01:00
Mario Zechner
f8b6164ecd Fix Escape key handling for Kitty keyboard protocol
Add isEscape() helper that handles both raw (\x1b) and Kitty protocol
(\x1b[27u) Escape sequences. Update all components that check for
Escape key to use the new helper.
2025-12-19 04:54:02 +01:00
Mario Zechner
139af12b37 Merge kitty-protocol-support into main 2025-12-19 01:21:47 +01:00
Mario Zechner
b2f29613e8 Add /hotkeys command, Ctrl+D exit, markdown table borders 2025-12-19 01:19:21 +01:00
Ahmed Kamal
d569f0353e Remove isKittyCtrl and isKittyKey from public exports
These generic helpers aren't used externally and would require
exporting MODIFIERS constants to be ergonomic. The specific
isCtrl* helpers cover all practical use cases.
2025-12-18 19:51:04 +02:00
Ahmed Kamal
727a7ab018 Add Ctrl+D to exit when editor is empty
- Add isCtrlD helper to keys.ts
- CustomEditor intercepts Ctrl+D and only triggers callback when editor is empty
- Single Ctrl+D with empty input exits immediately
- Update CHANGELOG to frame as feature (Kitty protocol support) not fix
2025-12-18 19:39:41 +02:00
Ahmed Kamal
c3c2bffc68 Add helper functions for key detection and update usage
- Add isCtrlA/C/E/K/O/P/T/U/W helper functions that check both raw and Kitty formats
- Add isAltBackspace helper function
- Refactor editor.ts, input.ts, select-list.ts to use helper functions
- Refactor custom-editor.ts, session-selector.ts, user-message-selector.ts
- Add CHANGELOG entry for the Shift+Enter fix
2025-12-18 19:29:40 +02:00
Ahmed Kamal
4a4531f887 Add Kitty keyboard protocol support for Shift+Enter and other modifier keys
Enable the Kitty keyboard protocol on terminal start to receive enhanced
key sequences that include modifier information. This fixes Shift+Enter
not working in Ghostty, Kitty, WezTerm, and other modern terminals.

Changes:
- Enable Kitty protocol on start (\x1b[>1u), disable on stop (\x1b[<u)
- Add centralized key definitions in packages/tui/src/keys.ts
- Support both legacy and Kitty sequences for all modifier+key combos:
  - Shift+Enter, Alt+Enter for newlines
  - Shift+Tab for thinking level cycling
  - Ctrl+C, Ctrl+A, Ctrl+E, Ctrl+K, Ctrl+U, Ctrl+W, Ctrl+O, Ctrl+P, Ctrl+T
  - Alt+Backspace for word deletion
- Export Keys constants and helper functions from @mariozechner/pi-tui
2025-12-18 19:20:30 +02:00
Mario Zechner
2f86c8bc3c Release v0.23.4 2025-12-18 16:56:50 +01:00
Sergii Kozak
f8e6d62db7 Add syntax highlighting to markdown code blocks 2025-12-17 20:15:44 -08:00
Mario Zechner
00851369fc Release v0.23.3 2025-12-17 22:29:46 +01:00
Mario Zechner
4894fa411c Release v0.23.2
Fixed Claude models via GitHub Copilot re-answering all previous prompts.

fixes #209
2025-12-17 17:56:00 +01:00
Ahmed Kamal
c1113deea9
Fix markdown tables overflowing/wrapping in TUI (width-aware rendering) (#206)
Fix markdown tables overflowing/wrapping in TUI
2025-12-17 17:13:27 +01:00
Mario Zechner
46ba48a35d Release v0.23.1 2025-12-17 16:43:09 +01:00
Mario Zechner
909989066a Fix TUI performance regression: add caching to Box, use Text directly for built-in tools 2025-12-17 16:39:23 +01:00
Mario Zechner
67b73d018f Release v0.23.0 2025-12-17 16:13:32 +01:00
Mario Zechner
e7097d911a Custom tools with session lifecycle, examples for hooks and tools
- Custom tools: TypeScript modules that extend pi with new tools
  - Custom TUI rendering via renderCall/renderResult
  - User interaction via pi.ui (select, confirm, input, notify)
  - Session lifecycle via onSession callback for state reconstruction
  - Examples: todo.ts, question.ts, hello.ts

- Hook examples: permission-gate, git-checkpoint, protected-paths

- Session lifecycle centralized in AgentSession
  - Works across all modes (interactive, print, RPC)
  - Unified session event for hooks (replaces session_start/session_switch)

- Box component added to pi-tui

- Examples bundled in npm and binary releases

Fixes #190
2025-12-17 16:03:23 +01:00
Mario Zechner
295f51b53f Release v0.22.5 2025-12-17 01:22:13 +01:00
Mario Zechner
03b061773c Release v0.22.4
- Add --list-models CLI flag for listing/finding models with fuzzy search

fixes #203
2025-12-17 00:39:14 +01:00
Markus Ylisiurunen
4b04c87b3d
add new getCursor and getLines methods to editor (#201) 2025-12-16 20:13:43 +01:00
Mario Zechner
deee1c2952 Release v0.22.3 2025-12-16 20:06:05 +01:00
Markus Ylisiurunen
92577316e0
Fix double new line issues in markdown rendering (#199)
* prevent double blank lines after markdown elements

* prevent double blank lines after markdown elements
2025-12-16 00:25:06 +01:00
Mario Zechner
ce9ffaff91 Fix ANSI styles not preserved across newlines in text wrapping
wrapTextWithAnsi() was processing each line independently after splitting
on newlines, losing ANSI state. When styled text contained embedded newlines
(e.g. from markdown paragraphs), subsequent lines would lose their styling.

Fixed by tracking ANSI state across lines and prepending active codes to
lines after the first.

Fixes #197
2025-12-15 23:00:25 +01:00
Mario Zechner
fd5134f88c Release v0.22.2 2025-12-15 22:09:14 +01:00
Mario Zechner
a7e3b8625b Release v0.22.1 2025-12-15 21:53:27 +01:00
Mario Zechner
04058d5812 Release v0.22.0 2025-12-15 20:14:25 +01:00
Mario Zechner
3b440bb13b Release v0.21.0 2025-12-13 23:55:31 +01:00
Mario Zechner
e4e234ecff Fix image rendering artifacts and improve show-images selector
- Image component returns correct number of lines (rows) for TUI accounting
- Empty lines rendered first, then cursor moves up and image is drawn
- This clears the space the image occupies before rendering
- Add spacer before inline images in tool output
- Create ShowImagesSelectorComponent with borders like other selectors
- Use showSelector pattern for /show-images command
2025-12-13 23:53:28 +01:00