Commit graph

2029 commits

Author SHA1 Message Date
Mario Zechner
5aa0689828 fix(coding-agent): fix standalone binary WASM loading on Linux, fixes #784
- Import photon-node from ESM entry point (photon_rs_bg.js) instead of CJS
  entry, allowing Bun to embed WASM in compiled binaries
- Add photon.d.ts for TypeScript support of ESM entry
- Add scripts/build-binaries.sh for local binary builds
- Simplify GitHub workflow to use the build script
- Add binaries/ to gitignore
2026-01-16 21:11:01 +01:00
Mario Zechner
0c33e0dee5 chore: audit changelog entries for v0.47.0, add cl.md prompt template
- Add missing changelog entries for commits since v0.47.0
- Cross-duplicate ai/tui fixes to coding-agent changelog
- Change PI_NO_HARDWARE_CURSOR to PI_HARDWARE_CURSOR (opt-in)
- Fix typo in PI_CODING_AGENT_DIR changelog entry
- Add .pi/prompts/cl.md for pre-release changelog audits
2026-01-16 21:11:01 +01:00
Rafał Krzyważnia
48b4324155
fix(session): improve session ID resolution with global search and fork support (#785)
When using `--session <UUID>`, the session lookup now:

1. Searches locally first (current project's session directory)
2. Falls back to global search across all projects
3. If found in different project, prompts user to fork the session
4. If not found anywhere, shows clear error instead of silently creating
   a broken session with malformed path

Adds `SessionManager.forkFrom()` to create a forked session from another
project, preserving full conversation history with updated cwd.
2026-01-16 20:18:10 +01:00
Danila Poyarkov
923b9cb9ee
fix(ai): coerce string numbers in tool argument validation (#786)
* fix(ai): coerce string numbers in tool argument validation

* fix(ai): clone tool arguments before AJV validation for type coercion
2026-01-16 20:16:13 +01:00
Aliou Diallo
09d9107d7f
fix(coding-agent): expand tilde in PI_CODING_AGENT_DIR env var (#778) 2026-01-16 17:53:58 +01:00
Sarat Chandra
12ab69fbad
fix(tui): decode Kitty CSI-u shifted symbols (#779) 2026-01-16 17:53:15 +01:00
Pablo Tovar
ba8059a502
fix: sanitize bedrock tool call ids (#781) 2026-01-16 17:51:48 +01:00
Danila Poyarkov
c45ea27de5
feat(coding-agent): display timeout in bash tool UI (#780) 2026-01-16 17:49:33 +01:00
mom
fc3ca545df docs(coding-agent): fix ctx.branch -> ctx.fork in extensions docs 2026-01-16 13:47:28 +00:00
Mario Zechner
4dbf094b65 Add PI_NO_HARDWARE_CURSOR env var for terminals with limited escape sequence support
Fixes cursor visibility issues in JetBrains IDE terminals (IntelliJ, PyCharm) where
the hardware cursor either blinks or becomes invisible depending on settings.

Fixes #771
2026-01-16 12:51:09 +01:00
Rafał Krzyważnia
35e48ca018 feat(coding-agent): extension command argument autocomplete 2026-01-16 12:47:29 +01:00
Mario Zechner
f900eb591d Fix provider feature detection to use model.provider, not just URL
Previously, OpenAI-compatible provider settings (like developer role support)
were detected only from the baseUrl. When using custom URLs (e.g., proxies),
detection failed. Now checks model.provider first, then falls back to URL.

Fixes #774
2026-01-16 12:41:23 +01:00
Mario Zechner
0438decd26 docs: add changelog entry for #765 2026-01-16 12:16:49 +01:00
Danila Poyarkov
898a1a50ea fix(coding-agent): prevent duplicate rendering of extension messages on startup 2026-01-16 12:16:36 +01:00
Mario Zechner
05d78ea2de Fix session picker 'No sessions found' overflow 2026-01-16 12:11:01 +01:00
Mario Zechner
43c4a80e2e docs: document prompt template slicing 2026-01-16 12:08:57 +01:00
Zeno Jiricek
f869cc4ae5 feat: add bash-style array slicing for $@ in prompt templates
Implements support for ${@:N} and ${@:N:L} syntax to slice argument arrays
in prompt templates, following bash conventions.

Syntax:
- ${@:N} - All arguments from Nth position onwards (1-indexed)
- ${@:N:L} - L arguments starting from Nth position

Features:
- Bash-style slicing familiar to shell users
- 1-indexed for consistency with $1, $2, etc.
- Processes before simple $@ to avoid conflicts
- No recursive substitution of patterns in arguments
- Comprehensive edge case handling

Examples:
- ${@:2} with ["a", "b", "c"] -> "b c"
- ${@:2:1} with ["a", "b", "c"] -> "b"
- ${@:99} with ["a", "b"] -> "" (empty, out of range)

Test coverage: 24 new tests, all passing (73 total)

Closes #769
2026-01-16 12:05:53 +01:00
Mario Zechner
2836d97735 Fix session picker empty state overflow 2026-01-16 12:04:55 +01:00
Mario Zechner
588399594c Fix session picker hint overflow (closes #764) 2026-01-16 12:01:50 +01:00
Danila Poyarkov
c5cf74e032
feat(coding-agent): export getShellConfig for extensions (#766) 2026-01-16 12:01:46 +01:00
scutifer
b11b7d1f84
coding-agent: update theme-schema.json to match latest theme implementation (#763)
* feat(coding-agent): update theme-schema.json
Added to required/properties:
- thinkingText - thinking block text color
- selectedBg - selected item background
- toolTitle - tool execution box title (replaces toolText)
- toolOutput - tool execution box output text
- mdLinkUrl - markdown link URL color
- thinkingOff, thinkingMinimal, thinkingLow, thinkingMedium, thinkingHigh, thinkingXhigh, bashMode added to required array (were already in properties)

Removed:
- toolText (replaced by toolTitle and toolOutput)

* removed thinking* border colors from required
2026-01-16 11:45:39 +01:00
Mario Zechner
589a2ffcd3 Add [Unreleased] section for next cycle 2026-01-16 04:41:48 +01:00
Mario Zechner
6248d86ff6 Release v0.47.0 2026-01-16 04:41:04 +01:00
Mario Zechner
cb369b680b Update changelogs for v0.47.0 release
- Add OpenAI Codex official support entry
- Add pi-internal:// URL scheme
- Add ctx.shutdown() fix (#756)
- Add OpenAI Codex retry logic (#733)
- Add third-party contributions:
  - #702 by @aliou (custom tool HTML export)
  - #728 by @richardgill (frontmatter parsing, SelectList fix)
  - #747 by @kaofelix (tree filter shortcuts)
  - #752 by @richardgill (keymap expansion)
2026-01-16 04:39:48 +01:00
Mario Zechner
07fad1362c feat(tui): hardware cursor positioning for IME support
- Add Focusable interface for components that need hardware cursor positioning
- Add CURSOR_MARKER (APC escape sequence) for marking cursor position in render output
- Editor and Input components implement Focusable and emit marker when focused
- TUI extracts cursor position from rendered output and positions hardware cursor
- Track hardwareCursorRow separately from cursorRow for differential rendering
- visibleWidth() and extractAnsiCode() now handle APC sequences
- Update overlay-test.ts example to demonstrate Focusable usage
- Add documentation for Focusable interface in docs/tui.md

Closes #719, closes #525
2026-01-16 04:30:07 +01:00
Mario Zechner
d9464383ec chore: remove test extension load-file.ts 2026-01-16 04:14:26 +01:00
Mario Zechner
356a482527 fix(tui): add vertical scrolling to Editor when content exceeds terminal height
The Editor component now accepts TUI as the first constructor parameter,
enabling it to query terminal dimensions. When content exceeds available
height, the editor scrolls vertically keeping the cursor visible.

Features:
- Max editor height is 30% of terminal rows (minimum 5 lines)
- Page Up/Down keys scroll by page size
- Scroll indicators show lines above/below: ─── ↑ 5 more ───

Breaking change: Editor constructor signature changed from
  new Editor(theme)
to
  new Editor(tui, theme)

fixes #732
2026-01-16 04:12:21 +01:00
Mario Zechner
d30f6460fa Fix ctx.shutdown() not waiting for pending UI renders, fixes #756 2026-01-16 03:35:41 +01:00
Mario Zechner
c50bfec01b Fix piped stdin support, auto-enable print mode
When stdin is piped (not a TTY), read the content and treat it as the
first message. Since interactive mode requires a TTY for keyboard input,
print mode is automatically enabled.

- echo foo | pi -> equivalent to pi -p foo
- echo foo | pi -p -> equivalent to pi -p foo
- RPC mode unaffected (uses stdin for JSON-RPC)

fixes #708
2026-01-16 03:18:56 +01:00
Mario Zechner
c08801e4c5 Add retry logic to OpenAI Codex provider
Fixes #733
2026-01-16 03:15:59 +01:00
Mario Zechner
b4a05cbcab Move skill command handling to AgentSession, update docs
- Skill commands (/skill:name) now expanded in AgentSession instead of
  interactive mode, enabling them in RPC and print modes
- Input event can now intercept /skill:name before expansion
- Updated extensions.md with clearer input event docs and processing order
- Updated rpc.md: hook -> extension terminology, added skill expansion mentions
- Added PR attribution to changelog entries for #761
2026-01-16 03:01:08 +01:00
Nico Bailon
3e5d91f287
feat(coding-agent): add input event for extension input interception (#761)
* feat(coding-agent): add input event for extension input interception

Extensions can now intercept, transform, or handle user input before the
agent processes it. Three result types: continue (pass through), transform
(modify text/images), handled (respond without LLM). Handlers chain
transforms and short-circuit on handled. Source field identifies origin.

* fix: make source public, use if/else over ternary

* fix: remove response field, extension handles own UI
2026-01-16 02:41:56 +01:00
Mario Zechner
012319e15a Support pi-internal:// scheme in read tool
Resolves pi-internal:// paths to the coding-agent package directory,
allowing the model to read internal documentation. Appends a hint
showing the filesystem path and instructing to use it for further reads.
2026-01-16 02:31:59 +01:00
Mario Zechner
be26d362fa Fix alt+backspace in Kitty mode and clamp Codex effort (refs #752) 2026-01-16 01:30:46 +01:00
Mario Zechner
6484ae279d
Finalize OpenAI Codex compatibility (#737)
- align Codex Responses provider with Pi static instructions
- simplify Codex request/stream handling and cleanup exports
- keep legacy OpenCode Codex prompt for testing until Pi prompt is allowlisted
2026-01-16 00:58:36 +01:00
Aliou Diallo
0c6ac46646
feat(coding-agent): Custom tool export rendering in export (#702)
* coding-agent: add ANSI-to-HTML converter for export

* coding-agent: add getToolDefinition method to ExtensionRunner

* coding-agent: add tool HTML renderer factory for custom tools

* coding-agent: add custom tool pre-rendering to HTML export

* coding-agent: render pre-rendered custom tools in HTML export

* coding-agent: integrate tool renderer in exportToHtml
2026-01-16 00:32:31 +01:00
Richard Gill
ce7e73b503
Centralize frontmatter parsing + parse frontmatter with yaml library (#728)
* Add frontmatter utility and tidy coding agent prompts

* Add frontmatter parsing utilities and tests

* Parse frontmatter with YAML parser

* Simplify frontmatter parsing utilities

* strip body in 1 place

* Improve frontmatter parsing error handling

* Normalize multiline skill and select-list descriptions
2026-01-16 00:31:53 +01:00
Kao Félix
df58d3191e
Add direct filter shortcuts for Tree mode (#747)
* Add direct filter shortcuts for Tree mode

- Add Ctrl+D for default filter
- Add Ctrl+T for no-tools filter (toggles with default)
- Add Ctrl+U for user-only filter (toggles with default)
- Add Ctrl+L for labeled-only filter (toggles with default)
- Add Ctrl+A for all filter (toggles with default)
- Keep existing Ctrl+O / Shift+Ctrl+O cycle shortcuts
- Update help text to show new shortcuts

* simplify tree selector shortcut line
2026-01-16 00:28:53 +01:00
Richard Gill
131f1a25f3
Expand keymap coverage and add key tests (#752) 2026-01-16 00:21:37 +01:00
Melih Mucuk
cceb5908d9
fix: opencode provider uses system role instead of developer (#755)
* fix: opencode provider uses system role instead of developer for /v1 endpoint

* changelog updated
2026-01-15 21:26:31 +01:00
warren
3a89ebbe7c fix(coding-agent): fix tree indentation after filtering 2026-01-15 18:05:52 +01:00
Mario Zechner
e46cc55fe0 Add [Unreleased] section for next cycle 2026-01-15 17:36:40 +01:00
Mario Zechner
0aaa4ef5e4 Release v0.46.0 2026-01-15 17:35:54 +01:00
Mario Zechner
a216cc496f chore: update changelogs 2026-01-15 17:34:59 +01:00
Danila Poyarkov
eacd33602b
feat(coding-agent): export getAgentDir for extensions (#749) 2026-01-15 17:16:56 +01:00
Jian Zhang
12c61b5879
docs(coding-agent): document vscode shift+enter for multi-line input (#740)
Co-authored-by: Jian Zhang <jzhang@yanhuangdata.com>
2026-01-15 13:14:54 +01:00
Richard Gill
5f8d21daf7
Set coding agent CLI process title (#742) 2026-01-15 13:14:14 +01:00
Jian Zhang
6a3633ca53
feat(coding-agent): show loaded prompt templates in init (#743)
Co-authored-by: Jian Zhang <jzhang@yanhuangdata.com>
2026-01-15 13:13:40 +01:00
Roshan Singh
b18f401d9e
fix(ai): avoid unsigned Gemini 3 tool calls (#741) 2026-01-15 13:12:39 +01:00
Can Celik
2c10cc6da9
fix(coding-agent): remember last selected model when using scoped models (#736) 2026-01-15 13:10:15 +01:00