import type { AgentEngine, EngineMessage, EngineTool } from "../agent/engine/types.js"; import type { ActionEntry, ActionCaller, AgentLoopFinalResponseGuard, AgentLoopUsage } from "../agent/production-agent.js"; import type { AgentChatEvent } from "../agent/types.js"; import type { AgentRunOptions, AgentRunOutput, EvalProductionContext, EvalInput, ScorerAnalyzeContext } from "./types.js"; export type RunAgentLoopFn = (opts: { engine: AgentEngine; model: string; systemPrompt: string; tools: EngineTool[]; messages: EngineMessage[]; actions: Record; send: (event: AgentChatEvent) => void; signal: AbortSignal; availableTools?: EngineTool[]; onUsage?: (usage: AgentLoopUsage) => void; ownerEmail?: string; orgId?: string | null; appId?: string; actionCaller?: ActionCaller; finalResponseGuard?: AgentLoopFinalResponseGuard | null; finalResponseGuardRequestText?: string; runId?: string; }) => Promise; interface AgentRunnerConfigBase { engine?: AgentEngine; model?: string; timeoutMs?: number; runLoop?: RunAgentLoopFn; } export type AgentRunnerConfig = AgentRunnerConfigBase & ({ productionContext: EvalProductionContext; actions?: Record; systemPrompt?: string; } | { productionContext?: undefined; actions: Record; systemPrompt?: string; }); export interface AgentRunner { runAgent(input: EvalInput, options?: AgentRunOptions): Promise; analyzeContext(): ScorerAnalyzeContext; readonly engine: AgentEngine; readonly model: string; } export declare function isUnscoreableProductionPathOutput(output: AgentRunOutput): boolean; export declare function getUnscoreableProductionPathOutputError(output: AgentRunOutput): string | undefined; export declare function isProductionContextAgentRunner(runner: AgentRunner): boolean; export declare function hasOriginalProductionContextAgentRunnerMethods(runner: AgentRunner): boolean; export declare function captureAgentRunnerForEval(runner: AgentRunner): { runner: AgentRunner; isProductionContext: boolean; hasOriginalMethods: boolean; }; export declare function createAgentRunner(config: AgentRunnerConfig): Promise; export {};