Documentation
¶
Overview ¶
Package livetool reads and bounds transient tool-step bodies: harness's public projection of ToolCallStarted and ToolCallCompleted.
The bodies carry the tool's redacted audit summary and a capped result preview, never raw tool arguments. This package neither widens nor derives either; it only shortens them so one frame fits the transport cap.
Index ¶
Constants ¶
const ( // KindStarted is the body type of a tool call that began executing. KindStarted = "ToolCallStarted" // KindCompleted is the body type of a tool call that finished. KindCompleted = "ToolCallCompleted" )
Variables ¶
This section is empty.
Functions ¶
func Fit ¶
func Fit(body json.RawMessage, limit int) (json.RawMessage, bool)
Fit returns body shortened until its encoding is at most limit bytes. It truncates result_preview first and summary second, each at a rune boundary with a trailing ellipsis, and leaves every other member intact. A body that already fits is returned byte-identical. It refuses a body Parse refuses and one that cannot fit even with both members reduced to the ellipsis.
Types ¶
type Step ¶
type Step struct {
Version int `json:"v"`
Type string `json:"type"`
SessionID string `json:"session_id"`
LoopID string `json:"loop_id"`
TurnID string `json:"turn_id"`
StepID string `json:"step_id"`
ToolExecutionID string `json:"tool_execution_id"`
ToolUseID string `json:"tool_use_id"`
ToolName string `json:"tool_name"`
Summary string `json:"summary"`
IsError bool `json:"is_error"`
ElapsedMillis uint64 `json:"elapsed_ms"`
ResultPreview string `json:"result_preview"`
}
Step is the correlation and visible content of one public tool-step body.