MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / handle_hook_command

Function handle_hook_command

src/hook_cmd.rs:3–80  ·  view source on GitHub ↗
(command: Commands)

Source from the content-addressed store, hash-verified

1use crate::cli::Commands;
2
3pub(crate) async fn handle_hook_command(command: Commands) -> tracedecay::errors::Result<()> {
4 match command {
5 Commands::HookPreToolUse => {
6 tracedecay::hooks::hook_pre_tool_use();
7 }
8 Commands::HookPromptSubmit => {
9 tracedecay::hooks::hook_prompt_submit().await;
10 }
11 Commands::HookStop => {
12 tracedecay::hooks::hook_stop().await;
13 }
14 Commands::HookClaudeSessionStart => {
15 exit_if_nonzero(tracedecay::hooks::hook_claude_session_start().await);
16 }
17 Commands::HookClaudePostToolUse => {
18 exit_if_nonzero(tracedecay::hooks::hook_claude_post_tool_use().await);
19 }
20 Commands::HookClaudeSubagentStart => {
21 exit_if_nonzero(tracedecay::hooks::hook_claude_subagent_start().await);
22 }
23 Commands::HookKiroPreToolUse => {
24 exit_if_nonzero(tracedecay::hooks::hook_kiro_pre_tool_use());
25 }
26 Commands::HookKiroPromptSubmit => {
27 exit_if_nonzero(tracedecay::hooks::hook_kiro_prompt_submit().await);
28 }
29 Commands::HookKiroPostToolUse => {
30 exit_if_nonzero(tracedecay::hooks::hook_kiro_post_tool_use().await);
31 }
32 Commands::HookCursorSubagentStart => {
33 exit_if_nonzero(tracedecay::hooks::hook_cursor_subagent_start());
34 }
35 Commands::HookCursorPostToolUse => {
36 exit_if_nonzero(tracedecay::hooks::hook_cursor_post_tool_use());
37 }
38 Commands::HookCursorBeforeSubmitPrompt => {
39 exit_if_nonzero(tracedecay::hooks::hook_cursor_before_submit_prompt().await);
40 }
41 Commands::HookCursorPreCompact => {
42 exit_if_nonzero(tracedecay::hooks::hook_cursor_pre_compact().await);
43 }
44 Commands::HookCursorAfterFileEdit => {
45 exit_if_nonzero(tracedecay::hooks::hook_cursor_after_file_edit().await);
46 }
47 Commands::HookCursorSessionStart => {
48 exit_if_nonzero(tracedecay::hooks::hook_cursor_session_start().await);
49 }
50 Commands::HookCursorSessionEnd => {
51 exit_if_nonzero(tracedecay::hooks::hook_cursor_session_end().await);
52 }
53 Commands::HookCursorAfterShell => {
54 exit_if_nonzero(tracedecay::hooks::hook_cursor_after_shell().await);
55 }
56 Commands::HookCursorWorkspaceOpen => {
57 exit_if_nonzero(tracedecay::hooks::hook_cursor_workspace_open().await);
58 }
59 Commands::HookCursorStop => {
60 exit_if_nonzero(tracedecay::hooks::hook_cursor_stop().await);

Callers 1

dispatch_commandFunction · 0.85

Calls 15

hook_pre_tool_useFunction · 0.85
hook_prompt_submitFunction · 0.85
hook_stopFunction · 0.85
exit_if_nonzeroFunction · 0.85
hook_kiro_pre_tool_useFunction · 0.85
hook_kiro_prompt_submitFunction · 0.85
hook_kiro_post_tool_useFunction · 0.85

Tested by

no test coverage detected