Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentEvent ¶
type AgentEvent struct {
Type EventType
Timestamp time.Time
// Init fields
Model string
SessionID string
// Thinking / Text fields
Text string
// ToolUse fields
ToolName string
ToolInput map[string]any
// ToolResult fields
Stdout string
Stderr string
IsError bool
// Complete fields
Result string
CostUSD float64
Usage Usage
}
AgentEvent is a parsed event from the agent's output stream.
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
Bridge manages the agent subprocess and pipes its output to a parser.
func NewBridge ¶
NewBridge creates a bridge for the given agent command. For Claude Code, it uses --print --output-format stream-json.
type ClaudeCodeParser ¶
type ClaudeCodeParser struct {
// contains filtered or unexported fields
}
ClaudeCodeParser parses Claude Code's stream-json output format.
func NewClaudeCodeParser ¶
func NewClaudeCodeParser(r io.Reader) *ClaudeCodeParser
NewClaudeCodeParser creates a parser that reads from the given reader.
func (*ClaudeCodeParser) Parse ¶
func (p *ClaudeCodeParser) Parse(ctx context.Context, events chan<- AgentEvent) error
Parse reads JSON lines from the reader and emits AgentEvents.
Click to show internal directories.
Click to hide internal directories.