export type TaskConversationStatus = 'idle' | 'active'; export type TaskSessionRole = 'primary' | 'discussion' | 'execution'; export type TaskSessionStatus = 'active' | 'completed' | 'superseded' | 'failed'; export interface TaskConversationState { taskId: string; activeSessionKey?: string; currentExecutorAgentId?: string; assignmentEpoch: number; status: TaskConversationStatus; updatedAt: number; } export interface TaskSessionLink { id: string; taskId: string; sessionKey: string; role: TaskSessionRole; agentId?: string; runId?: string; assignmentEpoch: number; status: TaskSessionStatus; startedAt: number; endedAt?: number; createdAt: number; } export interface TaskHandoffSnapshot { id: string; taskId: string; fromSessionKey?: string; toSessionKey: string; fromAgentId?: string; toAgentId: string; assignmentEpoch: number; payload: Record; createdAt: number; } export declare class TaskConversationConflictError extends Error { } export declare class TaskConversationRepository { findHandoffByIdempotencyKey(input: { taskId: string; expectedTaskVersion: number; toAgentId: string; idempotencyKey: string; }): TaskHandoffSnapshot | undefined; getState(taskId: string): TaskConversationState | undefined; requireState(taskId: string): TaskConversationState; listSessions(taskId: string): TaskSessionLink[]; getActiveSession(taskId: string): TaskSessionLink | undefined; resolveActiveExecutionSession(sessionKey: string): TaskSessionLink | undefined; activateExecutionSession(input: { taskId: string; sessionKey: string; agentId: string; runId?: string; now?: number; }): TaskConversationState; completeHandoff(input: { taskId: string; expectedTaskVersion: number; toSessionKey: string; toAgentId: string; idempotencyKey: string; payload: Record; now?: number; }): { state: TaskConversationState; snapshot: TaskHandoffSnapshot; taskVersion: number; }; getLatestHandoff(taskId: string): TaskHandoffSnapshot | undefined; }