import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@gajae-code/agent-core"; import type { Component } from "@gajae-code/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 { ReadWindow, TruncationResult } from "../session/streaming-output"; import { type OutputMeta } from "./output-meta"; export declare function streamLinesFromFile(filePath: string, startLine: number, maxLinesToCollect: number, maxBytes: number, selectedLineLimit: number | null, signal?: AbortSignal, collect?: "head" | "tail" | "both", collectEndExclusive?: number | null): Promise<{ lines: string[]; totalFileLines: number; collectedBytes: number; stoppedByByteLimit: boolean; firstLinePreview?: { text: string; bytes: number; }; firstLineByteLength?: number; selectedBytesTotal: number; windowBytesTotal: number; windowLinesTotal: number; windowStartIndex: number; tailPartial?: { text: string; bytes: number; sourceIndex: number; sourceLineBytes: number; }; maxBytes: number; headLines?: string[]; headBytes?: number; headStartIndex?: number; degenerateTailBudget: boolean; degenerateHeadBudget: boolean; headStoppedByBytes: boolean; headStoppedByLines: boolean; ringBudgetLines: number; ringEvictedForBytes: boolean; ringEvictedForLines: boolean; tailDroppedForBytes: boolean; }>; export declare function streamResultWindow(result: Awaited>, collect: "tail" | "both", startLine: number, collectEndExclusive: number | null): ReadWindow; declare const readSchema: z.ZodObject<{ path: z.ZodString; truncation: z.ZodOptional>; }, z.core.$strict>; export type ReadToolInput = z.infer; /** Project paths and output sizes without exposing read content or remote URLs. */ export declare function summarizeReadToolActivity(kind: "args" | "result", value: unknown): string | undefined; 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; /** Whether this explicit content read may be spilled by output metadata. */ spillEligible?: boolean; /** 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; export declare class ReadTool implements AgentTool { #private; private readonly session; readonly name = "read"; readonly label = "Read"; readonly loadMode = "essential"; get description(): string; readonly parameters: z.ZodObject<{ path: z.ZodString; truncation: z.ZodOptional>; }, z.core.$strict>; readonly nonAbortable = true; readonly strict = true; readonly safeSummary: typeof summarizeReadToolActivity; 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 {};