import type { AgentToolResult, AgentToolUpdateCallback, ExtensionContext, ToolDefinition, } from "@earendil-works/pi-coding-agent"; import type { EvalSchemaToolInfo } from "../bridges/schema-bridge.ts"; import type { SessionBudget } from "../budget/session-budget.ts"; import type { CompletionRequest, CompletionResult, } from "../completion/handler.ts"; import type { ResolvedCodemodeSettings } from "../config/settings.ts"; import type { EvalExecutionTracker } from "../extension/session-manager.ts"; import type { EvalTimeoutFactory } from "./cell-execution.ts"; import type { EvalDetachedCellManager } from "./detached-cell-manager.ts"; import type { EvalImageResizer } from "./image.ts"; import type { SessionStore } from "./session-store.ts"; import type { ToolSnapshot } from "./tool-snapshot.ts"; import type { EnabledEvalLanguages, EvalInputSchema, EvalKernelManager, EvalToolDetails, EvalToolInput, ExecuteTool, } from "./types.ts"; export interface CreateEvalToolOptions { readonly artifactsDir?: string; /** Session token budget; an exhausted budget rejects new cells before they start. */ readonly budget?: SessionBudget; readonly cellManager?: EvalDetachedCellManager; readonly cellTimeoutSeconds: number; readonly complete?: ( request: CompletionRequest, ctx: ExtensionContext ) => Promise; readonly enabledLanguages: EnabledEvalLanguages; readonly executeTool: ExecuteTool; readonly executionTracker?: EvalExecutionTracker; readonly hostLine?: string; readonly imageResizer?: EvalImageResizer; /** Returns whether a live session runtime is available for execution. */ readonly isActive?: () => boolean; readonly kernelManager: EvalKernelManager; readonly listTools?: () => readonly EvalSchemaToolInfo[]; readonly modelId?: string; readonly proxyExecutor?: ( params: EvalToolInput, signal?: AbortSignal ) => Promise>; readonly renderers?: Pick< ToolDefinition, "renderCall" | "renderResult" >; /** Session value store backing the store()/load() helpers; defaults to a fresh store per cell when absent. */ readonly sessionStore?: SessionStore; readonly settings?: ResolvedCodemodeSettings; readonly spawnDefaultAgent?: string; readonly spawns?: boolean; readonly timeoutFactory?: EvalTimeoutFactory; readonly toolSnapshot?: ToolSnapshot; /** True when the wait tool is registered for this runtime; adds wait guidance to the eval prompt. */ readonly waitTool?: boolean; } export interface EvalCellInvocation { readonly cellId: string; readonly ctx: ExtensionContext; readonly input: EvalToolInput; readonly onUpdate: AgentToolUpdateCallback | undefined; readonly signal: AbortSignal; }