Commit graph

342 commits

Author SHA1 Message Date
Mario Zechner
9cf5758b68 feat(coding-agent): support shell commands and env vars in auth.json API keys
API keys in auth.json now support the same resolution as models.json:
- Shell command: "\!command" executes and uses stdout (cached)
- Environment variable: uses the value of the named variable
- Literal value: used directly

Extracted shared resolveConfigValue() to new resolve-config-value.ts module.
2026-02-04 23:02:00 +01:00
Mario Zechner
d0679dcfc0 fix(coding-agent): ignore unknown skill frontmatter fields 2026-02-04 14:20:24 +01:00
Mario Zechner
2d16d73ba1 docs(coding-agent): add PR attribution and keybindings docs for resume action 2026-02-04 13:44:15 +01:00
Mario Zechner
9eb8985fe4 Add pi.dev donation attribution 2026-02-03 23:00:40 +01:00
Mario Zechner
2f5235b966 fix(coding-agent): support local install paths relative to settings files closes #1216 2026-02-03 12:58:34 +01:00
Mario Zechner
e54dff7efb fix(coding-agent): rename SlashCommandSource "template" to "prompt" for consistency
BREAKING CHANGE: RPC get_commands response and SlashCommandSource type
now use "prompt" instead of "template" to match the rest of the codebase.
2026-02-03 12:27:45 +01:00
warren
2613754c47 feat(coding-agent): add ExtensionAPI.getCommands() 2026-02-03 12:18:52 +01:00
Mario Zechner
90b18218bd docs(coding-agent): document tool expansion UI methods 2026-02-03 01:16:29 +01:00
Mario Zechner
c64e228b76 fix(tui): honor keybindings for submit fallback 2026-02-03 01:10:06 +01:00
Mario Zechner
c9a20a3aa4 fix(coding-agent): normalize @ path prefixes closes #1206 2026-02-02 23:56:20 +01:00
Mario Zechner
1fbafd6cc7 docs: document video and image fields for package gallery 2026-02-02 20:16:18 +01:00
Mario Zechner
0a26db53ef fix(coding-agent): align ToolDefinition.execute signature with AgentTool
BREAKING CHANGE: ToolDefinition.execute parameter order changed from
(id, params, onUpdate, ctx, signal) to (id, params, signal, onUpdate, ctx).

This aligns with AgentTool.execute so wrapping built-in tools no longer
requires parameter reordering. Update extensions by swapping signal and
onUpdate parameters.
2026-02-02 00:29:47 +01:00
Mario Zechner
ad8026f821 docs(coding-agent): add Termux setup guide and changelog audit
- Add comprehensive Termux (Android) setup documentation
- Add Termux platform detection in tools-manager for fd/rg
- Add New Features entries for Android/Termux, bash spawn hook, Linux ARM64 musl
- Add missing changelog entry for clipboard dependency update
2026-02-02 00:09:17 +01:00
Mario Zechner
86b43c8eac feat(coding-agent): add bash spawn hook 2026-02-01 23:17:51 +01:00
G
a8a0f4b9fb feat(coding-agent): type ToolCallEvent.input per tool
Matches ToolResultEvent pattern with typed inputs via discriminated union.

- Export *ToolInput types from tool schemas
- Add *ToolCallEvent interfaces for each built-in tool
- Add isToolCallEventType() guard with overloads for built-ins

