Commit graph

1874 commits

Author SHA1 Message Date
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
307f9b4169 Add [Unreleased] section for next cycle 2026-01-09 00:10:41 +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
ef7c52ffa1 chore: fix template literal lint, update AGENTS.md to require fixing all check output 2026-01-08 23:44:26 +01:00
Mario Zechner
2dfc13e455 chore: format 2026-01-08 23:41:58 +01:00
Mario Zechner
a9ab7be92f chore(coding-agent): update shx to 0.4.0 to fix deprecated glob/inflight warnings 2026-01-08 23:41:58 +01:00
Mario Zechner
af2d8509e6 Fix --no-skills flag not preventing skills from loading
The --no-skills flag set options.skills = [] in main.ts, but the
interactive mode UI would rediscover skills anyway because it called
loadSkills() directly instead of using the already-loaded skills.

Changes:
- Add AgentSession.skills and AgentSession.skillWarnings properties
- discoverSkills() now returns { skills, warnings } instead of Skill[]
- Interactive mode uses session.skills instead of calling loadSkills()
- Update SDK docs and examples for new return type

Fixes #577
2026-01-08 23:41:54 +01:00
Carlos Villela
c865ec1d19
fix(coding-agent): --no-skills flag not preventing skills from loading (#577)
The --no-skills flag set options.skills = [] in main.ts, but the interactive mode UI would rediscover skills anyway because it called loadSkills() directly.

Changes:
- Add AgentSession.skills and AgentSession.skillWarnings properties  
- discoverSkills() now returns { skills, warnings } instead of Skill[]
- Interactive mode uses session.skills instead of calling loadSkills()

Co-authored-by: Carlos Villela <cv@lixo.org>
2026-01-08 23:40:05 +01:00
Mario Zechner
ec1ee7ddc6 docs: add overlay documentation, mark as experimental 2026-01-08 22:44:12 +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
16e142ef7d fix(ai): remove <thinking> tag wrapping, convert to plain text on cross-model handoff
- Remove <thinking> tag generation from google-shared.ts, transorm-messages.ts, openai-completions.ts
- Thinking blocks now convert to plain text when switching models (prevents models mimicking tags)
- Skip empty thinking blocks to avoid API errors
- Keep thinking blocks only when same provider AND same model

fixes #561
2026-01-08 21:19:16 +01:00
Mario Zechner
8fda948866 fix(coding-agent): string systemPrompt now works as full replacement
When passing a string systemPrompt to createAgentSession(), it is now
used as-is without appending context files and skills. This matches the
documented behavior: 'String replaces default, function receives default
and returns final.'

Previously, string systemPrompt would have context files and skills
appended, causing duplication if they were already in the string.

fixes #543
2026-01-08 20:47:52 +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
aa89080ea0 fix(ai): add bridge prompt to override Antigravity behavior with Pi defaults 2026-01-08 20:20:24 +01:00
Mario Zechner
aa91864715 chore: add changelog for #571, init theme with watcher in interactive mode 2026-01-08 20:10:39 +01:00
Mario Zechner
31f155d7db
Merge pull request #571 from ben-vargas/fix-antigravity-patch
fix(ai): align antigravity request payload
2026-01-08 20:00:40 +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
0774db2e5a feat: add wayland clipboard support for /copy command
- Use wl-copy for Wayland sessions with xclip/xsel fallback
- Reuse isWaylandSession() from clipboard-image.ts for consistent detection
- Handle spawn stdin errors gracefully

Closes #570

Co-authored-by: Ogulcan Celik <ogulcancelik@gmail.com>
2026-01-08 19:38:35 +01:00
Ogulcan Celik
a174578673 feat: add wayland clipboard support 2026-01-08 19:38:30 +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
ba46a52415 docs: add changelog entries for #568 2026-01-08 18:54:21 +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
bbf0d92e8c feat(coding-agent): use built-in renderers for tool overrides without custom renderers
When overriding a built-in tool (read, bash, edit, write, grep, find, ls)
without providing renderCall/renderResult, the built-in renderer is now
used automatically. This allows wrapping built-in tools for logging or
access control without reimplementing the UI (syntax highlighting, diffs, etc.).
2026-01-08 18:52:33 +01:00
Mario Zechner
66cbcee347 docs(coding-agent): simplify --no-tools description 2026-01-08 18:52:33 +01:00
Mario Zechner
4a6c32c142 docs(coding-agent): clarify tool override doesn't require --no-tools 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
7a2c19cdf0
Merge pull request #568 from tmustier/gemini-raw-stream
fix: restore ESC interrupt after auto-retry and correct retry abort messaging
2026-01-08 18:50:47 +01:00
Ben Vargas
74476be61d fix(ai): align antigravity request payload 2026-01-08 10:00:44 -07:00
Mario Zechner
2d4fa997bc
Merge pull request #567 from ferologics/feat/bun-update-notification
fix(coding-agent): show release URL for bun binary updates
2026-01-08 14:51:29 +01:00
ferologics
9073111cb0 fix(coding-agent): show release URL for bun binary updates
For bun binary installs, show 'Download from: <releases URL>' instead of 'npm install -g' since npm doesn't apply to standalone binaries.
2026-01-08 14:50:50 +01:00
Thomas Mustier
01f15fcbd2 fix: show retry attempt count when aborting during retry
When aborting a retry attempt, surface the retry-aware abort message
in the assistant output and tool results instead of a generic "Aborted".

- Set errorMessage for aborted streaming messages
- Render abort message without forcing a leading newline when no content
2026-01-08 12:36:46 +00:00
Thomas Mustier
a65da1c14b fix: ESC key not interrupting during Working... state
Three related fixes:

1. google-gemini-cli: Handle abort signal in stream reading loop
   - Add abort event listener to cancel reader immediately when signal fires
   - Fix AbortError detection in retry catch block (fetch throws AbortError,
     not our custom message)
   - Swallow reader.cancel() rejection to avoid unhandled promise

2. agent-session: Fix retry attempt counter showing 0 on cancel
   - abortRetry() was resetting _retryAttempt before the catch block could
     read it for the error message

3. interactive-mode: Restore main escape handler on agent_start
   - When auto-retry starts, onEscape is replaced with retry-specific handler
   - auto_retry_end (which restores it) fires on turn_end, after streaming begins
   - Now restore immediately on agent_start if retry handler is still active

Amended: suppress reader.cancel() rejection on abort.
2026-01-08 12:35:34 +00:00
Mario Zechner
7f38dbfba9
Merge pull request #557 from cv/feat/no-tools-flag
feat(coding-agent): add --no-tools flag to disable built-in tools
2026-01-08 12:52:42 +01:00
Mario Zechner
6c3f82a696 fix(ci): update clipboard bindings to @mariozechner/clipboard fork
fixes #556
2026-01-08 12:21:26 +01:00
Carlos Villela
8f5523ed56
feat(coding-agent): add --no-tools flag to disable built-in tools
Add --no-tools flag that allows starting pi without any built-in tools,
enabling extension-only tool setups (e.g., pi-ssh-remote).

- Add --no-tools flag to CLI args parsing
- Handle --tools '' (empty string) as equivalent to no tools
- Fix system prompt to not show READ-ONLY mode when no tools (extensions may provide write capabilities)
- Add tests for new flag and system prompt behavior

fixes #555
2026-01-07 23:10:58 -08:00
Mario Zechner
cfa63c255d Add [Unreleased] section for next cycle 2026-01-08 04:53:51 +01:00
Mario Zechner
4b084d0f9d Release v0.38.0 2026-01-08 04:52:55 +01:00
Mario Zechner
bf9a415541 Switch to @mariozechner/clipboard fork with musl support
fixes #533
2026-01-08 04:50:37 +01:00
Mario Zechner
b1fb910625 refactor(coding-agent): unify tool and event handler context creation
Tools now use ExtensionRunner.createContext() instead of a separate
inline context factory. This ensures tools and event handlers share
the same context, fixing ctx.shutdown() and other context methods.

- Made ExtensionRunner.createContext() public
- Changed wrapRegisteredTools to accept ExtensionRunner instead of getContext callback
- Create ExtensionRunner when SDK custom tools are present (not just extensions)
- Removed redundant inline context factory from sdk.ts
2026-01-08 03:45:39 +01:00
Mario Zechner
cf0466d96c fix(coding-agent): make ctx.shutdown() work from extension tools
The tool execution context was created with a no-op shutdown handler.
Now it delegates to ExtensionRunner.shutdown() which uses the handler
set by the mode via initialize().
2026-01-08 03:40:09 +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
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
0b680c67fb docs(coding-agent): add overflow changelog entry 2026-01-08 03:19:00 +01:00
Mario Zechner
6bcce1914a Merge branch 'codex-error-details-clean' 2026-01-08 03:17:33 +01:00