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 { RenderResultOptions } from "../extensibility/custom-tools/types"; import { type Theme } from "../modes/theme/theme"; import type { ToolSession } from "../sdk"; import { type TruncationResult } from "../session/streaming-output"; import { type OutputMeta } from "./output-meta"; declare const readSchema: z.ZodObject<{ path: z.ZodString; }, z.core.$strict>; export type ReadToolInput = z.infer; export interface ReadToolDetails { kind?: "file" | "url"; truncation?: TruncationResult; isDirectory?: boolean; resolvedPath?: string; suffixResolution?: { from: string; to: string; }; url?: string; finalUrl?: string; contentType?: string; method?: string; notes?: string[]; meta?: OutputMeta; /** Raw text + start line for user-visible TUI rendering, set when content is text-like. * Mirrors the same lines the model receives but without hashline/line-number prefixes, * so the TUI can render the file content with its own gutter without re-parsing the formatted text. */ displayContent?: { text: string; startLine: number; }; summary?: { lines: number; elidedSpans: number; elidedLines: number; }; /** Number of unresolved git conflicts surfaced by this read (TUI uses for inline `⚠ N` badge). */ conflictCount?: number; } type ReadParams = ReadToolInput; /** * Read tool implementation. * * Reads files with support for images, converted documents (via markit), and text. * Directories return a formatted listing with modification times. */ export declare class ReadTool implements AgentTool { #private; private readonly session; readonly name = "read"; readonly label = "Read"; readonly loadMode = "essential"; readonly description: string; readonly parameters: z.ZodObject<{ path: z.ZodString; }, z.core.$strict>; readonly nonAbortable = true; readonly strict = true; constructor(session: ToolSession); execute(_toolCallId: string, params: ReadParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback, _toolContext?: AgentToolContext): Promise>; } interface ReadRenderArgs { path?: string; file_path?: string; sel?: string; offset?: number; limit?: number; raw?: boolean; } export declare const readToolRenderer: { renderCall(args: ReadRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component; renderResult(result: { content: Array<{ type: string; text?: string; }>; details?: ReadToolDetails; isError?: boolean; }, options: RenderResultOptions, uiTheme: Theme, args?: ReadRenderArgs): Component; mergeCallAndResult: boolean; }; export {};