Commit graph

2175 commits

Author SHA1 Message Date
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
a20662da87 Remove broken git-diff extension 2026-01-16 03:07:55 +01:00
Mario Zechner
af7a8b5878 Remove temporary test file 2026-01-16 03:04:28 +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
Mario Zechner
3ed0d1bde7 Update package-lock.json 2026-01-16 00:44:38 +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
Mario Zechner
d9ac0c7b26 docs(prompts): prefer main files for PR diffs 2026-01-15 18:06:39 +01:00
Mario Zechner
bfeec88dbe Merge branch 'pr-739' 2026-01-15 18:06:00 +01:00
warren
3a89ebbe7c fix(coding-agent): fix tree indentation after filtering 2026-01-15 18:05:52 +01:00
Mario Zechner
f74f48660f Fix prompt-url-widget session name API 2026-01-15 17:50:24 +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
Fero
39ee5fee92
fix(plan-mode): change shortcut from Shift+P to Ctrl+Alt+P (#746)
Shift+P conflicts with typing capital P. Ctrl+Alt+P is cross-platform
safe and doesn't conflict with common shortcuts like:
- Ctrl+Shift+P (command palette on Windows/VS Code)
- Shift+Alt+P (types π on macOS)
2026-01-15 13:09:16 +01:00
Aadish Verma
cd83e73845
feat: add gpt-5.2-codex models for copilot & zen (#734) 2026-01-15 03:24:20 +01:00
vsabavat
72e29bce27
Fix compaction turn prefix summarization (#738) 2026-01-15 03:23:34 +01:00
Can Celik
537bdb6972
feat(coding-agent): improve session picker search (#731) 2026-01-14 23:28:23 +01:00
Mario Zechner
cc8c51d9ae chore(ai): regenerate models 2026-01-14 22:25:21 +01:00
Mario Zechner
0a7537bf86 Revert "feat(ai): add gpt-5.2-codex to OpenAI provider (#730)"
This reverts commit 5a795b9857.
2026-01-14 22:22:55 +01:00
Anton
5a795b9857
feat(ai): add gpt-5.2-codex to OpenAI provider (#730)
* feat(ai): add gpt-5.2-codex to OpenAI provider

* fix(ai): avoid build break when model generation misses providers
2026-01-14 22:21:01 +01:00
Burak Varlı
9a438465eb
fix(ai): signature support for non-Anthropic models in Amazon Bedrock provider (#727)
* Add Amazon Bedrock models test suite for agent package

Tests basic prompts, multi-turn conversations with thinking, and
synthetic thinking signatures across all Bedrock models.

Known issues are categorized and skipped:
- Models requiring inference profile (5)
- Invalid model IDs for us-east-1 region (6)
- Max tokens config exceeds model limit (2)
- No signature support in reasoningContent (10)
- Rejects reasoning content in user messages (25)
- Validates signature format - Anthropic newer models (7)

* Fix Bedrock signature support for non-Anthropic models

Only include the signature field in reasoningContent.reasoningText for
Anthropic Claude models. Other models (OpenAI, Qwen, Minimax, Moonshot,
etc.) reject this field with:
"This model doesn't support the reasoningContent.reasoningText.signature field"

This fix enables multi-turn conversations with thinking content for
10 additional Bedrock models that previously failed.

https://buildwithpi.ai/session?7e39c05f66ea358da3f993c267fe3e29

* Add a CHANGELOG entry
2026-01-14 19:21:35 +01:00
Danila Poyarkov
a497fccd06
refactor: use configurable keybindings for all UI hints (#724)
Follow-up to #717. Replaces all remaining hardcoded keybinding hints with configurable ones.

- Add pasteImage to AppAction so it can be configured in keybindings.json
- Create keybinding-hints.ts with reusable helper functions:
  - editorKey(action) / appKey(keybindings, action) - get key display string
  - keyHint(action, desc) / appKeyHint(kb, action, desc) / rawKeyHint(key, desc) - styled hints
- Export helpers from components/index.ts for extensions
- Update all components to use configured keybindings
- Remove now-unused getDisplayString() from KeybindingsManager and EditorKeybindingsManager
- Use keybindings.matches() instead of matchesKey() for pasteImage in custom-editor.ts
2026-01-14 15:42:03 +01:00