events

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Kind     Kind
	Text     string
	Item     *agentsdk.RunItem
	Result   *agentsdk.RunResult
	Err      error
	History  []agentsdk.RunItem
	Pending  *agentsdk.Interruption
	Snapshot agentsdk.ProgressSnapshot
	Child    *agentsdk.ChildToolEvent
	SubAgent *agentsdk.SubAgentStreamEvent
}

Event is the typed SDK event shape hosts can render or persist.

type Kind

type Kind string

Kind identifies an SDK runtime event emitted to a host adapter.

const (
	KindStatus    Kind = "status"
	KindDelta     Kind = "delta"
	KindItem      Kind = "item"
	KindTrace     Kind = "trace"
	KindLog       Kind = "log"
	KindDone      Kind = "done"
	KindError     Kind = "error"
	KindChildTool Kind = "child_tool"
	KindSubAgent  Kind = "subagent"
	KindPhase     Kind = "phase"
)

type LineWriter

type LineWriter struct {
	// contains filtered or unexported fields
}

LineWriter turns JSONL content events into typed SDK events.

Hosts can attach this to SessionEventStream and render typed events instead of reparsing event JSON themselves.

func NewLineWriter

func NewLineWriter(sink Sink) *LineWriter

func (*LineWriter) Write

func (w *LineWriter) Write(p []byte) (int, error)

type Sink

type Sink interface {
	Emit(Event)
}

Sink consumes typed runtime events.

type SinkFunc

type SinkFunc func(Event)

SinkFunc adapts a function to Sink.

func (SinkFunc) Emit

func (f SinkFunc) Emit(ev Event)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL