/** * Cross-field validation, normalization, and deterministic topological layering * for declarative task graphs. The function rejects the whole graph before any * workflow starts and returns only package-owned normalized data. * @module dsh-tool-orchestrate/graph */ import type { NormalizedTaskGraph, OrchestrateTasksInput } from './types.ts'; /** Deployment-owned graph limits (validated by the plugin config resolver). */ export interface GraphLimits { /** Maximum tasks in one orchestration call. */ readonly maxTasks: number; /** Maximum direct dependencies per task. */ readonly maxDependencies: number; /** Maximum normalized characters in one task prompt. */ readonly maxPromptChars: number; } /** The task-id vocabulary shared by the tool description and graph validation. */ export declare const TASK_ID_PATTERN: RegExp; /** Rejected declarative graph; `violations` lists actionable task paths and ids. */ export declare class TaskGraphError extends Error { /** Every collected violation in deterministic walk order. */ readonly violations: readonly string[]; constructor(violations: readonly string[]); } /** * Validate and normalize one declarative task graph. * @param input - untrusted model-facing input (the tool schema already rejects * unknown fields; this boundary also handles direct unit-test callers). * @param limits - deployment-owned graph limits. * @returns The normalized tasks and deterministic topological layers. */ export declare function normalizeTaskGraph(input: OrchestrateTasksInput, limits: GraphLimits): NormalizedTaskGraph;