import type { DatabaseSync } from 'node:sqlite'; import type { TaskAllocation, SpecialistTaskRequirements } from '@xopcai/gateway-contract'; export interface AllocationRow { id: string; task_id: string; origin_conversation_id: string; requirements_json: string; task_version: number; status: TaskAllocation['status']; selected_agent_id: string | null; selection_reason: string | null; reason_code: string | null; attempts: number; lease_token: string | null; lease_expires_at: number | null; next_attempt_at: number; updated_at: number; } export declare class TaskAllocationRepository { get(taskId: string): AllocationRow | undefined; summary(taskId: string): TaskAllocation | undefined; create(taskId: string, conversationId: string, taskVersion: number, requirements: SpecialistTaskRequirements): void; claim(now?: number): AllocationRow | undefined; owns(row: AllocationRow): boolean; publish(taskId: string, content: string): void; resetForReallocation(taskId: string, taskVersion: number, options?: { requirements?: Record; now?: number; }, db?: DatabaseSync): void; resetPendingWithRequirements(taskId: string, taskVersion: number, requirements: Record, now?: number, db?: DatabaseSync): void; retryAllocation(taskId: string, taskVersion: number, now?: number, db?: DatabaseSync): void; cancelUnassigned(taskId: string, now?: number, db?: DatabaseSync): void; cancelAll(taskId: string, options?: { touchUpdatedAt?: boolean; now?: number; }, db?: DatabaseSync): void; cancelById(id: string, now?: number, db?: DatabaseSync): void; requeueById(id: string, options?: { taskVersion?: number; }, db?: DatabaseSync): void; setTaskVersionById(id: string, taskVersion: number, db?: DatabaseSync): void; markAssignedById(id: string, selectedAgentId: string, selectionReason: string, now?: number, db?: DatabaseSync): void; recordFailureById(id: string, input: { status: 'pending' | 'failed' | 'blocked'; reasonCode: string; selectionReason: string; nextAttemptAt: number; now?: number; }, db?: DatabaseSync): void; }