/**
 * Sandboxed workflow runtime.
 *
 * Parses the script via {@link parseWorkflowScript} (which strips the `meta`
 * export), wraps the remaining body in an async IIFE, and runs it inside a
 * Node `vm` context with a curated set of globals:
 *
 *   - `agent(prompt, opts)` — spawns a subagent through the injected
 *     {@link SubagentRunner} and returns its result (string, or schema-validated
 *     object). Failures resolve to `null`.
 *   - `parallel(thunks)` — concurrent fan-out; thunks (not promises!) so the
 *     limiter sees each agent() call.
 *   - `pipeline(items, ...stages)` — per-item sequential stages, items run
 *     concurrently (no stage barrier). Each stage receives
 *     `(prevResult, originalItem, index)`. A stage that throws drops that item
 *     to `null` and skips remaining stages.
 *   - `phase(title)` — marks the current phase; surfaces through `onPhase`.
 *   - `log(message)` — appends to the workflow log.
 *   - `budget` — `{ total, spent(), remaining() }` for self-pacing scripts.
 *   - `args`, `cwd`, `process.cwd()`.
 *
 * The runtime is the only code that touches `vm`. It exposes no IO surface,
 * carries no LLM dependency, and is fully driven by injected callbacks — that
 * means the workflow tool, tests, and any future runner share one runtime.
 */
import type { Api, Model } from '@earendil-works/pi-ai';
import type { SubagentRunner, WorkflowRunOptions, WorkflowRunResult, WorkflowSnapshot } from './types.js';
export interface RunWorkflowDeps {
    runner: SubagentRunner;
    /** Resolve a model ref (`provider/model` or configured typed id) to a {@link Model}. Throws on unknown ref. */
    resolveModelId?: (modelId: string) => Model<Api>;
}
export declare function runWorkflow<T = unknown>(script: string, deps: RunWorkflowDeps, options: WorkflowRunOptions): Promise<WorkflowRunResult<T>>;
export declare function emptySnapshotFor(name: string, description?: string, phaseTitles?: string[]): WorkflowSnapshot;
