import { ZodType } from 'zod'; /** * UI rendering hint for a HITL step. * * - `'custom'` — render using a registered view component (by `viewId`). * - `'schema-form'` — auto-render a form for the step (no custom view needed). * The panel falls back to a raw-JSON textarea if no schema-form renderer is available. */ type HitlUiSpec = { type: 'custom'; /** View ID used to look up the renderer in the app's HITL view registry. */ viewId: string; title?: string; sections?: Array>; [key: string]: unknown; } | { type: 'schema-form'; title?: string; description?: string; }; /** Metadata for a human-in-the-loop step on `WorkerQueueStep.hitl`. */ type HitlStepConfig = { taskKey: string; timeoutSeconds?: number; onTimeout?: 'reject' | 'auto-approve'; assignees?: string[]; ui: HitlUiSpec; /** Reviewer form schema — single source of truth; use `z.infer` for types. */ inputSchema?: ZodType; }; /** * DX helper for queue authors: keeps HITL config typed/readable. * * @example * ```ts * const hitl = defineHitlConfig({ * taskKey: 'review-step', * ui: { type: 'schema-form', title: 'Review the output' }, * inputSchema: z.object({ approved: z.boolean(), comment: z.string().optional() }), * }); * ``` */ declare function defineHitlConfig(config: T): T; export { type HitlStepConfig, type HitlUiSpec, defineHitlConfig };