events

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const MaxFinalOutputRunes = 4096

Variables

This section is empty.

Functions

func BoundedFinalOutput added in v0.20.0

func BoundedFinalOutput(text string) string

func Int64 added in v0.20.0

func Int64(value any) (int64, bool)

Types

type Event

type Event struct {
	Event     string         `json:"event"`
	SessionID string         `json:"session_id,omitempty"`
	Fields    map[string]any `json:"-"`
}

func BoundFinalOutput added in v0.20.0

func BoundFinalOutput(event Event) Event

func Clone added in v0.20.0

func Clone(event Event) Event

func (Event) MarshalJSON added in v0.1.0

func (e Event) MarshalJSON() ([]byte, error)

func (*Event) UnmarshalJSON added in v0.1.0

func (e *Event) UnmarshalJSON(data []byte) error

type SessionState added in v0.15.0

type SessionState struct {
	SessionID         string   `json:"session_id,omitempty"`
	RunID             string   `json:"run_id,omitempty"`
	Backend           string   `json:"backend,omitempty"`
	Phase             string   `json:"phase,omitempty"`
	ChannelReady      bool     `json:"channel_ready,omitempty"`
	PromptQueued      bool     `json:"prompt_queued,omitempty"`
	PromptSubmitted   bool     `json:"prompt_submitted,omitempty"`
	WaitingPermission bool     `json:"waiting_permission,omitempty"`
	LastReportState   string   `json:"last_report_state,omitempty"`
	LastReplyTo       string   `json:"last_reply_to,omitempty"`
	FinishStatus      string   `json:"finish_status,omitempty"`
	FinishSummary     string   `json:"finish_summary,omitempty"`
	FilesChanged      []string `json:"files_changed,omitempty"`
	StopReason        string   `json:"stop_reason,omitempty"`
	Ended             bool     `json:"ended,omitempty"`
	LastEvent         string   `json:"last_event,omitempty"`
}

SessionState is a best-effort synthesized view of a live session derived from the raw event stream. It is transport-agnostic, but it preserves claude-channel-specific lifecycle signals when they are present.

type SessionTracker added in v0.15.0

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

SessionTracker incrementally derives SessionState from Avenor events.

func NewSessionTracker added in v0.15.0

func NewSessionTracker(sessionID string) *SessionTracker

func (*SessionTracker) Observe added in v0.15.0

func (t *SessionTracker) Observe(ev Event) bool

Observe applies one event to the tracker and reports whether the derived state changed.

func (*SessionTracker) Snapshot added in v0.15.0

func (t *SessionTracker) Snapshot() SessionState

Jump to

Keyboard shortcuts

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