Documentation
¶
Overview ¶
Package codex provides typed views over native Codex hook payloads.
Codex ships a deliberate Claude dialect and publishes machine-readable JSON schemas in-repo; these structs mirror those schemas (DESIGN.md §3.2) and capture unknown fields in Extra so schema drift never drops data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompactInput ¶
type CompactInput struct {
SessionID string `json:"session_id"`
TurnID string `json:"turn_id"`
CWD string `json:"cwd"`
HookEventName string `json:"hook_event_name"`
Extra map[string]json.RawMessage `json:"-"`
}
CompactInput is the native PreCompact / PostCompact payload.
func PostCompact ¶
func PostCompact(e *agenthooks.Event) (*CompactInput, bool)
func PreCompact ¶
func PreCompact(e *agenthooks.Event) (*CompactInput, bool)
type NotifyPayload ¶
type NotifyPayload struct {
Type string `json:"type"`
TurnID string `json:"turn-id"`
ThreadID string `json:"thread-id"`
CWD string `json:"cwd"`
LastAssistant string `json:"last-assistant-message"`
Extra map[string]json.RawMessage `json:"-"`
}
NotifyPayload is the legacy `codex notify` argv transport (kebab-case).
type PermissionRequestInput ¶
type PermissionRequestInput struct {
SessionID string `json:"session_id"`
TurnID string `json:"turn_id"`
CWD string `json:"cwd"`
HookEventName string `json:"hook_event_name"`
ToolName string `json:"tool_name"`
ToolInput json.RawMessage `json:"tool_input"`
ToolUseID string `json:"tool_use_id"`
Extra map[string]json.RawMessage `json:"-"`
}
PermissionRequestInput is the native PermissionRequest payload.
func PermissionRequest ¶
func PermissionRequest(e *agenthooks.Event) (*PermissionRequestInput, bool)
type PostToolUseInput ¶
type PostToolUseInput struct {
SessionID string `json:"session_id"`
TurnID string `json:"turn_id"`
CWD string `json:"cwd"`
HookEventName string `json:"hook_event_name"`
ToolName string `json:"tool_name"`
ToolInput json.RawMessage `json:"tool_input"`
ToolUseID string `json:"tool_use_id"`
ToolResponse json.RawMessage `json:"tool_response"`
Extra map[string]json.RawMessage `json:"-"`
}
PostToolUseInput is the native PostToolUse payload. Codex folds tool failures into PostToolUse (§4.1) — inspect ToolResponse/Extra for error state.
func PostToolUse ¶
func PostToolUse(e *agenthooks.Event) (*PostToolUseInput, bool)
type PreToolUseInput ¶
type PreToolUseInput struct {
SessionID string `json:"session_id"`
TurnID string `json:"turn_id"`
CWD string `json:"cwd"`
HookEventName string `json:"hook_event_name"`
PermissionMode string `json:"permission_mode"`
ToolName string `json:"tool_name"`
ToolInput json.RawMessage `json:"tool_input"`
ToolUseID string `json:"tool_use_id"`
Extra map[string]json.RawMessage `json:"-"`
}
PreToolUseInput is the native PreToolUse payload.
func PreToolUse ¶
func PreToolUse(e *agenthooks.Event) (*PreToolUseInput, bool)
type SessionStartInput ¶
type SessionStartInput struct {
SessionID string `json:"session_id"`
CWD string `json:"cwd"`
HookEventName string `json:"hook_event_name"`
Source string `json:"source"`
Extra map[string]json.RawMessage `json:"-"`
}
SessionStartInput is the native SessionStart payload.
func SessionStart ¶
func SessionStart(e *agenthooks.Event) (*SessionStartInput, bool)
type StopInput ¶
type StopInput struct {
SessionID string `json:"session_id"`
TurnID string `json:"turn_id"`
CWD string `json:"cwd"`
HookEventName string `json:"hook_event_name"`
StopHookActive bool `json:"stop_hook_active"`
Extra map[string]json.RawMessage `json:"-"`
}
StopInput is the native Stop / SubagentStop payload.
func SubagentStop ¶
func SubagentStop(e *agenthooks.Event) (*StopInput, bool)
type UserPromptSubmitInput ¶
type UserPromptSubmitInput struct {
SessionID string `json:"session_id"`
TurnID string `json:"turn_id"`
CWD string `json:"cwd"`
HookEventName string `json:"hook_event_name"`
Prompt string `json:"prompt"`
Extra map[string]json.RawMessage `json:"-"`
}
UserPromptSubmitInput is the native UserPromptSubmit payload.
func UserPromptSubmit ¶
func UserPromptSubmit(e *agenthooks.Event) (*UserPromptSubmitInput, bool)