Commit graph

1106 commits

Author SHA1 Message Date
badlogic
1349f02cdd docs: document Windows Terminal Shift+Enter limitation
Windows Terminal does not support the Kitty keyboard protocol, so
Shift+Enter cannot be distinguished from Enter. Document that users
should use Ctrl+Enter for multi-line input instead.

- Add Windows Terminal note in Terminal Setup section
- Update Keyboard Shortcuts table with Windows note
- Show Windows-specific hint in /hotkeys command
2026-01-05 23:17:58 +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
Ben Vargas
02b72b49d5 fix: codex thinking handling 2026-01-05 21:55:47 +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
a746e2c296
Merge pull request #470 from mcinteerj/fix-managed-binaries-migration-warning
fix: move managed binaries to bin/ and ignore hidden files in migration check
2026-01-05 20:26:18 +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
Jake
0a736e858d fix: move managed binaries to bin/ and ignore hidden files in migration check 2026-01-06 07:52:49 +13:00
Christian Catalan
05b9d55656
feat(oauth): show paste input immediately during OpenAI Codex login (#468)
Previously, users had to wait up to 60 seconds for the browser callback
to timeout before being prompted to paste the authorization code. This
was problematic for SSH/VPS sessions where the callback cannot work.

Now the paste input is shown immediately alongside the browser flow:
- Browser callback and manual paste race - whichever completes first wins
- Desktop users: browser callback succeeds, input is cleaned up
- SSH/VPS users: paste code immediately without waiting

Changes:
- Add cancelWait() to OAuth server for early termination of polling loop
- Add onManualCodeInput callback that races with browser callback
- Show paste input immediately in TUI for openai-codex provider
- Clean up input on success, error, or when browser callback wins

Co-authored-by: cc-vps <crcatala+vps@gmail.com>
2026-01-05 18:47:58 +01:00
Mario Zechner
7919c40907 docs: remove CLI-specific --extension mention from SDK example 2026-01-05 18:03:41 +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
LiuVaayne
49c4fe0bc1
feat: add claude-rules extension example (#461)
Add an extension that scans .claude/rules/ folder for project-specific
rules and lists them in the system prompt. The agent can then load
relevant rules using the read tool when needed.
2026-01-05 16:59:07 +01:00
Aliou Diallo
042d3fa310
fix(sdk): extensions: [] now disables discovery as documented (#465) 2026-01-05 16:55:51 +01:00
cursive
6a8609ac56
fix: prevent silent logout when multiple pi instances refresh OAuth tokens (#466) 2026-01-05 16:55:05 +01:00
Melih Mucuk
7e829273b0 docs(coding-agent): add changelog entry for #463 2026-01-05 13:53:18 +03:00
Melih Mucuk
e4f63f585f fix(coding-agent): load extensions from settings.json
SettingsManager was created after extension loading, so extensions
defined in settings.json were never loaded. Move SettingsManager.create
before discoverAndLoadExtensions and merge settings extensions with
CLI --extension args.
2026-01-05 13:26:41 +03:00
Carlos Gutierrez
d9e0604183
Ignore Windows binaries in tools/ (#458)
Co-authored-by: root <root@WIN11.localdomain>
2026-01-05 06:22:34 +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
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