/** * Human-in-the-Loop Node * * Features: * - Async human approvals * - Multiple approval types (binary, multi-choice, free-form, rating) * - Approval chains (sequential approvers) * - Timeout handling with configurable actions * - Delegation support * - Priority-based routing */ import type { WorkflowState, HumanNodeConfig, ApprovalResponse, ApprovalStore, ApprovalNotifier, ApprovalChoice, ApprovalChainStep } from '@cogitator-ai/types'; /** * Context for human node execution */ export interface HumanNodeContext { workflowId: string; runId: string; nodeId: string; approvalStore: ApprovalStore; approvalNotifier?: ApprovalNotifier; } /** * Result of human node execution */ export interface HumanNodeResult { approved: boolean; decision: unknown; response: ApprovalResponse; state: S; timedOut?: boolean; escalated?: boolean; } /** * Execute a human approval node */ export declare function executeHumanNode(state: S, config: HumanNodeConfig, context: HumanNodeContext): Promise>; /** * Create a human approval node factory */ export declare function humanNode(name: string, approval: HumanNodeConfig['approval']): HumanNodeConfig; /** * Create a simple approve/reject node */ export declare function approvalNode(name: string, options: { title: string; description?: string | ((state: S) => string); assignee?: string | ((state: S) => string); timeout?: number; timeoutAction?: 'approve' | 'reject' | 'fail'; priority?: 'low' | 'normal' | 'high' | 'urgent'; }): HumanNodeConfig; /** * Create a multi-choice selection node */ export declare function choiceNode(name: string, options: { title: string; description?: string | ((state: S) => string); choices: ApprovalChoice[]; assignee?: string | ((state: S) => string); timeout?: number; priority?: 'low' | 'normal' | 'high' | 'urgent'; }): HumanNodeConfig; /** * Create a free-form input node */ export declare function inputNode(name: string, options: { title: string; description?: string | ((state: S) => string); assignee?: string | ((state: S) => string); timeout?: number; priority?: 'low' | 'normal' | 'high' | 'urgent'; }): HumanNodeConfig; /** * Create a rating node */ export declare function ratingNode(name: string, options: { title: string; description?: string | ((state: S) => string); assignee?: string | ((state: S) => string); timeout?: number; priority?: 'low' | 'normal' | 'high' | 'urgent'; }): HumanNodeConfig; /** * Create an approval chain node */ export declare function chainNode(name: string, options: { title: string; description?: string | ((state: S) => string); chain: ApprovalChainStep[]; priority?: 'low' | 'normal' | 'high' | 'urgent'; }): HumanNodeConfig; /** * Create a manager → director → VP chain */ export declare function managementChain(name: string, options: { title: string; description?: string | ((state: S) => string); manager: string; director?: string; vp?: string; timeoutPerStep?: number; }): HumanNodeConfig; //# sourceMappingURL=human-node.d.ts.map