import type { RuntimeTask } from '../store/index.js'; import type { DaemonVerbCaller } from './daemon-verbs.js'; /** Where a task record came from, which decides what may be done to it. */ export type TaskOrigin = 'local' | 'daemon'; export interface UnionTask { readonly task: RuntimeTask; readonly origin: TaskOrigin; } export interface TasksUnionResult { readonly tasks: readonly UnionTask[]; /** * Why the daemon's half is missing, when it is. `null` means the union is * complete, either the daemon answered, or none is configured and the local * set genuinely IS every task. */ readonly daemonUnavailable: string | null; } /** The narrow local source: whatever already answers this surface's own tasks. */ export interface LocalTaskSource { list(limit: number): readonly RuntimeTask[]; get(taskId: string): RuntimeTask | null; } export interface TasksClient { /** Local rows union the daemon's, deduped by id with local winning. */ list(limit?: number): Promise; /** One task, local first, then the daemon. Null when neither has it. */ get(taskId: string): Promise; /** Cancel a daemon-owned task over `tasks.cancel`. */ cancel(taskId: string): Promise; /** Re-queue a daemon-owned task over `tasks.retry`. */ retry(taskId: string): Promise; } export declare function createTasksClient(deps: { readonly local: LocalTaskSource; readonly verbs: DaemonVerbCaller; }): TasksClient; //# sourceMappingURL=tasks-client.d.ts.map