import type { DatabaseSync } from 'node:sqlite'; import type { OneShotTerminalReason, Task, TaskWait } from '@xopcai/gateway-contract'; import type { Config } from '../../../config/schema.js'; import type { TaskRepository } from '../../../tasks/task-repository.js'; import type { TaskRunRepository } from '../../../tasks/task-run-repository.js'; import { type AttentionSource, type AttentionThread } from '../attention-repository.js'; import { type SettleOneShotSqlOptions } from '../one-shot-repository.js'; export type SettleOneShotThreadOptions = SettleOneShotSqlOptions; export declare function settleOneShotThread(db: DatabaseSync, threadId: string, opts: SettleOneShotThreadOptions): void; export declare function expireOverdueOneShotThreads(db: DatabaseSync, now: number): AttentionThread[]; export declare function hasOneShotReadAccess(config: Config, conversationId: string): boolean; export type OneShotVerificationResult = { kind: 'active'; ok: true; task: Task; wait: TaskWait; transcriptId?: string; sources?: AttentionSource[]; } | { kind: 'settled'; ok: false; status: 'completed' | 'expired'; reason: OneShotTerminalReason; recordCheckedAt: boolean; }; export declare function verifyOneShotTargetState(params: { db: DatabaseSync; config?: Config; thread: AttentionThread; tasks: TaskRepository; runs: TaskRunRepository; canReadTask?: (taskId: string, ownerId: string) => boolean; requireTranscriptSources?: boolean; }): OneShotVerificationResult;