/** What the agent is doing now. `unknown` is evidence-safe, not an error. */ export type AgentActivity = "unknown" | "working" | "needs_input" | "idle"; /** Whether the declared task remains open. Activity never changes this axis. */ export type TaskState = "active" | "blocked" | "done"; /** Raw fields stored in the disposable V3 coordination cache and rebuilt from canonical events. */ export interface SessionStateFields { activity?: AgentActivity; activity_updated_at?: string; activity_source?: string; task_state?: TaskState; task_state_updated_at?: string; task_state_reason?: string; } /** Reader-facing state with compatibility defaults applied. */ export interface SessionState extends SessionStateFields { activity: AgentActivity; task_state: TaskState; } export interface SessionStateSelector { instance_id?: string; session_id?: string; } export interface SessionStateEvidenceEvent { event_type: EventTypeV3; ts: string; payload?: Record; instance_id?: string; session_id?: string; } /** * Apply one canonical event to the two independent state axes. * * The table is deliberately evidence-only. Output chunks, post-tool events, * narration, coordination commands, and elapsed time cannot clear an observed * input wait. A command start only counts as progress when the session was * already inside an open turn (`working` or `needs_input`). */ export declare function applySessionStateEvent(current: Readonly, event: SessionStateEvidenceEvent): SessionStateFields; /** * Rebuild both axes from canonical events after a heartbeat has disappeared. * Events may be the whole ledger or an already-filtered session slice. */ export declare function foldSessionState(events: readonly SessionStateEvidenceEvent[], selector?: SessionStateSelector): SessionState; import type { EventTypeV3 } from "../../events/v3/contract.js"; //# sourceMappingURL=session-state.d.ts.map