/** * @license * Copyright 2026 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { CachePolicy, IExecuteContext, TaskConfig } from "@workglow/task-graph"; import { CreateWorkflow, Task } from "@workglow/task-graph"; import type { HumanResponseAction } from "@workglow/util"; import type { DataPortSchema, FromSchema } from "@workglow/util/schema"; export type HumanApprovalTaskConfig = TaskConfig & { /** Target human identifier — defaults to "default" */ targetHumanId?: string; /** Explanatory message */ message?: string; /** Arbitrary metadata passed to the connector */ metadata?: Record; }; declare const inputSchema: { readonly type: "object"; readonly properties: { readonly prompt: { readonly type: "string"; readonly title: "Prompt"; readonly description: "Dynamic prompt text merged into the approval message"; }; readonly context: { readonly type: "object"; readonly additionalProperties: true; readonly title: "Context"; readonly description: "Dynamic context data merged into the request metadata"; readonly "x-ui-hidden": true; }; }; readonly additionalProperties: false; }; export type HumanApprovalTaskInput = FromSchema; export type HumanApprovalTaskOutput = { readonly action: HumanResponseAction; readonly approved: boolean; readonly reason?: string; }; /** * Convenience task for the common approve/deny pattern. * * Presents the human with an approval dialog via MCP elicitation and returns * `{ action, approved, reason }`. Uses "single" mode — one question, one answer. * * If the human declines or cancels at the MCP level, `approved` is false and * `action` reflects the specific choice. */ export declare class HumanApprovalTask extends Task { static readonly type = "HumanApprovalTask"; static readonly category = "Human"; static title: string; static description: string; static cachePolicy: CachePolicy; static configSchema(): DataPortSchema; static inputSchema(): DataPortSchema; static outputSchema(): DataPortSchema; execute(input: HumanApprovalTaskInput, context: IExecuteContext): Promise; } declare module "@workglow/task-graph" { interface Workflow { humanApproval: CreateWorkflow; } } export {};