Documentation
¶
Index ¶
Constants ¶
View Source
const ( SessionStart = "SessionStart" UserPromptSubmit = "UserPromptSubmit" PreToolUse = "PreToolUse" PostToolUse = "PostToolUse" PostToolUseFailure = "PostToolUseFailure" PreCompact = "PreCompact" PostCompact = "PostCompact" Stop = "Stop" SessionEnd = "SessionEnd" )
Event names. config.HookEvents lists the same set for validation.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DeniedError ¶ added in v0.107.13
type DeniedError struct {
Reason string
}
DeniedError is a PreToolUse hook's structured refusal: it exited 0 and printed {"decision":"deny","reason":"..."} as its output or as the last output line.
func (*DeniedError) Error ¶ added in v0.107.13
func (e *DeniedError) Error() string
type Event ¶
type Event struct {
Name string `json:"event"`
SessionID string `json:"sessionId,omitempty"`
CWD string `json:"cwd,omitempty"`
Prompt string `json:"prompt,omitempty"`
ToolID string `json:"toolId,omitempty"`
ToolName string `json:"toolName,omitempty"`
ToolArgs string `json:"toolArgs,omitempty"`
ToolResult string `json:"toolResult,omitempty"`
// Trigger is "auto" or "manual" for PreCompact and PostCompact.
Trigger string `json:"trigger,omitempty"`
// MessagesBefore and TokensBefore describe the context PreCompact and
// PostCompact compact; MessagesAfter and TokensAfter the result (PostCompact).
// Tokens are the agent's estimate.
MessagesBefore int `json:"messagesBefore,omitempty"`
TokensBefore int `json:"tokensBefore,omitempty"`
MessagesAfter int `json:"messagesAfter,omitempty"`
TokensAfter int `json:"tokensAfter,omitempty"`
// Summary is the new compaction summary (PostCompact).
Summary string `json:"summary,omitempty"`
// Reason says why a session ended (SessionEnd): "exit", "close" or "switch".
Reason string `json:"reason,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.