import type { WorkflowDefinitionFromConfig } from "./types"; import { type ValidateWorkflowConfigOptions } from "./validate"; /** Options accepted by `createWorkflowFromConfig`. */ export type CreateWorkflowFromConfigOptions = ValidateWorkflowConfigOptions; /** * Builds a `WorkflowDefinition` from a JSON-serializable `WorkflowConfig`. Defaults to * `T = string`, the untrusted-JSON case; instantiate with a framework content type (e.g. * `createWorkflowFromConfig(...)`) for a same-runtime config carrying rich content. * * Validates the whole config first (structure, strict unknown-key rejection, and slot-appropriate * action shapes), collecting all issues into a single `ConfigValidationError` rather than failing * on the first one, then drives the existing `WorkflowBuilder` to produce the definition. * * By default `title`/`content` must be plain strings, regardless of `T`, since the runtime cannot * otherwise know what `T` is. Pass `options.validateContent` to accept a richer `T`. * * The returned definition carries the original (frozen) config as `.source`, so a future JSON * exporter can round-trip without re-deriving the config from the built definition. * * @param config The parsed JSON (or equivalent plain object) to build from. Accepts `unknown` so * callers can pass `JSON.parse(...)` output directly; it is validated and narrowed internally. * @param options Options; see {@link CreateWorkflowFromConfigOptions}. * @throws {ConfigValidationError} When the config is invalid. * @returns A frozen `WorkflowDefinition` with `.source` attached. */ export declare function createWorkflowFromConfig(config: unknown, options?: CreateWorkflowFromConfigOptions): WorkflowDefinitionFromConfig;