export type TaskCollaborationKind = 'progress' | 'question' | 'answer' | 'instruction' | 'ack' | 'result' | 'failure'; export type TaskCollaborationAuthor = 'main_agent' | 'worker_agent' | 'user' | 'system'; export interface TaskCollaborationEntry { id: string; taskId: string; taskRunId?: string; assignmentEpoch?: number; sequence: number; authorKind: TaskCollaborationAuthor; authorId: string; kind: TaskCollaborationKind; body: string; causationId?: string; createdAt: number; deliveryStatus?: 'pending' | 'delivered' | 'confirmed' | 'stale'; } export declare class TaskCollaborationRepository { list(taskId: string, afterSequence?: number, limit?: number): TaskCollaborationEntry[]; recent(taskId: string, beforeSequence?: number, limit?: number): TaskCollaborationEntry[]; /** Durable changes and acknowledgements, independent of the recent-chat window. */ coordination(taskId: string): TaskCollaborationEntry[]; get(entryId: string): TaskCollaborationEntry | undefined; latest(taskId: string): TaskCollaborationEntry | undefined; append(input: { taskId: string; taskRunId?: string; authorKind: TaskCollaborationAuthor; authorId: string; kind: TaskCollaborationKind; body: string; causationId?: string; idempotencyKey: string; deliverToWorker?: boolean; }): TaskCollaborationEntry; pendingDeliveries(limit?: number): Array<{ entry: TaskCollaborationEntry; clientMessageId: string; }>; pendingMainUpdates(limit?: number): Array<{ entry: TaskCollaborationEntry; conversationId: string; decision?: 'notify' | 'silent'; decisionReason?: string; failureCount: number; }>; decideMainUpdate(entryId: string, decision: 'notify' | 'silent', reason: string): void; hasNewerMainUpdate(taskId: string, sequence: number): boolean; hasNewerTerminalMainUpdate(taskId: string, sequence: number): boolean; /** * True when an earlier failure on this Task was already surfaced (or exhausted retries) * to the originating conversation without any subsequent user/main-agent instruction or answer. */ hasUnansweredNotifiedFailure(taskId: string, beforeSequence: number, conversationId: string): boolean; hasSubmittedMainUpdate(entryId: string): boolean; hasPendingMainQuestion(taskId: string, entryId?: string): boolean; markMainUpdateDelivered(entryId: string): void; deferMainUpdate(entryId: string, delayMs?: number): void; failMainUpdate(entryId: string, error: string, delayMs: number, terminal: boolean): void; private publishQuestionHandoff; markDelivered(entryId: string, conversationId: string, assignmentEpoch: number): void; canConfirm(entryId: string, conversationId: string, assignmentEpoch: number): boolean; markConfirmed(entryId: string): void; markStale(entryId: string): void; defer(entryId: string): void; }