/** * @license * Copyright 2025 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 { HumanInteractionKind, HumanResponseAction } from "@workglow/util"; import type { DataPortSchema } from "@workglow/util/schema"; export type HumanInputTaskConfig = TaskConfig & { /** Target human identifier — defaults to "default" */ targetHumanId?: string; /** Interaction kind — defaults to "elicit" */ kind?: HumanInteractionKind; /** JSON schema describing the content/form to render */ contentSchema?: DataPortSchema; /** Explanatory message */ message?: string; /** Interaction mode — defaults to "single" */ mode?: "single" | "multi-turn"; /** Arbitrary metadata passed to the connector */ metadata?: Record; }; export type HumanInputTaskInput = { prompt?: string; contentData?: Record; context?: Record; }; export type HumanInputTaskOutput = { /** The human's action */ action: HumanResponseAction; /** Additional response data (for elicit kind) */ [key: string]: unknown; }; /** * A task that sends an interaction to a human via an IHumanConnector. * * Supports four interaction kinds: * - "notify": Send a notification (fire-and-forget, task completes immediately) * - "display": Present content to the human (charts, data, markdown) * - "elicit": Request structured input via a form (MCP elicitation model) * - "confirm": Ask a human to approve or refuse one described action * * The contentSchema describes WHAT to render. The kind determines HOW. * For "elicit", the output includes the human's submitted data. * For "notify"/"display", the output is just `{ action: "accept" }`. */ export declare class HumanInputTask extends Task { static readonly type = "HumanInputTask"; static readonly category = "Human"; static title: string; static description: string; static cachePolicy: CachePolicy; static hasDynamicSchemas: boolean; static configSchema(): DataPortSchema; static inputSchema(): DataPortSchema; static outputSchema(): DataPortSchema; outputSchema(): DataPortSchema; execute(input: HumanInputTaskInput, context: IExecuteContext): Promise; } declare module "@workglow/task-graph" { interface Workflow { humanInput: CreateWorkflow; } }