mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
Implements prompt-based hooks that allow a smaller/different model to step in at specific agent lifecycle events and provide read-only advisory output. Hook events supported: - PreToolUse: fires before tool execution (with optional tool name matcher) - PostToolUse: fires after tool execution completes - Stop: fires when attempt_completion is invoked Configuration via .roo/hooks.json (project) and ~/.roo/hooks.json (global), using a Claude Code-compatible format. Hooks are read-only (no tool access) and receive conversation context. Uses the active profile API configuration. New files: - src/shared/hooks.ts: types, interfaces, and validation - src/services/hooks/HooksManager.ts: config loading with file watchers - src/services/hooks/HookExecutor.ts: hook prompt building and execution - src/shared/__tests__/hooks.spec.ts: 18 validation tests - src/services/hooks/__tests__/HookExecutor.spec.ts: 15 executor tests Modified files: - packages/types/src/message.ts: added hook_output ClineSay type - src/core/webview/ClineProvider.ts: HooksManager initialization - src/core/assistant-message/presentAssistantMessage.ts: PreToolUse/PostToolUse hooks - src/core/tools/AttemptCompletionTool.ts: Stop hook Addresses #11504 |
||
|---|---|---|
| .. | ||
| build | ||
| cloud | ||
| config-eslint | ||
| config-typescript | ||
| core | ||
| evals | ||
| ipc | ||
| telemetry | ||
| types | ||
| vscode-shim | ||