/** * Build a {@link WorkflowRevisionManifest} from a normalized contract. * * @module core/contract/manifest */ import type { WorkflowContract, WorkflowRevisionManifest } from './types.ts'; /** * Options accepted by {@link buildWorkflowRevisionManifest}. * * @example * ```ts * import type { BuildWorkflowRevisionManifestOptions } from '@lostgradient/weft'; * * const options: BuildWorkflowRevisionManifestOptions = { revision: 'deploy-2026.09.01' }; * console.log(options.revision); * ``` */ export interface BuildWorkflowRevisionManifestOptions { /** * Explicit opaque revision identity. When omitted, `revision` is derived * from the full contract via {@link deriveWorkflowRevision}. An empty * string, or a string exceeding `MAX_CONTRACT_IDENTIFIER_BYTES`, is * rejected rather than silently falling back to derivation. */ revision?: string; } /** * Build a {@link WorkflowRevisionManifest} for a workflow contract. * * Normalizes the contract, computes `contractHash`, and either derives * `revision` (the default) or validates and preserves an explicitly * supplied one. * * Throws a plain `Error` when `options.revision` is present but empty, or * exceeds `MAX_CONTRACT_IDENTIFIER_BYTES` — a caller-supplied identity is * validated the same way any other contract identifier is, since it becomes * part of the manifest a consumer will trust. * * **Round-trips through {@link parseWorkflowRevisionManifest} before * returning.** A manifest this function builds but its own parser would * reject (`identifier-too-long`, `too-many-entries`, `manifest-too-large`) * is a build-time bug, not a runtime condition to defer to whoever later * reads the manifest back — see WFT-5 PR #943 review thread * PRRT_kwDORwthfM6eWFwv. Throws a plain `Error` describing the rejection * reason when that happens. * * @example * ```ts * import { buildWorkflowContract, buildWorkflowRevisionManifest } from '@lostgradient/weft'; * * const contract = buildWorkflowContract({ name: 'checkout', version: '2.1.0' }); * const manifest = await buildWorkflowRevisionManifest(contract); * console.log(manifest.name, manifest.contractHash.startsWith('sha256:')); * ``` */ export declare function buildWorkflowRevisionManifest(contract: WorkflowContract, options?: BuildWorkflowRevisionManifestOptions): Promise;