Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupOldLogs ¶
CleanupOldLogs removes date directories older than retentionDays from logsDir. referenceDate is in YYYY-MM-DD format. Returns count of removed directories.
func IngestFromReader ¶
IngestFromReader reads a single JSON hook payload from r, normalizes it, and writes it to the log. It first tries forwarding to the daemon socket; on failure, falls back to direct file write.
func WriteToPath ¶
WriteToPath appends a single event to a specific file path. Used for fallback when the daemon is unreachable.
Types ¶
type Event ¶
type Event struct {
Timestamp time.Time `json:"timestamp"`
SessionID string `json:"session_id"`
Harness string `json:"harness"`
EventType string `json:"event_type"`
Source string `json:"source,omitempty"`
ToolName string `json:"tool_name,omitempty"`
ToolInput map[string]interface{} `json:"tool_input,omitempty"`
ToolResponseSummary string `json:"tool_response_summary,omitempty"`
ExitCode *int `json:"exit_code,omitempty"`
WorkingDirectory string `json:"working_directory"`
Error string `json:"error,omitempty"`
Reason string `json:"reason,omitempty"`
SessionDurationMs int64 `json:"session_duration_ms,omitempty"`
NumTurns int `json:"num_turns,omitempty"`
Metrics *EventMetrics `json:"metrics,omitempty"`
BootstrapSource string `json:"source_type,omitempty"`
}
Event is the normalized AgentJIT event schema.
func NormalizeEvent ¶
NormalizeEvent converts a raw Claude Code hook JSON payload into a normalized Event. maxResponseBytes controls truncation of tool_response.
type EventMetrics ¶
type EventMetrics struct {
ExecutionDurationMs int64 `json:"execution_duration_ms,omitempty"`
}
EventMetrics holds optional performance metrics for an event.