import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core"; import type { Component } from "@oh-my-pi/pi-tui"; import * as z from "zod/v4"; import type { EvalToolDetails } from "../eval/types"; import type { RenderResultOptions } from "../extensibility/custom-tools/types"; import { type Theme } from "../modes/theme/theme"; import { type ToolSession } from "."; export declare const EVAL_DEFAULT_PREVIEW_LINES = 10; /** * Per-cell input. Each cell runs in order; state persists within a language * across cells and across tool calls. */ declare const evalCellSchema: z.ZodObject<{ language: z.ZodEnum<{ js: "js"; py: "py"; }>; code: z.ZodString; title: z.ZodOptional; timeout: z.ZodOptional; reset: z.ZodOptional; }, z.core.$strip>; export type EvalCellInput = z.infer; export declare const evalSchema: z.ZodObject<{ cells: z.ZodArray; code: z.ZodString; title: z.ZodOptional; timeout: z.ZodOptional; reset: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; export type EvalToolParams = z.infer; export type EvalToolResult = { content: Array<{ type: "text"; text: string; }>; details: EvalToolDetails | undefined; }; export type EvalProxyExecutor = (params: EvalToolParams, signal?: AbortSignal) => Promise; export interface EvalToolDescriptionOptions { py?: boolean; js?: boolean; } export declare function getEvalToolDescription(options?: EvalToolDescriptionOptions): string; export interface EvalToolOptions { proxyExecutor?: EvalProxyExecutor; } export declare class EvalTool implements AgentTool { #private; private readonly session; readonly name = "eval"; readonly summary = "Execute Python or JavaScript code in an in-process eval backend"; readonly loadMode = "discoverable"; readonly label = "Eval"; get description(): string; readonly parameters: z.ZodObject<{ cells: z.ZodArray; code: z.ZodString; title: z.ZodOptional; timeout: z.ZodOptional; reset: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; readonly concurrency = "exclusive"; readonly strict = true; readonly intent: (args: Partial>) => string | undefined; constructor(session: ToolSession | null, options?: EvalToolOptions); execute(_toolCallId: string, params: z.infer, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback, _ctx?: AgentToolContext): Promise>; } interface EvalRenderCellArg { language?: string; code?: string; title?: string; } interface EvalRenderArgs { cells?: EvalRenderCellArg[]; __partialJson?: string; } interface EvalRenderContext { output?: string; expanded?: boolean; previewLines?: number; timeout?: number; } export declare const evalToolRenderer: { renderCall(args: EvalRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component; renderResult(result: { content: Array<{ type: string; text?: string; }>; details?: EvalToolDetails; }, options: RenderResultOptions & { renderContext?: EvalRenderContext; }, uiTheme: Theme, _args?: EvalRenderArgs): Component; mergeCallAndResult: boolean; inline: boolean; }; export {};