Commit Graph
100 Commits
Author SHA1 Message Date
Mario Zechner 7e2a99b485 Add [Unreleased] section for next cycle 2026-01-04 01:08:11 +01:00
Mario Zechner faa10b9a7e Release v0.33.0 2026-01-04 01:07:24 +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 6af7c97154 Update tui README.md: replace isXxx() with matchesKey() and Key helper 2026-01-03 23:11:11 +01:00
Mario Zechner 22abf50d85 Update tui.md docs: replace isXxx() with matchesKey() and Key helper 2026-01-03 23:10:22 +01:00
Mario Zechner f49d2aac12 Use same header color for Available Tools as System Prompt 2026-01-03 23:05:32 +01:00
Mario Zechner f9838bb5d4 Show first 10 lines of system prompt with click to expand for full content 2026-01-03 23:04:23 +01:00
Mario Zechner f5e38c4007 Add click-to-expand for system prompt in HTML export 2026-01-03 23:02:30 +01:00
Mario Zechner f090ec214a Fix missing spacer between text and tool calls in HTML export 2026-01-03 23:00:35 +01:00
Mario Zechner e98524f1fc Fix missing spacer between text and tool calls in HTML export 2026-01-03 22:56:36 +01:00
Mario Zechner 9549ac4695 Remove DEVELOPMENT.md reference from README 2026-01-03 22:53:33 +01:00
Mario Zechner 1079cd404e Add breaking change note for key detection functions (#405) 2026-01-03 22:52:38 +01:00
Mario Zechner 242291e290 Add changelog entries for PRs #426 and #427 2026-01-03 22:51:44 +01:00
Mario Zechner f2b89d5ec5 Merge branch 'feat/ctrl-n-external-editor' - configurable keybindings (#405) 2026-01-03 22:51:12 +01:00
Mario Zechner b8814372af Add changelog and README docs for keybindings feature (#405) 2026-01-03 22:49:58 +01:00
Mario Zechner 1153a50c56 Update package-lock.json after npm upgrade 2026-01-03 17:23:44 +01:00
Mario Zechner 7aba5883f2 Add [Unreleased] section for next cycle 2026-01-03 17:09:58 +01:00
Mario Zechner db829e73f9 Release v0.32.3 2026-01-03 17:09:22 +01:00
Mario Zechner c9a85342ea Fix google-vertex models showing without auth configured 2026-01-03 17:09:02 +01:00
Mario Zechner 2348a485cb Add changelog entries for PRs #423 and #424 2026-01-03 17:00:16 +01:00
Mario Zechner 79c56475e0 Fix non-PNG images not displaying in Kitty protocol terminals
JPEG/GIF/WebP images were not rendering in terminals using the Kitty
graphics protocol (Kitty, Ghostty, WezTerm) because it requires PNG
format (f=100). Non-PNG images are now converted to PNG using sharp
before being sent to the terminal.
2026-01-03 16:58:57 +01:00
Mario Zechner 9ea483e813 Fix test: update expected error message for concurrent prompt 2026-01-03 16:41:01 +01:00
Mario Zechner 1e1912654f Remove Discord note from main README 2026-01-03 16:39:07 +01:00
Mario Zechner d39769192a Remove redundant pi header and Discord note from coding-agent README 2026-01-03 16:38:39 +01:00
Mario Zechner 1ce1f91f26 Add centered logo and badges to READMEs 2026-01-03 16:37:44 +01:00
Mario Zechner a8ff115184 Add Discord and build badges to READMEs 2026-01-03 16:31:11 +01:00
Mario Zechner aea2ced2b8 Add [Unreleased] section for next cycle 2026-01-03 16:08:48 +01:00
Mario Zechner 113713d380 Release v0.32.2 2026-01-03 16:08:14 +01:00
Mario Zechner 69a8ecd5b3 fix: slash command autocomplete triggers for . - _ prefixes
fixes #422
2026-01-03 15:44:36 +01:00
Mario Zechner e9cf3c1835 Fix slash commands and hook commands during streaming
- Hook commands now execute immediately during streaming (they manage their own LLM interaction via pi.sendMessage())
- File-based slash commands are expanded and queued via steer/followUp during streaming
- prompt() accepts new streamingBehavior option ('steer' or 'followUp') for explicit queueing during streaming
- steer() and followUp() now expand file-based slash commands and error on hook commands
- RPC prompt command accepts optional streamingBehavior field
- Updated docs: rpc.md, sdk.md, CHANGELOG.md

fixes #420
2026-01-03 15:36:54 +01:00
Mario Zechner 5f91baa29e Add [Unreleased] section for next cycle 2026-01-03 04:26:33 +01:00
Mario Zechner b783a3f50f Release v0.32.1 2026-01-03 04:25:57 +01:00
Mario Zechner a4653d48c8 Add changelog entry for edit tool diff fix 2026-01-03 04:24:57 +01:00
Mario Zechner 0f81b09625 Fix edit tool diff not showing in TUI
The async diff preview computation could race with tool execution,
causing editDiffPreview to contain an error (file already modified)
while the actual tool result had the correct diff in details.diff.

Fix: prioritize result.details.diff over editDiffPreview when the
tool has executed successfully. The preview is only used before
tool execution completes.
2026-01-03 04:23:59 +01:00
Mario Zechner 746ec9eb01 Add shell commands without context contribution (!! prefix)
Use !!command to execute bash commands that are shown in the TUI and
saved to session history but excluded from LLM context, compaction
summaries, and branch summaries.

- Add excludeFromContext field to BashExecutionMessage
- Filter excluded messages in convertToLlm()
- Parse !! prefix in interactive mode
- Use dim border color for excluded commands

fixes #414
2026-01-03 04:14:35 +01:00
Mario Zechner bc52509a42 Add [Unreleased] section for next cycle 2026-01-03 02:49:00 +01:00
Mario Zechner 42a19ea81d Release v0.32.0 2026-01-03 02:48:23 +01:00
Mario Zechner 8df22faedf fix(ai): ensure maxTokens > thinkingBudget for Claude thinking models
Claude requires max_tokens > thinking.budget_tokens. When caller specifies
a small maxTokens (e.g. compaction with ~13k tokens) and reasoning is enabled
with high budget (16k tokens), the constraint was violated.

Fix: In mapOptionsForApi, add thinkingBudget on top of caller's maxTokens
(capped at model.maxTokens). If still not enough room, reduce thinkingBudget
to leave space for output.

Applied to both anthropic-messages and google-gemini-cli APIs.

Also adds test utilities for OAuth credential resolution and tests for
compaction with thinking models.

fixes #413
2026-01-03 02:45:30 +01:00
Mario Zechner 97af788344 Show 'In-memory' instead of 'File: undefined' for --no-session mode 2026-01-03 02:01:30 +01:00
Mario Zechner 42b1e06ad1 feat(coding-agent): configurable double-escape action (tree vs branch)
Add doubleEscapeAction setting to choose whether double-escape with an
empty editor opens /tree (default) or /branch.

- Add setting to Settings interface and SettingsManager
- Add to /settings UI for easy toggling
- Update interactive-mode to respect the setting
- Document in README.md settings table

fixes #404
2026-01-03 01:59:08 +01:00
Mario Zechner 17b3a14bfa Fix slow /model selector by deferring OAuth token refresh
getAvailable() now uses hasAuth() which checks if auth is configured
without triggering OAuth token refresh. Refresh happens later when
the model is actually used.
2026-01-03 01:20:11 +01:00
Mario Zechner 1007dca564 Fix changelog entries for Vertex AI provider 2026-01-03 01:12:16 +01:00
Mario Zechner d747ec6e23 Enhance provider override to support baseUrl-only mode
Builds on #406 to support simpler proxy use case:
- Override just baseUrl to route built-in provider through proxy
- All built-in models preserved, no need to redefine them
- Full replacement still works when models array is provided
2026-01-03 01:06:08 +01:00
Mario Zechner 6186e497c5 Add word wrapping changelog entry to coding-agent 2026-01-03 00:49:46 +01:00
Mario Zechner 2b054cdb7c Merge PR #382: word wrapping in Editor component 2026-01-03 00:48:28 +01:00
Mario Zechner e1b0b37ba4 tui: wrap settings descriptions instead of truncating 2026-01-03 00:45:28 +01:00
Mario Zechner 28fb502719 Add image auto-resize toggle to settings, changelog for #402 2026-01-03 00:42:02 +01:00
Mario Zechner ce637f3ea4 Remove obsolete DEVELOPMENT.md 2026-01-03 00:39:15 +01:00
Mario Zechner c6f496441c AGENTS.md: read full Unreleased section before adding changelog entries 2026-01-03 00:38:39 +01:00
Mario Zechner 3b2d3baed2 Add changelog entries for #411 2026-01-03 00:31:03 +01:00
Mario Zechner eb3d70c749 Add changelog entries for #411 2026-01-03 00:29:24 +01:00
Mario Zechner 93498737c0 feat: split queue API into steer() and followUp() (#403) 2026-01-03 00:25:07 +01:00
Mario Zechner 9f2e6ac5eb docs: update README.md, hooks.md, and CHANGELOG for steer()/followUp() API
- Fix settings-selector descriptions to explain one-at-a-time vs all
- Update README.md message queuing section, settings example, and table
- Update hooks.md: hasPendingMessages, sendMessage options, triggerTurn example
- Add Theme/ThemeColor export and hasPendingMessages rename to CHANGELOG
2026-01-03 00:19:07 +01:00
Mario Zechner 8c227052d3 fix(coding-agent): export Theme and ThemeColor for hooks to use proper types 2026-01-03 00:13:26 +01:00
Mario Zechner 65d3081d80 fix(coding-agent): fix Theme type cast in todo hook example 2026-01-03 00:13:26 +01:00
Mario Zechner 9d8230dfc6 feat(coding-agent): expose deliverAs option in hook sendMessage() API
- pi.sendMessage(msg, options?) now accepts { triggerTurn?, deliverAs? }
- deliverAs: 'steer' (default) or 'followUp' controls delivery timing
- Update all mode handlers to pass options through
- Update file-trigger example to use new API
- Update CHANGELOG
2026-01-03 00:13:26 +01:00
Mario Zechner d404f8fcfa docs: update CHANGELOGs for steer()/followUp() API changes
Refs #403
2026-01-03 00:13:26 +01:00
Mario Zechner 3ae02a6849 feat(coding-agent): complete steer()/followUp() migration
- Update settings-manager with steeringMode/followUpMode (migrates old queueMode)
- Update sdk.ts to use new mode options
- Update settings-selector UI to show both modes
- Add Alt+Enter keybind for follow-up messages
- Update RPC API: steer/follow_up commands, set_steering_mode/set_follow_up_mode
- Update rpc-client with new methods
- Delete dead code: queue-mode-selector.ts
- Update tests for new API
- Update mom/context.ts stubs
- Update web-ui example
2026-01-03 00:13:25 +01:00
Mario Zechner 58c423ba36 feat(coding-agent): update AgentSession for steer()/followUp() API
- Rename queueMessage to steer(), add followUp()
- Split _pendingMessages into _steeringMessages and _followUpMessages
- Update sendHookMessage to accept deliverAs option
- Rename hasQueuedMessages to hasPendingMessages
- Rename queuedMessageCount to pendingMessageCount
- Update clearQueue() return type to { steering, followUp }
- Update UI to show steering vs follow-up messages differently

WIP: settings-manager, sdk, interactive-mode, rpc-mode still need updates
2026-01-03 00:13:25 +01:00
Mario Zechner a980998464 Revert /todos to custom TUI component 2026-01-03 00:13:25 +01:00
Mario Zechner cc7823eb45 Change /todos to open in external editor instead of custom TUI 2026-01-03 00:13:25 +01:00
Mario Zechner 74dc5e7c49 Add todo hook companion to todo custom tool
- /todos command displays all todos on current branch with custom UI
- Update hooks.md to clarify components must not be wrapped in Box/Container
- Cross-reference tool and hook in example READMEs
2026-01-03 00:13:25 +01:00
Mario Zechner a3772d2fd7 test(agent): update tests for steer()/followUp() API, update AGENTS.md 2026-01-03 00:13:25 +01:00
Mario Zechner 1625d127c7 Add CHANGELOG entry for #400 2026-01-03 00:13:25 +01:00
Mario Zechner d0a4c37028 feat(agent): split queue into steer() and followUp() APIs
Breaking change: replaces queueMessage() with two separate methods:
- steer(msg): interrupt mid-run, delivered after current tool execution
- followUp(msg): wait until agent finishes before delivery

Also renames:
- queueMode -> steeringMode/followUpMode
- getQueuedMessages -> getSteeringMessages/getFollowUpMessages

Refs #403
2026-01-03 00:13:25 +01:00
Mario Zechner 1e7d991a25 Add changelog entry for terminal title feature (#407) 2026-01-02 22:02:24 +01:00
Mario Zechner 5ef3cc90d1 Add guard against concurrent prompt() calls
Agent.prompt() and Agent.continue() now throw if called while already
streaming, preventing race conditions and corrupted state. Use
queueMessage() to queue messages during streaming, or await the
previous call.

AgentSession.prompt() has the same guard with a message directing
users to queueMessage().

Ref #403
2026-01-02 22:02:24 +01:00
Mario Zechner fd35d9188c fix(ai): add retry with server-provided delay for Gemini CLI rate limits, fixes #370 2026-01-02 10:45:59 +01:00
Mario Zechner 0d1424d8e5 Add [Unreleased] section for next cycle 2026-01-02 10:39:42 +01:00
Mario Zechner d78a245cc8 Release v0.31.1 2026-01-02 10:39:08 +01:00
Mario Zechner c10d99d2de fix: export type guard functions at runtime, fixes #397 2026-01-02 10:37:28 +01:00
Mario Zechner e76ad7aebe Add [Unreleased] section for next cycle 2026-01-02 02:00:36 +01:00
Mario Zechner 3caf359402 Release v0.31.0 2026-01-02 01:59:59 +01:00
Mario Zechner d9adf659ca Fix edit tool failing on files with UTF-8 BOM
Strip BOM before matching (LLM won't include invisible BOM in oldText),
restore on write.

Based on #394 by @prathamdby
2026-01-02 01:57:24 +01:00
Mario Zechner 02175d908b Update docs for ctx.ui.editor() and handoff example
- Added ctx.ui.editor() to hooks.md and custom-tools.md
- Added ctx.ui.editor() to CHANGELOG.md
- Added handoff.ts to examples/hooks/README.md
2026-01-02 01:26:21 +01:00
Mario Zechner af4c66117b Fix BorderedLoader to pass theme to DynamicBorder
BorderedLoader receives theme as a parameter but was creating
DynamicBorder() without passing it, causing DynamicBorder to
fall back to the global theme variable which is undefined when
loaded via jiti (separate module cache).

Added doc comment to DynamicBorder explaining the jiti issue.
2026-01-02 01:21:07 +01:00
Mario Zechner 3ad5a168e7 Fix DynamicBorder crash when theme not initialized
Make DynamicBorder defensive against undefined theme by checking
at render time instead of relying on default parameter closure.
2026-01-02 01:15:45 +01:00
Mario Zechner d51770a63d fix(coding-agent): prevent full re-renders during write tool streaming
Move line count from header to footer to avoid changing the first line
during streaming, which was triggering full screen re-renders in the
TUI's differential rendering logic.
2026-01-02 01:11:06 +01:00
Mario Zechner 91c52de8be Use serializeConversation in handoff hook
Properly handles all message types including tool calls, thinking,
and tool results instead of manual text extraction.
2026-01-02 00:45:03 +01:00
Mario Zechner ace0063a00 Add handoff example hook
Transfers context to a new focused session instead of compacting.
User provides a goal, hook generates a prompt with relevant context,
creates a new session with parent tracking, and loads the prompt
as a draft in the editor for review.

Inspired by Amp's handoff feature.
2026-01-02 00:42:11 +01:00
Mario Zechner 5c37fe27c6 Remove unnecessary comments from types 2026-01-02 00:39:54 +01:00
Mario Zechner a433e524a0 Add Clawd summary comments to hook and custom tool types 2026-01-02 00:32:38 +01:00
Mario Zechner 03159d2f4b Add agent state methods to CustomToolContext and fix abort signature
CustomToolContext now has:
- isIdle() - check if agent is streaming
- hasQueuedMessages() - check if user has queued messages
- abort() - abort current operation (fire-and-forget)

Changed abort() signature from Promise<void> to void in both
HookContext and CustomToolContext. The abort is fire-and-forget:
it calls session.abort() without awaiting, so the abort signal
is set immediately while waitForIdle() runs in the background.

Fixes #388
2026-01-02 00:31:23 +01:00
Mario Zechner 0d9fddec1e Split HookContext and HookCommandContext to prevent deadlocks
HookContext (all events):
- isIdle() - read-only state check
- hasQueuedMessages() - read-only state check
- abort() - fire-and-forget, does not wait

HookCommandContext (slash commands only):
- waitForIdle() - waits for agent to finish
- newSession(options?) - create new session
- branch(entryId) - branch from entry
- navigateTree(targetId, options?) - navigate session tree

Session control methods moved from HookAPI (pi.*) to HookCommandContext (ctx.*)
because they can deadlock when called from event handlers that run inside
the agent loop (tool_call, tool_result, context events).
2026-01-02 00:24:58 +01:00
Mario Zechner ccdd7bd283 Add session management and agent state methods to hooks API
HookAPI additions:
- pi.newSession(options?) - create new session with optional setup callback
- pi.branch(entryId) - branch from a specific entry
- pi.navigateTree(targetId, options?) - navigate the session tree

HookContext additions:
- ctx.isIdle() - check if agent is streaming
- ctx.waitForIdle() - wait for agent to finish
- ctx.abort() - abort current operation
- ctx.hasQueuedMessages() - check for queued user messages

These enable hooks to programmatically manage sessions (handoff, templates)
and check agent state before showing interactive UI.

Fixes #388
2026-01-01 23:56:24 +01:00
Mario Zechner 484d7e06bb Consolidate session events: remove session_before_new/session_new, add reason field to switch events
- Remove session_before_new and session_new hook events
- Add reason: 'new' | 'resume' to session_before_switch and session_switch events
- Remove 'new' reason from custom tool onSession (use 'switch' for both /new and /resume)
- Rename reset() to newSession(options?) in AgentSession
- Add NewSessionOptions with optional parentSession for lineage tracking
- Rename branchedFrom to parentSession in SessionHeader
- Rename RPC reset command to new_session with optional parentSession
- Update example hooks to use new event structure
- Update documentation and changelog

Based on discussion in #293
2026-01-01 23:31:26 +01:00
Mario Zechner 1d9fa13d58 Fix crash on Unicode format characters in visibleWidth
Strip all Unicode format characters (category Cf) before passing to
string-width. These are invisible control characters that crash
string-width but have no visible width anyway.

Closes #390
2026-01-01 22:33:09 +01:00
Mario Zechner 7f0cd8bcb5 Remove extra spacer before loader in BorderedLoader 2026-01-01 22:30:19 +01:00
Mario Zechner e9cf47d09d Add CHANGELOG entries for export theme colors and syntax highlighting 2026-01-01 22:28:44 +01:00
Mario Zechner 6267720660 Add theme-configurable HTML export colors (from PR #387)
- Add optional 'export' section to theme JSON with pageBg, cardBg, infoBg
- If not specified, colors are auto-derived from userMessageBg
- Add export colors to dark.json and light.json
- Update theme-schema.json and TypeBox schema
- Add documentation to docs/theme.md
- Add margin-top back to tool-output for spacing between header and content
2026-01-01 22:21:40 +01:00
Mario Zechner d612bc45f5 Fix markdown code block default color to use --text not --mdCodeBlock
The mdCodeBlock color was being applied to all text in code blocks,
overriding hljs syntax highlighting for unspanned text.
2026-01-01 22:15:26 +01:00
Mario Zechner 28434ce3a6 Fix hljs v11 compound class selectors for functions/types 2026-01-01 22:07:04 +01:00
Mario Zechner ecfedce25f Fix hljs color mappings to match TUI theme
- Add .hljs-function for syntaxFunction
- Separate .hljs-punctuation to use syntaxPunctuation (was using syntaxOperator)
2026-01-01 22:04:38 +01:00
Mario Zechner 0b31884385 Fix HTML escaping in markdown code blocks
Move HTML tag escaping from pre-parse to custom renderers.
This preserves < in code blocks while still escaping in text content.
2026-01-01 22:03:01 +01:00
Mario Zechner dccdf91b8c Add ctx.ui.theme getter for styling status text with theme colors
- Add theme property to HookUIContext interface
- Implement in interactive, RPC, and no-op contexts
- Add status-line.ts example hook
- Document styling with theme colors in hooks.md
2026-01-01 21:58:01 +01:00
Mario Zechner 48ca55ab3c Remove test files, add out.html to gitignore 2026-01-01 21:50:32 +01:00
Mario Zechner 872205406e Remove padding from markdown code blocks 2026-01-01 21:50:23 +01:00
Mario Zechner a9492837e8 Remove accidentally committed files 2026-01-01 21:42:28 +01:00
Mario Zechner 0ec8509de3 Fix markdown code block syntax highlighting
Marked v15 removed the highlight option from setOptions.
Use marked.use() with a custom renderer instead.
2026-01-01 21:42:18 +01:00