Direct narrowing (event.toolName === "bash") doesn't work due to
CustomToolCallEvent.toolName: string overlapping with literals.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 19:13:52 +01:00
Mario Zechner
73839f876e feat(coding-agent): add named-only filter toggle to /resume picker (#1128)
Adds Ctrl+N toggle to filter sessions by named-only vs all in the /resume picker.

- Add NameFilter type and filtering logic to session-selector-search.ts
- Add toggleSessionNamedFilter app keybinding (default: ctrl+n)
- Show Name: All/Named state in header
- Empty state mentions toggle keybinding as escape hatch
- Export hasSessionName() to avoid duplication

Co-authored-by: warren <warren.winter@gmail.com>
2026-02-01 19:03:38 +01:00
Mario Zechner
8306b3bc20 docs(coding-agent): improve models.md with minimal example and defaults
- Add minimal example showing only required fields for local models
- Rename 'Basic Example' to 'Full Example' showing all fields
- Add 'Default' column to model configuration table
- Clarify that apiKey is required but ignored by Ollama
2026-02-01 17:51:24 +01:00
Aliou Diallo
7feae0d5c2
docs(coding-agent): document extension UI protocol in RPC docs, add examples (#1144) 2026-02-01 13:25:18 +01:00
Mario Zechner
7d632ba1c3 chore: update changelog and docs for qwen extension 2026-02-01 01:52:53 +01:00
Mario Zechner
030a61d88c feat: add maxDelayMs setting to cap server-requested retry delays
When a provider (e.g., Google Gemini CLI) requests a retry delay longer
than maxDelayMs (default: 60s), the request fails immediately with an
informative error instead of waiting silently for hours.

The error is then handled by agent-level auto-retry, which shows the
delay to the user and allows aborting with Escape.

- Add maxRetryDelayMs to StreamOptions (packages/ai)
- Add maxRetryDelayMs to AgentOptions (packages/agent)
- Add retry.maxDelayMs to settings (packages/coding-agent)
- Update _isRetryableError to match 'retry delay' errors

fixes #1123
2026-02-01 00:50:41 +01:00
Juan Ibiapina
6f2d066342 feat(coding-agent): add keybinding actions for /tree, /fork, and /new
Add newSession, tree, and fork as configurable keybinding actions.
All unbound by default. Users can configure in keybindings.json.

Closes #1088
2026-01-31 23:09:22 +01:00
Mario Zechner
99281e5913 feat(coding-agent): add ctx.getSystemPrompt() to extension context
Adds a method to access the effective system prompt (after any per-turn
extension modifications) from the extension context.

Implementation:
- Add systemPrompt getter to AgentSession reading from agent.state.systemPrompt
- Wire getSystemPrompt through ExtensionContextActions to ExtensionRunner
- Add getSystemPrompt to interactive-mode's shortcut context
- Update docs with ctx.getSystemPrompt() section
- Add system-prompt-header.ts example
- Add example to docs reference table

Closes #1098
2026-01-30 17:44:25 +01:00
Emanuel Stadler
fd6c6d8772
Update providers.md to include opencode provider (#1094)
add 'opencode' provider configuration to the documentation.
2026-01-30 16:43:32 +01:00
Ben Vargas
e045a9f142
feat(ai): add Vercel AI Gateway routing support (#1051)
* feat(ai): add Vercel AI Gateway routing support

Add vercelGatewayRouting to OpenAICompletionsCompat, parallel to
openRouterRouting. When a model targets ai-gateway.vercel.sh and has
vercelGatewayRouting configured, the openai-completions provider passes
providerOptions.gateway with only/order in the request body.

Changes:
- types.ts: VercelGatewayRouting interface + field on OpenAICompletionsCompat
- openai-completions.ts: buildParams passes providerOptions.gateway,
  detectCompat/getCompat include the new field
- model-registry.ts: VercelGatewayRoutingSchema for models.json validation
- test: updated Required<OpenAICompletionsCompat> in test fixture

* docs(coding-agent): add vercelGatewayRouting to custom models documentation
2026-01-30 01:44:51 +01:00
Nathan Igo
902473797d
feat(tui,coding-agent): add ctrl+b/ctrl+f cursor navigation keybindings (#1053) 2026-01-30 01:43:54 +01:00
Sviatoslav Abakumov
c5d16fe456
feat(tui): add character jump navigation (Ctrl+], Ctrl+Alt+]) (#1074)
Add Bash/Readline-style character search:

- Ctrl+] enters forward jump mode, awaits next character, jumps to it
- Ctrl+Alt+] does the same but searches backward
- Multi-line search
- Case-sensitive matching
- Pressing the hotkey again cancels; control chars cancel and fall
  through
2026-01-30 01:42:14 +01:00
Daniel Nouri
e20583aac8
feat(coding-agent): add set_session_name RPC command (#1075)
- Add set_session_name command with empty name validation
- Expose sessionName in get_state response
- Add setSessionName() to AgentSession and RpcClient
- Document in docs/rpc.md
2026-01-30 01:41:58 +01:00
Mario Zechner
87ab5c5c3b feat(ai): add Kimi For Coding provider support
- Add kimi-coding provider using Anthropic Messages API
- API endpoint: https://api.kimi.com/coding/v1
- Environment variable: KIMI_API_KEY
- Models: kimi-k2-thinking (text), k2p5 (text + image)
- Add context overflow detection pattern for Kimi errors
- Add tests for all standard test suites
2026-01-29 04:12:28 +01:00
Colin Mason
b212314f45 feat: add autocompleteMaxVisible setting for configurable dropdown height 2026-01-29 03:16:52 +01:00
Mario Zechner
c808de605a feat(ai): add Hugging Face provider support
- Add huggingface to KnownProvider type
- Add HF_TOKEN env var mapping
- Process huggingface models from models.dev (14 models)
- Use openai-completions API with compat settings
- Add tests for all provider test suites
- Update documentation

fixes #994
2026-01-29 02:40:14 +01:00
Mario Zechner
81be81328c feat(tui,coding-agent): add shell-style keybindings alt+b, alt+f, ctrl+d
- Add alt+b/alt+f as alternative bindings for cursorWordLeft/cursorWordRight
- Add ctrl+d as alternative binding for deleteCharForward
- Fix ctrl+d in custom editor to perform delete when text is present
  (previously it was always consumed, even with non-empty input)

Closes #1043

Co-authored-by: Jason Ish <ish@unx.ca>
2026-01-29 00:21:39 +01:00
Daniel Nouri
0ad189f12a
Add get_commands RPC for headless clients (#995)
* Add get_commands RPC for headless clients

Headless clients like Emacs can now query which commands are available.
Previously they could only discover file-based prompt templates by
scanning the filesystem; extension commands and skills were invisible.

The response includes each command's name, description, and source
(extension, template, or skill). Commands appear in the same order
as the TUI's autocomplete: extension commands first, then templates,
then skills.

Built-in TUI commands (/settings, /fork, etc.) are excluded since
they require the interactive UI. Commands like /compact have dedicated
RPC equivalents instead.

* Add location and path to get_commands response

Clients can show where commands come from (user/project/path) and
display file paths in tooltips. The data is already available on
templates and skills - just exposing it.
2026-01-28 02:34:15 +01:00
Mario Zechner
bec72c428c docs(coding-agent): clarify dependency categories 2026-01-27 00:13:54 +01:00
Mario Zechner
484b605ca0 docs(coding-agent): clarify pi package dependency bundling 2026-01-27 00:10:58 +01:00
Mario Zechner
3c252d50f5 docs(coding-agent): add placement note for extension hot-reload 2026-01-26 21:55:57 +01:00
Mario Zechner
a6f9c3cf0d fix(tui): fix scrollback overwrite when appending lines past viewport
Appended lines were not committed to terminal scrollback because the
renderer used cursor movement (CSI B) and carriage return without
linefeed. This caused earlier content to be overwritten when the
viewport filled up.

Changes:
- For appended lines, emit \r\n to create real scrollback lines
- When target row is below viewport, scroll with \r\n before positioning
- Add PI_TUI_WRITE_LOG env var for debugging raw ANSI output
- Add fullRedraws readonly property to TUI class
- Add viewport-overwrite-repro.ts test script

fixes #954
2026-01-26 16:51:28 +01:00
Mario Zechner
fa8b26a184 docs: update changelog guidance and links 2026-01-26 15:45:51 +01:00
Mario Zechner
ea93e2f3da fix(coding-agent): add force exclude pattern and fix config toggle persistence
- Add `-path` force-exclude pattern (exact path match, highest precedence)
- Change `+path` force-include to exact path match (no glob)
- Manifest-excluded resources are now hidden from config (not toggleable)
- Config toggle uses `+` to enable and `-` to disable
- Settings paths resolve relative to settings.json location:
  - Global: relative to ~/.pi/agent
  - Project: relative to .pi
- Add baseDir to PathMetadata for proper relative path computation
- Update tests for new base directory and pattern behavior

fixes #951
2026-01-26 12:47:07 +01:00
Mario Zechner
7a0b435923 docs(coding-agent): add security warnings for third-party packages
- README.md: Pi Packages section
- packages.md: Install and Manage section
- extensions.md: Extension Locations section
- skills.md: Locations section
2026-01-26 12:38:04 +01:00
Mario Zechner
a8d04a1dbf docs(coding-agent): add comprehensive cross-links in extensions.md
- context event → session.md (message types)
- setModel → models.md (custom models)
- session_before_tree → tree.md (tree navigation)
- Mode Behavior table → rpc.md, json.md (add JSON mode row)
- Fix table to distinguish RPC vs JSON modes
2026-01-26 11:54:56 +01:00
Mario Zechner
c3b8685467 docs(coding-agent): link to session.md for message types in context event 2026-01-26 11:52:29 +01:00
Mario Zechner
b078141c24 docs(coding-agent): add cross-links to themes.md and session.md 2026-01-26 11:51:11 +01:00
Mario Zechner
530826ba07 docs(coding-agent): link to tool-execution.ts in Custom Rendering section 2026-01-26 11:47:31 +01:00
Mario Zechner
d726c81faf docs(coding-agent): remove duplicate packages content from extensions.md
Replace 130 lines of duplicate content with link to packages.md
2026-01-26 11:44:56 +01:00
Mario Zechner
930207130b docs(coding-agent): improve extensions.md, add missing examples
- Add cross-links to session.md, keybindings.md, themes.md
- Document truncateLine, highlightCode, getLanguageFromPath utilities
- Add examples for previously undocumented APIs:
  - message-renderer.ts: registerMessageRenderer with Box styling
  - session-name.ts: setSessionName/getSessionName
  - event-bus.ts: pi.events for inter-extension communication
  - bookmark.ts: setLabel for entry bookmarking
- Update examples table in extensions.md and README.md
2026-01-26 11:43:01 +01:00
Nico Bailon
c565fa9af8
fix(tui): keep overlays centered across resizes (#950) 2026-01-26 09:43:16 +01:00
Mario Zechner
bf876fcd3b Revert "docs(coding-agent): restructure extensions.md, consolidate examples"
This reverts commit b85bf05461.
2026-01-26 02:44:16 +01:00
Mario Zechner
b85bf05461 docs(coding-agent): restructure extensions.md, consolidate examples
- Reduce from 1840 to 817 lines (55% smaller)
- Move all scattered example references to Examples Reference table at end
- Add missing setHeader() API documentation
- Add all 50 examples organized by category (Tools, Commands, Events, UI, etc.)
- Fix tui.md hooks->extensions terminology
2026-01-26 02:40:46 +01:00
Mario Zechner
5340862910 docs(coding-agent): update README-NEW.md, tui.md, add new docs
- README-NEW.md: add environment variables, philosophy extras (no built-in to-dos, no background bash), session ID support, pi config command, plain git URLs, version pinning
- tui.md: fix hooks->extensions terminology, update Component interface (invalidate required, add wantsKeyRelease)
- Add new docs: settings.md, development.md, json.md
- Add screenshots: tree-view.png, doom-extension.png
2026-01-26 02:27:19 +01:00
Mario Zechner
28ab25b07e docs(coding-agent): improve README structure and update session/compaction docs
- README-NEW.md: add Quick Start, Interactive Mode, Sessions sections
- session.md: add Message Types section, complete SessionManager API, fix source links to GitHub URLs
- compaction.md: rename hooks to extensions, fix source links to GitHub URLs
- keybindings.md: new file documenting all keyboard shortcuts
2026-01-26 01:25:15 +01:00