import type { SessionLocator, SessionPaths } from '../../session/paths.js'; import type { SessionId, TaskId, TenantId } from '../../types/ids/index.js'; import type { CreateTaskParams, Task, TaskEventListener, TaskStatus, TaskStore, UpdateTaskParams } from '../../types/task/index.js'; import { type Logger } from '../../utils/logger.js'; export interface DiskTaskStoreConfig { /** The project layout the session lives in. */ paths: SessionPaths; /** * The session whose tasks this store keeps, at `/tasks/`. * A child session names its ancestors, root first, as everywhere else in * the layout. */ session: SessionLocator; /** Stamped on a task whose creator names no tenant. */ tenantId?: TenantId; logger?: Logger; } /** A task was addressed to a session other than the one this store keeps. */ export declare class TaskSessionMismatchError extends Error { readonly name = "TaskSessionMismatchError"; readonly expected: SessionId; readonly actual: SessionId; constructor(expected: SessionId, actual: SessionId); } export declare class DiskTaskStore implements TaskStore { private readonly paths; private readonly session; private readonly tenantId?; private log; private listeners; private locks; constructor(config: DiskTaskStoreConfig); /** The session this store keeps the tasks of. */ get sessionId(): SessionId; private taskDir; private taskPath; private withLock; /** * Acquires locks on multiple task IDs in a canonical (lexicographic) order * to prevent deadlocks when operations touch several related tasks. * Duplicates are removed; each ID is locked exactly once. */ private withLocks; on(listener: TaskEventListener): () => void; private emit; create(params: CreateTaskParams): Promise; get(id: TaskId): Promise; update(id: TaskId, updates: UpdateTaskParams): Promise; delete(id: TaskId): Promise; /** * Every task of this store's session, oldest first. A `sessionId` filter * naming a different session lists nothing: that session's tasks are in * its own directory, not here. */ list(filter?: { status?: TaskStatus; owner?: string; sessionId?: SessionId; }): Promise; claim(id: TaskId, owner: string): Promise; block(blockerId: TaskId, blockedId: TaskId): Promise; reset(): Promise; private readTask; } //# sourceMappingURL=disk.d.ts.map