import type { AgentTool } from "@earendil-works/pi-agent-core"; import type { ImageContent } from "@earendil-works/pi-ai"; import { type Static, Type } from "typebox"; import type { ExtensionContext, ToolDefinition } from "../extensions/types.ts"; import { type TruncationResult } from "./truncate.ts"; declare const readSchema: Type.TObject<{ path: Type.TString; offset: Type.TOptional; limit: Type.TOptional; }>; export type ReadToolInput = Static; export interface ReadToolDetails { truncation?: TruncationResult; } /** * Pluggable operations for the read tool. * Override these to delegate file reading to remote systems (for example SSH). */ export interface ReadOperations { /** Read file contents as a Buffer */ readFile: (absolutePath: string) => Promise; /** Check if file is readable (throw if not) */ access: (absolutePath: string) => Promise; /** Detect image MIME type, return null or undefined for non-images */ detectImageMimeType?: (absolutePath: string) => Promise; } export interface ReadToolOptions { /** Whether to auto-resize images to 2000x2000 max. Default: true */ autoResizeImages?: boolean; /** * Vision model ("provider/modelId") used to describe images when the active * model cannot accept image input. The caption text is returned in place of * the image block. Default: unset (images are omitted as before). */ imageCaptionModel?: string; /** Custom operations for file reading. Default: local filesystem */ operations?: ReadOperations; } /** * Ask a vision model to describe an image. Returns the caption text, or null if * the caption model/credentials are unavailable or the request fails. */ export declare function captionImage(image: ImageContent, captionModelId: string | undefined, ctx: ExtensionContext | undefined, signal: AbortSignal | undefined): Promise; export declare function createReadToolDefinition(cwd: string, options?: ReadToolOptions): ToolDefinition; export declare function createReadTool(cwd: string, options?: ReadToolOptions): AgentTool; export {};