@mariozechner/pi-coding-agent 0.57.0 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/CHANGELOG.md +59 -1
  2. package/README.md +3 -1
  3. package/dist/core/agent-session.d.ts +9 -0
  4. package/dist/core/agent-session.d.ts.map +1 -1
  5. package/dist/core/agent-session.js +57 -9
  6. package/dist/core/agent-session.js.map +1 -1
  7. package/dist/core/export-html/index.d.ts +5 -2
  8. package/dist/core/export-html/index.d.ts.map +1 -1
  9. package/dist/core/export-html/index.js +4 -3
  10. package/dist/core/export-html/index.js.map +1 -1
  11. package/dist/core/export-html/template.js +11 -14
  12. package/dist/core/export-html/tool-renderer.d.ts +5 -2
  13. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  14. package/dist/core/export-html/tool-renderer.js +12 -5
  15. package/dist/core/export-html/tool-renderer.js.map +1 -1
  16. package/dist/core/extensions/index.d.ts +2 -2
  17. package/dist/core/extensions/index.d.ts.map +1 -1
  18. package/dist/core/extensions/index.js +1 -1
  19. package/dist/core/extensions/index.js.map +1 -1
  20. package/dist/core/extensions/types.d.ts +13 -1
  21. package/dist/core/extensions/types.d.ts.map +1 -1
  22. package/dist/core/extensions/types.js.map +1 -1
  23. package/dist/core/extensions/wrapper.d.ts +4 -11
  24. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  25. package/dist/core/extensions/wrapper.js +4 -78
  26. package/dist/core/extensions/wrapper.js.map +1 -1
  27. package/dist/core/index.d.ts +1 -1
  28. package/dist/core/index.d.ts.map +1 -1
  29. package/dist/core/index.js +1 -1
  30. package/dist/core/index.js.map +1 -1
  31. package/dist/core/resource-loader.d.ts.map +1 -1
  32. package/dist/core/resource-loader.js +1 -1
  33. package/dist/core/resource-loader.js.map +1 -1
  34. package/dist/core/session-manager.d.ts +1 -0
  35. package/dist/core/session-manager.d.ts.map +1 -1
  36. package/dist/core/session-manager.js +1 -1
  37. package/dist/core/session-manager.js.map +1 -1
  38. package/dist/core/system-prompt.d.ts.map +1 -1
  39. package/dist/core/system-prompt.js +5 -15
  40. package/dist/core/system-prompt.js.map +1 -1
  41. package/dist/index.d.ts +1 -1
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/index.js.map +1 -1
  45. package/dist/main.d.ts.map +1 -1
  46. package/dist/main.js +41 -11
  47. package/dist/main.js.map +1 -1
  48. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  49. package/dist/modes/interactive/components/extension-editor.js +1 -0
  50. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  51. package/dist/modes/interactive/components/tree-selector.d.ts +17 -0
  52. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  53. package/dist/modes/interactive/components/tree-selector.js +111 -6
  54. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  55. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  56. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  57. package/dist/modes/interactive/interactive-mode.js +45 -0
  58. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  59. package/dist/utils/exif-orientation.d.ts +5 -0
  60. package/dist/utils/exif-orientation.d.ts.map +1 -0
  61. package/dist/utils/exif-orientation.js +158 -0
  62. package/dist/utils/exif-orientation.js.map +1 -0
  63. package/dist/utils/image-convert.d.ts.map +1 -1
  64. package/dist/utils/image-convert.js +5 -1
  65. package/dist/utils/image-convert.js.map +1 -1
  66. package/dist/utils/image-resize.d.ts.map +1 -1
  67. package/dist/utils/image-resize.js +6 -1
  68. package/dist/utils/image-resize.js.map +1 -1
  69. package/docs/extensions.md +41 -7
  70. package/docs/keybindings.md +9 -1
  71. package/docs/terminal-setup.md +28 -3
  72. package/docs/tmux.md +30 -8
  73. package/docs/tree.md +9 -0
  74. package/examples/extensions/antigravity-image-gen.ts +5 -4
  75. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  76. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  77. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  78. package/examples/extensions/custom-provider-gitlab-duo/test.ts +2 -2
  79. package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
  80. package/examples/extensions/preset.ts +2 -3
  81. package/examples/extensions/sandbox/index.ts +2 -3
  82. package/examples/extensions/tool-override.ts +2 -3
  83. package/examples/extensions/with-deps/package-lock.json +2 -2
  84. package/examples/extensions/with-deps/package.json +1 -1
  85. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,64 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.58.0] - 2026-03-14
