/**
 * design/98 §2.4 (S8b) — STATIC, NON-EVAL extraction of a workflow script's `export const meta = {...}`.
 *
 * 🔴 The meta block is parsed as PURE DATA by a small recursive-descent reader that NEVER executes the
 * script (no `vm`, no `eval`, no `Function`) — evaluating untrusted source to read its metadata would itself
 * be the injection surface. The reader accepts ONLY literal values (string / number / boolean / null / array
 * / plain object) and REJECTS anything that could carry behavior or pollute a prototype:
 *   - identifier values (a variable reference), function calls, template literals, spreads, computed keys,
 *     method shorthand, getters/setters;
 *   - the dangerous keys `__proto__` / `constructor` / `prototype` (prototype-pollution guard).
 * Any violation throws {@link WorkflowScriptError} so the `run_workflow` tool can hand the LLM a structured
 * "fix your meta" error BEFORE the (hard) sandbox ever runs the body.
 */
import type { WorkflowMeta, WorkflowRequires } from "./workflow-script-runner.js";
/** Thrown when a workflow script is the party at fault: malformed at the static layer (bad meta, oversized
 *  source, a forbidden construct), or — at RUN time — calling a primitive with a shape it cannot run (a
 *  host-API stub in the sandbox, an unusable agent spec, a `parallel`/`pipeline` member that is not a
 *  function). Carries a `code` so the tool can return a structured error the model can act on. */
export declare class WorkflowScriptError extends Error {
    readonly code = "workflow.script_error";
    constructor(message: string);
}
/**
 * Statically extract + validate a workflow script's `export const meta`. Returns a typed {@link WorkflowMeta}
 * (name + description required, both strings; `phases`/`whenToUse` optional). NEVER executes the script.
 * @throws {WorkflowScriptError} on a missing/malformed/non-literal meta.
 */
export declare function parseWorkflowMeta(source: string): WorkflowMeta;
/** The `meta.name` a script's meta literal spells, read without judging the rest of the meta — what a script whose meta
 *  does not pass {@link parseWorkflowMeta} still claims to be called (a catalog holds that name too, so a broken file
 *  cannot let another file stand in under the name it declares). `undefined` when the literal itself does not read or
 *  spells no string `name`. NEVER executes the script. */
export declare function readWorkflowMetaName(source: string): string | undefined;
/** The one reading of a declared dependency list (`meta.requires`, a preset's `requires`): only the keys
 *  {@link WorkflowRequires} has, every name a non-empty string. Anything else throws, naming where — a
 *  dependency list that is read partly would check less than its author wrote. `where` names the value in the
 *  sentence (`` `meta.requires` ``, a preset file's member). */
export declare function parseWorkflowRequires(value: unknown, where: string): WorkflowRequires;
/** Replace every string literal (incl. template text, recursing into `${…}` code) and comment with spaces. */
export declare function stripStringsAndComments(src: string): string;
/** CC `wxl` semantics: a `Date.now` / `Math.random` member access, or an ARGLESS `new Date()`, anywhere in the
 *  body's CODE (strings/comments stripped) — each silently busts the resume prefix cache. */
export declare function workflowScriptReadsClockOrRandom(body: string): boolean;
/**
 * Parse the meta AND return the script BODY with the `export const meta = {...}` declaration removed — for a
 * runner that compiles the remaining body as an async function (the meta is DATA, parsed statically; only the
 * body is ever executed). An optional trailing `;` after the declaration is trimmed.
 */
export declare function splitWorkflowMeta(source: string): {
    meta: WorkflowMeta;
    body: string;
};
