feat(coding-agent): implement hooks system

- Add hooks infrastructure in core/hooks/ (loader, runner, types)
- HookUIContext interface with mode-specific implementations
- Interactive mode: TUI-based selector/input/confirm dialogs
- RPC mode: JSON protocol for hook UI requests/responses
- Print mode: no-op UI context (hooks run but can't prompt)
- AgentSession.branch() now async, returns { selectedText, skipped }
- Settings: hooks[] and hookTimeout configuration
- Export hook types from package for hook authors

Based on PR #147 proposal, adapted for new architecture.
This commit is contained in:
Mario Zechner 2025-12-09 22:17:12 +01:00
parent 195760d8ee
commit 04d59f31ea
17 changed files with 1264 additions and 126 deletions

View file

@ -33,7 +33,8 @@
"@mariozechner/pi-tui": "^0.17.0",
"chalk": "^5.5.0",
"diff": "^8.0.2",
"glob": "^11.0.3"
"glob": "^11.0.3",
"jiti": "^2.6.1"
},
"devDependencies": {
"@types/diff": "^7.0.2",