/** * Structural validator for HotMesh YAML pipe syntax. * * HotMesh collation errors are silent at deploy time but catastrophic at * runtime — a single malformed @pipe in an activated workflow poisons the * engine's stream, causing every execution attempt to fail with a * collation-error until the database is wiped. * * This module provides: * validatePipeStructure — throws on any structurally invalid @pipe * repairPipeStructure — auto-repairs safe-to-fix patterns, then validates * * Call repairPipeStructure before storing or deploying any YAML. * * ## What constitutes a valid @pipe row * * An @pipe value is a YAML sequence. Each element (row) must be one of: * 1. A YAML sequence (array) — operands row OR function call row * 2. A YAML mapping with '@pipe' key — nested sub-pipe * * Invalid row types that cause collation errors: * - A bare string: '{@object.create}' → must be ['{@object.create}'] * - A number/bool: 42, true → must be wrapped in an array * - A double-nested sequence: [[...]] → row itself is an array of arrays */ export interface PipeViolation { path: string; rowIndex: number; rowValue: unknown; message: string; repairable: boolean; } /** * Parse the YAML and check every @pipe for structural violations. * Throws a descriptive error listing all violations if any are found. */ export declare function validatePipeStructure(yamlContent: string): void; /** * Auto-repair safe violations (bare strings/scalars → array rows), then * validate that no unfixable violations remain. * * Returns the repaired YAML string. Throws if unfixable violations exist. */ export declare function repairPipeStructure(yamlContent: string): string;