Documentation
¶
Overview ¶
Package hook provides hook types for intercepting Claude CLI events.
Index ¶
- type AsyncJSONOutput
- type BaseInput
- type Callback
- type ConfigChangeInput
- type Context
- type CwdChangedInput
- type CwdChangedSpecificOutput
- type ElicitationInput
- type ElicitationResultInput
- type ElicitationResultSpecificOutput
- type ElicitationSpecificOutput
- type Event
- type FileChangedInput
- type FileChangedSpecificOutput
- type Input
- type InstructionsLoadedInput
- type JSONOutput
- type Matcher
- type NotificationInput
- type NotificationSpecificOutput
- type PermissionDeniedInput
- type PermissionDeniedSpecificOutput
- type PermissionRequestInput
- type PermissionRequestSpecificOutput
- type PostCompactInput
- type PostToolUseFailureInput
- type PostToolUseFailureSpecificOutput
- type PostToolUseInput
- type PostToolUseSpecificOutput
- type PreCompactInput
- type PreToolUseInput
- type PreToolUseSpecificOutput
- type SessionEndInput
- type SessionStartInput
- type SessionStartSpecificOutput
- type SetupInput
- type SetupSpecificOutput
- type SpecificOutput
- type StopFailureInput
- type StopInput
- type SubagentStartInput
- type SubagentStartSpecificOutput
- type SubagentStopInput
- type SyncJSONOutput
- type TaskCompletedInput
- type TaskCreatedInput
- type TeammateIdleInput
- type UnknownInput
- type UserPromptSubmitInput
- type UserPromptSubmitSpecificOutput
- type WorktreeCreateInput
- type WorktreeCreateSpecificOutput
- type WorktreeRemoveInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncJSONOutput ¶
type AsyncJSONOutput struct {
Async bool `json:"async"`
AsyncTimeout *int `json:"asyncTimeout,omitempty"` // milliseconds
}
AsyncJSONOutput represents an async hook output.
type BaseInput ¶
type BaseInput struct {
SessionID string `json:"session_id"`
TranscriptPath string `json:"transcript_path"`
Cwd string `json:"cwd"`
PermissionMode *string `json:"permission_mode,omitempty"`
}
BaseInput contains common fields for all hook inputs.
func (*BaseInput) GetPermissionMode ¶
GetPermissionMode implements Input.
func (*BaseInput) GetSessionID ¶
GetSessionID implements Input.
func (*BaseInput) GetTranscriptPath ¶
GetTranscriptPath implements Input.
type Callback ¶
type Callback func( ctx context.Context, input Input, toolUseID *string, hookCtx *Context, ) (JSONOutput, error)
Callback is the function signature for hook callbacks.
type ConfigChangeInput ¶ added in v0.0.7
type ConfigChangeInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
Source string `json:"source"`
FilePath *string `json:"file_path,omitempty"`
}
ConfigChangeInput is the input for ConfigChange hooks.
func (*ConfigChangeInput) GetHookEventName ¶ added in v0.0.7
func (c *ConfigChangeInput) GetHookEventName() Event
GetHookEventName implements Input.
type CwdChangedInput ¶ added in v0.0.7
type CwdChangedInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
OldCwd string `json:"old_cwd"`
NewCwd string `json:"new_cwd"`
}
CwdChangedInput is the input for CwdChanged hooks.
func (*CwdChangedInput) GetHookEventName ¶ added in v0.0.7
func (c *CwdChangedInput) GetHookEventName() Event
GetHookEventName implements Input.
type CwdChangedSpecificOutput ¶ added in v0.0.7
type CwdChangedSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "CwdChanged"
WatchPaths []string `json:"watchPaths,omitempty"`
}
CwdChangedSpecificOutput is the hook-specific output for CwdChanged.
func (*CwdChangedSpecificOutput) GetHookEventName ¶ added in v0.0.7
func (c *CwdChangedSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type ElicitationInput ¶ added in v0.0.7
type ElicitationInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
MCPServerName string `json:"mcp_server_name"`
Message string `json:"message"`
Mode *string `json:"mode,omitempty"`
URL *string `json:"url,omitempty"`
ElicitationID *string `json:"elicitation_id,omitempty"`
RequestedSchema map[string]any `json:"requested_schema,omitempty"`
}
ElicitationInput is the input for Elicitation hooks.
func (*ElicitationInput) GetHookEventName ¶ added in v0.0.7
func (e *ElicitationInput) GetHookEventName() Event
GetHookEventName implements Input.
type ElicitationResultInput ¶ added in v0.0.7
type ElicitationResultInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
MCPServerName string `json:"mcp_server_name"`
ElicitationID *string `json:"elicitation_id,omitempty"`
Mode *string `json:"mode,omitempty"`
Action string `json:"action"`
Content map[string]any `json:"content,omitempty"`
}
ElicitationResultInput is the input for ElicitationResult hooks.
func (*ElicitationResultInput) GetHookEventName ¶ added in v0.0.7
func (e *ElicitationResultInput) GetHookEventName() Event
GetHookEventName implements Input.
type ElicitationResultSpecificOutput ¶ added in v0.0.7
type ElicitationResultSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "ElicitationResult"
Action *string `json:"action,omitempty"`
Content map[string]any `json:"content,omitempty"`
}
ElicitationResultSpecificOutput is the hook-specific output for ElicitationResult.
func (*ElicitationResultSpecificOutput) GetHookEventName ¶ added in v0.0.7
func (e *ElicitationResultSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type ElicitationSpecificOutput ¶ added in v0.0.7
type ElicitationSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "Elicitation"
Action *string `json:"action,omitempty"`
Content map[string]any `json:"content,omitempty"`
}
ElicitationSpecificOutput is the hook-specific output for Elicitation.
func (*ElicitationSpecificOutput) GetHookEventName ¶ added in v0.0.7
func (e *ElicitationSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type Event ¶
type Event string
Event represents the type of event that triggers a hook.
const ( // EventPreToolUse is triggered before a tool is used. EventPreToolUse Event = "PreToolUse" // EventPostToolUse is triggered after a tool is used. EventPostToolUse Event = "PostToolUse" // EventPostToolUseFailure is triggered after a tool use fails. EventPostToolUseFailure Event = "PostToolUseFailure" // EventNotification is triggered when a notification is sent. EventNotification Event = "Notification" // EventUserPromptSubmit is triggered when a user submits a prompt. EventUserPromptSubmit Event = "UserPromptSubmit" // EventSessionStart is triggered when a session starts. EventSessionStart Event = "SessionStart" // EventSessionEnd is triggered when a session ends. EventSessionEnd Event = "SessionEnd" // EventStop is triggered when a session stops. EventStop Event = "Stop" // EventStopFailure is triggered when a stop operation fails. EventStopFailure Event = "StopFailure" // EventSubagentStart is triggered when a subagent starts. EventSubagentStart Event = "SubagentStart" // EventSubagentStop is triggered when a subagent stops. EventSubagentStop Event = "SubagentStop" // EventPreCompact is triggered before compaction. EventPreCompact Event = "PreCompact" // EventPostCompact is triggered after compaction finishes. EventPostCompact Event = "PostCompact" // EventPermissionRequest is triggered when a permission is requested. EventPermissionRequest Event = "PermissionRequest" // EventPermissionDenied is triggered when a permission request is denied. EventPermissionDenied Event = "PermissionDenied" // EventSetup is triggered during setup/maintenance. EventSetup Event = "Setup" // EventTeammateIdle is triggered when a teammate agent becomes idle. EventTeammateIdle Event = "TeammateIdle" // EventTaskCreated is triggered when a background task is created. EventTaskCreated Event = "TaskCreated" // EventTaskCompleted is triggered when a background task completes. EventTaskCompleted Event = "TaskCompleted" // EventElicitation is triggered when an MCP server requests user input. EventElicitation Event = "Elicitation" // EventElicitationResult is triggered when an elicitation response is ready. EventElicitationResult Event = "ElicitationResult" // EventConfigChange is triggered when config changes. EventConfigChange Event = "ConfigChange" // EventWorktreeCreate is triggered when a worktree is created. EventWorktreeCreate Event = "WorktreeCreate" // EventWorktreeRemove is triggered when a worktree is removed. EventWorktreeRemove Event = "WorktreeRemove" // EventInstructionsLoaded is triggered when instructions are loaded. EventInstructionsLoaded Event = "InstructionsLoaded" // EventCwdChanged is triggered when the cwd changes. EventCwdChanged Event = "CwdChanged" // EventFileChanged is triggered when a watched file changes. EventFileChanged Event = "FileChanged" )
type FileChangedInput ¶ added in v0.0.7
type FileChangedInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
FilePath string `json:"file_path"`
Event string `json:"event"`
}
FileChangedInput is the input for FileChanged hooks.
func (*FileChangedInput) GetHookEventName ¶ added in v0.0.7
func (f *FileChangedInput) GetHookEventName() Event
GetHookEventName implements Input.
type FileChangedSpecificOutput ¶ added in v0.0.7
type FileChangedSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "FileChanged"
WatchPaths []string `json:"watchPaths,omitempty"`
}
FileChangedSpecificOutput is the hook-specific output for FileChanged.
func (*FileChangedSpecificOutput) GetHookEventName ¶ added in v0.0.7
func (f *FileChangedSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type Input ¶
type Input interface {
GetHookEventName() Event
GetSessionID() string
GetTranscriptPath() string
GetCwd() string
GetPermissionMode() *string
}
Input is the interface for all hook input types.
type InstructionsLoadedInput ¶ added in v0.0.7
type InstructionsLoadedInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
FilePath string `json:"file_path"`
MemoryType string `json:"memory_type"`
LoadReason string `json:"load_reason"`
Globs []string `json:"globs,omitempty"`
TriggerFilePath *string `json:"trigger_file_path,omitempty"`
ParentFilePath *string `json:"parent_file_path,omitempty"`
}
InstructionsLoadedInput is the input for InstructionsLoaded hooks.
func (*InstructionsLoadedInput) GetHookEventName ¶ added in v0.0.7
func (i *InstructionsLoadedInput) GetHookEventName() Event
GetHookEventName implements Input.
type JSONOutput ¶
type JSONOutput any
JSONOutput is the interface for hook output types. This is a marker interface for type safety; use type switches to distinguish between AsyncJSONOutput and SyncJSONOutput.
type Matcher ¶
type Matcher struct {
// Matcher is a tool name like "Bash" or a pipe-separated combination like "Write|Edit".
// When nil, the hook matches all tools/events.
// This is NOT regex - pipe (|) separates multiple tool names to match.
Matcher *string
Hooks []Callback
Timeout *float64 // seconds (default 60)
Once *bool
Async *bool
AsyncRewake *bool
}
Matcher configures which tools/events a hook applies to.
type NotificationInput ¶
type NotificationInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
Message string `json:"message"`
Title *string `json:"title,omitempty"`
NotificationType string `json:"notification_type"`
}
NotificationInput is the input for Notification hooks.
func (*NotificationInput) GetHookEventName ¶
func (n *NotificationInput) GetHookEventName() Event
GetHookEventName implements Input.
type NotificationSpecificOutput ¶
type NotificationSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "Notification"
AdditionalContext *string `json:"additionalContext,omitempty"`
}
NotificationSpecificOutput is the hook-specific output for Notification.
func (*NotificationSpecificOutput) GetHookEventName ¶
func (n *NotificationSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type PermissionDeniedInput ¶ added in v0.0.7
type PermissionDeniedInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
ToolName string `json:"tool_name"`
ToolInput interface{} `json:"tool_input"`
ToolUseID string `json:"tool_use_id"`
Reason string `json:"reason"`
}
PermissionDeniedInput is the input for PermissionDenied hooks.
func (*PermissionDeniedInput) GetHookEventName ¶ added in v0.0.7
func (p *PermissionDeniedInput) GetHookEventName() Event
GetHookEventName implements Input.
type PermissionDeniedSpecificOutput ¶ added in v0.0.7
type PermissionDeniedSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "PermissionDenied"
Retry *bool `json:"retry,omitempty"`
}
PermissionDeniedSpecificOutput is the hook-specific output for PermissionDenied.
func (*PermissionDeniedSpecificOutput) GetHookEventName ¶ added in v0.0.7
func (p *PermissionDeniedSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type PermissionRequestInput ¶
type PermissionRequestInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
ToolName string `json:"tool_name"`
ToolInput map[string]any `json:"tool_input"`
PermissionSuggestions []any `json:"permission_suggestions"`
AgentID *string `json:"agent_id,omitempty"`
AgentType *string `json:"agent_type,omitempty"`
}
PermissionRequestInput is the input for PermissionRequest hooks.
func (*PermissionRequestInput) GetHookEventName ¶
func (p *PermissionRequestInput) GetHookEventName() Event
GetHookEventName implements Input.
type PermissionRequestSpecificOutput ¶
type PermissionRequestSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "PermissionRequest"
Decision map[string]any `json:"decision,omitempty"`
}
PermissionRequestSpecificOutput is the hook-specific output for PermissionRequest.
func (*PermissionRequestSpecificOutput) GetHookEventName ¶
func (p *PermissionRequestSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type PostCompactInput ¶ added in v0.0.7
type PostCompactInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
Trigger string `json:"trigger"`
CompactSummary string `json:"compact_summary"`
}
PostCompactInput is the input for PostCompact hooks.
func (*PostCompactInput) GetHookEventName ¶ added in v0.0.7
func (p *PostCompactInput) GetHookEventName() Event
GetHookEventName implements Input.
type PostToolUseFailureInput ¶
type PostToolUseFailureInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
ToolName string `json:"tool_name"`
ToolInput map[string]any `json:"tool_input"`
ToolUseID string `json:"tool_use_id"`
Error string `json:"error"`
IsInterrupt *bool `json:"is_interrupt,omitempty"`
AgentID *string `json:"agent_id,omitempty"`
AgentType *string `json:"agent_type,omitempty"`
}
PostToolUseFailureInput is the input for PostToolUseFailure hooks.
func (*PostToolUseFailureInput) GetHookEventName ¶
func (p *PostToolUseFailureInput) GetHookEventName() Event
GetHookEventName implements Input.
type PostToolUseFailureSpecificOutput ¶
type PostToolUseFailureSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "PostToolUseFailure"
AdditionalContext *string `json:"additionalContext,omitempty"`
}
PostToolUseFailureSpecificOutput is the hook-specific output for PostToolUseFailure.
func (*PostToolUseFailureSpecificOutput) GetHookEventName ¶
func (p *PostToolUseFailureSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type PostToolUseInput ¶
type PostToolUseInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
ToolName string `json:"tool_name"`
ToolInput map[string]any `json:"tool_input"`
ToolUseID string `json:"tool_use_id"`
ToolResponse any `json:"tool_response"`
AgentID *string `json:"agent_id,omitempty"`
AgentType *string `json:"agent_type,omitempty"`
}
PostToolUseInput is the input for PostToolUse hooks.
func (*PostToolUseInput) GetHookEventName ¶
func (p *PostToolUseInput) GetHookEventName() Event
GetHookEventName implements Input.
type PostToolUseSpecificOutput ¶
type PostToolUseSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "PostToolUse"
AdditionalContext *string `json:"additionalContext,omitempty"`
UpdatedMCPToolOutput any `json:"updatedMCPToolOutput,omitempty"` //nolint:tagliatelle // CLI protocol uses MCP acronym
}
PostToolUseSpecificOutput is the hook-specific output for PostToolUse.
func (*PostToolUseSpecificOutput) GetHookEventName ¶
func (p *PostToolUseSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type PreCompactInput ¶
type PreCompactInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
Trigger string `json:"trigger"` // "manual" or "auto"
CustomInstructions *string `json:"custom_instructions,omitempty"`
}
PreCompactInput is the input for PreCompact hooks.
func (*PreCompactInput) GetHookEventName ¶
func (p *PreCompactInput) GetHookEventName() Event
GetHookEventName implements Input.
type PreToolUseInput ¶
type PreToolUseInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
ToolName string `json:"tool_name"`
ToolInput map[string]any `json:"tool_input"`
ToolUseID string `json:"tool_use_id"`
AgentID *string `json:"agent_id,omitempty"`
AgentType *string `json:"agent_type,omitempty"`
}
PreToolUseInput is the input for PreToolUse hooks.
func (*PreToolUseInput) GetHookEventName ¶
func (p *PreToolUseInput) GetHookEventName() Event
GetHookEventName implements Input.
type PreToolUseSpecificOutput ¶
type PreToolUseSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "PreToolUse"
PermissionDecision *string `json:"permissionDecision,omitempty"`
PermissionDecisionReason *string `json:"permissionDecisionReason,omitempty"`
UpdatedInput map[string]any `json:"updatedInput,omitempty"`
AdditionalContext *string `json:"additionalContext,omitempty"`
}
PreToolUseSpecificOutput is the hook-specific output for PreToolUse.
func (*PreToolUseSpecificOutput) GetHookEventName ¶
func (p *PreToolUseSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type SessionEndInput ¶ added in v0.0.7
type SessionEndInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
Reason string `json:"reason"`
}
SessionEndInput is the input for SessionEnd hooks.
func (*SessionEndInput) GetHookEventName ¶ added in v0.0.7
func (s *SessionEndInput) GetHookEventName() Event
GetHookEventName implements Input.
type SessionStartInput ¶ added in v0.0.7
type SessionStartInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
Source string `json:"source"`
AgentType *string `json:"agent_type,omitempty"`
Model *string `json:"model,omitempty"`
}
SessionStartInput is the input for SessionStart hooks.
func (*SessionStartInput) GetHookEventName ¶ added in v0.0.7
func (s *SessionStartInput) GetHookEventName() Event
GetHookEventName implements Input.
type SessionStartSpecificOutput ¶ added in v0.0.7
type SessionStartSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "SessionStart"
AdditionalContext *string `json:"additionalContext,omitempty"`
InitialUserMessage *string `json:"initialUserMessage,omitempty"`
WatchPaths []string `json:"watchPaths,omitempty"`
}
SessionStartSpecificOutput is the hook-specific output for SessionStart.
func (*SessionStartSpecificOutput) GetHookEventName ¶ added in v0.0.7
func (s *SessionStartSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type SetupInput ¶ added in v0.0.7
type SetupInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
Trigger string `json:"trigger"`
}
SetupInput is the input for Setup hooks.
func (*SetupInput) GetHookEventName ¶ added in v0.0.7
func (s *SetupInput) GetHookEventName() Event
GetHookEventName implements Input.
type SetupSpecificOutput ¶ added in v0.0.7
type SetupSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "Setup"
AdditionalContext *string `json:"additionalContext,omitempty"`
}
SetupSpecificOutput is the hook-specific output for Setup.
func (*SetupSpecificOutput) GetHookEventName ¶ added in v0.0.7
func (s *SetupSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type SpecificOutput ¶
type SpecificOutput interface {
GetHookEventName() string
}
SpecificOutput is the interface for hook-specific outputs.
type StopFailureInput ¶ added in v0.0.7
type StopFailureInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
Error string `json:"error"`
ErrorDetails *string `json:"error_details,omitempty"`
LastAssistantMessage *string `json:"last_assistant_message,omitempty"`
}
StopFailureInput is the input for StopFailure hooks.
func (*StopFailureInput) GetHookEventName ¶ added in v0.0.7
func (s *StopFailureInput) GetHookEventName() Event
GetHookEventName implements Input.
type StopInput ¶
type StopInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
StopHookActive bool `json:"stop_hook_active"`
LastAssistantMessage *string `json:"last_assistant_message,omitempty"`
}
StopInput is the input for Stop hooks.
func (*StopInput) GetHookEventName ¶
GetHookEventName implements Input.
type SubagentStartInput ¶
type SubagentStartInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
AgentID string `json:"agent_id"`
AgentType string `json:"agent_type"`
}
SubagentStartInput is the input for SubagentStart hooks.
func (*SubagentStartInput) GetHookEventName ¶
func (s *SubagentStartInput) GetHookEventName() Event
GetHookEventName implements Input.
type SubagentStartSpecificOutput ¶
type SubagentStartSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "SubagentStart"
AdditionalContext *string `json:"additionalContext,omitempty"`
}
SubagentStartSpecificOutput is the hook-specific output for SubagentStart.
func (*SubagentStartSpecificOutput) GetHookEventName ¶
func (s *SubagentStartSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type SubagentStopInput ¶
type SubagentStopInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
StopHookActive bool `json:"stop_hook_active"`
AgentID string `json:"agent_id"`
AgentTranscriptPath string `json:"agent_transcript_path"`
AgentType string `json:"agent_type"`
LastAssistantMessage *string `json:"last_assistant_message,omitempty"`
}
SubagentStopInput is the input for SubagentStop hooks.
func (*SubagentStopInput) GetHookEventName ¶
func (s *SubagentStopInput) GetHookEventName() Event
GetHookEventName implements Input.
type SyncJSONOutput ¶
type SyncJSONOutput struct {
Continue *bool `json:"continue,omitempty"`
SuppressOutput *bool `json:"suppressOutput,omitempty"`
StopReason *string `json:"stopReason,omitempty"`
Decision *string `json:"decision,omitempty"` // "block"
SystemMessage *string `json:"systemMessage,omitempty"`
Reason *string `json:"reason,omitempty"`
HookSpecificOutput SpecificOutput `json:"hookSpecificOutput,omitempty"`
}
SyncJSONOutput represents a sync hook output.
type TaskCompletedInput ¶ added in v0.0.7
type TaskCompletedInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
TaskID string `json:"task_id"`
TaskSubject string `json:"task_subject"`
TaskDescription *string `json:"task_description,omitempty"`
TeammateName *string `json:"teammate_name,omitempty"`
TeamName *string `json:"team_name,omitempty"`
}
TaskCompletedInput is the input for TaskCompleted hooks.
func (*TaskCompletedInput) GetHookEventName ¶ added in v0.0.7
func (t *TaskCompletedInput) GetHookEventName() Event
GetHookEventName implements Input.
type TaskCreatedInput ¶ added in v0.0.7
type TaskCreatedInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
TaskID string `json:"task_id"`
TaskSubject string `json:"task_subject"`
TaskDescription *string `json:"task_description,omitempty"`
TeammateName *string `json:"teammate_name,omitempty"`
TeamName *string `json:"team_name,omitempty"`
}
TaskCreatedInput is the input for TaskCreated hooks.
func (*TaskCreatedInput) GetHookEventName ¶ added in v0.0.7
func (t *TaskCreatedInput) GetHookEventName() Event
GetHookEventName implements Input.
type TeammateIdleInput ¶ added in v0.0.7
type TeammateIdleInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
TeammateName string `json:"teammate_name"`
TeamName string `json:"team_name"`
}
TeammateIdleInput is the input for TeammateIdle hooks.
func (*TeammateIdleInput) GetHookEventName ¶ added in v0.0.7
func (t *TeammateIdleInput) GetHookEventName() Event
GetHookEventName implements Input.
type UnknownInput ¶ added in v0.0.7
type UnknownInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
Raw map[string]any `json:"raw"`
}
UnknownInput preserves unsupported future hook events instead of failing hard.
func (*UnknownInput) GetHookEventName ¶ added in v0.0.7
func (u *UnknownInput) GetHookEventName() Event
GetHookEventName implements Input.
type UserPromptSubmitInput ¶
type UserPromptSubmitInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
Prompt string `json:"prompt"`
}
UserPromptSubmitInput is the input for UserPromptSubmit hooks.
func (*UserPromptSubmitInput) GetHookEventName ¶
func (u *UserPromptSubmitInput) GetHookEventName() Event
GetHookEventName implements Input.
type UserPromptSubmitSpecificOutput ¶
type UserPromptSubmitSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "UserPromptSubmit"
AdditionalContext *string `json:"additionalContext,omitempty"`
}
UserPromptSubmitSpecificOutput is the hook-specific output for UserPromptSubmit.
func (*UserPromptSubmitSpecificOutput) GetHookEventName ¶
func (u *UserPromptSubmitSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type WorktreeCreateInput ¶ added in v0.0.7
type WorktreeCreateInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
Name string `json:"name"`
}
WorktreeCreateInput is the input for WorktreeCreate hooks.
func (*WorktreeCreateInput) GetHookEventName ¶ added in v0.0.7
func (w *WorktreeCreateInput) GetHookEventName() Event
GetHookEventName implements Input.
type WorktreeCreateSpecificOutput ¶ added in v0.0.7
type WorktreeCreateSpecificOutput struct {
HookEventName string `json:"hookEventName"` // "WorktreeCreate"
WorktreePath string `json:"worktreePath"`
}
WorktreeCreateSpecificOutput is the hook-specific output for WorktreeCreate.
func (*WorktreeCreateSpecificOutput) GetHookEventName ¶ added in v0.0.7
func (w *WorktreeCreateSpecificOutput) GetHookEventName() string
GetHookEventName implements SpecificOutput.
type WorktreeRemoveInput ¶ added in v0.0.7
type WorktreeRemoveInput struct {
BaseInput
HookEventName string `json:"hook_event_name"`
WorktreePath string `json:"worktree_path"`
}
WorktreeRemoveInput is the input for WorktreeRemove hooks.
func (*WorktreeRemoveInput) GetHookEventName ¶ added in v0.0.7
func (w *WorktreeRemoveInput) GetHookEventName() Event
GetHookEventName implements Input.