/** * buildTaskTree — pure-functional task hierarchy builder. * * Accepts a flat array of tasks and constructs a tree of {@link TaskTreeNode} * objects. No I/O, no DB access — all input supplied by the caller. * * @arch SDK Tool (Category B) — pure, no side effects, contracts-typed * @task T10068 * @epic T9835 */ import type { BuildTaskTreeInput, BuildTaskTreeOptions, BuildTaskTreeResult } from '@cleocode/contracts'; /** * Build a task hierarchy tree from a flat array of tasks. * * Pure functional — no I/O. The caller is responsible for loading tasks and * passing them in. When `rootId` is provided, only the subtree rooted at that * task is returned. When `opts.withBlockers` is true, each node is annotated * with `blockerChain` and `leafBlockers`. * * @param tasks - Flat array of all tasks (or a pre-filtered subset) * @param rootId - Optional root task ID; returns full tree when omitted * @param opts - Tree-build options * @returns Tree nodes and total node count * * @example * ```typescript * const { tree, totalNodes } = buildTaskTree(allTasks, 'T042'); * console.log(`${totalNodes} nodes in subtree`); * ``` * * @example * ```typescript * const { tree } = buildTaskTree(allTasks, undefined, { withBlockers: true }); * console.log(tree[0].blockerChain); * ``` */ export declare function buildTaskTree(tasks: BuildTaskTreeInput[], rootId?: string, opts?: BuildTaskTreeOptions): BuildTaskTreeResult; //# sourceMappingURL=build-task-tree.d.ts.map