import type { WorkflowDefinition } from "../flow/types.ts"; export type ValidationStage = "typescript" | "runtime" | "conformance"; export interface WorkflowCandidateValidation { readonly workflow: WorkflowDefinition; readonly checks: { readonly typescript: "passed"; readonly runtime: "passed"; readonly conformance: "passed" | "skipped"; }; readonly summary: string; } export interface ValidateWorkflowCandidateOptions { readonly source: string; /** Intended final path. The temporary candidate is written beside it so relative imports resolve identically. */ readonly targetPath: string; readonly projectRoot: string; readonly signal?: AbortSignal; /** Optional caller-owned semantic/structural check over the workflow that successfully loaded. */ readonly conformance?: (workflow: WorkflowDefinition) => string | undefined; /** Test seam; production uses a bounded, non-shell child process. */ readonly runCommand?: CommandRunner; } export interface ValidateWorkflowFileOptions { /** Absolute path to the workflow entry module already written on disk. Imported files are followed by TypeScript. */ readonly entryPath: string; readonly projectRoot: string; readonly signal?: AbortSignal; /** Optional caller-owned semantic/structural check over the workflow that successfully loaded. */ readonly conformance?: (workflow: WorkflowDefinition) => string | undefined; /** Test seam; production uses a bounded, non-shell child process. */ readonly runCommand?: CommandRunner; } export declare class WorkflowCandidateValidationError extends Error { readonly stage: ValidationStage; constructor(stage: ValidationStage, message: string); } interface CommandRequest { readonly command: string; readonly args: readonly string[]; readonly cwd: string; readonly input?: string; readonly signal?: AbortSignal; } interface CommandResult { readonly code: number; readonly stdout: string; readonly stderr: string; } type CommandRunner = (request: CommandRequest) => Promise; /** * Validate one generated workflow through static tooling and the real runtime loader. * * TypeScript, runtime loading, and caller-provided conformance are mandatory. Formatting is not a * correctness gate: rejecting valid generated code for style would spend another model turn without * making the workflow safer. */ export declare function validateWorkflowCandidate(options: ValidateWorkflowCandidateOptions): Promise; /** * Validate a workflow entry module in place. * * Unlike {@link validateWorkflowCandidate}, this does not copy source into a one-file probe. TypeScript * starts at the real entry module and follows its relative imports, and the runtime loader evaluates the * same module graph. That makes this the validation boundary for workflows authored as multiple files. */ export declare function validateWorkflowFile(options: ValidateWorkflowFileOptions): Promise; export {}; //# sourceMappingURL=workflow-candidate-validator.d.ts.map