AgentWithHistory
Extension of Agent that exposes checkpoint history for time-travel UIs.
Concrete adapters that record per-node checkpoints (e.g. LangGraph) should implement this. Pure request/response runtimes that don't have checkpoints should implement plain Agent.
import type { AgentWithHistory } from '@threadplane/chat';Declaration
export interface AgentWithHistory<TState = unknown> extends Agent<TState> {
history: Signal<AgentCheckpoint[]>;
messageCheckpoints?: Signal<ReadonlyMap<string, string>>;
}Type parameters
TStateDefault:unknown
Members
history
history: Signal<AgentCheckpoint[]>;messageCheckpoints
Optional reactive map of messageId → checkpointId, computed by
walking history once: for each checkpoint, find the most recent
assistant message present in its values.messages and pair them.
UIs use this to anchor inline checkpoint markers on each assistant
turn. Missing on adapters that don't compute it.
messageCheckpoints?: Signal<ReadonlyMap<string, string>>;