{"version":3,"sources":["../../../src/agents/requirement/types.ts"],"names":["RequirementAgentSystemPromptInputSchema","z","object","role","string","optional","instructions","notes","finalAnswerName","finalAnswerSchema","finalAnswerInstructions","tools","array","name","description","inputSchema","allowed","reason","RequirementAgentTaskPromptInputSchema","prompt","context","expectedOutput","RequirementAgentToolErrorPromptInputSchema","RequirementAgentToolNoResultPromptInputSchema","toolCall","tool","any","input","unknown"],"mappings":";;;;AAeO,MAAMA,uCAAAA,GAA0CC,MAAEC,MAAAA,CAAO;EAC9DC,IAAAA,EAAMF,KAAAA,CAAEG,MAAAA,EAAM,CAAGC,QAAAA,EAAQ;EACzBC,YAAAA,EAAcL,KAAAA,CAAEG,MAAAA,EAAM,CAAGC,QAAAA,EAAQ;EACjCE,KAAAA,EAAON,KAAAA,CAAEG,MAAAA,EAAM,CAAGC,QAAAA,EAAQ;AAC1BG,EAAAA,eAAAA,EAAiBP,MAAEG,MAAAA,EAAM;EACzBK,iBAAAA,EAAmBR,KAAAA,CAAEG,MAAAA,EAAM,CAAGC,QAAAA,EAAQ;EACtCK,uBAAAA,EAAyBT,KAAAA,CAAEG,MAAAA,EAAM,CAAGC,QAAAA,EAAQ;EAC5CM,KAAAA,EAAOV,KAAAA,CAAEW,KAAAA,CACPX,KAAAA,CAAEC,MAAAA,CAAO;AACPW,IAAAA,IAAAA,EAAMZ,MAAEG,MAAAA,EAAM;AACdU,IAAAA,WAAAA,EAAab,MAAEG,MAAAA,EAAM;AACrBW,IAAAA,WAAAA,EAAad,MAAEG,MAAAA,EAAM;AACrBY,IAAAA,OAAAA,EAASf,MAAEG,MAAAA,EAAM;IACjBa,MAAAA,EAAQhB,KAAAA,CAAEG,MAAAA,EAAM,CAAGC,QAAAA;AACrB,GAAA,CAAA;AAEJ,CAAA;AAEO,MAAMa,qCAAAA,GAAwCjB,MAAEC,MAAAA,CAAO;AAC5DiB,EAAAA,MAAAA,EAAQlB,MAAEG,MAAAA,EAAM;EAChBgB,OAAAA,EAASnB,KAAAA,CAAEG,MAAAA,EAAM,CAAGC,QAAAA,EAAQ;EAC5BgB,cAAAA,EAAgBpB,KAAAA,CAAEG,MAAAA,EAAM,CAAGC,QAAAA;AAC7B,CAAA;AAEO,MAAMiB,0CAAAA,GAA6CrB,MAAEC,MAAAA,CAAO;AACjEe,EAAAA,MAAAA,EAAQhB,MAAEG,MAAAA;AACZ,CAAA;AAEO,MAAMmB,6CAAAA,GAAgDtB,MAAEC,MAAAA,CAAO;AACpEsB,EAAAA,QAAAA,EAAUvB,MAAEC,MAAAA,CAAO;IACjBuB,IAAAA,EAAMxB,KAAAA,CAAEyB,GAAAA,EAAG,CAAGrB,QAAAA,EAAQ;AACtBsB,IAAAA,KAAAA,EAAO1B,MAAE2B,OAAAA;GACX;AACF,CAAA","file":"types.cjs","sourcesContent":["/**\n * Copyright 2025 © BeeAI a Series of LF Projects, LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { BaseMemory } from \"@/memory/base.js\";\nimport { AssistantMessage } from \"@/backend/message.js\";\nimport { AnyTool, ToolOutput } from \"@/tools/base.js\";\nimport { FrameworkError } from \"@/errors.js\";\nimport { PromptTemplate } from \"@/template.js\";\nimport { ChatModelOutput, ChatModelToolChoice, ChatModelUsage } from \"@/backend/chat.js\";\nimport { BaseAgentRunOptions } from \"@/agents/base.js\";\nimport { z } from \"zod\";\nimport { FinalAnswerTool } from \"@/agents/requirement/utils/tool.js\";\n\nexport const RequirementAgentSystemPromptInputSchema = z.object({\n  role: z.string().optional(),\n  instructions: z.string().optional(),\n  notes: z.string().optional(),\n  finalAnswerName: z.string(),\n  finalAnswerSchema: z.string().optional(),\n  finalAnswerInstructions: z.string().optional(),\n  tools: z.array(\n    z.object({\n      name: z.string(),\n      description: z.string(),\n      inputSchema: z.string(),\n      allowed: z.string(),\n      reason: z.string().optional(),\n    }),\n  ),\n});\n\nexport const RequirementAgentTaskPromptInputSchema = z.object({\n  prompt: z.string(),\n  context: z.string().optional(),\n  expectedOutput: z.string().optional(),\n});\n\nexport const RequirementAgentToolErrorPromptInputSchema = z.object({\n  reason: z.string(),\n});\n\nexport const RequirementAgentToolNoResultPromptInputSchema = z.object({\n  toolCall: z.object({\n    tool: z.any().optional(),\n    input: z.unknown(),\n  }),\n});\n\n// Template collection\nexport interface RequirementAgentTemplates {\n  system: PromptTemplate<typeof RequirementAgentSystemPromptInputSchema>;\n  task: PromptTemplate<typeof RequirementAgentTaskPromptInputSchema>;\n  toolError: PromptTemplate<typeof RequirementAgentToolErrorPromptInputSchema>;\n  toolNoResult: PromptTemplate<typeof RequirementAgentToolNoResultPromptInputSchema>;\n}\n\n// Run state types\nexport interface RequirementAgentRunStateStep {\n  id: string;\n  iteration: number;\n  tool: AnyTool | null;\n  input: unknown;\n  output: ToolOutput;\n  error: FrameworkError | null;\n}\n\nexport interface RequirementAgentRunState {\n  answer: AssistantMessage | null;\n  result: unknown;\n  memory: BaseMemory;\n  iteration: number;\n  steps: RequirementAgentRunStateStep[];\n  usage: ChatModelUsage;\n  // cost: ChatModelCost; TODO: not supported yet\n}\n\n// Agent output\nexport interface RequirementAgentOutput {\n  result: AssistantMessage;\n  memory: BaseMemory;\n  state: RequirementAgentRunState;\n}\n\n// Internal request structure\nexport interface RequirementAgentRequest {\n  tools: AnyTool[];\n  allowedTools: AnyTool[];\n  reasonByTool: WeakMap<AnyTool, string | undefined>;\n  hiddenTools: AnyTool[];\n  toolChoice: ChatModelToolChoice;\n  finalAnswer: FinalAnswerTool;\n  canStop: boolean;\n}\n\n// Execution configuration\nexport interface RequirementAgentExecutionConfig {\n  maxRetriesPerStep?: number;\n  totalMaxRetries?: number;\n  maxIterations?: number;\n}\n\n// Run input and options\nexport interface RequirementAgentRunInput {\n  prompt: string | null;\n  context?: string;\n  expectedOutput?: string | z.ZodSchema;\n}\n\nexport interface RequirementAgentRunOptions extends BaseAgentRunOptions {\n  execution?: RequirementAgentExecutionConfig;\n}\n\n// Event callback types\nexport interface RequirementAgentCallbacks {\n  start: (data: { state: RequirementAgentRunState; request: RequirementAgentRequest }) => void;\n  success: (data: { state: RequirementAgentRunState; response: ChatModelOutput }) => void;\n  finalAnswer: (data: {\n    state: RequirementAgentRunState;\n    output: string;\n    delta: string;\n    outputStructured: unknown;\n  }) => void;\n}\n"]}