refactor(hooks): address PR feedback

- Rename getTools/setTools to getActiveTools/setActiveTools
- Add getAllTools to enumerate all configured tools
- Remove text_delta event (use turn_end/agent_end instead)
- Add shortcut conflict detection:
  - Skip shortcuts that conflict with built-in shortcuts (with warning)
  - Log warnings when hooks register same shortcut (last wins)
- Add note about prompt cache invalidation in setActiveTools
- Update plan-mode hook to use agent_end for [DONE:id] parsing
This commit is contained in:
Helmut Januschka 2026-01-03 21:30:19 +01:00 committed by Mario Zechner
parent 5b634ddf75
commit 4ecf3f9422
13 changed files with 175 additions and 153 deletions

View file

@ -4,7 +4,8 @@ export {
loadHooks,
type AppendEntryHandler,
type BranchHandler,
type GetToolsHandler,
type GetActiveToolsHandler,
type GetAllToolsHandler,
type HookFlag,
type HookShortcut,
type LoadedHook,
@ -12,7 +13,7 @@ export {
type NavigateTreeHandler,
type NewSessionHandler,
type SendMessageHandler,
type SetToolsHandler,
type SetActiveToolsHandler,
} from "./loader.js";
export { execCommand, HookRunner, type HookErrorListener } from "./runner.js";
export { wrapToolsWithHooks, wrapToolWithHooks } from "./tool-wrapper.js";