/** * Task listing with filters. * @task T4460 * @epic T4454 */ import type { RecordProjectionDisclosure, Task, TaskKind, TaskPopulation, TaskPriority, TaskRecord, TaskSeverity, TaskStatus, TaskType } from '@cleocode/contracts'; import type { LAFSPage } from '@cleocode/lafs'; import { type EngineResult } from '../engine-result.js'; import type { NextDirectives } from '../mvi-helpers.js'; import { LIST_BINDING_SAGA_GROUPS, SAGA_GROUPS_RELATION, SAGA_LABEL } from '../sagas/constants.js'; import { type DataAccessor } from '../store/data-accessor.js'; export { LIST_BINDING_SAGA_GROUPS, SAGA_GROUPS_RELATION, SAGA_LABEL }; /** Compact task representation — minimal fields for list responses. */ export interface CompactTask extends RecordProjectionDisclosure { id: string; title: string; status: string; priority: string; type?: string; parentId?: string | null; /** Progressive disclosure directives for follow-up operations. */ _next?: NextDirectives; } /** Convert a full Task to compact representation with _next directives. */ export declare function toCompact(task: Task): CompactTask; /** Filter options for listing tasks. */ export interface ListTasksOptions { status?: TaskStatus; priority?: TaskPriority; type?: TaskType; /** * Severity axis filter (`P0`-`P3`), orthogonal to {@link priority}. * @task T12120 — GH #1245; previously accepted at the CLI and never applied. */ severity?: TaskSeverity | TaskSeverity[]; /** * Kind axis filter (ADR-066), orthogonal to {@link type}. * @task T12120 — GH #1246; previously accepted at the CLI and never applied. */ kind?: TaskKind | TaskKind[]; parentId?: string; phase?: string; label?: string; /** * No-op, retained for compatibility. * * @remarks * T12120 (GH #1247): `--children` was advertised in `--help` as "limit * parent queries to direct children" and threaded through four layers into * this options bag, but `listTasks` never read it — because `parentId` * ALREADY restricts to direct children on every path (the default query * applies `eq(tasks.parentId, ...)`, and the saga branch resolves members * through the same `parentId` containment since T10638). There is no * transitive mode for it to narrow from, so it cannot change a result. * * Kept as an accepted field rather than removed so the advertised CLI * surface stays stable; `listTasks` asserts the equivalence in tests so a * future transitive mode is forced to give this flag real meaning instead * of leaving it a lie. */ children?: boolean; limit?: number; offset?: number; /** * When `true`, omit rows with `status='archived'` from the result set. * * @remarks * T948: convenience flag used by Studio surfaces that must never render * archived tasks (kanban, /tasks API). Translates to `excludeStatus: * ['archived']` at the accessor layer. Ignored when `status` is already * set to a non-archived value. */ excludeArchived?: boolean; /** Include archived rows with the same filters as ordinary rows. */ includeArchive?: boolean; /** * When `true`, order results by priority (critical → high → medium → low) * instead of the default position-based order. * * @remarks * T948: preserves the historic priority-first ordering of Studio's * `/api/tasks` and `/api/tasks/pipeline` endpoints, whose raw SQL used * `ORDER BY CASE priority WHEN 'critical' …`. */ sortByPriority?: boolean; } /** Result of listing tasks. */ export interface ListTasksResult { tasks: Task[]; total: number; filtered: number; population: TaskPopulation; page: LAFSPage; pagination?: { limit: number; offset: number; hasMore: boolean; }; /** * Tag identifying which resolution path produced `tasks`. Present when the * default `parentId` query was overridden by a routing branch. * * - `'saga.groups'` — legacy binding-source label retained for compatibility; * the `--parent` target was a Saga and children were resolved via * canonical `parentId` containment, not relation-based grouping. * * Absent when the default `parentId`-based query produced the result. * Dispatch layers (e.g. LAFS envelope wrappers) MAY lift this into * envelope meta as `meta.bindingSource`. * * @see ADR-088 — PM-Core V2 WorkGraph containment * @task T9658 */ bindingSource?: typeof LIST_BINDING_SAGA_GROUPS; } /** * List tasks with optional filtering and pagination. * * When `options.parentId` resolves to a Saga (`type='saga'`), children are * resolved via canonical `parentId` containment. All other filters (`status`, * `priority`, `type`, `phase`, `label`, `excludeArchived`) are applied to the * resolved member set in-memory. The returned `bindingSource` field is set to * `'saga.groups'` for legacy client compatibility only. * * @task T4460 * @task T9658 — Saga-aware --parent routing */ export declare function listTasks(options?: ListTasksOptions, cwd?: string, accessor?: DataAccessor): Promise; /** * List tasks with optional filters, wrapped in EngineResult. * * @param projectRoot - Absolute path to the project root * @param params - Optional filter, pagination, and format parameters * @returns EngineResult with task array, total count, and filtered count * * @task T1568 * @epic T1566 */ export declare function taskList(projectRoot: string, params?: { parent?: string; status?: string; priority?: string; type?: string; severity?: string | string[]; kind?: string | string[]; phase?: string; label?: string; children?: boolean; limit?: number; offset?: number; compact?: boolean; includeArchive?: boolean; }): Promise>; //# sourceMappingURL=list.d.ts.map