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