Commit graph

1696 commits

Author SHA1 Message Date
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
Aliou Diallo
80be0fc901
fix(ci): fix typecheck by adding example to workspace (#467) 2026-01-05 16:54:04 +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
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
Anton Kuzmenko
63093bf7e4 fix(ai): cache vertex adc credentials file check 2026-01-04 17:16:40 -08: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
Anton Kuzmenko
a3f30e085a fix(ai): add vertex ai dummy value for configured credentials 2026-01-04 12:59:19 -08: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
Nico Bailon
9c9e6822e3
feat(coding-agent): add event bus for tool/hook communication (#431)
* feat(coding-agent): add event bus for tool/hook communication

Adds pi.events API enabling custom tools and hooks to communicate via
pub/sub. Tools can emit events, hooks can listen. Shared EventBus instance
created per session in createAgentSession().

- EventBus interface with emit() and on() methods
- on() returns unsubscribe function
- Threaded through hook and tool loaders
- Documented in hooks.md and custom-tools.md

* fix(coding-agent): wrap event handlers to catch errors

* docs: note async handler error handling for event bus

* feat(coding-agent): add sendMessage to tools, nextTurn delivery mode

- Custom tools now have pi.sendMessage() for direct agent notifications
- New deliverAs: 'nextTurn' queues messages for next user prompt
- Fix: hooks and tools now share the same eventBus (was isolated before)

* fix(coding-agent): nextTurn delivery should always queue, even when streaming
2026-01-04 21:36:19 +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
Aliou Diallo
5cb7af1ddc
feat(hooks): expose setTitle to HookUIContext (#446) 2026-01-04 20:55:52 +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
Kao Félix
b836a9d2ee
feat(tui): add symbol key support to keybinding system (#450)
- Added SymbolKey type with 32 symbol keys
- Added symbol key constants to Key helper (Key.backtick, Key.comma, Key.period, etc.)
- Updated matchesKey() and parseKey() to handle symbol key input
- Added documentation in coding-agent README with examples
2026-01-04 20:37:08 +01:00