@mariozechner/pi-coding-agent 0.12.11 → 0.12.13
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 +128 -267
- package/README.md +12 -0
- package/dist/fuzzy.d.ts +7 -0
- package/dist/fuzzy.d.ts.map +1 -0
- package/dist/fuzzy.js +64 -0
- package/dist/fuzzy.js.map +1 -0
- package/dist/fuzzy.test.d.ts +2 -0
- package/dist/fuzzy.test.d.ts.map +1 -0
- package/dist/fuzzy.test.js +76 -0
- package/dist/fuzzy.test.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +11 -14
- package/dist/main.js.map +1 -1
- package/dist/tui/footer.d.ts.map +1 -1
- package/dist/tui/footer.js +6 -2
- package/dist/tui/footer.js.map +1 -1
- package/dist/tui/model-selector.d.ts.map +1 -1
- package/dist/tui/model-selector.js +2 -13
- package/dist/tui/model-selector.js.map +1 -1
- package/dist/tui/session-selector.d.ts.map +1 -1
- package/dist/tui/session-selector.js +2 -14
- package/dist/tui/session-selector.js.map +1 -1
- package/dist/tui/tui-renderer.d.ts +6 -2
- package/dist/tui/tui-renderer.d.ts.map +1 -1
- package/dist/tui/tui-renderer.js +113 -12
- package/dist/tui/tui-renderer.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
## [0.12.13] - 2025-12-05
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **Faster startup**: Version check now runs in parallel with TUI initialization instead of blocking startup for up to 1 second. Update notifications appear in chat when the check completes.
|
|
10
|
+
|
|
11
|
+
## [0.12.12] - 2025-12-05
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- **Footer display**: Token counts now use M suffix for millions (e.g., `10.2M` instead of `10184k`). Context display shortened from `61.3% of 200k` to `61.3%/200k`.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- **Multi-key sequences in inputs**: Inputs like model search now handle multi-key sequences identically to the main prompt editor. ([#122](https://github.com/badlogic/pi-mono/pull/122) by [@markusylisiurunen](https://github.com/markusylisiurunen))
|
|
20
|
+
- **Line wrapping escape codes**: Fixed underline style bleeding into padding when wrapping long URLs. ANSI codes now attach to the correct content, and line-end resets only turn off underline (preserving background colors). ([#109](https://github.com/badlogic/pi-mono/issues/109))
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- **Fuzzy search models and sessions**: Implemented a simple fuzzy search for models and sessions (e.g., `codexmax` now finds `gpt-5.1-codex-max`). ([#122](https://github.com/badlogic/pi-mono/pull/122) by [@markusylisiurunen](https://github.com/markusylisiurunen))
|
|
25
|
+
- **Prompt History Navigation**: Browse previously submitted prompts using Up/Down arrow keys when the editor is empty. Press Up to cycle through older prompts, Down to return to newer ones or clear the editor. Similar to shell history and Claude Code's prompt history feature. History is session-scoped and stores up to 100 entries. ([#121](https://github.com/badlogic/pi-mono/pull/121) by [@nicobailon](https://github.com/nicobailon))
|
|
26
|
+
- **`/resume` Command**: Switch to a different session mid-conversation. Opens an interactive selector showing all available sessions. Equivalent to the `--resume` CLI flag but can be used without restarting the agent. ([#117](https://github.com/badlogic/pi-mono/pull/117) by [@hewliyang](https://github.com/hewliyang))
|
|
27
|
+
|
|
3
28
|
## [0.12.11] - 2025-12-05
|
|
4
29
|
|
|
5
30
|
### Changed
|
|
@@ -63,378 +88,214 @@
|
|
|
63
88
|
|
|
64
89
|
### Added
|
|
65
90
|
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
### Fixed
|
|
69
|
-
|
|
70
|
-
- **Windows Carriage Return Handling**: Fixed tool output containing stray `\r` characters on Windows, which could cause rendering issues. Carriage returns are now stripped from bash output.
|
|
91
|
+
- **RPC Termination Safeguard**: When running as an RPC worker (stdin pipe detected), the CLI now exits immediately if the parent process terminates unexpectedly. Prevents orphaned RPC workers from persisting indefinitely and consuming system resources.
|
|
71
92
|
|
|
72
93
|
## [0.12.3] - 2025-12-02
|
|
73
94
|
|
|
74
95
|
### Fixed
|
|
75
96
|
|
|
76
|
-
- **
|
|
97
|
+
- **Rate limit handling**: Anthropic rate limit errors now trigger automatic retry with exponential backoff (base 10s, max 5 retries). Previously these errors would abort the request immediately.
|
|
98
|
+
- **Usage tracking during retries**: Retried requests now correctly accumulate token usage from all attempts, not just the final successful one. Fixes artificially low token counts when requests were retried.
|
|
77
99
|
|
|
78
100
|
## [0.12.2] - 2025-12-02
|
|
79
101
|
|
|
80
|
-
### Fixed
|
|
81
|
-
|
|
82
|
-
- **Windows Binary Path Resolution**: Fixed Bun compiled binary on Windows failing to find `package.json` and other assets. The binary was incorrectly using the Bun runtime's virtual filesystem path (`B:\~BUN\`) instead of the actual executable location. Now uses `process.execPath` which correctly points to the compiled binary, and updated detection to check for `%7EBUN` (URL-encoded `~BUN`) in `import.meta.url`.
|
|
83
|
-
|
|
84
|
-
## [0.12.1] - 2025-12-02
|
|
85
|
-
|
|
86
102
|
### Changed
|
|
87
103
|
|
|
88
|
-
-
|
|
89
|
-
|
|
90
|
-
## [0.12.0] - 2025-12-02
|
|
91
|
-
|
|
92
|
-
### Added
|
|
93
|
-
|
|
94
|
-
- **Standalone Binary Support**: Build a self-contained binary using Bun with `npm run build:binary`. Pre-built binaries for macOS (arm64/x64), Linux (x64/arm64), and Windows (x64) are available on GitHub Releases. Based on [#89](https://github.com/badlogic/pi-mono/pull/89) by [@steipete](https://github.com/steipete), extended with cross-platform path resolution and GitHub Actions for automated release builds.
|
|
95
|
-
|
|
96
|
-
## [0.11.6] - 2025-12-02
|
|
97
|
-
|
|
98
|
-
### Added
|
|
99
|
-
|
|
100
|
-
- **OAuth Login Status Indicator**: The `/login` provider selector now shows "✓ logged in" next to providers where you're already authenticated. This makes it clear at a glance whether you're using your Claude Pro/Max subscription. ([#88](https://github.com/badlogic/pi-mono/pull/88) by [@steipete](https://github.com/steipete))
|
|
101
|
-
- **Subscription Cost Indicator**: The footer now shows "(sub)" next to the cost when using an OAuth subscription (e.g., `$0.123 (sub)`). This makes it visible without needing `/login` that you're using your Claude Pro/Max subscription.
|
|
102
|
-
|
|
103
|
-
## [0.11.5] - 2025-12-01
|
|
104
|
+
- Removed support for gpt-4.5-preview and o3 models (not yet available)
|
|
104
105
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
- **Custom Slash Commands**: Define reusable prompt templates as Markdown files. Place files in `~/.pi/agent/commands/` (global) or `.pi/commands/` (project-specific). Commands appear in `/` autocomplete with source indicators like `(user)` or `(project)`. Supports bash-style arguments (`$1`, `$2`, `$@`) with quote-aware parsing. Subdirectories create namespaced commands (e.g., `.pi/commands/frontend/component.md` shows as `(project:frontend)`). Optional `description` field in YAML frontmatter. Works from CLI as well (`pi -p "/review"`). ([#86](https://github.com/badlogic/pi-mono/issues/86))
|
|
108
|
-
|
|
109
|
-
## [0.11.4] - 2025-12-01
|
|
110
|
-
|
|
111
|
-
### Improved
|
|
112
|
-
|
|
113
|
-
- **TUI Crash Diagnostics**: When a render error occurs (line exceeds terminal width), all rendered lines are now written to `~/.pi/agent/pi-crash.log` with their indices and visible widths for easier debugging.
|
|
114
|
-
|
|
115
|
-
### Fixed
|
|
116
|
-
|
|
117
|
-
- **Session Selector Crash with Wide Characters**: Fixed crash when running `pi -r` to resume sessions containing emojis, CJK characters, or other wide Unicode characters. The session list was using character count instead of visible terminal width for truncation, causing lines to exceed terminal width. Added `truncateToWidth()` utility that properly handles ANSI codes and wide characters. ([#85](https://github.com/badlogic/pi-mono/issues/85))
|
|
118
|
-
|
|
119
|
-
## [0.11.3] - 2025-12-01
|
|
106
|
+
## [0.12.1] - 2025-12-02
|
|
120
107
|
|
|
121
108
|
### Added
|
|
122
109
|
|
|
123
|
-
- **
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
-
|
|
110
|
+
- **Models**: Added support for OpenAI's new models:
|
|
111
|
+
- `gpt-4.1` (128K context)
|
|
112
|
+
- `gpt-4.1-mini` (128K context)
|
|
113
|
+
- `gpt-4.1-nano` (128K context)
|
|
114
|
+
- `o3` (200K context, reasoning model)
|
|
115
|
+
- `o4-mini` (200K context, reasoning model)
|
|
128
116
|
|
|
129
|
-
## [0.
|
|
117
|
+
## [0.12.0] - 2025-12-02
|
|
130
118
|
|
|
131
119
|
### Added
|
|
132
120
|
|
|
133
|
-
-
|
|
134
|
-
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
- **
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
- **`--tools` Flag**: New CLI flag to specify available tools (e.g., `--tools read,grep,find,ls` for read-only mode). Default behavior remains unchanged (`read,bash,edit,write`).
|
|
142
|
-
- **Dynamic System Prompt**: The system prompt now adapts to the selected tools, showing relevant guidelines and warnings (e.g., "READ-ONLY mode" when write tools are disabled).
|
|
121
|
+
- **`-p, --print` Flag**: Run in non-interactive batch mode. Processes input message or piped stdin without TUI, prints agent response directly to stdout. Ideal for scripting, piping, and CI/CD integration. Exits after first response.
|
|
122
|
+
- **`-P, --print-streaming` Flag**: Like `-p`, but streams response tokens as they arrive. Use `--print-streaming --no-markdown` for raw unformatted output.
|
|
123
|
+
- **`--print-turn` Flag**: Continue processing tool calls and agent turns until the agent naturally finishes or requires user input. Combine with `-p` for complete multi-turn conversations.
|
|
124
|
+
- **`--no-markdown` Flag**: Output raw text without Markdown formatting. Useful when piping output to tools that expect plain text.
|
|
125
|
+
- **Streaming Print Mode**: Added internal `printStreaming` option for streaming output in non-TUI mode.
|
|
126
|
+
- **RPC Mode `print` Command**: Send `{"type":"print","content":"text"}` to get formatted print output via `print_output` events.
|
|
127
|
+
- **Auto-Save in Print Mode**: Print mode conversations are automatically saved to the session directory, allowing later resumption with `--continue`.
|
|
128
|
+
- **Thinking level options**: Added `--thinking-off`, `--thinking-minimal`, `--thinking-low`, `--thinking-medium`, `--thinking-high` flags for directly specifying thinking level without the selector UI.
|
|
143
129
|
|
|
144
|
-
###
|
|
130
|
+
### Changed
|
|
145
131
|
|
|
146
|
-
- **
|
|
147
|
-
- **
|
|
148
|
-
- **File Selector Styling**: Selected items in file autocomplete (`@` and Tab) now use consistent accent color for the entire line instead of mixed colors.
|
|
132
|
+
- **Simplified RPC Protocol**: Replaced the `prompt` wrapper command with direct message objects. Send `{"role":"user","content":"text"}` instead of `{"type":"prompt","message":"text"}`. Better aligns with message format throughout the codebase.
|
|
133
|
+
- **RPC Message Handling**: Agent now processes raw message objects directly, with `timestamp` auto-populated if missing.
|
|
149
134
|
|
|
150
|
-
## [0.
|
|
135
|
+
## [0.11.9] - 2025-12-02
|
|
151
136
|
|
|
152
137
|
### Changed
|
|
153
138
|
|
|
154
|
-
-
|
|
155
|
-
- **Native Model Identity**: Removed "You are actually not Claude, you are Pi" from system prompt, allowing models to use their native identity ([#73](https://github.com/badlogic/pi-mono/issues/73))
|
|
156
|
-
|
|
157
|
-
## [0.10.1] - 2025-11-27
|
|
158
|
-
|
|
159
|
-
### Added
|
|
139
|
+
- Change Ctrl+I to Ctrl+P for model cycling shortcut to avoid collision with Tab key in some terminals
|
|
160
140
|
|
|
161
|
-
|
|
141
|
+
## [0.11.8] - 2025-12-01
|
|
162
142
|
|
|
163
143
|
### Fixed
|
|
164
144
|
|
|
165
|
-
-
|
|
166
|
-
- **Edit Diff Line Number Alignment**: Fixed two issues with diff display in the edit tool:
|
|
167
|
-
1. Line numbers were incorrect for edits far from the start of a file (e.g., showing 1, 2, 3 instead of 336, 337, 338). The skip count for context lines was being added after displaying lines instead of before.
|
|
168
|
-
2. When diff lines wrapped due to terminal width, the line number prefix lost its leading space alignment, and code indentation (spaces/tabs after line numbers) was lost. Rewrote `splitIntoTokensWithAnsi` in `pi-tui` to preserve whitespace as separate tokens instead of discarding it, so wrapped lines maintain proper alignment and indentation.
|
|
169
|
-
|
|
170
|
-
### Improved
|
|
171
|
-
|
|
172
|
-
- **Git Branch Display**: Footer now shows the active git branch after the directory path (e.g., `~/project (main)`). Branch is detected by reading `.git/HEAD` directly (fast, synchronous). Cache is refreshed after each assistant message to detect branch changes from git commands executed by the agent. ([#55](https://github.com/badlogic/pi-mono/issues/55))
|
|
173
|
-
- **HTML Export**: Added timestamps to each message, fixed text clipping with proper word-wrapping CSS, improved font selection (`ui-monospace`, `Cascadia Code`, `Source Code Pro`), reduced font sizes for more compact display (12px base), added model switch indicators in conversation timeline, created dedicated Tokens & Cost section with cumulative statistics (input/output/cache tokens, cost breakdown by type), added context usage display showing token count and percentage for the last model used, and now displays all models used during the session. ([#51](https://github.com/badlogic/pi-mono/issues/51), [#52](https://github.com/badlogic/pi-mono/issues/52))
|
|
174
|
-
|
|
175
|
-
## [0.10.0] - 2025-11-27
|
|
145
|
+
- Absolute glob patterns (e.g., `/Users/foo/**/*.ts`) are now handled correctly. Previously the leading `/` was being stripped, causing the pattern to be interpreted relative to the current directory.
|
|
176
146
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
- **Fuzzy File Search (`@`)**: Type `@` followed by a search term to fuzzy-search files and folders across your project. Respects `.gitignore` and skips hidden files. Directories are prioritized in results. Based on [PR #60](https://github.com/badlogic/pi-mono/pull/60) by [@fightbulc](https://github.com/fightbulc), reimplemented with pure Node.js for fast, dependency-free searching.
|
|
147
|
+
## [0.11.7] - 2025-12-01
|
|
180
148
|
|
|
181
149
|
### Fixed
|
|
182
150
|
|
|
183
|
-
-
|
|
184
|
-
- **Footer Cost Display**: Added `$` prefix to cost display in footer. Now shows `$0.078` instead of `0.078`. ([#53](https://github.com/badlogic/pi-mono/issues/53))
|
|
185
|
-
|
|
186
|
-
## [0.9.3] - 2025-11-24
|
|
187
|
-
|
|
188
|
-
### Added
|
|
189
|
-
|
|
190
|
-
- Added Anthropic Claude Opus 4.5 support
|
|
151
|
+
- Fix read path traversal vulnerability. Paths are now validated to prevent reading outside the working directory or its parents. The `read` tool can read from `cwd`, its ancestors (for config files), and all descendants. Symlinks are resolved before validation.
|
|
191
152
|
|
|
192
|
-
## [0.
|
|
153
|
+
## [0.11.6] - 2025-12-01
|
|
193
154
|
|
|
194
155
|
### Fixed
|
|
195
156
|
|
|
196
|
-
-
|
|
197
|
-
|
|
198
|
-
## [0.9.0] - 2025-11-21
|
|
199
|
-
|
|
200
|
-
### Added
|
|
201
|
-
|
|
202
|
-
- **`/clear` Command**: New slash command to reset the conversation context and start a fresh session. Aborts any in-flight agent work, clears all messages, and creates a new session file. ([#48](https://github.com/badlogic/pi-mono/pull/48))
|
|
203
|
-
- **Model Cycling with Thinking Levels**: The `--models` flag now supports thinking level syntax (e.g., `--models sonnet:high,haiku:low`). When cycling models with `Ctrl+P`, the associated thinking level is automatically applied. The first model in the scope is used as the initial model when starting a new session. Both model and thinking level changes are now saved to session and settings for persistence. ([#47](https://github.com/badlogic/pi-mono/pull/47))
|
|
204
|
-
- **`--thinking` Flag**: New CLI flag to set thinking level directly (e.g., `--thinking high`). Valid values: `off`, `minimal`, `low`, `medium`, `high`. Takes highest priority over all other thinking level sources. ([#45](https://github.com/badlogic/pi-mono/issues/45))
|
|
205
|
-
|
|
206
|
-
### Breaking
|
|
157
|
+
- Fix `--system-prompt <path>` allowing the path argument to be captured by the message collection, causing "file not found" errors.
|
|
207
158
|
|
|
208
|
-
|
|
159
|
+
## [0.11.5] - 2025-11-30
|
|
209
160
|
|
|
210
161
|
### Fixed
|
|
211
162
|
|
|
212
|
-
-
|
|
213
|
-
-
|
|
214
|
-
-
|
|
163
|
+
- Fixed fatal error "Cannot set properties of undefined (setting '0')" when editing empty files in the `edit` tool.
|
|
164
|
+
- Simplified `edit` tool output: Shows only "Edited file.txt" for successful edits instead of verbose search/replace details.
|
|
165
|
+
- Fixed fatal error in footer rendering when token counts contain NaN values due to missing usage data.
|
|
215
166
|
|
|
216
|
-
## [0.
|
|
167
|
+
## [0.11.4] - 2025-11-30
|
|
217
168
|
|
|
218
169
|
### Fixed
|
|
219
170
|
|
|
220
|
-
-
|
|
221
|
-
- **Autocomplete Arrow Keys**: Fixed issue where arrow keys would move both the autocomplete selection and the editor cursor simultaneously when the file selector list was shown.
|
|
171
|
+
- Fixed chat rendering crash when messages contain preformatted/styled text (e.g., thinking traces with gray italic styling). The markdown renderer now preserves existing ANSI escape codes when they appear before inline elements.
|
|
222
172
|
|
|
223
|
-
## [0.
|
|
173
|
+
## [0.11.3] - 2025-11-29
|
|
224
174
|
|
|
225
175
|
### Fixed
|
|
226
176
|
|
|
227
|
-
-
|
|
228
|
-
|
|
229
|
-
## [0.8.3] - 2025-11-21
|
|
230
|
-
|
|
231
|
-
### Improved
|
|
232
|
-
|
|
233
|
-
- **Export HTML**: Limited container width to 700px for better readability. Fixed message statistics to match `/session` command output with proper breakdown of User/Assistant/Tool Calls/Tool Results/Total messages.
|
|
234
|
-
- **Dark Theme**: Increased visibility of editor border (darkGray from #303030 to #505050) and thinking minimal indicator (from #4e4e4e to #6e6e6e).
|
|
235
|
-
|
|
236
|
-
## [0.8.0] - 2025-11-21
|
|
237
|
-
|
|
238
|
-
### Added
|
|
239
|
-
|
|
240
|
-
- **Theme System**: Full theming support with 44 customizable color tokens. Two built-in themes (`dark`, `light`) with auto-detection based on terminal background. Use `/theme` command to select themes interactively. Custom themes in `~/.pi/agent/themes/*.json` support live editing - changes apply immediately when the file is saved. Themes use RGB hex values for consistent rendering across terminals. VS Code users: set `terminal.integrated.minimumContrastRatio` to `1` for proper color rendering. See [Theme Documentation](docs/theme.md) for details.
|
|
241
|
-
|
|
242
|
-
## [0.7.29] - 2025-11-20
|
|
243
|
-
|
|
244
|
-
### Improved
|
|
245
|
-
|
|
246
|
-
- **Read Tool Display**: When the `read` tool is called with offset/limit parameters, the tool execution now displays the line range in a compact format (e.g., `read src/main.ts:100-200` for offset=100, limit=100).
|
|
247
|
-
|
|
248
|
-
## [0.7.28] - 2025-11-20
|
|
249
|
-
|
|
250
|
-
### Added
|
|
251
|
-
|
|
252
|
-
- **Message Queuing**: You can now send multiple messages while the agent is processing without waiting for the previous response to complete. Messages submitted during streaming are queued and processed based on your queue mode setting. Queued messages are shown in a pending area below the chat. Press Escape to abort and restore all queued messages to the editor. Use `/queue` to select between "one-at-a-time" (process queued messages sequentially, recommended) or "all" (process all queued messages at once). The queue mode setting is saved and persists across sessions. ([#15](https://github.com/badlogic/pi-mono/issues/15))
|
|
177
|
+
- Fix file drop functionality for absolute paths
|
|
253
178
|
|
|
254
|
-
## [0.
|
|
179
|
+
## [0.11.2] - 2025-11-29
|
|
255
180
|
|
|
256
181
|
### Fixed
|
|
257
182
|
|
|
258
|
-
-
|
|
259
|
-
-
|
|
183
|
+
- Fixed TUI crash when pasting content containing tab characters. Tabs are now converted to 4 spaces before insertion.
|
|
184
|
+
- Fixed terminal corruption after exit when shell integration sequences (OSC 133) appeared in bash output. These sequences are now stripped along with other ANSI codes.
|
|
260
185
|
|
|
261
|
-
## [0.
|
|
186
|
+
## [0.11.1] - 2025-11-29
|
|
262
187
|
|
|
263
188
|
### Added
|
|
264
189
|
|
|
265
|
-
-
|
|
266
|
-
- **Custom Headers**: Added support for custom HTTP headers in `models.json` configuration. Headers can be specified at both provider and model level, with model-level headers overriding provider-level ones. This enables bypassing Cloudflare bot detection and other proxy requirements. ([#39](https://github.com/badlogic/pi-mono/issues/39))
|
|
190
|
+
- Added `fd` integration for file path autocompletion. Now uses `fd` for faster fuzzy file search
|
|
267
191
|
|
|
268
192
|
### Fixed
|
|
269
193
|
|
|
270
|
-
-
|
|
271
|
-
- **Mistral/Chutes Syntax Error**: Fixed syntax error in merged PR that used `iif` instead of `if`.
|
|
272
|
-
- **Anthropic OAuth Bug**: Fixed bug where `process.env.ANTHROPIC_API_KEY = undefined` set the env var to string "undefined" instead of deleting it. Now uses `delete` operator.
|
|
273
|
-
|
|
274
|
-
## [0.7.25] - 2025-11-20
|
|
275
|
-
|
|
276
|
-
### Added
|
|
277
|
-
|
|
278
|
-
- **Model Cycling**: Press `Ctrl+P` to quickly cycle through models. Use `--models` CLI argument to scope to specific models (e.g., `--models claude-sonnet,gpt-4o`). Supports pattern matching and smart version selection (prefers aliases over dated versions). ([#37](https://github.com/badlogic/pi-mono/pull/37) by [@fightbulc](https://github.com/fightbulc))
|
|
279
|
-
|
|
280
|
-
## [0.7.24] - 2025-11-20
|
|
281
|
-
|
|
282
|
-
### Added
|
|
283
|
-
|
|
284
|
-
- **Thinking Level Cycling**: Press `Shift+Tab` to cycle through thinking levels (off → minimal → low → medium → high) for reasoning-capable models. Editor border color changes to indicate current level (gray → blue → cyan → magenta). ([#36](https://github.com/badlogic/pi-mono/pull/36) by [@fightbulc](https://github.com/fightbulc))
|
|
194
|
+
- Fixed keyboard shortcuts Ctrl+A, Ctrl+E, Ctrl+K, Ctrl+U, Ctrl+W, and word navigation (Option+Arrow) not working in VS Code integrated terminal and some other terminal emulators
|
|
285
195
|
|
|
286
|
-
## [0.
|
|
196
|
+
## [0.11.0] - 2025-11-29
|
|
287
197
|
|
|
288
198
|
### Added
|
|
289
199
|
|
|
290
|
-
- **
|
|
200
|
+
- **File-based Slash Commands**: Create custom reusable prompts as `.txt` files in `~/.pi/slash-commands/`. Files become `/filename` commands with first-line descriptions. Supports `{{selection}}` placeholder for referencing selected/attached content.
|
|
201
|
+
- **`/branch` Command**: Create conversation branches from any previous user message. Opens a selector to pick a message, then creates a new session file starting from that point. Original message text is placed in the editor for modification.
|
|
202
|
+
- **Unified Content References**: Both `@path` in messages and `--file path` CLI arguments now use the same attachment system with consistent MIME type detection.
|
|
203
|
+
- **Drag & Drop Files**: Drop files onto the terminal to attach them to your message. Supports multiple files and both text and image content.
|
|
291
204
|
|
|
292
205
|
### Changed
|
|
293
206
|
|
|
294
|
-
- **
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
- **
|
|
299
|
-
- **Absolute Path Completion**: Fixed tab completion for absolute paths (e.g., `/Applications`). Absolute paths in the middle of text (like "hey /") now complete correctly. Also fixed crashes when trying to stat inaccessible files (like macOS `.VolumeIcon.icns`) during directory traversal.
|
|
300
|
-
|
|
301
|
-
## [0.7.22] - 2025-11-19
|
|
302
|
-
|
|
303
|
-
### Fixed
|
|
304
|
-
|
|
305
|
-
- **Long Line Wrapping**: Fixed crash when rendering long lines without spaces (e.g., file paths). Long words now break character-by-character to fit within terminal width.
|
|
306
|
-
|
|
307
|
-
## [0.7.21] - 2025-11-19
|
|
207
|
+
- **Model Selector with Search**: The `/model` command now opens a searchable list. Type to filter models by name, use arrows to navigate, Enter to select.
|
|
208
|
+
- **Improved File Autocomplete**: File path completion after `@` now supports fuzzy matching and shows file/directory indicators.
|
|
209
|
+
- **Session Selector with Search**: The `--resume` and `--session` flags now open a searchable session list with fuzzy filtering.
|
|
210
|
+
- **Attachment Display**: Files added via `@path` are now shown as "Attached: filename" in the user message, separate from the prompt text.
|
|
211
|
+
- **Tab Completion**: Tab key now triggers file path autocompletion anywhere in the editor, not just after `@` symbol.
|
|
308
212
|
|
|
309
213
|
### Fixed
|
|
310
214
|
|
|
311
|
-
-
|
|
312
|
-
-
|
|
313
|
-
-
|
|
314
|
-
|
|
315
|
-
## [0.7.20] - 2025-11-18
|
|
215
|
+
- Fixed autocomplete z-order issue where dropdown could appear behind chat messages
|
|
216
|
+
- Fixed cursor position when navigating through wrapped lines in the editor
|
|
217
|
+
- Fixed attachment handling for continued sessions to preserve file references
|
|
316
218
|
|
|
317
|
-
|
|
219
|
+
## [0.10.6] - 2025-11-28
|
|
318
220
|
|
|
319
|
-
|
|
221
|
+
### Changed
|
|
320
222
|
|
|
321
|
-
|
|
223
|
+
- Show base64-truncated indicator for large images in tool output
|
|
322
224
|
|
|
323
225
|
### Fixed
|
|
324
226
|
|
|
325
|
-
-
|
|
326
|
-
-
|
|
227
|
+
- Fixed image dimensions not being read correctly from PNG/JPEG/GIF files
|
|
228
|
+
- Fixed PDF images being incorrectly base64-truncated in display
|
|
229
|
+
- Allow reading files from ancestor directories (needed for monorepo configs)
|
|
327
230
|
|
|
328
|
-
## [0.
|
|
231
|
+
## [0.10.5] - 2025-11-28
|
|
329
232
|
|
|
330
233
|
### Added
|
|
331
234
|
|
|
332
|
-
-
|
|
333
|
-
- **OAuth Authentication**: Added `/login` and `/logout` commands for OAuth-based authentication with Claude Pro/Max subscriptions. Tokens are stored in `~/.pi/agent/oauth.json` with 0600 permissions and automatically refreshed when expired. OAuth tokens take priority over API keys for Anthropic models.
|
|
235
|
+
- Full multimodal support: attach images (PNG, JPEG, GIF, WebP) and PDFs to prompts using `@path` syntax or `--file` flag
|
|
334
236
|
|
|
335
237
|
### Fixed
|
|
336
238
|
|
|
337
|
-
-
|
|
338
|
-
-
|
|
339
|
-
- **Input Paste Support**: Added bracketed paste mode support to `Input` component, enabling paste of long OAuth authorization codes.
|
|
239
|
+
- `@`-references now handle special characters in file names (spaces, quotes, unicode)
|
|
240
|
+
- Fixed cursor positioning issues with multi-byte unicode characters in editor
|
|
340
241
|
|
|
341
|
-
## [0.
|
|
242
|
+
## [0.10.4] - 2025-11-28
|
|
342
243
|
|
|
343
244
|
### Fixed
|
|
344
245
|
|
|
345
|
-
-
|
|
246
|
+
- Removed padding on first user message in TUI to improve visual consistency.
|
|
346
247
|
|
|
347
|
-
## [0.
|
|
348
|
-
|
|
349
|
-
### Fixed
|
|
350
|
-
|
|
351
|
-
- **Anthropic OAuth Support**: Added support for `ANTHROPIC_OAUTH_TOKEN` environment variable. The agent now checks for OAuth tokens before falling back to API keys for Anthropic models, enabling OAuth-based authentication.
|
|
352
|
-
|
|
353
|
-
## [0.7.14] - 2025-11-17
|
|
354
|
-
|
|
355
|
-
### Fixed
|
|
356
|
-
|
|
357
|
-
- **Mistral API Compatibility**: Fixed compatibility with Mistral API by excluding the `store` field and using `max_tokens` instead of `max_completion_tokens`, and avoiding the `developer` role in system prompts.
|
|
358
|
-
- **Error Display**: Fixed error message display in assistant messages to include proper spacing before the error text.
|
|
359
|
-
- **Message Streaming**: Fixed missing `message_start` event when no partial message chunks were received during streaming.
|
|
360
|
-
|
|
361
|
-
## [0.7.13] - 2025-11-16
|
|
362
|
-
|
|
363
|
-
### Fixed
|
|
364
|
-
|
|
365
|
-
- **TUI Editor**: Fixed unicode input support for umlauts (äöü), emojis (😀), and other extended characters. Previously the editor only accepted ASCII characters (32-126). Now properly handles all printable unicode while still filtering out control characters. ([#20](https://github.com/badlogic/pi-mono/pull/20))
|
|
366
|
-
|
|
367
|
-
## [0.7.12] - 2025-11-16
|
|
248
|
+
## [0.10.3] - 2025-11-28
|
|
368
249
|
|
|
369
250
|
### Added
|
|
370
251
|
|
|
371
|
-
-
|
|
372
|
-
- Added `gpt-5.1-codex` model to OpenAI provider (400k context, 128k max output, reasoning-capable).
|
|
252
|
+
- Added RPC mode (`--rpc`) for programmatic integration. Accepts JSON commands on stdin, emits JSON events on stdout. See [RPC mode documentation](https://github.com/nicobailon/pi-mono/blob/main/packages/coding-agent/README.md#rpc-mode) for protocol details.
|
|
373
253
|
|
|
374
254
|
### Changed
|
|
375
255
|
|
|
376
|
-
-
|
|
377
|
-
- Interactive mode now allows starting without a model, showing helpful error on message submission instead of failing at startup.
|
|
378
|
-
- Non-interactive mode (CLI messages, JSON, RPC) still fails early if no model or API key is available.
|
|
379
|
-
- Model selector now saves selected model as default in settings.json.
|
|
380
|
-
- `models.json` validation errors (syntax + schema) now surface with precise file/field info in both CLI and `/model` selector.
|
|
381
|
-
- Agent system prompt now includes absolute path to its own README.md for self-documentation.
|
|
256
|
+
- Refactored internal architecture to support multiple frontends (TUI, RPC) with shared agent logic.
|
|
382
257
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
- Fixed crash when restoring a session with a custom model that no longer exists or lost credentials. Now gracefully falls back to default model, logs the reason, and appends a warning message to the restored chat.
|
|
386
|
-
- Footer no longer crashes when no model is selected.
|
|
387
|
-
|
|
388
|
-
## [0.7.11] - 2025-11-16
|
|
389
|
-
|
|
390
|
-
### Changed
|
|
391
|
-
|
|
392
|
-
- The `/model` selector now filters models based on available API keys. Only models for which API keys are configured in environment variables are shown. This prevents selecting models that would fail due to missing credentials. A yellow hint is displayed at the top of the selector explaining this behavior. ([#19](https://github.com/badlogic/pi-mono/pull/19))
|
|
393
|
-
|
|
394
|
-
## [0.7.10] - 2025-11-14
|
|
258
|
+
## [0.10.2] - 2025-11-26
|
|
395
259
|
|
|
396
260
|
### Added
|
|
397
261
|
|
|
398
|
-
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
- Editor: updated keyboard shortcuts to follow Unix conventions:
|
|
405
|
-
- **Ctrl+W** deletes the previous word (stopping at whitespace or punctuation)
|
|
406
|
-
- **Ctrl+U** deletes from cursor to start of line (at line start, merges with previous line)
|
|
407
|
-
- **Ctrl+K** deletes from cursor to end of line (at line end, merges with next line)
|
|
408
|
-
- **Option+Backspace** in Ghostty now behaves like **Ctrl+W** (delete word backwards)
|
|
409
|
-
- **Cmd+Backspace** in Ghostty now behaves like **Ctrl+U** (delete to start of line)
|
|
410
|
-
|
|
411
|
-
## [0.7.8] - 2025-11-13
|
|
262
|
+
- Added thinking level persistence. Default level stored in `~/.pi/settings.json`, restored on startup. Per-session overrides saved in session files.
|
|
263
|
+
- Added model cycling shortcut: `Ctrl+I` cycles through available models (or scoped models with `-m` flag).
|
|
264
|
+
- Added automatic retry with exponential backoff for transient API errors (network issues, 500s, overload).
|
|
265
|
+
- Cumulative token usage now shown in footer (total tokens used across all messages in session).
|
|
266
|
+
- Added `--system-prompt` flag to override default system prompt with custom text or file contents.
|
|
267
|
+
- Footer now shows estimated total cost in USD based on model pricing.
|
|
412
268
|
|
|
413
269
|
### Changed
|
|
414
270
|
|
|
415
|
-
-
|
|
271
|
+
- Replaced `--models` flag with `-m/--model` supporting multiple values. Specify models as `provider/model@thinking` (e.g., `anthropic/claude-sonnet-4-20250514@high`). Multiple `-m` flags scope available models for the session.
|
|
272
|
+
- Thinking level border now persists visually after selector closes.
|
|
273
|
+
- Improved tool result display with collapsible output (default collapsed, expand with `Ctrl+O`).
|
|
416
274
|
|
|
417
|
-
## [0.
|
|
275
|
+
## [0.10.1] - 2025-11-25
|
|
418
276
|
|
|
419
277
|
### Added
|
|
420
278
|
|
|
421
|
-
-
|
|
422
|
-
- `/changelog` command to display the changelog in the TUI
|
|
423
|
-
- OpenRouter Auto Router model support ([#5](https://github.com/badlogic/pi-mono/pull/5))
|
|
424
|
-
- Windows Git Bash support with automatic detection and process tree termination ([#1](https://github.com/badlogic/pi-mono/pull/1))
|
|
425
|
-
|
|
426
|
-
### Changed
|
|
427
|
-
|
|
428
|
-
- **BREAKING**: Renamed project context file from `AGENT.md` to `AGENTS.md`. The system now looks for `AGENTS.md` or `CLAUDE.md` (with `AGENTS.md` preferred). Existing `AGENT.md` files will need to be renamed to `AGENTS.md` to continue working. (fixes [#9](https://github.com/badlogic/pi-mono/pull/9))
|
|
429
|
-
- **BREAKING**: Session file format changed to store provider and model ID separately instead of as a single `provider/modelId` string. Existing sessions will not restore the model correctly when resumed - you'll need to manually set the model again using `/model`. (fixes [#4](https://github.com/badlogic/pi-mono/pull/4))
|
|
430
|
-
- Improved Windows Git Bash detection logic with better error messages showing actual paths searched ([#13](https://github.com/badlogic/pi-mono/pull/13))
|
|
279
|
+
- Add custom model configuration via `~/.pi/models.json`
|
|
431
280
|
|
|
432
|
-
|
|
281
|
+
## [0.10.0] - 2025-11-25
|
|
433
282
|
|
|
434
|
-
|
|
435
|
-
- Fixed context percentage showing 0% in footer when last assistant message was aborted ([#12](https://github.com/badlogic/pi-mono/issues/12))
|
|
436
|
-
- Fixed error message loss when `turn_end` event contains an error. Previously, errors in `turn_end` events (e.g., "Provider returned error" from OpenRouter Auto Router) were not captured in `agent.state.error`, making it appear as if the agent completed successfully. ([#6](https://github.com/badlogic/pi-mono/issues/6))
|
|
283
|
+
Initial public release.
|
|
437
284
|
|
|
438
|
-
|
|
285
|
+
### Added
|
|
439
286
|
|
|
440
|
-
|
|
287
|
+
- Interactive TUI with streaming responses
|
|
288
|
+
- Conversation session management with `--continue`, `--resume`, and `--session` flags
|
|
289
|
+
- Multi-line input support (Shift+Enter or Option+Enter for new lines)
|
|
290
|
+
- Tool execution: `read`, `write`, `edit`, `bash`, `glob`, `grep`, `think`
|
|
291
|
+
- Thinking mode support for Claude with visual indicator and `/thinking` selector
|
|
292
|
+
- File path autocompletion with `@` prefix
|
|
293
|
+
- Slash command autocompletion
|
|
294
|
+
- `/export` command for HTML session export
|
|
295
|
+
- `/model` command for runtime model switching
|
|
296
|
+
- `/session` command for session statistics
|
|
297
|
+
- Model provider support: Anthropic (Claude), OpenAI, Google (Gemini)
|
|
298
|
+
- Git branch display in footer
|
|
299
|
+
- Message queueing during streaming responses
|
|
300
|
+
- OAuth integration for Gmail and Google Calendar access
|
|
301
|
+
- HTML export with syntax highlighting and collapsible sections
|
package/README.md
CHANGED
|
@@ -502,6 +502,16 @@ This allows you to explore alternative conversation paths without losing your cu
|
|
|
502
502
|
/branch
|
|
503
503
|
```
|
|
504
504
|
|
|
505
|
+
### /resume
|
|
506
|
+
|
|
507
|
+
Switch to a different session. Opens an interactive selector showing all available sessions. Select a session to load it and continue where you left off.
|
|
508
|
+
|
|
509
|
+
This is equivalent to the `--resume` CLI flag but can be used mid-session.
|
|
510
|
+
|
|
511
|
+
```
|
|
512
|
+
/resume
|
|
513
|
+
```
|
|
514
|
+
|
|
505
515
|
### /login
|
|
506
516
|
|
|
507
517
|
Login with OAuth to use subscription-based models (Claude Pro/Max):
|
|
@@ -691,6 +701,8 @@ Change queue mode with `/queue` command. Setting is saved in `~/.pi/agent/settin
|
|
|
691
701
|
|
|
692
702
|
**Navigation:**
|
|
693
703
|
- **Arrow keys**: Move cursor (Up/Down navigate visual lines, Left/Right move by character)
|
|
704
|
+
- **Up Arrow** (empty editor): Browse previous prompts (history)
|
|
705
|
+
- **Down Arrow** (browsing history): Browse newer prompts or return to empty editor
|
|
694
706
|
- **Option+Left** / **Ctrl+Left**: Move word backwards
|
|
695
707
|
- **Option+Right** / **Ctrl+Right**: Move word forwards
|
|
696
708
|
- **Ctrl+A** / **Home**: Jump to start of line
|
package/dist/fuzzy.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface FuzzyMatch {
|
|
2
|
+
matches: boolean;
|
|
3
|
+
score: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function fuzzyMatch(query: string, text: string): FuzzyMatch;
|
|
6
|
+
export declare function fuzzyFilter<T>(items: T[], query: string, getText: (item: T) => string): T[];
|
|
7
|
+
//# sourceMappingURL=fuzzy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fuzzy.d.ts","sourceRoot":"","sources":["../src/fuzzy.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,UAAU;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAoDlE;AAGD,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,CAAC,EAAE,CAmB3F","sourcesContent":["// Fuzzy search. Matches if all query characters appear in order (not necessarily consecutive).\n// Lower score = better match.\n\nexport interface FuzzyMatch {\n\tmatches: boolean;\n\tscore: number;\n}\n\nexport function fuzzyMatch(query: string, text: string): FuzzyMatch {\n\tconst queryLower = query.toLowerCase();\n\tconst textLower = text.toLowerCase();\n\n\tif (queryLower.length === 0) {\n\t\treturn { matches: true, score: 0 };\n\t}\n\n\tif (queryLower.length > textLower.length) {\n\t\treturn { matches: false, score: 0 };\n\t}\n\n\tlet queryIndex = 0;\n\tlet score = 0;\n\tlet lastMatchIndex = -1;\n\tlet consecutiveMatches = 0;\n\n\tfor (let i = 0; i < textLower.length && queryIndex < queryLower.length; i++) {\n\t\tif (textLower[i] === queryLower[queryIndex]) {\n\t\t\tconst isWordBoundary = i === 0 || /[\\s\\-_./]/.test(textLower[i - 1]!);\n\n\t\t\t// Reward consecutive character matches (e.g., typing \"foo\" matches \"foobar\" better than \"f_o_o\")\n\t\t\tif (lastMatchIndex === i - 1) {\n\t\t\t\tconsecutiveMatches++;\n\t\t\t\tscore -= consecutiveMatches * 5;\n\t\t\t} else {\n\t\t\t\tconsecutiveMatches = 0;\n\t\t\t\t// Penalize gaps between matched characters\n\t\t\t\tif (lastMatchIndex >= 0) {\n\t\t\t\t\tscore += (i - lastMatchIndex - 1) * 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Reward matches at word boundaries (start of words are more likely intentional targets)\n\t\t\tif (isWordBoundary) {\n\t\t\t\tscore -= 10;\n\t\t\t}\n\n\t\t\t// Slight penalty for matches later in the string (prefer earlier matches)\n\t\t\tscore += i * 0.1;\n\n\t\t\tlastMatchIndex = i;\n\t\t\tqueryIndex++;\n\t\t}\n\t}\n\n\t// Not all query characters were found in order\n\tif (queryIndex < queryLower.length) {\n\t\treturn { matches: false, score: 0 };\n\t}\n\n\treturn { matches: true, score };\n}\n\n// Filter and sort items by fuzzy match quality (best matches first)\nexport function fuzzyFilter<T>(items: T[], query: string, getText: (item: T) => string): T[] {\n\tif (!query.trim()) {\n\t\treturn items;\n\t}\n\n\tconst results: { item: T; score: number }[] = [];\n\n\tfor (const item of items) {\n\t\tconst text = getText(item);\n\t\tconst match = fuzzyMatch(query, text);\n\t\tif (match.matches) {\n\t\t\tresults.push({ item, score: match.score });\n\t\t}\n\t}\n\n\t// Sort ascending by score (lower = better match)\n\tresults.sort((a, b) => a.score - b.score);\n\n\treturn results.map((r) => r.item);\n}\n"]}
|