Documentation
¶
Overview ¶
Package parse turns raw transcript lines and snapshots into typed events, leniently and without I/O.
Index ¶
Constants ¶
const MaxText = 64 << 10
MaxText caps Event.Text in bytes.
Variables ¶
var ErrBadLine = errors.New("parse: line is not valid JSON")
ErrBadLine is returned for input that is not valid JSON.
Functions ¶
Types ¶
type AgentMeta ¶
type AgentMeta struct {
AgentType, Description, ToolUseID, ParentAgentID string
SpawnDepth int
Finished *bool
}
AgentMeta is the content of an agent-*.meta.json snapshot.
type Event ¶
type Event struct {
Kind Kind
TS time.Time // zero if the line has none
CWD, Branch string
Sidechain bool
Text string // capped at MaxText, cut on a rune boundary
AI bool
Model string
Usage *Usage
ToolUseID, Tool, Summary, Skill, Idents string
IsError bool
Background bool // KindToolUse: run_in_background, so its tool result is only the launch ack
DurationMs, AgentTotalMs *int64
Failure *Failure
Meta *AgentMeta
// Agent time (spec 02 section 4), set on KindTouch events only.
TurnStart bool // a user line that is neither a tool_result nor isMeta
Work bool // an assistant line or a user line carrying a tool_result
WorkAsst bool // Work, and an assistant line
ReportedMs *int64 // Work: the duration the tool result reports (durationMs, else totalDurationMs)
}
Event is one typed fact extracted from a line or snapshot; which fields are set depends on Kind.
type FileInfo ¶
FileInfo is the result of ClassifyPath.
func ClassifyPath ¶
ClassifyPath classifies a path relative to the projects root.