import { Run } from '../context.js'; import { Workflow, WorkflowRunOptions, WorkflowRun } from './workflow.js'; import { Message, MessageContentPart } from '../backend/message.js'; import { AnyTool } from '../tools/base.js'; import { ReadOnlyMemory } from '../memory/base.js'; import { z } from 'zod'; import { B as BaseAgent } from '../base-BjzyQ8k6.js'; import { a as ChatModel } from '../chat-CfTNfR60.js'; import { ToolCallingAgentRunInput, ToolCallingAgentRunOutput, ToolCallingAgentRunOptions, ToolCallingAgentExecutionConfig } from '../agents/toolCalling/types.js'; import '../emitter-kHxkUxco.js'; import '../internals/types.js'; import '../internals/helpers/guards.js'; import '../internals/serializable.js'; import '../internals/helpers/promise.js'; import '../errors.js'; import 'ai'; import 'ajv'; import 'promise-based-task'; import '../cache/base.js'; import '../internals/helpers/schema.js'; import 'zod-to-json-schema'; import '../backend/constants.js'; import '../template.js'; import '../logger/logger.js'; import 'pino'; import '../agents/toolCalling/prompts.js'; type AgentInstance = BaseAgent; type AgentFactory = (memory: ReadOnlyMemory) => AgentInstance | Promise; interface AgentFactoryInput { name?: string; role?: string; llm: ChatModel; instructions?: string; tools?: AnyTool[]; execution?: ToolCallingAgentExecutionConfig; } declare class AgentWorkflow { protected readonly workflow: Workflow; context: z.ZodOptional; expectedOutput: z.ZodOptional, z.ZodTypeDef, z.ZodType>]>>; }, "strip", z.ZodTypeAny, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }>, "many">; finalAnswer: z.ZodOptional; newMessages: z.ZodDefault, z.ZodTypeDef, Message>, "many">>; }, "strip", z.ZodTypeAny, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; newMessages: Message[]; finalAnswer?: string | undefined; }, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer?: string | undefined; newMessages?: Message[] | undefined; }>, z.ZodObject<{ inputs: z.ZodArray; context: z.ZodOptional; expectedOutput: z.ZodOptional, z.ZodTypeDef, z.ZodType>]>>; }, "strip", z.ZodTypeAny, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }>, "many">; finalAnswer: z.ZodString; newMessages: z.ZodDefault, z.ZodTypeDef, Message>, "many">>; }, "strip", z.ZodTypeAny, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer: string; newMessages: Message[]; }, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer: string; newMessages?: Message[] | undefined; }>, string>; readonly schema: z.ZodObject<{ inputs: z.ZodArray; context: z.ZodOptional; expectedOutput: z.ZodOptional, z.ZodTypeDef, z.ZodType>]>>; }, "strip", z.ZodTypeAny, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }>, "many">; finalAnswer: z.ZodOptional; newMessages: z.ZodDefault, z.ZodTypeDef, Message>, "many">>; }, "strip", z.ZodTypeAny, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; newMessages: Message[]; finalAnswer?: string | undefined; }, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer?: string | undefined; newMessages?: Message[] | undefined; }>; constructor(name?: string); run(inputs: (ToolCallingAgentRunInput | Message)[], options?: WorkflowRunOptions): Run; context: z.ZodOptional; expectedOutput: z.ZodOptional, z.ZodTypeDef, z.ZodType>]>>; }, "strip", z.ZodTypeAny, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }>, "many">; finalAnswer: z.ZodOptional; newMessages: z.ZodDefault, z.ZodTypeDef, Message>, "many">>; }, "strip", z.ZodTypeAny, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; newMessages: Message[]; finalAnswer?: string | undefined; }, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer?: string | undefined; newMessages?: Message[] | undefined; }>, z.ZodObject<{ inputs: z.ZodArray; context: z.ZodOptional; expectedOutput: z.ZodOptional, z.ZodTypeDef, z.ZodType>]>>; }, "strip", z.ZodTypeAny, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }>, "many">; finalAnswer: z.ZodString; newMessages: z.ZodDefault, z.ZodTypeDef, Message>, "many">>; }, "strip", z.ZodTypeAny, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer: string; newMessages: Message[]; }, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer: string; newMessages?: Message[] | undefined; }>, string>, Workflow; context: z.ZodOptional; expectedOutput: z.ZodOptional, z.ZodTypeDef, z.ZodType>]>>; }, "strip", z.ZodTypeAny, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }>, "many">; finalAnswer: z.ZodOptional; newMessages: z.ZodDefault, z.ZodTypeDef, Message>, "many">>; }, "strip", z.ZodTypeAny, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; newMessages: Message[]; finalAnswer?: string | undefined; }, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer?: string | undefined; newMessages?: Message[] | undefined; }>, z.ZodObject<{ inputs: z.ZodArray; context: z.ZodOptional; expectedOutput: z.ZodOptional, z.ZodTypeDef, z.ZodType>]>>; }, "strip", z.ZodTypeAny, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }>, "many">; finalAnswer: z.ZodString; newMessages: z.ZodDefault, z.ZodTypeDef, Message>, "many">>; }, "strip", z.ZodTypeAny, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer: string; newMessages: Message[]; }, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer: string; newMessages?: Message[] | undefined; }>, string>, readonly [{ inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer?: string | undefined; newMessages?: Message[] | undefined; }, WorkflowRunOptions]>; addAgent(agent: AgentFactory | AgentFactoryInput): this; addAgent(agent: AgentInstance): Promise; delAgent(name: string): Workflow; context: z.ZodOptional; expectedOutput: z.ZodOptional, z.ZodTypeDef, z.ZodType>]>>; }, "strip", z.ZodTypeAny, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }>, "many">; finalAnswer: z.ZodOptional; newMessages: z.ZodDefault, z.ZodTypeDef, Message>, "many">>; }, "strip", z.ZodTypeAny, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; newMessages: Message[]; finalAnswer?: string | undefined; }, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer?: string | undefined; newMessages?: Message[] | undefined; }>, z.ZodObject<{ inputs: z.ZodArray; context: z.ZodOptional; expectedOutput: z.ZodOptional, z.ZodTypeDef, z.ZodType>]>>; }, "strip", z.ZodTypeAny, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }, { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }>, "many">; finalAnswer: z.ZodString; newMessages: z.ZodDefault, z.ZodTypeDef, Message>, "many">>; }, "strip", z.ZodTypeAny, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer: string; newMessages: Message[]; }, { inputs: { prompt?: string | undefined; context?: string | undefined; expectedOutput?: string | z.ZodType | undefined; }[]; finalAnswer: string; newMessages?: Message[] | undefined; }>, never>; protected _createFactory(input: AgentFactoryInput): AgentFactory; protected _add(name: string, factory: AgentFactory): this; } export { AgentWorkflow };