docs: update changelog with full hook API additions

This commit is contained in:
Helmut Januschka 2026-01-03 15:36:18 +01:00 committed by Mario Zechner
parent 056f40b00b
commit 09048681b8

View file

@ -38,9 +38,16 @@
- `$ARGUMENTS` syntax for custom slash commands as alternative to `$@` for all arguments joined. Aligns with patterns used by Claude, Codex, and OpenCode. Both syntaxes remain fully supported. ([#418](https://github.com/badlogic/pi-mono/pull/418) by [@skuridin](https://github.com/skuridin))
- Hook API: `pi.getTools()` and `pi.setTools(toolNames)` for dynamically enabling/disabling tools from hooks
- Hook API: `pi.registerFlag(name, options)` and `pi.getFlag(name)` for hooks to register custom CLI flags
- Hook API: `pi.registerShortcut(shortcut, options)` for hooks to register custom keyboard shortcuts
- New example hook: `plan-mode.ts` - Claude Code-style read-only exploration mode with `/plan` command, `--plan` flag, and Shift+P shortcut
- Hook API: `pi.registerFlag(name, options)` and `pi.getFlag(name)` for hooks to register custom CLI flags (parsed automatically)
- Hook API: `pi.registerShortcut(shortcut, options)` for hooks to register custom keyboard shortcuts (e.g., `shift+p`, `ctrl+shift+x`)
- `/hotkeys` command now shows hook-registered shortcuts in a separate "Hooks" section
- New example hook: `plan-mode.ts` - Claude Code-style read-only exploration mode:
- Toggle via `/plan` command, `Shift+P` shortcut, or `--plan` CLI flag
- Read-only tools: `read`, `bash`, `grep`, `find`, `ls` (no `edit`/`write`)
- Bash commands restricted to non-destructive operations (blocks `rm`, `mv`, `git commit`, `npm install`, etc.)
- Interactive prompt after each response: execute plan, stay in plan mode, or refine
- Shows `⏸ plan` indicator in footer when active
- State persists across sessions
### Changed