import { ChatState } from "./state/protocol/channels-chat/state.js"; import { SessionState } from "./state/protocol/channels-session/state.js"; /** A persisted history that could not be decoded. Distinct from a transport/HTTP failure. */ export declare class TaskEventReplayError extends Error { constructor(message: string); } /** The replayed state of a single session found in a task's persisted history. */ export interface IReplayedSession { /** Session channel URI (`ahp-session:/`). */ readonly session: string; /** Folded session-channel state. */ readonly state: SessionState; /** Folded chat-channel state, keyed by chat channel URI. */ readonly chats: ReadonlyMap; /** * The host-announced default chat, or a sole recorded chat consistent with all recorded catalogue evidence. * History without either retains the legacy `/chat` fallback. */ readonly defaultChat: string; /** Whether the default chat has recorded chat-channel actions rather than only a synthesized state. */ readonly hasRecordedDefaultChat?: boolean; /** Timestamp of the last persisted event, ISO 8601. */ readonly modifiedAt: string; } /** * Outcome of replaying a task's persisted AHP history. * * {@link truncated} MUST be surfaced rather than presented as a complete transcript: a partial * tail means the recorded conversation stops short of what actually happened. */ export interface IReplayedTaskHistory { /** Every session the task's history covers. A task may own more than one. */ readonly sessions: readonly IReplayedSession[]; /** Whether the recorded history ends mid-action, so the tail is missing. */ readonly truncated: boolean; } /** * Replay Mission Control's persisted AHP frames for a task. * * Returns `undefined` when the task has no AHP history at all (a cloud task that never ran on a * sandbox), which is not an error. */ export declare function replayTaskAhpEvents(events: readonly unknown[]): IReplayedTaskHistory | undefined; /** * Decode the `events` array of a Mission Control `GET /agents/tasks//events` response. * * The `total` cross-check guards against a silently short page being folded into a transcript * that looks whole. */ export declare function parseTaskEventsResponse(body: unknown): readonly unknown[];