Commit graph

188 commits

Author SHA1 Message Date
Mario Zechner
ffdc8d686b docs: add OpenCode Zen to provider lists in coding-agent README 2026-01-16 21:20:52 +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
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
Mario Zechner
43c4a80e2e docs: document prompt template slicing 2026-01-16 12:08:57 +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
Jian Zhang
558a77b45f
feat(ai): add support for MiniMax China (minimax-cn) provider (#725)
Co-authored-by: Jian Zhang <jzhang@yanhuangdata.com>
2026-01-14 15:41:47 +01:00
Jian Zhang
30a126f2bd
feat(coding-agent): add support for APPEND_SYSTEM.md to append instructions to system prompt (#716)
Co-authored-by: Jian Zhang <jzhang@yanhuangdata.com>
2026-01-14 10:25:38 +01:00
Timo Lins
65eb738c90 Rename to vercel-ai-gateway for clarity 2026-01-13 16:42:34 +01:00
Timo Lins
164a69a601 Add Vercel AI Gateway support 2026-01-13 16:42:34 +01:00
Mario Zechner
8af8d0d672 Add MiniMax provider support (#656 by @dannote)
- Add minimax to KnownProvider and Api types
- Add MINIMAX_API_KEY to getEnvApiKey()
- Generate MiniMax-M2 and MiniMax-M2.1 models
- Add context overflow detection pattern
- Add tests to all required test files
- Update README and CHANGELOG with attribution

Also fixes:
- Bedrock duplicate toolResult ID when content has multiple blocks
- Sandbox extension unused parameter lint warning
2026-01-13 02:27:09 +01:00
Mario Zechner
fd268479a4 feat(ai): Add Amazon Bedrock provider (#494)
Adds support for Amazon Bedrock with Claude models including:
- Full streaming support via Converse API
- Reasoning/thinking support for Claude models
- Cross-region inference model ID handling
- Multiple AWS credential sources (profile, IAM keys, API keys)
- Image support in messages and tool results
- Unicode surrogate sanitization

Also adds 'Adding a New Provider' documentation to AGENTS.md and README.

Co-authored-by: nickchan2 <nickchan2@users.noreply.github.com>
2026-01-13 00:32:59 +01:00
Mario Zechner
8f95a13e07 feat(coding-agent): add session naming via /name command and extension API
- Add SessionInfoEntry type for session metadata
- Add /name <name> command to set session display name
- Add pi.setSessionName() and pi.getSessionName() extension API
- Session selector shows name (in warning color) instead of first message when set
- Session name included in fuzzy search
- /session command displays name when set

closes #650
2026-01-12 16:56:39 +01:00
Thomas Mustier
520e3b02f3 feat(coding-agent): tweak queued hint text 2026-01-12 16:36:46 +01:00
Mario Zechner
50cd054edb Rework /scoped-models command UX
- Renamed from /models to /scoped-models
- Changes are now session-only by default (Ctrl+S to persist to settings)
- Added search with fuzzy filtering
- Hotkeys: Enter toggle, Ctrl+A enable all, Ctrl+X clear all, Ctrl+P toggle provider
- Ctrl+C clears search (or exits if empty), Escape exits
- Enabled models shown at top of list
- No checkmarks when all models enabled (no scope)
- First toggle when unscoped clears all and selects that model
- Uses current session thinking level instead of settings default
- Reads from session state first (preserves session-only changes across /scoped-models invocations)

Builds on #626
2026-01-12 00:53:52 +01:00
Mario Zechner
9d49b4d4ed Merge branch 'tmp-2025-01-11' - resume scope toggle with async loading (#620) 2026-01-12 00:00:28 +01:00
Mario Zechner
302404684f feat(coding-agent): add resume scope toggle with async loading
- /resume and --resume now toggle between Current Folder and All sessions with Tab
- SessionManager.list() and listAll() are now async with optional progress callback
- Shows loading progress (e.g. Loading 5/42) while scanning sessions
- SessionInfo.cwd field shows session working directory in All view
- Lazy loading: All sessions only loaded when user presses Tab

closes #619

Co-authored-by: Thomas Mustier <mustierthomas@gmail.com>
2026-01-12 00:00:03 +01:00
Mario Zechner
df3f5f41c0 Rename /branch command to /fork
- RPC: branch -> fork, get_branch_messages -> get_fork_messages
- SDK: branch() -> fork(), getBranchMessages() -> getForkMessages()
- AgentSession: branch() -> fork(), getUserMessagesForBranching() -> getUserMessagesForForking()
- Extension events: session_before_branch -> session_before_fork, session_branch -> session_fork
- Settings: doubleEscapeAction 'branch' -> 'fork'

fixes #641
2026-01-11 23:12:31 +01:00
Patrick Kidger
92ee954195 docs(coding-agent) Fix install-from-source instructions 2026-01-11 22:59:30 +01:00
Carlos Gutierrez
49acd8e648 Add /models command for enabling/disabling Ctrl+P model cycling
- New /models command with toggle UI for each available model
- Changes persist to enabledModels in settings.json
- Updates take effect immediately for Ctrl+P cycling
2026-01-11 19:36:36 +01:00
Aos Dabbagh
23a4fd1159 fix: load keybindings before --resume session picker
The problem: I wanted to be able to select my session (either from
`/resume` or `--resume`) with different keybindings.

The issue: when running `pi --resume`, custom keybindings from
`~/.pi/agent/keybindings.json` were not being applied to the session
picker. This happened because `KeybindingsManager.create()` was only
called when `InteractiveMode` initialized, but the session picker runs
before that in `main.ts`.

The session picker uses `getEditorKeybindings()` for navigation
(selectUp/selectDown etc.), which returns the global default keybindings
if `setEditorKeybindings()` hasn't been called yet.

Fix: Call `KeybindingsManager.create()` inside the `--resume` block
before showing the session picker. This loads user keybindings and sets
them globally.

The current fix results in double-init of keybindings when entering
interactive mode which _should_ be harmless, since it's the same same
config loaded twice, but is minimal and only affects the `--resume`
path.

I considered passing keybindings from `main()` to `InteractiveMode` -
it's cleaner but requires API changes.

Also documented the `select*` keybindings in README.md.
2026-01-11 19:22:52 +01:00
Mario Zechner
9655907624 feat: Add skill slash commands and fuzzy matching for all commands
- Skills registered as /skill:name commands for quick access
- Toggle via /settings or skills.enableSkillCommands in settings.json
- Fuzzy matching for all slash command autocomplete (type /skbra for /skill:brave-search)
- Moved fuzzy module from coding-agent to tui package for reuse

Closes #630 by @Dwsy (reimplemented with fixes)
2026-01-11 17:56:11 +01:00
Kao Félix
6d60302646 fix(coding-agent): remove -- from registerFlag calls
This was causing the agent sometimes to pick up on the incorrect syntax when
asked to write extensions with flags
2026-01-11 02:21:15 +01:00
Mario Zechner
d82df76222 docs: add supportsUsageInStreaming to compat table 2026-01-10 01:16:52 +01:00
Mario Zechner
c39250d0df Fix Google Cloud Code Assist OAuth for paid subscriptions
- Properly handle long-running operations for project provisioning
- Support GOOGLE_CLOUD_PROJECT / GOOGLE_CLOUD_PROJECT_ID env vars for paid tiers
- Handle VPC-SC affected users
- Update docs for paid subscription requirements

Closes #582
2026-01-09 23:32:46 +01:00
Mario Zechner
e8eb4c254a feat: add search parameter and auto-select to /model command
- /model <search> pre-filters selector or auto-selects on exact match
- Support provider/model syntax for disambiguation (e.g., /model openai/gpt-4)
- Auto-select logic moved to InteractiveMode to avoid selector UI flicker

Closes #587
2026-01-09 22:39:26 +01:00
Mario Zechner
19b5663340 Revert "Remove Anthropic OAuth support"
This reverts commit f5e6bcac1b.
2026-01-09 06:00:20 +01:00
Mario Zechner
f5e6bcac1b Remove Anthropic OAuth support 2026-01-09 05:10:33 +01:00
Mario Zechner
66cbcee347 docs(coding-agent): simplify --no-tools description 2026-01-08 18:52:33 +01:00
Mario Zechner
e3dd4f21d1 feat(coding-agent): add tool override support via extensions
- Add setActiveTools() to ExtensionAPI for dynamic tool management
- Extensions can now override, wrap, or disable built-in tools
- Add tool-override.ts example demonstrating the pattern
- Update documentation for tool override capabilities
2026-01-08 18:52:33 +01:00
Mario Zechner
7f3fa417c4 feat(coding-agent): add --no-extensions flag to disable extension discovery
Adds --no-extensions CLI flag that skips automatic extension discovery
while still allowing explicit -e paths. Three modes now available:

1. Default: auto-discover + any -e additions
2. --no-extensions: no extensions at all
3. --no-extensions -e foo.js: only load explicit extensions

Useful for debugging or running subagent instances without auto-discovered
extensions.

closes #524
2026-01-08 03:22:38 +01:00
Mario Zechner
6f726a2178 feat(coding-agent): add PI_SKIP_VERSION_CHECK env variable
Skip new version check at startup when set. Useful for Nix or other
package manager installs where npm install is not used.

Also documents PI_CODING_AGENT_DIR and other environment variables
in the README.

closes #549

Co-authored-by: Aos Dabbagh <25783780+aos@users.noreply.github.com>
2026-01-08 02:29:51 +01:00
Mario Zechner
512ae4b4c0 fix: OAuth token refresh failure returns undefined instead of throwing
When OAuth refresh fails during model discovery, getApiKey() now returns
undefined instead of throwing. This allows the app to start and fall back
to other providers, so the user can /login to re-authenticate.

fixes #498

feat(coding-agent): support searching/resuming sessions by ID

- Session picker (pi -r) now searches session IDs in addition to message content
- --session flag accepts UUID prefix (e.g., pi --session a8ec1c2a)
- Documented in README.md

fixes #495
2026-01-06 21:09:11 +01:00
Mario Zechner
f023af0dab Add ctx.ui.setFooter() for extensions to replace footer component
Extensions can now replace the built-in footer with a custom component:
- setFooter(factory) replaces with custom component
- setFooter(undefined) restores built-in footer

Includes example extension demonstrating context usage display.

Closes #481
2026-01-06 12:39:45 +01:00
Mario Zechner
df5ad091b3 docs: add blockImages setting to README 2026-01-06 12:01:16 +01:00
badlogic
1349f02cdd docs: document Windows Terminal Shift+Enter limitation
Windows Terminal does not support the Kitty keyboard protocol, so
Shift+Enter cannot be distinguished from Enter. Document that users
should use Ctrl+Enter for multi-line input instead.

- Add Windows Terminal note in Terminal Setup section
- Update Keyboard Shortcuts table with Windows note
- Show Windows-specific hint in /hotkeys command
2026-01-05 23:17:58 +01:00
Mario Zechner
4d87196801 fix(tui): remove alt+enter from newLine default keybinding
alt+enter is used by coding-agent for follow-up messages.
Having it also mapped to newLine caused a conflict.
2026-01-05 23:17:34 +01:00
Mario Zechner
c5d54a8413 feat(tui): query Kitty keyboard protocol support before enabling
- Query terminal with CSI ? u before enabling Kitty protocol
- Only enable protocol if terminal responds (100ms timeout)
- Mode-aware key parsing: when Kitty active, interpret legacy
  sequences as custom terminal mappings (e.g. \x1b\r = shift+enter)
- Add Terminal Setup section to README with Ghostty/wezterm config

fixes #439
2026-01-05 22:52:13 +01:00
Mario Zechner
9a147559c0 Merge branch 'openai-codex' 2026-01-05 05:33:48 +01:00
Mario Zechner
91cca23d23 Add migration for commands->prompts, warn about deprecated hooks/tools dirs
- Auto-migrate commands/ to prompts/ on startup
- Warn if hooks/ or tools/ directories contain custom extensions
- Show deprecation warnings in interactive mode with keypress to continue
- Update CHANGELOG and docs with full migration guide
2026-01-05 02:41:08 +01:00
Mario Zechner
c6fc084534 Merge hooks and custom-tools into unified extensions system (#454)
Breaking changes:
- Settings: 'hooks' and 'customTools' arrays replaced with 'extensions'
- CLI: '--hook' and '--tool' flags replaced with '--extension' / '-e'
- API: HookMessage renamed to CustomMessage, role 'hookMessage' to 'custom'
- API: FileSlashCommand renamed to PromptTemplate
- API: discoverSlashCommands() renamed to discoverPromptTemplates()
- Directories: commands/ renamed to prompts/ for prompt templates

Migration:
- Session version bumped to 3 (auto-migrates v2 sessions)
- Old 'hookMessage' role entries converted to 'custom'

Structural changes:
- src/core/hooks/ and src/core/custom-tools/ merged into src/core/extensions/
- src/core/slash-commands.ts renamed to src/core/prompt-templates.ts
- examples/hooks/ and examples/custom-tools/ merged into examples/extensions/
- docs/hooks.md and docs/custom-tools.md merged into docs/extensions.md

New test coverage:
- test/extensions-runner.test.ts (10 tests)
- test/extensions-discovery.test.ts (26 tests)
- test/prompt-templates.test.ts
2026-01-05 01:43:35 +01:00
Mario Zechner
affa618b43 docs: add note about macOS Finder image copy behavior 2026-01-04 20:52:51 +01:00
Kao Félix
b836a9d2ee
feat(tui): add symbol key support to keybinding system (#450)
- Added SymbolKey type with 32 symbol keys
- Added symbol key constants to Key helper (Key.backtick, Key.comma, Key.period, etc.)
- Updated matchesKey() and parseKey() to handle symbol key input
- Added documentation in coding-agent README with examples
2026-01-04 20:37:08 +01:00
Mario Zechner
00fa8b71c8 revert: remove unnecessary themeOverride params from theme functions
The optional theme parameter was added as a workaround for tsx dev mode,
but that's a dev-only issue. Users running the built package don't need it.
2026-01-04 20:27:46 +01:00
Ahmed Kamal
1650041a63 feat(ai): add OpenAI Codex OAuth + responses provider 2026-01-04 21:11:19 +02:00
Mario Zechner
2849623afc fix(tools): tool registry now contains ALL built-in tools
- createAllTools() populates registry with all 7 built-in tools
- --tools flag only sets initially active tools (default: read/bash/edit/write)
- Hooks can enable any tool from registry via setActiveTools()
- System prompt rebuilds with correct tool guidelines when tools change
- Document tsx module resolution workaround in README
2026-01-04 18:44:41 +01:00
Armin Ronacher
5b95ccf830
Add consistent, configurable image placeholders (#442)
* Add consistent, configurable image placeholders

* Kill the placeholders
2026-01-04 18:12:55 +01:00
Mario Zechner
5c5084481b feat(coding-agent): clipboard image paste support via Ctrl+V (fixes #419) 2026-01-04 01:05:22 +01:00
Mario Zechner
97bb411988 Add Vim-style keybindings example to README 2026-01-03 23:44:40 +01:00
Mario Zechner
9549ac4695 Remove DEVELOPMENT.md reference from README 2026-01-03 22:53:33 +01:00
Mario Zechner
f2b89d5ec5 Merge branch 'feat/ctrl-n-external-editor' - configurable keybindings (#405) 2026-01-03 22:51:12 +01:00