import { type Task } from "../models.js"; import type { ListInput, SubmitInput, TaskStore } from "./base.js"; /** * SQLiteStore — better-sqlite3 backend executing the shared cairnq-protocol SQL. * * The driver is synchronous, which suits SQLite's single writer: claim is one * short transaction, the handler runs outside any transaction, and * progress/heartbeat/succeed/fail are each their own short write. JS being * single-threaded means sync DB calls never interleave. Cross-process contention * (deployment mode B) is absorbed by busy_timeout. */ export declare class SQLiteStore implements TaskStore { private readonly path; private readonly opts; private db; private stmts; private readonly statements; constructor(path: string, opts?: { busyTimeoutMs?: number; }); connect(): Promise; close(): Promise; private ensure; private applyMigrations; private checkVersion; private readProtocolVersion; protocolVersion(): Promise; private all; private run; private ownedWrite; submit(input: SubmitInput): Promise; get(taskId: string): Promise; getByKey(key: string): Promise; list(input?: ListInput): Promise; cancel(taskId: string): Promise; cancelByKey(key: string): Promise; retry(taskId: string, opts?: { resetAttempt?: boolean; }): Promise; retryByKey(key: string, opts?: { resetAttempt?: boolean; }): Promise; claim(input: { queues: string[]; workerId: string; leaseMs?: number; limit?: number; }): Promise; heartbeat(input: { taskId: string; workerId: string; leaseMs?: number; }): Promise; progress(input: { taskId: string; workerId: string; progress: number | null; message: string | null; }): Promise; succeed(input: { taskId: string; workerId: string; result: unknown; }): Promise; complete(input: { taskId: string; workerId: string; result: unknown; }): Promise; fail(input: { taskId: string; workerId: string; error: unknown; retryable?: boolean; delayMs?: number; }): Promise; }