import type { WorkflowMeta } from "./types.js"; export interface ParsedScript { meta: WorkflowMeta; body: string; } export interface ScriptValidationResult { valid: boolean; errors: string[]; } /** * Validate a workflow script for banned patterns and required structure */ export declare function validateScript(script: string): ScriptValidationResult; /** * Parse a workflow script into meta and body. * Extracts the `export const meta = {...}` declaration and the rest of the script. */ export declare function parseScript(script: string): ParsedScript; /** * Execute a workflow script with the given API closures. * The script body is wrapped in an async IIFE and executed via new Function(). */ export declare function executeScript(script: string, apis: { agent: (prompt: string, opts?: Record) => Promise; parallel: (thunks: Array<() => Promise>) => Promise; pipeline: (items: unknown[], ...stages: Array<(prev: unknown, item: unknown, index: number) => Promise>) => Promise; phase: (title: string) => void; log: (message: string) => void; args: unknown; budget: unknown; }, abortSignal?: AbortSignal): Promise<{ meta: WorkflowMeta; result: unknown; }>;