Documentation
¶
Overview ¶
Package event provides lifecycle event streaming for agent runs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Type Type
Message any
ToolCall any
ToolResult any
ToolResults any
Messages any
TextDelta string
ReasoningDelta string
Update string
// DurationMs is elapsed milliseconds for completed phases (turn, tool, thinking).
DurationMs int64
// Step is the 1-based agent turn index when Type is TypeTurnEnd.
Step int
Err error
}
Event is a structured lifecycle notification for UI and harness consumers.
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream multiplexes agent lifecycle events to subscribers and exposes the final result.
func (*Stream) Await ¶
Await blocks until the stream ends and returns the final result. Multiple callers may Await the same stream; each receives an identical copy.
type Type ¶
type Type string
Type identifies lifecycle events emitted by the agent loop.
const ( TypeAgentStart Type = "agent_start" TypeTurnStart Type = "turn_start" TypeMessageStart Type = "message_start" TypeMessageUpdate Type = "message_update" TypeMessageEnd Type = "message_end" TypeToolExecutionStart Type = "tool_execution_start" TypeToolExecutionUpdate Type = "tool_execution_update" TypeToolExecutionEnd Type = "tool_execution_end" TypeTurnEnd Type = "turn_end" TypeAgentEnd Type = "agent_end" )
Click to show internal directories.
Click to hide internal directories.