4
+
5
+ ### New Features
6
+
7
+ - Claude Opus 4.6, Sonnet 4.6, and related Bedrock models now use a 1M token context window (up from 200K) ([#2135](https://github.com/badlogic/pi-mono/pull/2135) by [@mitsuhiko](https://github.com/mitsuhiko)).
8
+ - Extension tool calls now execute in parallel by default, with sequential `tool_call` preflight preserved for extension interception.
9
+ - `GOOGLE_CLOUD_API_KEY` environment variable support for the `google-vertex` provider as an alternative to Application Default Credentials ([#1976](https://github.com/badlogic/pi-mono/pull/1976) by [@gordonhwc](https://github.com/gordonhwc)).
10
+ - Extensions can supply deterministic session IDs via `newSession()` ([#2130](https://github.com/badlogic/pi-mono/pull/2130) by [@zhahaoyu](https://github.com/zhahaoyu)).
11
+
12
+ ### Added
13
+
14
+ - Added `GOOGLE_CLOUD_API_KEY` environment variable support for the `google-vertex` provider as an alternative to Application Default Credentials ([#1976](https://github.com/badlogic/pi-mono/pull/1976) by [@gordonhwc](https://github.com/gordonhwc))
15
+ - Added custom session ID support in `newSession()` for extensions that need deterministic session paths ([#2130](https://github.com/badlogic/pi-mono/pull/2130) by [@zhahaoyu](https://github.com/zhahaoyu))
16
+
17
+ ### Changed
18
+
19
+ - Changed extension tool interception to use agent-core `beforeToolCall` and `afterToolCall` hooks instead of wrapper-based interception. Tool calls now execute in parallel by default, extension `tool_call` preflight still runs sequentially, and final tool results are emitted in assistant source order.
20
+ - Raised Claude Opus 4.6, Sonnet 4.6, and related Bedrock model context windows from 200K to 1M tokens ([#2135](https://github.com/badlogic/pi-mono/pull/2135) by [@mitsuhiko](https://github.com/mitsuhiko))
21
+
22
+ ### Fixed
23
+
24
+ - Fixed `tool_call` extension handlers observing stale `sessionManager` state during multi-tool turns by draining queued agent events before each `tool_call` preflight. In parallel tool mode this guarantees state through the current assistant tool-calling message, but not sibling tool results from the same assistant message.
25
+ - Fixed interactive input fields backed by the TUI `Input` component to scroll by visual column width for wide Unicode text (CJK, fullwidth characters), preventing rendered line overflow and TUI crashes in places like search and filter inputs ([#1982](https://github.com/badlogic/pi-mono/issues/1982))
26
+ - Fixed `shift+tab` and other modified Tab bindings in tmux when `extended-keys-format` is left at the default `xterm`
27
+ - Fixed EXIF orientation not being applied during image convert and resize, causing JPEG and WebP images from phone cameras to display rotated or mirrored ([#2105](https://github.com/badlogic/pi-mono/pull/2105) by [@melihmucuk](https://github.com/melihmucuk))
28
+ - Fixed the default coding-agent system prompt to include only the current date in ISO format, not the current time, so prompt prefixes stay cacheable across reloads and resumed sessions ([#2131](https://github.com/badlogic/pi-mono/issues/2131))
29
+ - Fixed retry regex to match `server_error` and `internal_error` error types from providers, improving automatic retry coverage ([#2117](https://github.com/badlogic/pi-mono/pull/2117) by [@MadKangYu](https://github.com/MadKangYu))
30
+ - Fixed example extensions to support `PI_CODING_AGENT_DIR` environment variable for custom agent directory paths ([#2009](https://github.com/badlogic/pi-mono/pull/2009) by [@smithbm2316](https://github.com/smithbm2316))
31
+ - Fixed tool result images not being sent in `function_call_output` items for OpenAI Responses API providers, causing image data to be silently dropped in tool results ([#2104](https://github.com/badlogic/pi-mono/issues/2104))
32
+ - Fixed assistant content being sent as structured content blocks instead of plain strings in the `openai-completions` provider, causing errors with some OpenAI-compatible backends ([#2008](https://github.com/badlogic/pi-mono/pull/2008) by [@geraldoaax](https://github.com/geraldoaax))
33
+ - Fixed error details in OpenAI Responses `response.failed` handler to include status code, error code, and message instead of a generic failure ([#1956](https://github.com/badlogic/pi-mono/pull/1956) by [@drewburr](https://github.com/drewburr))
34
+ - Fixed GitHub Copilot device-code login polling to respect OAuth slow-down intervals, wait before the first token poll, and include a clearer clock-drift hint in WSL/VM environments when repeated slow-downs lead to timeout
35
+ - Fixed usage statistics not being captured for OpenAI-compatible providers that return usage in `choice.usage` instead of the standard `chunk.usage` (e.g., Moonshot/Kimi) ([#2017](https://github.com/badlogic/pi-mono/issues/2017))
36
+ - Fixed editor scroll indicator rendering crash in narrow terminal widths ([#2103](https://github.com/badlogic/pi-mono/pull/2103) by [@haoqixu](https://github.com/haoqixu))
37
+ - Fixed tab characters in editor and input paste not being normalized to spaces ([#2027](https://github.com/badlogic/pi-mono/pull/2027), [#1975](https://github.com/badlogic/pi-mono/pull/1975) by [@haoqixu](https://github.com/haoqixu))
38
+ - Fixed `wordWrapLine` overflow when wide characters (CJK, fullwidth) fall exactly at the wrap boundary ([#2082](https://github.com/badlogic/pi-mono/pull/2082) by [@haoqixu](https://github.com/haoqixu))
39
+ - Fixed paste markers not being treated as atomic segments in editor word wrapping and cursor navigation ([#2111](https://github.com/badlogic/pi-mono/pull/2111) by [@haoqixu](https://github.com/haoqixu))
40
+
41
+ ## [0.57.1] - 2026-03-07
42
+
43
+ ### New Features
44
+ - Tree branch folding and segment-jump navigation in `/tree`, with `Ctrl+←`/`Ctrl+→` and `Alt+←`/`Alt+→` shortcuts while `←`/`→` and `Page Up`/`Page Down` remain available for paging. See [docs/tree.md](docs/tree.md) and [docs/keybindings.md](docs/keybindings.md).
45
+ - `session_directory` extension event for customizing session directory paths before session manager creation. See [docs/extensions.md](docs/extensions.md).
46
+ - Digit keybindings (`0-9`) in the TUI keybinding system, including modified combos like `ctrl+1`. See [docs/keybindings.md](docs/keybindings.md).
47
+
48
+ ### Added
49
+ - Added `/tree` branch folding and segment-jump navigation with `Ctrl+←`/`Ctrl+→` and `Alt+←`/`Alt+→`, while keeping `←`/`→` and `Page Up`/`Page Down` for paging ([#1724](https://github.com/badlogic/pi-mono/pull/1724) by [@Perlence](https://github.com/Perlence))
50
+ - Added `session_directory` extension event that fires before session manager creation, allowing extensions to customize the session directory path based on cwd and other factors. CLI `--session-dir` flag takes precedence over extension-provided paths ([#1730](https://github.com/badlogic/pi-mono/pull/1730) by [@hjanuschka](https://github.com/hjanuschka)).
51
+ - Added digit keys (`0-9`) to the keybinding system, including Kitty CSI-u and xterm `modifyOtherKeys` support for bindings like `ctrl+1` ([#1905](https://github.com/badlogic/pi-mono/issues/1905))
52
+
53
+ ### Fixed
54
+ - Fixed custom tool collapsed/expanded rendering in HTML exports. Custom tools that define different collapsed vs expanded displays now render correctly in exported HTML, with expandable sections when both states differ and direct display when only expanded exists ([#1934](https://github.com/badlogic/pi-mono/pull/1934) by [@aliou](https://github.com/aliou))
55
+ - Fixed tmux startup guidance and keyboard setup warnings for modified key handling, including Ghostty `shift+enter=text:\n` remap guidance and tmux `extended-keys-format` detection ([#1872](https://github.com/badlogic/pi-mono/issues/1872))
56
+ - Fixed z.ai context overflow recovery so `model_context_window_exceeded` errors trigger auto-compaction instead of surfacing as unhandled stop reason failures ([#1937](https://github.com/badlogic/pi-mono/issues/1937))
57
+ - Fixed autocomplete selection ignoring typed text: highlight now follows the first prefix match as the user types, and exact matches are always selected on Enter ([#1931](https://github.com/badlogic/pi-mono/pull/1931) by [@aliou](https://github.com/aliou))
58
+ - Fixed slash-command Tab completion to immediately open argument completions when available ([#1481](https://github.com/badlogic/pi-mono/pull/1481) by [@barapa](https://github.com/barapa))
59
+ - Fixed explicit `pi -e <path>` extensions losing command and tool conflicts to discovered extensions by giving CLI-loaded extensions higher precedence ([#1896](https://github.com/badlogic/pi-mono/issues/1896))
60
+ - Fixed Windows external editor launch for `Ctrl+G` and `ctx.ui.editor()` so shell-based commands like `EDITOR="code --wait"` work correctly ([#1925](https://github.com/badlogic/pi-mono/issues/1925))
61
+
3
62
  ## [0.57.0] - 2026-03-07
4
63
 
5
64
  ### New Features
@@ -134,7 +193,6 @@
134
193
  - Fixed Bedrock `AWS_PROFILE` region resolution by honoring profile `region` values ([#1800](https://github.com/badlogic/pi-mono/issues/1800)).
135
194
  - Fixed Gemini 3.1 thinking-level detection for `google` and `google-vertex` providers ([#1785](https://github.com/badlogic/pi-mono/issues/1785)).
136
195
  - Fixed browser bundling compatibility for `@mariozechner/pi-ai` by removing Node-only side effects from default browser import paths ([#1814](https://github.com/badlogic/pi-mono/issues/1814)).
137
-
138
196
  ## [0.55.4] - 2026-03-02
139
197
 
140
198
  ### New Features
package/README.md CHANGED
@@ -186,6 +186,8 @@ Submit messages while the agent is working:
186
186
  - **Escape** aborts and restores queued messages to editor
187
187
  - **Alt+Up** retrieves queued messages back to editor
188
188
 
189
+ On Windows Terminal, `Alt+Enter` is fullscreen by default. Remap it in [docs/terminal-setup.md](docs/terminal-setup.md) so pi can receive the follow-up shortcut.
190
+
189
191
  Configure delivery in [settings](docs/settings.md): `steeringMode` and `followUpMode` can be `"one-at-a-time"` (default, waits for response) or `"all"` (delivers all queued at once). `transport` selects provider transport preference (`"sse"`, `"websocket"`, or `"auto"`) for providers that support multiple transports.
190
192
 
191
193
  ---
@@ -211,7 +213,7 @@ pi --session <path> # Use specific session file or ID
211
213
 
212
214
  <p align="center"><img src="docs/images/tree-view.png" alt="Tree View" width="600"></p>
213
215
 
214
- - Search by typing, page with ←/→
216
+ - Search by typing, fold/unfold and jump between branches with Ctrl+←/Ctrl+→ or Alt+←/Alt+→, page with ←/→
215
217
  - Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all
216
218
  - Press `l` to label entries as bookmarks
217
219
 
@@ -173,6 +173,15 @@ export declare class AgentSession {
173
173
  constructor(config: AgentSessionConfig);
174
174
  /** Model registry for API key resolution and model discovery */
175
175
  get modelRegistry(): ModelRegistry;
176
+ /**
177
+ * Install tool hooks once on the Agent instance.
178
+ *
179
+ * The callbacks read `this._extensionRunner` at execution time, so extension reload swaps in the
180
+ * new runner without reinstalling hooks. Extension-specific tool wrappers are still used to adapt
181
+ * registered tool execution to the extension context. Tool call and tool result interception now
182
+ * happens here instead of in wrappers.
183
+ */
184
+ private _installAgentToolHooks;
176
185
  /** Emit an event to all listeners */
177
186
  private _emit;
178
187
  private _lastAssistantMessage;