import { type Clock, type JournalKind, type KernelPaths, type TaskActivity, type TaskHealth, type TaskRecord } from "./types.js"; export interface ClaimTaskOptions { readonly paths: KernelPaths; readonly clock: Clock; readonly expectedRunId?: string; readonly expectedRunVersion?: number; readonly taskId: string; readonly sourceDigest: string; readonly sourceSnapshot: Readonly>; readonly engine?: "claude" | "codex"; readonly model?: string; } /** * Live-decision task list for one campaign. Old-run projections never appear here. */ export declare function listTasksForRun(paths: KernelPaths, runId: string): TaskRecord[]; /** * Tasks for the journal-authoritative active campaign only. * Prefer `listTasksForRun` when the run id is already known. */ export declare function listTasks(paths: KernelPaths): TaskRecord[]; /** * Public read of a task under the active campaign. Rejects tasks that belong to another run. */ export declare function readTask(paths: KernelPaths, taskId: string): TaskRecord; export declare function readTaskForRun(paths: KernelPaths, runId: string, taskId: string): TaskRecord; export declare function tryReadTask(paths: KernelPaths, taskId: string): TaskRecord | null; /** * One claim transition: journal-first, complete next_task, then project under run dir. */ export declare function claimTask(options: ClaimTaskOptions): TaskRecord; /** Caller already holds the kernel lock. */ export declare function claimTaskUnlocked(options: ClaimTaskOptions): TaskRecord; export interface ApplyTaskPatchOptions { readonly paths: KernelPaths; readonly clock: Clock; readonly taskId: string; readonly expectedVersion: number; readonly kind: JournalKind; readonly operationId?: string; readonly patch: Partial>; readonly extraPayload?: Readonly>; readonly incrementAttempt?: boolean; } export declare function applyTaskPatch(options: ApplyTaskPatchOptions): TaskRecord; export declare function applyTaskPatchUnlocked(options: ApplyTaskPatchOptions): TaskRecord; /** @deprecated Prefer applyTaskPatch with an explicit kind. */ export interface UpdateTaskOptions { readonly paths: KernelPaths; readonly clock: Clock; readonly taskId: string; readonly expectedVersion: number; readonly activity?: TaskActivity; readonly health?: TaskHealth; readonly incrementAttempt?: boolean; readonly sourceDigest?: string | null; readonly sourceSnapshot?: Readonly> | null; readonly markSourceChanged?: boolean; readonly worktreeId?: string | null; readonly worktreePath?: string | null; readonly baseCommit?: string | null; readonly engine?: "claude" | "codex" | null; readonly model?: string | null; readonly adviceOperationId?: string | null; readonly lastFailureDigest?: string | null; readonly draftPrUrl?: string | null; } export declare function updateTask(options: UpdateTaskOptions): TaskRecord; export declare function createSyntheticGoalTask(paths: KernelPaths, clock: Clock, goalDigest: string, expected?: { readonly runId: string; readonly runVersion: number; }): TaskRecord; export declare function parseTaskRecord(value: unknown, label: string): TaskRecord;