| 1 | package Claude::Agent::Hook; | ||
| 2 | |||
| 3 | 3 | ▶ | use 5.020; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 3 | ▶ | use Exporter qw(import); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 3 | ▶ | use Const::XS qw(const); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 3 | ▶ | use Claude::Agent::Hook::Matcher; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 3 | ▶ | use Claude::Agent::Hook::Context; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 3 | ▶ | use Claude::Agent::Hook::Result; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 3 | const our $PRE_TOOL_USE => 'PreToolUse'; | |
| 14 | 3 | const our $POST_TOOL_USE => 'PostToolUse'; | |
| 15 | 3 | const our $POST_TOOL_USE_FAIL => 'PostToolUseFailure'; | |
| 16 | 3 | const our $NOTIFICATION => 'Notification'; | |
| 17 | 3 | const our $USER_PROMPT_SUBMIT => 'UserPromptSubmit'; | |
| 18 | 3 | const our $SESSION_START => 'SessionStart'; | |
| 19 | 3 | const our $SESSION_END => 'SessionEnd'; | |
| 20 | 3 | const our $STOP => 'Stop'; | |
| 21 | 3 | const our $STOP_FAILURE => 'StopFailure'; | |
| 22 | 3 | const our $SUBAGENT_START => 'SubagentStart'; | |
| 23 | 3 | const our $SUBAGENT_STOP => 'SubagentStop'; | |
| 24 | 3 | const our $PRE_COMPACT => 'PreCompact'; | |
| 25 | 3 | const our $POST_COMPACT => 'PostCompact'; | |
| 26 | 3 | const our $PERMISSION_REQUEST => 'PermissionRequest'; | |
| 27 | 3 | const our $PERMISSION_DENIED => 'PermissionDenied'; | |
| 28 | 3 | const our $CONFIG_CHANGE => 'ConfigChange'; | |
| 29 | 3 | const our $WORKTREE_CREATE => 'WorktreeCreate'; | |
| 30 | 3 | const our $WORKTREE_REMOVE => 'WorktreeRemove'; | |
| 31 | 3 | const our $ELICITATION => 'Elicitation'; | |
| 32 | 3 | const our $ELICITATION_RESULT => 'ElicitationResult'; | |
| 33 | 3 | const our $INSTRUCTIONS_LOADED => 'InstructionsLoaded'; | |
| 34 | 3 | const our $CWD_CHANGED => 'CwdChanged'; | |
| 35 | 3 | const our $FILE_CHANGED => 'FileChanged'; | |
| 36 | 3 | const our $TASK_COMPLETED => 'TaskCompleted'; | |
| 37 | 3 | const our $TEAMMATE_IDLE => 'TeammateIdle'; | |
| 38 | 3 | const our $SETUP => 'Setup'; | |
| 39 | |||
| 40 | 3 | const our @EVENTS => ( | |
| 41 | $PRE_TOOL_USE, $POST_TOOL_USE, $POST_TOOL_USE_FAIL, $NOTIFICATION, | ||
| 42 | $USER_PROMPT_SUBMIT, $SESSION_START, $SESSION_END, $STOP, $STOP_FAILURE, | ||
| 43 | $SUBAGENT_START, $SUBAGENT_STOP, $PRE_COMPACT, $POST_COMPACT, | ||
| 44 | $PERMISSION_REQUEST, $PERMISSION_DENIED, $CONFIG_CHANGE, $WORKTREE_CREATE, | ||
| 45 | $WORKTREE_REMOVE, $ELICITATION, $ELICITATION_RESULT, $INSTRUCTIONS_LOADED, | ||
| 46 | $CWD_CHANGED, $FILE_CHANGED, $TASK_COMPLETED, $TEAMMATE_IDLE, $SETUP, | ||
| 47 | ); | ||
| 48 | |||
| 49 | 3 | our @EXPORT_OK = qw( | |
| 50 | $PRE_TOOL_USE $POST_TOOL_USE $POST_TOOL_USE_FAIL $NOTIFICATION | ||
| 51 | $USER_PROMPT_SUBMIT $SESSION_START $SESSION_END $STOP $STOP_FAILURE | ||
| 52 | $SUBAGENT_START $SUBAGENT_STOP $PRE_COMPACT $POST_COMPACT | ||
| 53 | $PERMISSION_REQUEST $PERMISSION_DENIED $CONFIG_CHANGE $WORKTREE_CREATE | ||
| 54 | $WORKTREE_REMOVE $ELICITATION $ELICITATION_RESULT $INSTRUCTIONS_LOADED | ||
| 55 | $CWD_CHANGED $FILE_CHANGED $TASK_COMPLETED $TEAMMATE_IDLE $SETUP | ||
| 56 | @EVENTS | ||
| 57 | ); | ||
| 58 | |||
| 59 | 3 | our %EXPORT_TAGS = (events => \@EXPORT_OK); | |
| 60 | |||
| 61 | 3 | 1; | |
| 62 | |||
| 63 | __END__ | ||