Commit Graph
100 Commits
Author SHA1 Message Date
Mario Zechner a236e62025 Add [Unreleased] section for next cycle 2026-01-06 13:44:28 +01:00
Mario Zechner 86fea6379c Release v0.37.3 2026-01-06 13:43:47 +01:00
Mario Zechner 7210086677 Extensions: add pi.sendUserMessage() for sending user messages
Adds sendUserMessage() to the extension API, allowing extensions to send
actual user messages (role: user) rather than custom messages. Unlike
sendMessage(), this always triggers a turn and behaves as if the user
typed the message.

- Add SendUserMessageHandler type and sendUserMessage() to ExtensionAPI
- Wire handler through loader, runner, and all modes
- Implement via prompt() with expandPromptTemplates: false
- Add send-user-message.ts example with /ask, /steer, /followup commands
- Document in extensions.md

fixes #483
2026-01-06 13:40:24 +01:00
Mario Zechner f023af0dab Add ctx.ui.setFooter() for extensions to replace footer component
Extensions can now replace the built-in footer with a custom component:
- setFooter(factory) replaces with custom component
- setFooter(undefined) restores built-in footer

Includes example extension demonstrating context usage display.

Closes #481
2026-01-06 12:39:45 +01:00
Mario Zechner 2bc445498a fix: install cross-platform native bindings for bun cross-compilation
fixes #485
2026-01-06 12:19:24 +01:00
Mario Zechner 90e0b95c81 Merge branch 'fix/image-paste-in-wayland'
# Conflicts:
#	packages/coding-agent/CHANGELOG.md
2026-01-06 12:12:17 +01:00
Mario Zechner df5ad091b3 docs: add blockImages setting to README 2026-01-06 12:01:16 +01:00
Mario Zechner a1d0b1c151 Merge PR #492: Add blockImages setting
- Setting controls filtering at convertToLlm layer
- Images are always stored in session, filtered dynamically based on current setting
- Toggle mid-session works: LLM sees/doesn't see images already in session
- Fixed SettingsManager.save() to handle inMemory mode for all setters

Closes #492
2026-01-06 12:00:15 +01:00
Mario Zechner 1fc2a912d4 Add blockImages setting to prevent images from being sent to LLM providers
- Setting controls filtering at convertToLlm layer (defense-in-depth)
- Images are always stored in session, filtered dynamically based on current setting
- Toggle mid-session works: LLM sees/doesn't see images already in session
- Fixed SettingsManager.save() to handle inMemory mode for all setters

