Documentation
¶
Overview ¶
Package observation contains decoded, read-only session facts. These values carry no backend request IDs, process handles, or execution capabilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandAction ¶
type CommandAction struct{ Type, Command, Path, Query string }
type Event ¶
type Event struct {
At, Started time.Time
Kind Kind
ThreadID, TurnID, ItemID, Delta, TurnStatus string
Item Item
Thread Thread
ThreadStatus, ProcessID, Stdin string
Context Context
}
Event is an immutable observation. Started is present on retained item completions; synthetic starts and deltas are the replay consumer's policy.
type FileChange ¶
type Item ¶
type Item struct {
SavedPath string
CompactionReference string // Exact retained replacement bound to this native boundary.
UserShell bool // Host-identified command entered by the user.
ID, Type, Status, Text, Delivery, Phase, Cwd, Path string
Command, ProcessID, ClientID string
Tool string
Server string // MCP server identity.
Arguments, Result, Error jsontext.Value // Opaque MCP input and outcome.
DurationMS *int64
Summary []string
Content jsontext.Value
AggregatedOutput *string
ExitCode *int
Questions []Question
Changes []FileChange
CommandActions []CommandAction
Query string
Action *WebSearchAction
Results *int
}
Item contains the retained facts used by session presentation. Content and question options preserve opaque user-content blocks for their own consumer; raw/private reasoning is never included.
type ItemRef ¶
type ItemRef struct{ ThreadID, TurnID, ItemID string }
ItemRef preserves host identity independently of display names and feed order.
type Kind ¶
type Kind string
const ( TurnStarted Kind = "turn/started" TurnCompleted Kind = "turn/completed" ItemStarted Kind = "item/started" ItemCompleted Kind = "item/completed" AgentDelta Kind = "item/agentMessage/delta" ReasoningDelta Kind = "item/reasoning/summaryTextDelta" CommandDelta Kind = "item/commandExecution/outputDelta" ProviderStarted Kind = "replay/providerStarted" ProviderCompleted Kind = "replay/providerCompleted" )
const ReasoningPart Kind = "item/reasoning/summaryPartAdded"
type TextItem ¶
type TextItem struct {
Ref ItemRef
Type, Text, Status string
Summary []string
AsyncQuestion, Final bool
}
TextItem contains only authored text and public-summary facts. User text is supplied by its Conversation consumer; no raw/private reasoning is carried.
type TextScope ¶
TextScope carries application-owned correlation stores. A nil Turn admits only authoritative completion text, without reviving a closed turn's state.
type TextUpdate ¶
type TextUpdate struct {
Ref ItemRef
Replaces string
Kind, Phase, Text, Status string
Observed, Completed time.Time
Thought time.Duration
Live bool
Sequence uint64
}
TextUpdate is a transient projection into an existing feed, not another transcript. Sequence is assigned by the feed consumer before terminal pacing.
type Transcript ¶
type Transcript interface {
// current is false only when the application knows another turn is active.
TurnCompleted(thread, turn, status string, at time.Time, current bool, stores TextScope) []TextUpdate
Observe(TextEvent, bool, TextScope) []TextUpdate
ProviderStarted(thread string, at time.Time, store *scope.Store) []TextUpdate
OtherItemStarted(thread string, store *scope.Store) []TextUpdate
}
Transcript observes admitted text without execution, storage or renderer capabilities. Historical projection is deliberately separate from live state.