/** * Tasks domain Core operations — ADR-057 D1 normalized shape. * * Each exported function follows the uniform `(projectRoot: string, params: Params)` * signature so the dispatch layer can call Core directly without positional-arg * coupling or inline business logic. * * The original Core functions (`addTask`, `listTasks`, etc.) are preserved with their * existing signatures for internal Core callers. This file provides **normalized wrappers** * that satisfy the ADR-057 D1 shape at the dispatch boundary. * * Field-name mapping (ADR-057 D2 canonical wire form → Core internal form): * - `params.parent` → `options.parentId` (tasks add/update) * - `params.kind` → `options.kind` (same field name, no mapping needed; T9072) * * @module tasks/ops * @task T1458 — tasks domain Core API SSoT alignment (ADR-057 D1+D2) * @task T1445 — `tasksCoreOps` type registry for OpsFromCore inference * @see ADR-057 — Core API normalization * @see packages/contracts/src/operations/tasks.ts */ import type { EngineResult, TaskKind, TaskPriority, TaskScope, TaskSeverity, TaskSize, TaskStatus, TasksOps, TaskType } from '@cleocode/contracts'; import { type AddTaskResult } from './add.js'; import { type AddBatchResult, type AddBatchTaskSpec } from './add-batch.js'; import { type ArchiveTasksResult } from './archive.js'; import { type CompleteTaskResult } from './complete.js'; import { type DeleteTaskResult } from './delete.js'; import { type FindTasksResult } from './find.js'; import { type ListTasksResult } from './list.js'; import { type TaskDetail } from './show.js'; import { type UpdateTaskResult } from './update.js'; /** * Normalized wrapper for {@link showTask}. * ADR-057 D1 shape: (projectRoot: string, params: TasksShowOpsParams) * * @param projectRoot - Absolute path to the project root. * @param params - Operation parameters. * @returns TaskDetail for the given task ID. * @throws CleoError with ExitCode.NOT_FOUND when task does not exist. */ export declare function tasksShowOp(projectRoot: string, params: { taskId: string; }): Promise; /** * Normalized wrapper for {@link listTasks}. * ADR-057 D1 shape: (projectRoot: string, params: TasksListOpsParams) * * @param projectRoot - Absolute path to the project root. * @param params - Operation parameters. * @returns List of tasks matching the given filters. */ export declare function tasksListOp(projectRoot: string, params?: { parent?: string; status?: TaskStatus; priority?: TaskPriority; type?: TaskType; phase?: string; label?: string; children?: boolean; limit?: number; offset?: number; }): Promise; /** * Normalized wrapper for {@link findTasks}. * ADR-057 D1 shape: (projectRoot: string, params: TasksFindOpsParams) * * @param projectRoot - Absolute path to the project root. * @param params - Operation parameters. * @returns Find results with matching tasks. */ export declare function tasksFindOp(projectRoot: string, params: { query: string; limit?: number; id?: string; exact?: boolean; status?: TaskStatus; includeArchive?: boolean; offset?: number; kind?: TaskKind; /** Filter by label — selects tasks whose `labels[]` includes this value. @task T9904 */ label?: string; }): Promise; /** * Normalized wrapper for {@link coreTaskSlice}. * ADR-057 D1 shape: (projectRoot: string, params: TasksSliceParams) * * @task T10628 */ export declare function tasksSliceOp(projectRoot: string, params: TasksOps['slice'][0]): Promise; /** * Normalized wrapper for {@link addTask}. * ADR-057 D1 shape: (projectRoot: string, params: TasksAddOpsParams) * * @param projectRoot - Absolute path to the project root. * @param params - Operation parameters. * @returns AddTaskResult with the created task. * @throws CleoError on validation failures or duplicate detection. */ export declare function tasksAddOp(projectRoot: string, params: { title: string; description?: string; /** Canonical wire field for parent task ID (ADR-057 D2). */ parent?: string; depends?: string[]; priority?: TaskPriority; labels?: string[]; type?: TaskType; acceptance?: string[]; phase?: string; size?: TaskSize; notes?: string; files?: string[]; dryRun?: boolean; /** Task kind axis — intent of work (T944/T9072). */ kind?: TaskKind; scope?: TaskScope; severity?: TaskSeverity; /** * Bypass the BRAIN duplicate-detection rejection guard (T1633). * Audited to `.cleo/audit/duplicate-bypass.jsonl`. */ forceDuplicate?: boolean; }): Promise; /** * Normalized wrapper for {@link tasksAddBatchOp}. * ADR-057 D1 shape: (projectRoot: string, params: TasksAddBatchParams) * * Wraps N `addTask` inserts in a single `dataAccessor.transaction()` so * any failure rolls back ALL inserts (true atomic batch). * * @param projectRoot - Absolute path to the project root. * @param params - Batch operation parameters (wire format — `parent` field). * @returns AddBatchResult with per-task results and aggregate count. * @throws CleoError when any task spec fails validation (all inserts reverted). * * @task T9814 */ export declare function tasksAddBatchOpNormalized(projectRoot: string, params: { tasks: AddBatchTaskSpec[]; defaultParent?: string; dryRun?: boolean; }): Promise>; export type { AddBatchResult, AddBatchTaskSpec }; /** * Normalized wrapper for {@link updateTask}. * ADR-057 D1 shape: (projectRoot: string, params: TasksUpdateOpsParams) * * @param projectRoot - Absolute path to the project root. * @param params - Operation parameters. * @returns UpdateTaskResult with the updated task and change log. * @throws CleoError with ExitCode.NOT_FOUND when task does not exist. */ export declare function tasksUpdateOp(projectRoot: string, params: { taskId: string; title?: string; description?: string; status?: TaskStatus; priority?: TaskPriority; notes?: string; labels?: string[]; addLabels?: string[]; removeLabels?: string[]; depends?: string[]; addDepends?: string[]; removeDepends?: string[]; acceptance?: string[]; /** Canonical wire field for parent task ID (ADR-057 D2). */ parent?: string | null; type?: TaskType; size?: TaskSize; files?: string[]; /** Add files incrementally. @task T9242 */ addFiles?: string[]; /** Remove files incrementally. @task T9242 */ removeFiles?: string[]; pipelineStage?: string; kind?: TaskKind; scope?: TaskScope; /** Severity level — valid for any role (T9073). Orthogonal to priority. */ severity?: TaskSeverity; /** Clear the blockedBy free-text reason. @task T9241 */ clearBlockedBy?: boolean; }): Promise; /** * Normalized wrapper for {@link completeTask}. * ADR-057 D1 shape: (projectRoot: string, params: TasksCompleteOpsParams) * * @param projectRoot - Absolute path to the project root. * @param params - Operation parameters. * @returns CompleteTaskResult with the completed task. * @throws CleoError on gate failures or when task does not exist. */ export declare function tasksCompleteOp(projectRoot: string, params: { taskId: string; notes?: string; acknowledgeRisk?: string; }): Promise; /** * Normalized wrapper for {@link deleteTask}. * ADR-057 D1 shape: (projectRoot: string, params: TasksDeleteOpsParams) * * @param projectRoot - Absolute path to the project root. * @param params - Operation parameters. * @returns DeleteTaskResult with the deleted task. * @throws CleoError with ExitCode.NOT_FOUND when task does not exist. */ export declare function tasksDeleteOp(projectRoot: string, params: { taskId: string; force?: boolean; }): Promise; /** * Normalized wrapper for {@link archiveTasks}. * ADR-057 D1 shape: (projectRoot: string, params: TasksArchiveOpsParams) * * @param projectRoot - Absolute path to the project root. * @param params - Operation parameters. * @returns ArchiveTasksResult with the archived task IDs and count. */ export declare function tasksArchiveOp(projectRoot: string, params?: { taskId?: string; before?: string; taskIds?: string[]; includeCancelled?: boolean; dryRun?: boolean; }): Promise; /** * Type helper: extract the single-arg function type for a tasks operation. * * @typeParam Op - A key of `TasksOps` (e.g. `'show'`, `'add'`). */ type TaskCoreOperation = (params: TasksOps[Op][0]) => Promise; /** * Tasks operation signature registry — consumed by the dispatch layer for * `OpsFromCore` inference. * * @example * ```ts * import type { tasks as coreTasks } from '@cleocode/core'; * import type { OpsFromCore } from '../adapters/typed.js'; * * type TasksOps = OpsFromCore; * ``` * * @task T1445 — OpsFromCore inference migration */ export declare const tasksCoreOps: { readonly show: TaskCoreOperation<'show'>; readonly list: TaskCoreOperation<'list'>; readonly find: TaskCoreOperation<'find'>; readonly tree: TaskCoreOperation<'tree'>; readonly blockers: TaskCoreOperation<'blockers'>; readonly depends: TaskCoreOperation<'depends'>; readonly slice: TaskCoreOperation<'slice'>; readonly 'deps.validate': TaskCoreOperation<'deps.validate'>; readonly 'deps.tree': TaskCoreOperation<'deps.tree'>; readonly analyze: TaskCoreOperation<'analyze'>; readonly impact: TaskCoreOperation<'impact'>; readonly next: TaskCoreOperation<'next'>; readonly plan: TaskCoreOperation<'plan'>; readonly relates: TaskCoreOperation<'relates'>; readonly 'complexity.estimate': TaskCoreOperation<'complexity.estimate'>; readonly history: TaskCoreOperation<'history'>; readonly current: TaskCoreOperation<'current'>; readonly 'label.list': TaskCoreOperation<'label.list'>; readonly 'sync.links': TaskCoreOperation<'sync.links'>; readonly add: TaskCoreOperation<'add'>; readonly 'add-batch': TaskCoreOperation<'add-batch'>; readonly update: TaskCoreOperation<'update'>; readonly complete: TaskCoreOperation<'complete'>; readonly cancel: TaskCoreOperation<'cancel'>; readonly delete: TaskCoreOperation<'delete'>; readonly archive: TaskCoreOperation<'archive'>; readonly restore: TaskCoreOperation<'restore'>; readonly reparent: TaskCoreOperation<'reparent'>; readonly reorder: TaskCoreOperation<'reorder'>; readonly 'reorder-rank': TaskCoreOperation<'reorder-rank'>; readonly 'bulk-move': TaskCoreOperation<'bulk-move'>; readonly assignee: TaskCoreOperation<'assignee'>; readonly 'relates.add': TaskCoreOperation<'relates.add'>; readonly 'relates.add-batch': TaskCoreOperation<'relates.add-batch'>; readonly 'relates.remove': TaskCoreOperation<'relates.remove'>; readonly start: TaskCoreOperation<'start'>; readonly stop: TaskCoreOperation<'stop'>; readonly 'sync.reconcile': TaskCoreOperation<'sync.reconcile'>; readonly 'sync.links.remove': TaskCoreOperation<'sync.links.remove'>; readonly claim: TaskCoreOperation<'claim'>; readonly unclaim: TaskCoreOperation<'unclaim'>; readonly context: TaskCoreOperation<'context'>; }; //# sourceMappingURL=ops.d.ts.map