Observation
The protocol evidence a session holds: the transcript, the state document, the last run and its pause, as the backend's events gave them.
import type { Observation } from '@threadplane/ag-ui';Declaration
export interface Observation {
readonly clientToolCatalog?: readonly string[];
readonly decision?: Decision;
readonly earlierSubagents?: Subagents;
readonly hold?: 'hydrating' | 'checking' | 'storage';
readonly plan?: readonly AgentPlanStep[];
readonly reasoningDurations?: Readonly<Record<string, number>>;
readonly run?: {
readonly id: string;
readonly outcome?: CompleteOutcome;
readonly failure?: {
readonly status: number;
};
readonly terminal?: OwnedRootTerminal;
readonly legacyInterrupt?: OwnedLegacyInterrupt;
};
readonly state: PlainValue;
readonly status: 'idle' | 'running' | 'error';
readonly subagents: Subagents;
readonly transcript: Transcript;
}Members
clientToolCatalog
The names of the client tools declared through session.clientTools.
Present, and possibly empty, on a session with that capability. It is
what pendingClientTools is read against, and is not published itself.
readonly clientToolCatalog?: readonly string[];decision
readonly decision?: Decision;earlierSubagents
Children with terminal evidence from earlier invocations, and children supplied at restore. Absent when there are none.
readonly earlierSubagents?: Subagents;hold
Set while the owner cannot take a command for a reason of its own: the saved thread is loading, a status check is running, or storage failed.
readonly hold?: 'hydrating' | 'checking' | 'storage';plan
Steps the agent declared in the state's todos list, [{ content, status }]. Absent when the state holds no such list.
readonly plan?: readonly AgentPlanStep[];reasoningDurations
Measured arrival time of root reasoning messages, in milliseconds, by message ID. Present once a reasoning message has both started and ended in this session; restored reasoning has none.
readonly reasoningDurations?: Readonly<Record<string, number>>;run
readonly run?: {
readonly id: string;
readonly outcome?: CompleteOutcome;
readonly failure?: {
readonly status: number;
};
readonly terminal?: OwnedRootTerminal;
readonly legacyInterrupt?: OwnedLegacyInterrupt;
};state
The literal state document, as requests send it.
readonly state: PlainValue;status
Whether a run is going, and whether the last one failed.
readonly status: 'idle' | 'running' | 'error';subagents
Children observed in the current root invocation.
readonly subagents: Subagents;transcript
Every protocol message of the thread, in order.
readonly transcript: Transcript;