Commit graph

1633 commits

Author SHA1 Message Date
Mario Zechner
d79eb99cd2 docs(coding-agent): merge theme.md into themes.md, add hot reload info
- Merged theme.md content into themes.md
- Added hot reload documentation
- Updated all references from theme.md to themes.md
- Fixed outdated info (vars not defs, complete example with all 50 tokens)
- Removed dev-focused Implementation section
2026-01-25 20:39:49 +01:00
Mario Zechner
94952bd6c0 docs(coding-agent): update README intro, add packages/prompt-templates/themes docs
- Rewrote README intro to emphasize extensibility and pi packages
- Added Pi Packages section to README
- Created docs/packages.md covering install, sources, manifest, filtering
- Created docs/prompt-templates.md covering format and arguments
- Created docs/themes.md with overview linking to theme.md
2026-01-25 20:33:19 +01:00
Sviatoslav Abakumov
27b27d9441
fix(coding-agent): restore the correct editor after /reload (#949)
This issue occurs when extension uses setEditorComponent. The
restoreEditor() callback was capturing this.editor AFTER
resetExtensionUI() (which restores defaultEditor), then adding that
captured editor back to the container - ignoring any new editor created
by extensions during session_start.

On success, use this.editor (may be custom editor from extension).
On failure, restore the fallback editor (safe defaultEditor state).

Rename restoreEditor to dismissLoader to reflect its actual purpose.
2026-01-25 20:11:09 +01:00
aos
225fcb3830
feat: make session selector keybindings configurable (#948)
I lost my ability to select up and down in the session selector because
of some hardcoded keybindings again... So, I am adding these
configurable keybindings so I can `ctrl+p` to select up :-)

### Changes

Adds 4 new keybinding actions for the session picker (/resume):
- `toggleSessionPath` (ctrl+p) - toggle path display
- `toggleSessionSort` (ctrl+r) - toggle sort mode
- `deleteSession` (ctrl+d) - delete selected session
- `deleteSessionNoninvasive` (ctrl+backspace) - delete when query empty

Refactors session-selector to use `kb.matches()` instead of hardcoded key checks.
2026-01-25 20:08:11 +01:00
Mario Zechner
4bb21b7f5f fix(coding-agent): change sort keybinding from Ctrl+N to Ctrl+S in /resume picker
Also add changelog entries for #863 session rename feature.
2026-01-25 19:43:16 +01:00
Sergii Kozak
b5873507c1
Rename session from /resume session list (#863)
* Add session renaming in interactive mode resume picker

Session list now displays last message timestamp as modified time
instead of file mtime. Ctrl+N enters rename mode in the interactive
resume picker, allowing quick session renaming without leaving the
selector. Rename hint is shown only in interactive mode, not in the
CLI --resume picker./

* Add docs entry for renaming in picker

* Update shortcut to ctrl+r for session renaming
2026-01-25 19:42:34 +01:00
Armin Ronacher
5555864c57
Fixes distributed themes breaking /export (#946)
Thanks
2026-01-25 19:26:54 +01:00
Li Yang
1675824ed3
Add active path highlighting in html exports (#929)
* fix(coding-agent): HTML export sidebar click scrolls instead of truncating branch

Previously, clicking a message in the sidebar tree would set that message
as the new leaf, causing getPath() to only return messages up to that point
and hiding all messages below it.

Now handleTreeNodeClick() checks if the clicked entry is on the current path:
- If yes: just scrolls to it without re-rendering
- If no: finds the actual leaf of that branch and navigates to it, then
  scrolls to the clicked message

Added childrenMap for parent->children lookup and findBranchLeaf() to
traverse down to a branch's leaf.

* fix(coding-agent): HTML export sidebar click scrolls instead of truncating branch

Previously, clicking a message in the sidebar tree would set that message
as the new leaf, causing getPath() to only return messages up to that point
and hiding all messages below it.

Now handleTreeNodeClick() checks if the clicked entry is on the current path:
- If yes: scrolls to it and updates the active marker
- If no: finds the branch's leaf, navigates to it, then scrolls to clicked message

Adds currentTargetId to track the selected entry separately from currentLeafId
(which branch to display), so the active marker follows user selection.

* most recent path wins

* reuse method

* revert

* feat(coding-agent): highlight active path in HTML export sidebar

- Add subtle accent background tint to in-path nodes
- Dim off-path nodes to 50% opacity (restore on hover)
- Makes current branch visually distinct in tree navigation

* docs(coding-agent): move changelog entry to Unreleased and add attribution

* chore(coding-agent): remove dead code and fix changelog attribution

- Remove unused childrenMap, findBranchLeaf, handleTreeNodeClick, scrollToEntry
- Split changelog entry: navigation (#853 by @mitsuhiko), highlighting (#929 by @hewliyang)
2026-01-25 19:25:44 +01:00
Mario Zechner
b1211261be docs(coding-agent): add changelog entry for extension shortcut fix (#947) 2026-01-25 19:21:18 +01:00
Sviatoslav Abakumov
f1b1d54955
fix(coding-agent): delegate extension shortcuts instead of copying (#947)
Extension shortcuts registered via registerShortcut() were not firing
when the extension also used setEditorComponent(). This happened because
setEditorComponent() copied onExtensionShortcut from defaultEditor at
creation time, capturing undefined if setupExtensionShortcuts() hadn't
run yet.

The fix is to delegate to defaultEditor.onExtensionShortcut at call
time.
2026-01-25 19:20:51 +01:00
Mario Zechner
0faba293e6 fix(coding-agent): truncate bash hint line to terminal width
Fixes TUI crash on narrow terminals (< 40 chars) when displaying
collapsed bash output with 'earlier lines' hint.

fixes #941
2026-01-25 19:19:41 +01:00
Mario Zechner
b0c050582a fix(coding-agent): update test expectations for trailing period in read tool messages 2026-01-25 19:08:52 +01:00
jake
dac7474da2 feat(ai): add OpenRouter provider routing support
Allows custom models to specify which upstream providers OpenRouter
should route requests to via the `openRouterRouting` field in model
definitions.

Supported fields:
- `only`: list of provider slugs to exclusively use
- `order`: list of provider slugs to try in order
2026-01-25 03:34:49 +01:00
Mario Zechner
d74fd82673 docs(coding-agent): add pi config to CLI Reference 2026-01-25 03:13:58 +01:00
Mario Zechner
150128fd2c feat(coding-agent): add pi config TUI to manage resources
Adds a new 'pi config' command with a TUI to list and toggle package
resources (extensions, skills, prompts, themes).

- Displays resources grouped by source (packages, user, project)
- Subgroups by resource type (Extensions, Skills, Prompts, Themes)
- Toggle enabled/disabled state with space
- Filter resources by typing
- Supports +pattern for force-include, !pattern for exclude
- Properly reads exclusion patterns from settings.json

fixes #938
2026-01-25 03:12:21 +01:00
Mario Zechner
ef5149fdf6 Fixes #933 2026-01-25 02:51:05 +01:00
Mario Zechner
6b4188fa0b Fixes #933 2026-01-25 02:47:17 +01:00
Mario Zechner
349c6420c7 fix(coding-agent): setWorkingMessage() now works in agent_start handlers
Extensions calling setWorkingMessage() in agent_start handlers previously
had no effect because the loading animation didn't exist yet. Now the
message is queued and applied once the loader is created.

Fixes #935
2026-01-25 02:37:12 +01:00
Mario Zechner
3e8eb956b3 feat(coding-agent): resolve resources with enabled state 2026-01-25 02:13:24 +01:00
Mario Zechner
9dc2b9b163 docs(coding-agent): document pi-package keyword for npm discoverability 2026-01-25 01:40:26 +01:00
Mario Zechner
353ac792eb chore(gitlab-duo): use pi's own GitLab OAuth client ID 2026-01-25 01:12:50 +01:00
Mario Zechner
7b920f27d2 fix(coding-agent): check npm package version before using cached copy
For temporary npm extensions (-e npm:...):
- Unpinned packages: fetch latest version from registry and reinstall if newer
- Pinned packages: reinstall if cached version doesn't match
2026-01-25 00:57:58 +01:00
Mario Zechner
0d24ddbb03 fix(ai): use model.api instead of hardcoding api type in streaming functions
- anthropic.ts: use model.api instead of hardcoding 'anthropic-messages'
- openai-responses.ts: use model.api instead of hardcoding 'openai-responses'
- gitlab-duo: simplify to use actual model IDs, export MODELS array
2026-01-25 00:52:34 +01:00
Mario Zechner
7019fdb92b fix(gitlab-duo): use Responses API for all GPT models
Ensures consistent tool call ID format when switching between models.
2026-01-25 00:29:05 +01:00
Mario Zechner
758baa9fec refactor: rename custom provider examples
- custom-provider -> custom-provider-anthropic
- gitlab-duo -> custom-provider-gitlab-duo
- Update READMEs with custom provider section
2026-01-25 00:18:13 +01:00
Mario Zechner
7caa08999e fix: use template literal in test.ts 2026-01-25 00:13:44 +01:00
Mario Zechner
7a5cfdaed0 fix: apply extension provider registrations before model resolution
- Extensions register providers via pendingProviderRegistrations
- These were only applied in bindCore() during AgentSession creation
- But model resolution in main.ts happens before session creation
- Fix: apply pending registrations immediately after loading extensions
- Also fix gitlab-duo to pass Authorization header instead of apiKey
2026-01-25 00:13:20 +01:00
Mario Zechner
dd01d83e64 fix: use opencode's OAuth client ID for localhost redirects 2026-01-24 23:53:56 +01:00
Mario Zechner
639d706156 fix: use correct GitLab OAuth redirect URI with port 8080 2026-01-24 23:52:04 +01:00
Mario Zechner
3e6d8dc72a feat: add GitLab Duo provider extension example
- Delegates to pi-ai's built-in Anthropic/OpenAI streaming
- OAuth support with GitLab's bundled client ID
- Direct access token caching (25 min TTL)
- Models: duo-chat-opus/sonnet/haiku-4-5, duo-chat-gpt-5-1/mini/codex
- No external dependencies beyond pi-ai
2026-01-24 23:51:17 +01:00
Mario Zechner
6aad6e30ce refactor: convert custom-provider example to package with deps
- Move custom-provider.ts to custom-provider/index.ts
- Add package.json with @anthropic-ai/sdk dependency
- Extension now requires npm install before use
2026-01-24 23:21:19 +01:00
Mario Zechner
d4bd1a956b docs: rewrite custom-provider.md with actual stream pattern
- Document stream.push/end pattern instead of yield
- Link to existing provider implementations on GitHub
- Add testing section with list of test files to run
- Include proper content block and tool call examples
2026-01-24 23:18:36 +01:00
Mario Zechner
177c694406 feat: custom provider support with streamSimple
- Add resetApiProviders() to clear and re-register built-in providers
- Add createAssistantMessageEventStream() factory for extensions
- Add streamSimple support in ProviderConfig for custom API implementations
- Call resetApiProviders() on /reload to clean up extension providers
- Add custom-provider.md documentation
- Add custom-provider.ts example with full Anthropic implementation
- Update extensions.md with streamSimple config option
2026-01-24 23:15:11 +01:00
Mario Zechner
3256d3c083 refactor(oauth): add provider registry 2026-01-24 23:15:11 +01:00
Mario Zechner
89636cfe6e fix(coding-agent): improve read tool description for full file reads 2026-01-24 23:15:11 +01:00
Mario Zechner
79ded84d46
Merge pull request #936 from Perlence/fix/extension-editor-padding-x
fix(coding-agent): propagate paddingX to custom editors
2026-01-24 20:48:41 +01:00
Mario Zechner
39b94ad7be
Merge pull request #930 from Perlence/fix/document-missing-hotkeys
docs(coding-agent): document missing hotkeys in README and /hotkeys
2026-01-24 20:48:22 +01:00
Armin Ronacher
48020405f3 Defer create .gitignore 2026-01-24 19:53:01 +01:00
Sviatoslav Abakumov
2bbc255237
fix(coding-agent): propagate paddingX to custom editors
setCustomEditorComponent() was not copying the paddingX setting from
the default editor to extension-provided editors. Also propagate live
changes from the settings callback.
2026-01-24 21:00:14 +04:00
Markus Ylisiurunen
085c378d34 add Azure deployment name map and refresh generated models 2026-01-24 12:04:34 +01:00
Markus Ylisiurunen
0789bcbab0 clarify Azure OpenAI env vars in docs 2026-01-24 12:04:34 +01:00
Markus Ylisiurunen
391c93800c switch azure responses to base url config and v1 api 2026-01-24 12:04:34 +01:00
Markus Ylisiurunen
856012296b add Azure OpenAI Responses provider with deployment-aware model mapping 2026-01-24 12:04:34 +01:00
Sviatoslav Abakumov
a8f1ff09e5
docs(coding-agent): use Alt+ instead of Option+ for consistency 2026-01-24 13:42:36 +04:00
Sviatoslav Abakumov
7b0244a5ed
docs(coding-agent): document missing hotkeys in README and /hotkeys
- Add Ctrl+L (Open model selector) to /hotkeys command
- Add Alt+Enter (Queue follow-up message) to keyboard shortcuts table
- Add PageUp/PageDown (Scroll by page) to all documentation sections
2026-01-24 13:33:49 +04:00
Mario Zechner
951fb953ed feat(coding-agent): support disable-model-invocation frontmatter for skills
When set to true, the skill is hidden from the system prompt, preventing
agentic invocation. Users can still invoke explicitly via /skill:name.

Also fixes pre-existing test bug where source expectation was wrong.

Fixes #927
2026-01-24 03:34:40 +01:00
Mario Zechner
3235926eed fix(coding-agent): off-by-one error in bash output 'earlier lines' count
fixes #921
2026-01-24 03:25:55 +01:00
Mario Zechner
48fc57f321 feat(coding-agent): expose copyToClipboard for extensions
fixes #926
2026-01-24 03:17:04 +01:00
Mario Zechner
3a57f1259b feat(coding-agent): surface extension shortcut conflicts 2026-01-24 03:17:04 +01:00
Mario Zechner
25bdfb0b8e
Merge pull request #925 from dannote/feat/update-changelog-link
feat(coding-agent): add changelog link to update notification
2026-01-24 02:58:06 +01:00