import type { CreateWorkflowInput, LoopTarget, WorkflowSpec } from "../../types.js"; import { CodedError } from "../errors.js"; import { preflightTarget } from "../executor.js"; import { preflightWorkflow } from "../workflow-runner.js"; /** * Validation/preflight gates shared by CLI commands and route engines. Failures * throw a `GateError` carrying the gate kind and structured context so the CLI * error runner can render the stable `{ok:false, created:false, ...}` JSON shape. */ export declare class GateError extends CodedError { readonly gate: "validation" | "preflight"; readonly context: Record; constructor(gate: "validation" | "preflight", message: string, context: Record); } export declare function normalizeLoopTargetForStorage(target: unknown, context: Record, opts?: { baseDir?: string; }): Exclude; export declare function normalizeWorkflowForStorage(body: CreateWorkflowInput, context: Record): CreateWorkflowInput; export declare function workflowBodyFromFile(file: string, fallbackName: string | undefined, context: Record): CreateWorkflowInput; export declare function preflightLoopTarget(target: Exclude, context: Record, metadata: Parameters[1], opts: Parameters[2]): ReturnType; export declare function preflightStoredWorkflow(workflow: Parameters[0], context: Record, opts: Parameters[1]): ReturnType; export declare function workflowSpecForPreflight(body: CreateWorkflowInput, id?: string): WorkflowSpec;