feat(hooks): add tools.ts example hook for interactive tool enable/disable

- /tools command opens SettingsList-based selector for all loaded tools
- Space/Enter toggles individual tools between enabled/disabled
- Changes apply immediately on toggle (like /settings)
- Tool selection persisted to session via appendEntry()
- State restored from current branch on session_start, session_tree, session_branch
- Uses getBranch() to respect branch-specific tool configuration
- Export getSettingsListTheme and getSelectListTheme for hooks to use
This commit is contained in:
Mario Zechner 2026-01-04 17:24:24 +01:00
parent ddf8bfceee
commit 892acedb6b
4 changed files with 159 additions and 7 deletions

View file

@ -17,6 +17,7 @@ cp permission-gate.ts ~/.pi/agent/hooks/
| Hook | Description |
|------|-------------|
| `plan-mode.ts` | Claude Code-style plan mode for read-only exploration with `/plan` command |
| `tools.ts` | Interactive `/tools` command to enable/disable tools with session persistence |
| `permission-gate.ts` | Prompts for confirmation before dangerous bash commands (rm -rf, sudo, etc.) |
| `git-checkpoint.ts` | Creates git stash checkpoints at each turn for code restoration on branch |
| `protected-paths.ts` | Blocks writes to protected paths (.env, .git/, node_modules/) |