Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileParser ¶
type FileParser struct {
// contains filtered or unexported fields
}
FileParser incrementally parses a JSONL session file, tracking state across calls.
func NewFileParser ¶
func NewFileParser() *FileParser
NewFileParser creates a new parser with empty state.
func (*FileParser) State ¶
func (p *FileParser) State() SessionState
State returns the current accumulated state.
func (*FileParser) Update ¶
func (p *FileParser) Update(reader FileReader, path string) (SessionState, error)
Update reads new data from the file and updates internal state.
func (*FileParser) UpdateBytes ¶
func (p *FileParser) UpdateBytes(data []byte) (SessionState, error)
UpdateBytes parses raw JSONL bytes (for testing). Resets offset to 0 on first call.
type FileReader ¶
FileReader abstracts reading bytes from a file at a given offset.
type OSFileReader ¶
type OSFileReader struct{}
OSFileReader implements FileReader using the real filesystem.
type SessionState ¶
type SessionState struct {
SessionID string
Cwd string
Slug string
StartedAt time.Time
LastActivity time.Time
IsWorking bool // true = Claude actively generating, false = idle/waiting
Subagents []Subagent
Tasks []Task
}
SessionState holds the parsed state for a single JSONL session file.
type Subagent ¶
type Subagent struct {
ToolUseID string // tool_use id (e.g. "toolu_01AaZ...") for completion tracking
Description string // from input.description
SubagentType string // "Explore", "Plan", etc.
AgentID string // from toolUseResult.agentId on completion
StartedAt time.Time
CompletedAt *time.Time // nil = still running
DurationMs int64 // from toolUseResult.totalDurationMs (0 if still running)
}
Subagent represents a spawned Agent tool_use and its lifecycle.
type Task ¶
type Task struct {
TaskID string // from toolUseResult.task.id (TaskCreate result) or input.taskId (TaskUpdate)
ToolUseID string // tool_use id of the TaskCreate — for mapping result → taskId
Subject string
Status string // "pending", "in_progress", "completed"
CreatedAt time.Time
UpdatedAt time.Time
}
Task represents a TaskCreate/TaskUpdate tool_use and its status.