timeline

package
v0.1.57 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HydrationEventsFromMessage

func HydrationEventsFromMessage(msg protocol.Message) []protocol.Event

Types

type Item

type Item struct {
	ID            string
	TurnID        string
	ItemID        string
	ParentID      string
	ToolCallID    string
	ApprovalID    string
	WorkflowRunID string
	ToolName      string
	Kind          ItemKind
	Phase         Phase
	Status        string
	Text          string
	Decision      string
	DecisionScope string
	ApprovalKeys  []string
	Metadata      map[string]any
	Events        []TimelineEvent
}

func (Item) Pending

func (item Item) Pending() bool

type ItemKind

type ItemKind string
const (
	ItemKindTool           ItemKind = "tool"
	ItemKindSubagent       ItemKind = "subagent"
	ItemKindParallelReason ItemKind = "parallel_reason"
	ItemKindWorkflow       ItemKind = "workflow"
	ItemKindHook           ItemKind = "hook"
	ItemKindUserInput      ItemKind = "user_input"
)

type Phase

type Phase string
const (
	PhaseRequested        Phase = "requested"
	PhaseApprovalRequired Phase = "approval_required"
	PhaseApprovalDecided  Phase = "approval_decided"
	PhaseStarted          Phase = "started"
	PhaseProgress         Phase = "progress"
	PhaseCompleted        Phase = "completed"
	PhaseFailed           Phase = "failed"
	PhaseCanceled         Phase = "canceled"
)

type Snapshot

type Snapshot struct {
	Items []Item
}

func (Snapshot) HasPendingItems

func (s Snapshot) HasPendingItems() bool

type TimelineEvent

type TimelineEvent struct {
	Kind             protocol.EventKind
	Phase            Phase
	Sequence         int64
	Text             string
	Status           string
	Decision         string
	DecisionScope    string
	ApprovalKeys     []string
	Metadata         map[string]any
	LocalResult      *protocol.LocalResult
	Hook             *protocol.HookRun
	StartedAt        time.Time
	ProgressMessages []protocol.ProgressStep
	Questions        []protocol.UserInputQuestion
	ToolOutcome      string
	ToolCode         string
	ToolPayload      map[string]any
}

type TurnTimelineBuilder

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

func NewTurnTimelineBuilder

func NewTurnTimelineBuilder() *TurnTimelineBuilder

func (*TurnTimelineBuilder) HandleEvent

func (b *TurnTimelineBuilder) HandleEvent(ev protocol.Event)

func (*TurnTimelineBuilder) Reset

func (b *TurnTimelineBuilder) Reset()

func (*TurnTimelineBuilder) Snapshot

func (b *TurnTimelineBuilder) Snapshot() Snapshot

Jump to

Keyboard shortcuts

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