/** * Task ID sequence management core module. * @task T4538 * @epic T4454 */ import { type DataAccessor } from '../store/data-accessor.js'; /** Show current sequence state. */ export declare function showSequence(cwd?: string): Promise>; /** Check sequence integrity. */ export declare function checkSequence(cwd?: string, accessor?: DataAccessor): Promise>; /** Repair result with proper typing. */ export interface RepairResult { repaired: boolean; message: string; counter: number; oldCounter?: number; newCounter?: number; } /** Repair sequence if behind. */ export declare function repairSequence(cwd?: string, accessor?: DataAccessor): Promise; /** * Atomically allocate the next task ID via SQLite. * * Uses a SAVEPOINT (instead of BEGIN IMMEDIATE) so that this function * can be called from within an outer transaction without causing * "cannot start a transaction within a transaction" errors (T9814). * * SQLite SAVEPOINTs nest correctly: * - Called outside a transaction: the SAVEPOINT implicitly begins one. * - Called inside a transaction (e.g., addBatchTasks outer tx): * the SAVEPOINT creates a logical checkpoint within the outer tx. * RELEASE commits the savepoint; ROLLBACK TO reverts only to it. * * Falls back to repair+retry if the sequence counter is behind * the actual max task ID (e.g., stale counter from installations * that never incremented it). * * @task T5184 * @task T9814 — SAVEPOINT for nestability inside batch-insert outer transaction */ export declare function allocateNextTaskId(cwd?: string, retryCount?: number): Promise; //# sourceMappingURL=index.d.ts.map