import type { RunState } from "../contracts/orchestration.js";
export interface ChatState extends RunState {
    /** Chat-run status not present on the base RunState contract. */
    status?: string;
    /** Creation timestamp used by chat state initialisation. */
    createdAt?: string;
}
/**
 * Queue a shallow patch to the chat run state.json.
 * Patches are applied serially to avoid read-modify-write races.
 */
export declare function queueChatStatePatch(runId: string, patch: Partial<ChatState>, root?: string): Promise<void>;
/**
 * Update the lastHeartbeatAt timestamp (liveness ping).
 * Does NOT update lastActivityAt — use updateChatActivity for real output.
 */
export declare function updateChatHeartbeat(runId: string, root?: string): Promise<void>;
/**
 * Update lastActivityAt and optionally the chat node's thinking text.
 * Use this when there is real output (tool calls, thinking updates).
 */
export declare function updateChatActivity(runId: string, thinking?: string, root?: string): Promise<void>;
/**
 * Mark the chat run as done or failed.
 * Computes durationMs from startedAt for backward compatibility with old state.json consumers.
 */
export declare function finalizeChatState(runId: string, success: boolean, _exitCode?: number, root?: string): Promise<void>;
