Commit 1c7e323
feat(cortex-hooks): extend hooks system with async, new events, and LLM prompts (#204)
- Add new HookType events: PreToolUse, PostToolUse, PostToolUseFailure,
PermissionRequest, UserPromptSubmit, Notification, Stop, SubagentStart,
SubagentStop, PreCompact, Setup, SessionStart, SessionEnd
- Add async execution support (async_exec flag for fire-and-forget hooks)
- Add once execution support (once flag for single-execution-per-session)
- Add tool name matcher for tool-related hooks
- Add HookStatus enum for detailed execution status tracking
- Extend HookContext with tool/agent/session context and as_env() method
- Create prompt_hook.rs for LLM-based decision hooks (PromptHook, PromptHookExecutor)
- Create session_env.rs for persistent session environment variables
- Add semaphore-based concurrency control for hook execution
- Add comprehensive tests for new functionality (32 passing tests)
This implements AGENT_5 from ORCHESTRATE/AGENT_5_HOOKS.md
Co-authored-by: Droid Agent <droid@factory.ai>1 parent cb446a6 commit 1c7e323
7 files changed
Lines changed: 1390 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
0 commit comments