import type { DatabaseSync } from 'node:sqlite'; import type { TaskAllocation, TaskOperationalState, TaskPresentation, TaskResolution } from '@xopcai/gateway-contract'; export interface DelegatedTaskSummary { id: string; title: string; objective?: string; phase: string; operationalState: TaskOperationalState; presentation: TaskPresentation; runStatus?: string; allocation?: TaskAllocation; createdAt: number; updatedAt: number; } export declare class TaskOriginRepository { listCurrent(conversationId: string): { id: string; title: string; phase: "ready" | "active" | "review" | "backlog" | "closed"; operationalState: "queued" | "cancelled" | "failed" | "running" | "waiting" | "allocating" | "idle" | "verifying" | "blocked"; resolution: "cancelled" | "done" | "duplicate" | "wont_do" | undefined; updatedAt: number; presentation: { status: "queued" | "cancelled" | "ready" | "active" | "paused" | "completed" | "failed" | "running" | "waiting" | "review" | "ended" | "allocating" | "verifying" | "blocked" | "needsUser" | "captured"; reason?: string | undefined; primaryAction?: { type: "view_results"; } | { type: "resume"; waitId: string; } | { type: "resolve_wait"; waitId: string; } | { type: "inspect_run"; runId: string; } | { type: "review"; } | { type: "signoff"; resultId: string; } | { type: "retry_allocation"; } | { type: "mark_ready"; } | { type: "start"; } | { type: "retry_run"; runId: string; } | undefined; }; attention: { kind: "allocation_blocked" | "allocation_failed" | "input_required" | "approval_required" | "dependency_blocked" | "run_failed" | "run_decision_required" | "verification_failed" | "verification_unverified" | "overdue" | "stale"; summary: string; sourceId?: string | undefined; } | undefined; prompt: { id: string; conversationId: string; } | undefined; artifact: { artifactId: string; title: string; kind: "file" | "document" | "presentation" | "spreadsheet" | "pdf" | "image" | "video" | "audio" | "site" | "archive"; availability: "expired" | "failed" | "materializing" | "available" | "missing"; location: "workspace" | "external_host" | "worktree" | "remote_runtime" | "artifact_store"; capabilities: ("open" | "preview" | "share" | "download" | "import" | "regenerate")[]; sourceFileId?: string | undefined; mimeType?: string | undefined; sha256?: string | undefined; sizeBytes?: number | undefined; uri?: string | undefined; workspaceRelativePath?: string | undefined; shareUrl?: string | undefined; thumbnailUrl?: string | undefined; expiresAt?: string | undefined; } | undefined; }[]; owns(taskId: string, conversationId: string): boolean; /** The most recent result shown after the preceding human input is the implicit continuation anchor. */ recentResultTask(conversationId: string, inputId: string, before: number): string | undefined; getConversationId(taskId: string, db?: DatabaseSync): string | undefined; getRequestInputId(taskId: string, db?: DatabaseSync): string | undefined; linkOrigin(input: { taskId: string; conversationId: string; createdAt: number; linkRunningOriginInput?: boolean; }, db?: DatabaseSync): void; refreshOriginContext(input: { taskId: string; conversationId: string; preserveExistingInputId?: boolean; }, db?: DatabaseSync): void; setOriginRequestBinding(input: { taskId: string; originTranscriptId: string; requestInputId: string; }, db?: DatabaseSync): void; bindSelectionRecordOrigin(taskId: string, selectionRecordId: string, db?: DatabaseSync): void; list(conversationId: string, limit?: number, options?: { offset?: number; order?: 'active-first' | 'recent'; query?: string; excludeClosed?: boolean; }): { items: DelegatedTaskSummary[]; total: number; }; listRecentEnded(conversationId: string, limit: number, offset: number): { total: number; items: { presentation: { status: "completed" | "failed" | "ended"; primaryAction: { type: "view_results"; }; }; artifact: { artifactId: string; title: string; kind: "file" | "document" | "presentation" | "spreadsheet" | "pdf" | "image" | "video" | "audio" | "site" | "archive"; availability: "expired" | "failed" | "materializing" | "available" | "missing"; location: "workspace" | "external_host" | "worktree" | "remote_runtime" | "artifact_store"; capabilities: ("open" | "preview" | "share" | "download" | "import" | "regenerate")[]; sourceFileId?: string | undefined; mimeType?: string | undefined; sha256?: string | undefined; sizeBytes?: number | undefined; uri?: string | undefined; workspaceRelativePath?: string | undefined; shareUrl?: string | undefined; thumbnailUrl?: string | undefined; expiresAt?: string | undefined; } | undefined; id: string; title: string; phase: string; resolution: TaskResolution | null; updatedAt: number; }[]; }; private endedWork; }