Closes #492
2026-01-06 11:59:09 +01:00
Mario Zechner 0761356684 Merge branch 'worktree-statusbar'
# Conflicts:
#	packages/coding-agent/CHANGELOG.md
2026-01-06 11:13:44 +01:00
Mario Zechner edb0da9611 feat(ai,agent,coding-agent): add sessionId for provider session-based caching
- Add sessionId to StreamOptions for providers that support session-based caching
- OpenAI Codex provider uses sessionId for prompt_cache_key and routing headers
- Agent class now accepts and forwards sessionId to stream functions
- coding-agent passes session ID from SessionManager and updates on session changes
- Update ai package README with table of contents, OpenAI Codex OAuth docs, and env vars table
- Increase Codex instructions cache TTL from 15 minutes to 24 hours
- Add tests for sessionId forwarding in ai and agent packages
2026-01-06 11:08:42 +01:00
Mario Zechner 858c6bae8a refactor(ai): streamline codex prompt handling 2026-01-06 10:27:51 +01:00
Mario Zechner b04ce9fe95 Add minimatch dependency to coding-agent 2026-01-06 09:29:05 +01:00
Mario Zechner 9063a71fe6 Add [Unreleased] section for next cycle 2026-01-06 00:54:00 +01:00
Mario Zechner 6f4d16d76f Release v0.37.2 2026-01-06 00:53:18 +01:00
Mario Zechner aad93a1ec8 docs: add changelog entry for #484 2026-01-06 00:51:17 +01:00
Mario Zechner cfa2ba544f docs: add changelog entry for #479 2026-01-06 00:48:32 +01:00
Mario Zechner c6aa0407e7 docs: add changelog entry for share deep link fix 2026-01-06 00:43:25 +01:00
Mario Zechner 58a77f3b70 docs: update changelog for #480 2026-01-06 00:42:51 +01:00
Mario Zechner 1922db81a2 fix: inject URL params for share links in iframe context 2026-01-06 00:37:45 +01:00
Mario Zechner 2da853e9d6 Add [Unreleased] section for next cycle 2026-01-06 00:32:56 +01:00
Mario Zechner a20112f45f Release v0.37.1 2026-01-06 00:32:09 +01:00
Mario Zechner 0b39e21f30 docs: add changelog entry for share link fix 2026-01-06 00:31:13 +01:00
Mario Zechner 8b963f833a fix: copy link in shared sessions uses correct URL instead of about:srcdoc 2026-01-06 00:22:32 +01:00
Mario Zechner 0c712659b3 Add [Unreleased] section for next cycle 2026-01-06 00:07:57 +01:00
Mario Zechner d3d53392e8 Release v0.37.0 2026-01-06 00:07:15 +01:00
Mario Zechner b85cb53dfb chore: update generated models from OpenRouter 2026-01-06 00:06:56 +01:00
Mario Zechner e824b6dfa4 fix: add missing scripts to pi-extension-with-deps example 2026-01-06 00:06:41 +01:00
Mario Zechner 38eb4f7aa6 docs: add changelog entry for #477 2026-01-06 00:00:54 +01:00
Mario ZechnerandThomas Mustier e182b123a9 feat(coding-agent): queue compaction submissions, closes #475
Messages submitted during compaction are queued and delivered after
compaction completes, preserving steer vs follow-up behavior. Extension
commands execute immediately during compaction.

Co-authored-by: Thomas Mustier <tmustier@users.noreply.github.com>
2026-01-05 23:47:40 +01:00
Mario Zechner 4d87196801 fix(tui): remove alt+enter from newLine default keybinding
alt+enter is used by coding-agent for follow-up messages.
Having it also mapped to newLine caused a conflict.
2026-01-05 23:17:34 +01:00
Mario Zechner 9c17af9367 fix(coding-agent): use shx for cross-platform build scripts
Windows npm runs scripts through cmd.exe even from Git Bash.
Use shx to wrap Unix commands (mkdir -p, cp, rm -rf, chmod).
2026-01-05 22:56:22 +01:00
Mario Zechner c5d54a8413 feat(tui): query Kitty keyboard protocol support before enabling
- Query terminal with CSI ? u before enabling Kitty protocol
- Only enable protocol if terminal responds (100ms timeout)
- Mode-aware key parsing: when Kitty active, interpret legacy
  sequences as custom terminal mappings (e.g. \x1b\r = shift+enter)
- Add Terminal Setup section to README with Ghostty/wezterm config

fixes #439
2026-01-05 22:52:13 +01:00
Mario Zechner 0b9e3ada0c fix: clean up Codex thinking level handling
- Remove per-thinking-level model variants (gpt-5.2-codex-high, etc.)
- Remove thinkingLevels from Model type
- Provider clamps reasoning effort internally
- Omit reasoning field when thinking is off

