Documentation
¶
Overview ¶
Package trace defines shared types for conversation trace parsing. These types are produced by each provider's ParseTrace method and consumed by the TUI views for rendering.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EstimateTurnCost ¶
EstimateTurnCost calculates the estimated cost for a turn based on model name and token counts, delegating to the cost package.
func EstimateTurnCostLegacy ¶
EstimateTurnCostLegacy uses the original heuristic-based cost estimation from the view layer. It applies rough per-million-token rates based on model name substrings. Use EstimateTurnCost for more accurate pricing.
Types ¶
type Tailer ¶ added in v0.9.0
type Tailer struct {
// contains filtered or unexported fields
}
Tailer watches a JSONL file and calls onLine for each new complete line appended after the tailer starts. Uses fsnotify for immediate detection with a 1s poll fallback.
type ToolSpan ¶
type ToolSpan struct {
Name string
Snippet string // short description of the input
Success bool // true if tool succeeded
ErrorMsg string // error message if failed
OldString string // for Edit: the old text
NewString string // for Edit: the new text
ToolUseID string // for matching tool_result entries
}
ToolSpan represents a single tool call within a turn.
type Turn ¶
type Turn struct {
Number int
Timestamp time.Time
EndTime time.Time // timestamp of last entry in this turn (for duration)
UserLines []string // full user input text
Actions []ToolSpan
OutputLines []string
TokensIn int64
TokensOut int64
CostUSD float64 // calculated from tokens + model
Model string // model used for this turn
Subagent subagent.Info // subagent identity (empty for main thread)
}
Turn groups a user prompt with the assistant response into one logical unit -- the fundamental trace element for evaluation (input -> actions -> output).
func (Turn) ErrorCount ¶
ErrorCount returns the number of failed tool calls in this turn.