import type { FileUpload } from './file'; export type IAgentReasoning = { agentName?: string; messages?: string[]; usedTools?: any[]; artifacts?: FileUpload[]; sourceDocuments?: any[]; instructions?: string; nextAgent?: string; }; /** * How a paused run expects to be answered. * * `confirmation` is the approve/reject pair rendered as buttons. Everything else * is a form: Core's human-input node collects a real answer and resumes with it, * so rendering only buttons leaves those runs unanswerable. * * `fileUpload` is deliberately absent — see HumanInputForm for why it degrades * rather than pretending to work. */ export type HumanInteractionType = 'confirmation' | 'textInput' | 'enterSecret' | 'singleSelect' | 'multiSelect' | 'fileUpload' | string; /** One choice in a single/multi select. */ export type HumanInputOption = { value: string; label?: string; description?: string; }; /** * Field configuration for a structured prompt, mirroring Core's `actionConfig`. * Every field is optional: an unconfigured prompt still has to render. */ export type HumanInputActionConfig = { label?: string; placeholder?: string; required?: boolean; options?: HumanInputOption[]; minSelections?: number; maxSelections?: number; validation?: { pattern?: string; minLength?: number; maxLength?: number; message?: string; }; }; /** The answer, in the shape Core's engine reads it. */ export type HumanInputFormData = { value?: string | string[]; }; export type IAction = { id?: string; data?: any; elements?: Array<{ type: string; label: string; }>; mapping?: { approve: string; reject: string; toolCalls: any[]; }; /** * Read from `action.interactionType` or `action.data.input.interactionType` — * Core populates whichever the node produced, so both are checked. */ interactionType?: HumanInteractionType; actionConfig?: HumanInputActionConfig; /** Present for a clarification prompt; each is answered with free text. */ questions?: Array<{ question: string; }>; };