co-mono/packages/coding-agent/src/core
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
..
compaction Rework custom tools API with CustomToolContext 2025-12-31 12:05:24 +01:00
custom-tools feat(coding-agent): add event bus for tool/hook communication (#431) 2026-01-04 21:36:19 +01:00
export-html Use same header color for Available Tools as System Prompt 2026-01-03 23:05:32 +01:00
hooks feat(coding-agent): add event bus for tool/hook communication (#431) 2026-01-04 21:36:19 +01:00
tools Added automatic image resizing 2026-01-02 12:01:56 +01:00
agent-session.ts feat(coding-agent): add event bus for tool/hook communication (#431) 2026-01-04 21:36:19 +01:00
auth-storage.ts Fix slow /model selector by deferring OAuth token refresh 2026-01-03 01:20:11 +01:00
bash-executor.ts fix(coding-agent): resolved UTF-8 corruption in bash executor output (#433) 2026-01-04 03:15:50 +01:00
event-bus.ts feat(coding-agent): add event bus for tool/hook communication (#431) 2026-01-04 21:36:19 +01:00
exec.ts Refactor: shared exec utility, rename CustomMessageRenderer to HookMessageRenderer 2025-12-30 22:42:19 +01:00
index.ts feat(coding-agent): add event bus for tool/hook communication (#431) 2026-01-04 21:36:19 +01:00
keybindings.ts feat: configurable keybindings for all editor and app actions 2026-01-03 08:23:56 +01:00
messages.ts Add shell commands without context contribution (!! prefix) 2026-01-03 04:14:35 +01:00
model-registry.ts Fix slow /model selector by deferring OAuth token refresh 2026-01-03 01:20:11 +01:00
model-resolver.ts Add Vertex AI provider with ADC support 2026-01-03 01:11:03 +01:00
sdk.ts feat(coding-agent): add event bus for tool/hook communication (#431) 2026-01-04 21:36:19 +01:00
session-manager.ts Consolidate session events: remove session_before_new/session_new, add reason field to switch events 2026-01-01 23:31:26 +01:00
settings-manager.ts feat(coding-agent): configurable double-escape action (tree vs branch) 2026-01-03 01:59:08 +01:00
skills.ts Skip over exact duplicate skills 2025-12-24 22:45:19 +01:00
slash-commands.ts feat(coding-agent): add $ARGUMENTS syntax for slash commands (#418) 2026-01-03 14:08:39 +01:00
system-prompt.ts Add custom models/providers to system prompt doc references 2025-12-31 13:18:05 +01:00
timings.ts Release v0.27.1 2025-12-22 19:28:26 +01:00