/** * Task work management operations (start/stop/current). * @task T4462 * @task T4750 * @epic T4454 */ import '../hooks/handlers/index.js'; import type { KnowledgeCoverage, TaskClaim } from '@cleocode/contracts'; import type { DataAccessor } from '../store/data-accessor.js'; import { type ClaimOverrideFlags } from './claims.js'; import { currentTask, type TaskCurrentResult } from './current.js'; export type { Claimant, ClaimOverrideFlags, SessionHeartbeatResult, SpawnClaimReceipt, } from './claims.js'; export { claimModeFor, claimSpawnedTask, heartbeatProjectSession, releaseOwnClaim, releaseSpawnClaim, renewClaimsForSession, renewProjectSessionClaims, renewTaskClaim, resolveClaimant, } from './claims.js'; export { currentTask, type TaskCurrentResult }; /** Result of starting work on a task. */ export interface TaskStartResult { /** Coverage at task start; unavailable evidence never implies no impact. */ knowledgeCoverage?: KnowledgeCoverage; taskId: string; taskTitle: string; previousTask: string | null; /** * The claim lease this start holds on the task, or `null` when the caller * is not bound to a session (no lease is taken). @task T12502 */ claim: TaskClaim | null; } /** * Options for {@link startTask}: explicit, audited overrides of another * session's claim (T12502). */ export type StartTaskOptions = ClaimOverrideFlags; /** Task work history entry. */ export interface TaskWorkHistoryEntry { taskId: string; timestamp: string; } /** * Refuse to start `taskId` while it has unresolved dependencies — the * readiness check {@link startTask} runs before it takes any claim or writes * focus. Exported so a composite verb (`pivot`) can run it BEFORE its own * side effects instead of discovering the refusal half-way (T12502). * * @param acc - Task accessor. * @param taskId - The task about to be started. * @throws CleoError `DEPENDENCY_ERROR` naming the unresolved blockers. * @example * ```ts * await assertTaskStartable(acc, 'T2'); * ``` * @task T12502 */ export declare function assertTaskStartable(acc: DataAccessor, taskId: string): Promise; /** * Start working on a specific task. * * T12502: the start takes the caller session's claim lease on the task with a * compare-and-set inside the same write transaction as the focus write. When * another session holds the task the start is refused with `E_TASK_CLAIMED` * naming the holder and lease expiry; `takeOver` takes an expired lease and * `forceClaim` a live one (both audited). The human `assignee` is not touched. * Starting a new task releases the lease this session held on its previous one. * * @param taskId - Task to start. * @param cwd - Project root. * @param accessor - Task accessor (tests inject one). * @param options - Claim overrides (`--take-over`, `--force-claim`). * @task T4462 * @task T4750 * @task T12502 */ export declare function startTask(taskId: string, cwd?: string, accessor?: DataAccessor, options?: StartTaskOptions): Promise; /** * Stop working on the current task. T12502: releases the claim lease the * caller's session holds on it (a lease held by another session is left). * @task T4462 * @task T4750 * @task T12502 */ export declare function stopTask(cwd?: string, accessor?: DataAccessor): Promise<{ previousTask: string | null; }>; /** * Get task work history from session notes. * @task T4462 * @task T4750 */ export declare function getWorkHistory(cwd?: string, accessor?: DataAccessor): Promise; /** * Get task work history (canonical verb alias for dispatch layer). * @task T5323 */ export declare const getTaskHistory: typeof getWorkHistory; //# sourceMappingURL=index.d.ts.map