import { type IChatModel } from "@empiricalrun/llm/chat"; import type { CanonicalMessage, ChatState, ChatStateGeneric, MessageCheckpoint, PendingToolCall, ProcessToolResultsResult, ReporterFunction, StreamingMessageReporterFunc, SupportedChatModels, TextMessagePart, TextMessageWithAttachmentsPart, ToolResult, ToolsForLLM } from "@empiricalrun/shared-types/chat-agent"; import type { TraceClient } from "@empiricalrun/shared-types/common"; import type { FileInfo } from "@empiricalrun/shared-types/test-gen"; import type { IToolExecutor } from "../../tools/executor/types"; type RunLoopParams = { signal?: AbortSignal; reporter: ReporterFunction; streamingMessageReporter?: StreamingMessageReporterFunc; onLLMResponse?: (response: T, selectedModel: SupportedChatModels) => Promise; }; type AgentParamsWithoutPrompt = { trace?: TraceClient; chatState?: ChatStateGeneric; workerEnv?: Record; featureFlags?: string[]; toolExecutor?: IToolExecutor; systemPrompt?: string; selectedModel: SupportedChatModels; repoInfoBuilder?: () => Promise; }; export type AgentParams = AgentParamsWithoutPrompt & ({ systemPrompt: string; } | { repoInfoBuilder: () => Promise; }); export type OnToolResultsProcessedCallback = (newChatState: ChatState) => Promise; export type OnToolCallCallback = (toolCalls: PendingToolCall[]) => Promise; export type OnLLMResponseCallback = (response: T, selectedModel: SupportedChatModels) => Promise; export declare abstract class BaseAgent { featureFlags: string[]; tools: ToolsForLLM; selectedModel: SupportedChatModels; chatModel: IChatModel; workerEnv?: Record; toolExecutor?: IToolExecutor; trace?: TraceClient; systemPrompt: string | undefined; repoInfoBuilder: (() => Promise) | undefined; onToolResultsProcessed?: OnToolResultsProcessedCallback; onToolCall?: OnToolCallCallback; onLLMResponse?: OnLLMResponseCallback; constructor({ featureFlags, selectedModel, workerEnv, chatState, toolExecutor, trace, systemPrompt, repoInfoBuilder, }: AgentParams); protected abstract getTools(): ToolsForLLM; protected abstract buildSystemPrompt(repoInfoBuilder: () => Promise): Promise; get messages(): CanonicalMessage[]; get askUserForInput(): boolean; get chatState(): ChatStateGeneric; pushUserMessage(parts: Array): ChatStateGeneric; setChatState(chatState: ChatStateGeneric): void; changeModel(newModel: SupportedChatModels): void; stop(): ChatStateGeneric; processToolResults(toolCalls: PendingToolCall[], toolResults: ToolResult[], checkpoint: MessageCheckpoint | null): ProcessToolResultsResult; toolCallHandler(toolCalls: PendingToolCall[]): Promise; runLoop(params: RunLoopParams): Promise; getHumanReadableLatestMessage(): { role: string; textMessage: string; } | undefined; } export {}; //# sourceMappingURL=index.d.ts.map