Add hooks to changelog (closes #145, supersedes #158)

This commit is contained in:
Mario Zechner 2025-12-10 01:00:32 +01:00
parent 1abc635044
commit c7afa35e1b

View file

@ -2,6 +2,20 @@
## [Unreleased]
### Added
- **Hooks system**: TypeScript modules that extend agent behavior by subscribing to lifecycle events. Hooks can intercept tool calls, prompt for confirmation, modify results, and inject messages from external sources. Auto-discovered from `~/.pi/agent/hooks/*.ts` and `.pi/hooks/*.ts`. ([#145](https://github.com/badlogic/pi-mono/issues/145), supersedes [#158](https://github.com/badlogic/pi-mono/pull/158))
- **`pi.send()` API**: Hooks can inject messages into the agent session from external sources (file watchers, webhooks, CI systems). If streaming, messages are queued; otherwise a new agent loop starts immediately.
- **`--hook <path>` CLI flag**: Load hook files directly for testing without modifying settings.
- **Hook events**: `session_start`, `session_switch`, `agent_start`, `agent_end`, `turn_start`, `turn_end`, `tool_call` (can block), `tool_result` (can modify), `branch`.
- **Hook UI primitives**: `ctx.ui.select()`, `ctx.ui.confirm()`, `ctx.ui.input()`, `ctx.ui.notify()` for interactive prompts from hooks.
- **Hooks documentation**: Full API reference at `docs/hooks.md`, shipped with npm package.
## [0.17.0] - 2025-12-09
### Changed