Commit graph

61 commits

Author SHA1 Message Date
Mario Zechner
1367a76ee8 Change getAllTools() to return ToolInfo[] instead of string[]
Breaking change: pi.getAllTools() now returns Array<{ name, description }>
instead of string[]. Extensions needing just names can use .map(t => t.name).

Removes redundant getToolInfo() method added in original PR.

Fixes #647
2026-01-12 17:18:43 +01:00
Mario Zechner
06bf2493a1 docs: add changelog and readme entry for notify.ts extension (#658) 2026-01-12 16:33:42 +01:00
Fero
424597d558
example: add desktop notification extension (OSC 777) (#658) 2026-01-12 16:33:03 +01:00
Mario Zechner
8ac130c729 Release v0.43.0 2026-01-12 00:59:39 +01:00
Mario Zechner
783aa0d6d0 Add changelog, update docs, fix handoff example for PR #642 2026-01-12 00:10:14 +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
Mario Zechner
a20c6efe17 feat(coding-agent): add model_select extension hook
Fires when the model changes via /model command, model cycling (Ctrl+P),
or session restore. Includes source field and previousModel.

Add model-status.ts example extension demonstrating status bar updates.

closes #628
2026-01-11 18:12:46 +01:00
Mario Zechner
31fe16f2e7 Release v0.42.5 2026-01-11 04:10:49 +01:00
Mario Zechner
345de59833 Release v0.42.4 2026-01-10 13:56:11 +01:00
Mario Zechner
2a04b0fb28 Release v0.42.3 2026-01-10 13:27:28 +01:00
Mario Zechner
0c02f5c053 Release v0.42.2 2026-01-10 01:42:46 +01:00
Mario Zechner
22b2a18952
Merge pull request #600 from nicobailon/feature/footer-data-provider
feat(coding-agent): add FooterDataProvider for git branch and extension statuses
2026-01-09 22:46:23 +01:00
Mario Zechner
d856bb097c Release v0.42.1 2026-01-09 20:24:10 +01:00
Nico Bailon
7b902612e9 feat(coding-agent): add FooterDataProvider for git branch and extension statuses
Expose data that extensions cannot otherwise access: git branch and
extension statuses from setStatus(). Token stats, model info, etc.
remain computable via ctx.sessionManager and ctx.model.
2026-01-09 07:39:30 -08:00
Mario Zechner
0752995424 Release v0.42.0 2026-01-09 06:59:26 +01:00
Mario Zechner
ec9def84ef Release v0.41.0 2026-01-09 06:06:54 +01:00
Mario Zechner
19b5663340 Revert "Remove Anthropic OAuth support"
This reverts commit f5e6bcac1b.
2026-01-09 06:00:20 +01:00
Mario Zechner
ebd661fe13 Release v0.40.1 2026-01-09 05:11:49 +01:00
Mario Zechner
f5e6bcac1b Remove Anthropic OAuth support 2026-01-09 05:10:33 +01:00
Mario Zechner
2e362fbfd2 Make mac-system-theme extension async to avoid blocking keyboard input 2026-01-09 00:49:31 +01:00
Mario Zechner
070ef9c771 Release v0.40.0 2026-01-09 00:43:32 +01:00
Mario Zechner
39bfbb125c Release v0.39.1 2026-01-09 00:33:39 +01:00
Mario Zechner
37378fb346 Fix setTheme not triggering rerender, improve mac-system-theme example 2026-01-09 00:32:41 +01:00
Mario Zechner
e5e944475d Poll macOS system theme every 2 seconds in mac-system-theme extension 2026-01-09 00:18:59 +01:00
Mario Zechner
c25f1eab64 Release v0.39.0 2026-01-09 00:10:00 +01:00
Mario Zechner
c5b97d7a2f feat(coding-agent): add interactive-shell.ts extension example
Demonstrates running interactive commands (vim, git rebase, htop, etc.)
with full terminal access using user_bash event and ctx.ui.custom().

- Auto-detects interactive commands from built-in list
- !i prefix to force interactive mode
- Configurable via INTERACTIVE_COMMANDS/INTERACTIVE_EXCLUDE env vars

closes #532
2026-01-09 00:08:52 +01:00
Mario Zechner
f9064c2f69 feat(tui): add overlay compositing for ctx.ui.custom() (#558)
Adds overlay rendering capability to the TUI, enabling floating modal
components that render on top of existing content without clearing the screen.

- Add showOverlay(), hideOverlay(), hasOverlay() methods to TUI
- Implement ANSI-aware line compositing via extractSegments()
- Support overlay stack (multiple overlays, later on top)
- Add { overlay: true } option to ctx.ui.custom()
- Add overlay-test.ts example extension

Also fixes pre-existing bug where bash tool output cached visual lines
at fixed terminal width, causing crashes on terminal resize.

Co-authored-by: Nico Bailon <nico.bailon@gmail.com>
2026-01-08 22:40:42 +01:00
Mario Zechner
121823c74d feat(coding-agent): add user_bash event and theme API extensions
- user_bash event for intercepting ! and !! commands (#528)
- Extensions can return { operations } or { result } to redirect/replace
- executeBashWithOperations() for custom BashOperations execution
- session.recordBashResult() for extensions handling bash themselves
- Theme API: getAllThemes(), getTheme(), setTheme() on ctx.ui
- mac-system-theme.ts example: sync with macOS dark/light mode
- Updated ssh.ts to use user_bash event
2026-01-08 21:50:56 +01:00
Mario Zechner
dc54c308a9 SSH extension: evaluate pwd on remote when no path given, use accent color for status 2026-01-08 20:37:56 +01:00
Mario Zechner
b0e5954cf8 feat(coding-agent): default ssh extension remote cwd to ~ 2026-01-08 20:27:09 +01:00
Mario Zechner
17cb328ca1 Allow extensions to modify system prompt in before_agent_start
- Add systemPrompt to BeforeAgentStartEvent so extensions can see current prompt
- Change systemPromptAppend to systemPrompt in BeforeAgentStartEventResult for full replacement
- Extensions can now chain modifications (each sees the result of previous)
- Update ssh.ts to replace local cwd with remote cwd in system prompt
- Update pirate.ts, claude-rules.ts, preset.ts to use new API

fixes #575
2026-01-08 19:54:34 +01:00
Mario Zechner
9ed88646a8 feat(coding-agent): add pluggable operations for remote tool execution
Adds optional operations parameter to create*Tool functions enabling
delegation to remote systems (SSH, containers, etc.):

- ReadOperations: readFile, access, detectImageMimeType
- WriteOperations: writeFile, mkdir
- EditOperations: readFile, writeFile, access
- BashOperations: exec (with streaming, signal, timeout)

Add ssh.ts example demonstrating --ssh flag for remote execution.
Built-in renderers used automatically for overrides without custom renderers.

fixes #564
2026-01-08 19:32:25 +01:00
Mario Zechner
550742ca98 docs(coding-agent): simplify tool-override example to use built-in renderer 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
4b084d0f9d Release v0.38.0 2026-01-08 04:52:55 +01:00
Mario Zechner
baf6fe4b39 fix(coding-agent): add PR attribution to ctx.shutdown() changelog, fix example comments 2026-01-08 03:31:55 +01:00
Kao Félix
6845c4b85e
feat(coding-agent): make ctx.shutdown() available for extensions (#542) 2026-01-08 03:30:48 +01:00
Mario Zechner
09471ebc7d feat(coding-agent): add ctx.ui.setEditorComponent() extension API
- Add setEditorComponent() to ctx.ui for custom editor components
- Add CustomEditor base class for extensions (handles app keybindings)
- Add keybindings parameter to ctx.ui.custom() factory (breaking change)
- Add modal-editor.ts example (vim-like modes)
- Add rainbow-editor.ts example (animated text highlighting)
- Update docs: extensions.md, tui.md Pattern 7
- Clean up terminal on TUI render errors
2026-01-07 16:11:49 +01:00
Nico Bailon
77477f6166 feat(coding-agent): add timeout option to extension dialogs with live countdown
Extension UI dialogs (select, confirm, input) now support a timeout option
that auto-dismisses with a live countdown display. Simpler alternative to
manually managing AbortSignal for timed dialogs.

Also adds ExtensionUIDialogOptions type export and updates RPC mode to
forward timeout to clients.
2026-01-06 21:49:27 -08:00
Mario Zechner
5514d4ffdb Release v0.37.8 2026-01-07 01:32:53 +01:00
Mario Zechner
a4f2bb5c27 Release v0.37.7 2026-01-07 01:01:55 +01:00
Mario Zechner
befbeb30e4 Release v0.37.6 2026-01-07 00:42:45 +01:00
Nico Bailon
9771fa1e44 Add AbortSignal support to extension UI dialogs
Closes #474
2026-01-06 15:01:15 -08:00
Mario Zechner
282273e156 Fix preset.ts example to use gpt-5.2-codex for plan mode 2026-01-06 23:29:20 +01:00
Mario Zechner
fe95983dcf Release v0.37.5 2026-01-06 23:25:12 +01:00
Mario Zechner
59d8b7948c Add ExtensionAPI methods, preset example, and TUI documentation improvements
- ExtensionAPI: setModel(), getThinkingLevel(), setThinkingLevel() methods
- New preset.ts example with plan/implement presets for model/thinking/tools switching
- Export all UI components from pi-coding-agent for extension use
- docs/tui.md: Common Patterns section with copy-paste code for SelectList, BorderedLoader, SettingsList, setStatus, setWidget, setFooter
- docs/tui.md: Key Rules section for extension UI development
- docs/extensions.md: Exhaustive example links for all ExtensionAPI methods and events
- System prompt now references docs/tui.md for TUI development

Fixes #509, relates to #347
2026-01-06 23:24:23 +01:00
Mario Zechner
7c99ea54bf Export truncation utilities for custom tools, add truncated-tool example
- Export truncateHead, truncateTail, truncateLine, formatSize, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES from package
- Add examples/extensions/truncated-tool.ts showing proper output truncation with custom rendering
- Document output truncation best practices in docs/extensions.md
2026-01-06 22:13:08 +01:00
Mario Zechner
b08a6b22ce Release v0.37.4 2026-01-06 21:28:24 +01:00
Tudor Oancea
f755f69e0a added custom header support and example extension 2026-01-06 21:20:19 +01:00
Mario Zechner
86fea6379c Release v0.37.3 2026-01-06 13:43:47 +01:00