/** * Human-in-the-loop approval — `ctx.approval(name, opts)` uses the durable * signal-wait protocol understood by the MemoFlow server. * * Signal-name convention: an approval named `name` waits on the signal * `approval:{name}` (e.g. `ctx.approval('deploy-plan')` waits on signal * `approval:deploy-plan`). The server recognizes this prefix and creates an * approval work item atomically with the wait. Resolving that work item emits * the compatible signal that resumes the workflow. The work item and its * audit record, not the checkpoint payload, are the authoritative evidence. */ /** Typed payload resolved by `ctx.approval()`. Rejection is not an error — * `{ approved: false }` resolves normally; the workflow decides what to do * next. Only a malformed payload or a timeout is exceptional. */ export interface ApprovalDecision { approved: boolean; by?: string; comment?: string; } /** Prefix applied to an approval `name` to form the underlying signal name. */ export declare const APPROVAL_SIGNAL_PREFIX = "approval:"; /** The signal name a given approval `name` waits on (e.g. `deploy-plan` -> `approval:deploy-plan`). */ export declare function approvalSignalName(name: string): string; /** True when `signalName` follows the `approval:{name}` convention. */ export declare function isApprovalSignal(signalName: string): boolean; /** The approval `name` encoded in an `approval:{name}` signal name, or null if it isn't one. */ export declare function approvalNameFromSignal(signalName: string): string | null; /** * Thrown when a resolved approval signal's payload does not match the * `ApprovalDecision` shape. Design Law 4 spirit: a malformed payload must * fail loudly, never be silently coerced into `{ approved: false }` or * similar — that would fabricate an audit record that never happened. */ export declare class InvalidApprovalPayloadError extends Error { readonly approvalName: string; readonly payload: unknown; constructor(approvalName: string, payload: unknown); } /** * Validate and normalize a raw signal payload into an `ApprovalDecision`. * Throws `InvalidApprovalPayloadError` rather than coercing malformed input. */ export declare function parseApprovalDecision(approvalName: string, payload: unknown): ApprovalDecision;