fixes #472
2026-01-05 21:58:26 +01:00
Mario Zechner 22870ae0c2 chore: remove deprecation comment from getToolsDir, add changelog entry for #470 2026-01-05 20:26:48 +01:00
Mario Zechner 168d114750 Add changelog entries for headless OAuth and truecolor detection 2026-01-05 20:16:59 +01:00
Mario Zechner b4fb6770e4 Assume truecolor for most terminals (fixes SSH color detection)
Only fall back to 256color for truly limited terminals (dumb, empty, linux).
Virtually all modern terminals support truecolor, no need to be conservative.
2026-01-05 20:11:10 +01:00
Mario Zechner 9c87eeb805 Fix Anthropic login not showing URL (showPrompt should not clear content) 2026-01-05 20:03:07 +01:00
Mario Zechner 9b12719ab1 Improve OAuth login UI with consistent dialog component
- Add LoginDialogComponent with proper borders (top/bottom DynamicBorder)
- Refactor all OAuth providers to use racing approach (browser callback vs manual paste)
- Add onEscape handler to Input component for cancellation
- Add abortable sleep for GitHub Copilot polling (instant cancel on Escape)
- Show OS-specific click hint (Cmd+click on macOS, Ctrl+click elsewhere)
- Clear content between login phases (fixes GitHub Copilot two-phase flow)
- Use InteractiveMode's showStatus/showError for result messages
- Reorder providers: Anthropic, ChatGPT, GitHub Copilot, Gemini CLI, Antigravity
2026-01-05 19:58:44 +01:00
Mario Zechner 817221b79f fix(tui): trim trailing whitespace in wrapped lines to prevent width overflow
fixes #457
2026-01-05 18:16:54 +01:00
Mario Zechner 60ec863354 Merge branch 'pr-457-wrap-whitespace' 2026-01-05 18:16:39 +01:00
Mario Zechner 7919c40907 docs: remove CLI-specific --extension mention from SDK example 2026-01-05 18:03:41 +01:00
Mario Zechnerandmelihmucuk 010b337ad2 fix(coding-agent): load extensions from settings.json (#463)
Extensions defined in settings.json were being ignored because SettingsManager was created after the extension loading step.

The fix moves SettingsManager.create() before discoverAndLoadExtensions() and merges settings extensions with CLI --extension args. CLI args take precedence (appended after settings).

Also clarifies SDK documentation about extension discovery behavior.

Co-authored-by: melihmucuk <melih@mucuk.co>
2026-01-05 18:00:58 +01:00
Mario Zechner 3129e2ac10 docs: clarify SDK extension discovery and settings.json support 2026-01-05 18:00:32 +01:00
Mario Zechner 4a7e8672af Merge main into fix/settings-extensions-loading, resolve CHANGELOG conflict 2026-01-05 17:58:13 +01:00
Mario Zechner 7e2ebdd78e fix: mark with-deps example as private, update changelog 2026-01-05 17:55:15 +01:00
Mario Zechner 74d5f5523e Add [Unreleased] section for next cycle 2026-01-05 06:17:05 +01:00
Mario Zechner 435cd5d61f Release v0.36.0 2026-01-05 06:16:25 +01:00
Mario Zechner 467670024c docs: mark Codex experimental 2026-01-05 06:15:11 +01:00
Mario Zechner bb50738f7e fix(ai): append system prompt to codex bridge message instead of converting to input
Previously the system prompt was converted to an input message in convertMessages,
then stripped out by filterPiSystemPrompts. Now the system prompt is passed directly
to transformRequestBody and appended after CODEX_PI_BRIDGE in the bridge message.
2026-01-05 06:03:07 +01:00
Mario Zechner 9a147559c0 Merge branch 'openai-codex' 2026-01-05 05:33:48 +01:00
Mario Zechner eede2e1644 Merge origin/main into feature/detect-vertex-ai 2026-01-05 04:35:17 +01:00
Mario Zechner 168bfe618e Remove debug console.log from with-deps example 2026-01-05 03:57:30 +01:00
Mario Zechner 32f032b6d1 Add [Unreleased] section for next cycle 2026-01-05 03:42:07 +01:00
Mario Zechner 78d0b88f7d Release v0.35.0 2026-01-05 03:41:24 +01:00
Mario Zechner 79cb8f0906 Add extensions option to createAgentSession SDK
- Accept ExtensionFactory[] for inline extensions (merged with discovery)
- Mark preloadedExtensions as @internal (CLI implementation detail)
- Update sdk.md with inline extension example
- Update CHANGELOG
2026-01-05 03:38:56 +01:00
Mario Zechner 8da793b1ba Add customTools option back to createAgentSession SDK
- Accepts ToolDefinition[] directly (simplified from old { path?, tool } format)
- Tools are combined with extension-registered tools
- Updated sdk.md documentation
- Updated CHANGELOG
2026-01-05 03:34:36 +01:00
Mario Zechner 6bd5e419a6 Improve Custom Components docs: explain editor replacement, simplify example 2026-01-05 03:09:02 +01:00
Mario Zechner a5741df69a Document setWidget Component support 2026-01-05 03:07:11 +01:00
Mario Zechner 0919ec5417 Add Custom UI section, update CHANGELOG migration docs
- Add ## Custom UI section consolidating dialogs, widgets, custom components, message rendering, theme colors
- Simplify ctx.ui and pi.registerMessageRenderer in other sections to reference Custom UI
- Update CHANGELOG to reflect auto-migration of commands/ to prompts/
2026-01-05 03:06:39 +01:00
Mario Zechner 0e41b9c2a2 Restructure extensions.md: add Custom Tools section, improve sendMessage docs
- Add ## Custom Tools section with Tool Definition, Multiple Tools, Custom Rendering
- Expand pi.sendMessage docs with deliverAs mode explanations
- Add Extension Styles subsection (single file, dir, package.json)
- Expand ExtensionCommandContext with waitForIdle, newSession, branch, navigateTree
- Replace lodash with zod in examples
- Various fixes and reorganization
2026-01-05 03:04:19 +01:00
Mario Zechner e4f8215f97 Add table of contents to extensions.md 2026-01-05 02:51:45 +01:00
Mario Zechner 3e38fce541 Show UI context methods in extension quick start example 2026-01-05 02:49:52 +01:00
Mario Zechner 08f9622e99 Update CHANGELOG with npm deployment note 2026-01-05 02:49:10 +01:00
Mario Zechner 3f60de8929 Add npm deployment to package.json benefits 2026-01-05 02:48:40 +01:00
Mario Zechner c8cfef7225 Add note about npm dependencies in extensions 2026-01-05 02:48:18 +01:00
Mario Zechner f4a3724b7e Improve extension discovery docs with multi-entry package.json example 2026-01-05 02:47:52 +01:00
Mario Zechner 91cca23d23 Add migration for commands->prompts, warn about deprecated hooks/tools dirs
- Auto-migrate commands/ to prompts/ on startup
- Warn if hooks/ or tools/ directories contain custom extensions
- Show deprecation warnings in interactive mode with keypress to continue
- Update CHANGELOG and docs with full migration guide
2026-01-05 02:41:08 +01:00
Mario Zechner cf1c4c31f4 Flatten hello/ and question/ extension examples to single files 2026-01-05 01:45:10 +01:00
Mario Zechner c6fc084534 Merge hooks and custom-tools into unified extensions system (#454)
Breaking changes:
- Settings: 'hooks' and 'customTools' arrays replaced with 'extensions'
- CLI: '--hook' and '--tool' flags replaced with '--extension' / '-e'
- API: HookMessage renamed to CustomMessage, role 'hookMessage' to 'custom'
- API: FileSlashCommand renamed to PromptTemplate
- API: discoverSlashCommands() renamed to discoverPromptTemplates()
- Directories: commands/ renamed to prompts/ for prompt templates

Migration:
- Session version bumped to 3 (auto-migrates v2 sessions)
- Old 'hookMessage' role entries converted to 'custom'

Structural changes:
- src/core/hooks/ and src/core/custom-tools/ merged into src/core/extensions/
- src/core/slash-commands.ts renamed to src/core/prompt-templates.ts
- examples/hooks/ and examples/custom-tools/ merged into examples/extensions/
- docs/hooks.md and docs/custom-tools.md merged into docs/extensions.md

New test coverage:
- test/extensions-runner.test.ts (10 tests)
- test/extensions-discovery.test.ts (26 tests)
- test/prompt-templates.test.ts
2026-01-05 01:43:35 +01:00
Mario Zechner 9794868b38 Implement extension discovery with package.json manifest support
Discovery rules:
1. extensions/*.ts or *.js - direct files
2. extensions/*/index.ts or index.js - subdirectory with index
3. extensions/*/package.json with pi field - load declared paths

No recursion beyond one level. Complex packages use package.json manifest.

Added PiManifest type for future theme/skill bundling support.

17 tests covering all discovery scenarios.

refs #454
2026-01-04 23:24:24 +01:00
Mario Zechner 2846c7d190 Add unified extensions system (not wired up yet)
New src/core/extensions/ directory with:
- types.ts: merged types from hooks and custom-tools
- loader.ts: single loader for extensions
- runner.ts: ExtensionRunner for event emission
- wrapper.ts: tool wrapping utilities
- index.ts: exports

Key changes from old system:
- Single ExtensionAPI with registerTool() for LLM-callable tools
- Tools use ExtensionContext (has UI access)
- No onSession callback on tools (use pi.on events instead)

refs #454
2026-01-04 22:51:11 +01:00
Mario Zechner be330fdd9c Fix event bus async error handling, clear pending messages on session switch, improve SDK docs
- event-bus.ts: await async handlers to catch errors properly
- agent-session.ts: clear _pendingNextTurnMessages on newSession/switchSession/branch
- sdk.ts: make eventBus first (required) param for discoverHooks/discoverCustomTools
- docs/sdk.md: document eventBus sharing pattern for hook/tool communication
2026-01-04 22:04:50 +01:00
Mario Zechner 024ec33bf2 docs(coding-agent): fix event bus docs - handlers persist, remove redundant note 2026-01-04 21:39:13 +01:00
Mario Zechner 99a539baa4 docs(coding-agent): update event bus docs - async errors now caught automatically 2026-01-04 21:37:16 +01:00
Mario Zechner 12805f61bd Add [Unreleased] section for next cycle 2026-01-04 21:06:48 +01:00
Mario Zechner 71c978e2f9 Release v0.34.2 2026-01-04 21:06:08 +01:00
Mario Zechner a4d6f22f55 fix: move hook API changelog entries from 0.32.2 to 0.34.0
The Hook API features (registerFlag, registerShortcut, setWidget, getActiveTools,
plan-mode.ts) were incorrectly listed under 0.32.2 but actually shipped in 0.34.0.
2026-01-04 21:05:18 +01:00
Mario Zechner 2a47b1114d Add [Unreleased] section for next cycle 2026-01-04 20:57:34 +01:00
Mario Zechner de92eeda1f Release v0.34.1 2026-01-04 20:56:51 +01:00
Mario Zechner affa618b43 docs: add note about macOS Finder image copy behavior 2026-01-04 20:52:51 +01:00
Mario Zechner 2a332f7064 docs: add changelog entries for symbol key support (#450) 2026-01-04 20:38:27 +01:00
Mario Zechner 61cadc226c Add [Unreleased] section for next cycle 2026-01-04 20:30:34 +01:00
Mario Zechner dc2f5d43cc Release v0.34.0 2026-01-04 20:29:50 +01:00
Mario Zechner 00fa8b71c8 revert: remove unnecessary themeOverride params from theme functions
The optional theme parameter was added as a workaround for tsx dev mode,
but that's a dev-only issue. Users running the built package don't need it.
2026-01-04 20:27:46 +01:00
Mario Zechner 7302fe5063 docs: remove dev-only changelog entry 2026-01-04 20:26:29 +01:00
Mario Zechner 5318b42bd2 docs: update CHANGELOG and hooks.md with missing items
- tools.ts example hook
- Multiple messages from before_agent_start
- getSettingsListTheme/getSelectListTheme optional theme param
- Hook error stack traces
2026-01-04 19:01:35 +01:00
Mario Zechner b06bd1d24c fix(tools.ts): sync with active tools when no saved state
Hook was showing all tools as enabled even though only 4 were active.
Now initializes from pi.getActiveTools() to match actual state.
2026-01-04 18:50:45 +01:00
Mario Zechner 31438fdf2a fix(tools): wrap ALL registry tools with hooks, not just active ones
wrappedToolRegistry was only containing activeToolsArray (4 tools).
Now wraps all tools from the registry so hooks can enable any tool.
2026-01-04 18:47:57 +01:00
Mario Zechner 2849623afc fix(tools): tool registry now contains ALL built-in tools
- createAllTools() populates registry with all 7 built-in tools
- --tools flag only sets initially active tools (default: read/bash/edit/write)
- Hooks can enable any tool from registry via setActiveTools()
- System prompt rebuilds with correct tool guidelines when tools change
- Document tsx module resolution workaround in README
2026-01-04 18:44:41 +01:00
Mario Zechner c447e62662 fix(theme): add optional themeOverride param to getSettingsListTheme/getSelectListTheme
When hooks are loaded via jiti, they get a separate module instance from
the main app. This means the global 'theme' variable in the hook's module
is never initialized. Adding an optional theme parameter allows hooks to
pass the theme from ctx.ui.custom() callback.

Usage in hooks:
  getSettingsListTheme(theme)  // theme from ctx.ui.custom callback
2026-01-04 18:39:00 +01:00
Mario Zechner 6390ff87ef fix(hooks): add stack traces to hook errors, fix tools.ts theme bug
- HookError now includes optional stack field
- Hook error display shows stack trace in dim color below error message
- tools.ts: create SettingsListTheme using the theme passed to ctx.ui.custom()
  instead of using getSettingsListTheme() which depends on global theme
2026-01-04 18:33:28 +01:00
Mario Zechner 91fae8b2f0 Merge feature/plan-mode into main 2026-01-04 18:27:38 +01:00
Mario Zechner e4dd21a3b2 feat(hooks): add systemPromptAppend to before_agent_start, full tool registry
- before_agent_start handlers can return systemPromptAppend to dynamically
  append text to the system prompt for that turn
- Multiple hooks' systemPromptAppend strings are concatenated
- Multiple hooks' messages are now all injected (not just first)
- Tool registry now contains ALL built-in tools (read, bash, edit, write,
  grep, find, ls) regardless of --tools flag
- --tools only sets initially active tools, hooks can enable any via
  setActiveTools()
- System prompt automatically rebuilds when tools change, updating tool
  descriptions and guidelines
- Add pirate.ts example hook demonstrating systemPromptAppend
- Update hooks.md with systemPromptAppend documentation
2026-01-04 18:21:26 +01:00
Mario Zechner 892acedb6b feat(hooks): add tools.ts example hook for interactive tool enable/disable
- /tools command opens SettingsList-based selector for all loaded tools
- Space/Enter toggles individual tools between enabled/disabled
- Changes apply immediately on toggle (like /settings)
- Tool selection persisted to session via appendEntry()
- State restored from current branch on session_start, session_tree, session_branch
- Uses getBranch() to respect branch-specific tool configuration
- Export getSettingsListTheme and getSelectListTheme for hooks to use
2026-01-04 18:13:30 +01:00
Mario Zechner ddf8bfceee fix(hooks): deep copy messages in context event before passing to hooks
The context event handler documentation promised a deep copy but the
implementation passed the original array reference. This could cause
hooks to accidentally mutate session messages.

Uses structuredClone() for fast native deep copying.
2026-01-04 18:13:30 +01:00
Mario Zechner 8b6bc30301 fix(hooks): deep copy messages in context event before passing to hooks
The context event handler documentation promised a deep copy but the
implementation passed the original array reference. This could cause
hooks to accidentally mutate session messages.

Uses structuredClone() for fast native deep copying.
2026-01-04 17:16:49 +01:00
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