import type { AgentToolResult } from "@gajae-code/agent-core"; import { type Component } from "@gajae-code/tui"; import type { Settings } from "../config/settings"; import type { RenderResultOptions } from "../extensibility/custom-tools/types"; import { type Theme } from "../modes/theme/theme"; import type { ToolSession } from "../sdk"; import { type TruncationDirection } from "../session/streaming-output"; import type { RenderResult } from "../web/scrapers/types"; import { type OutputMeta } from "./output-meta"; export declare function isReadableUrlPath(value: string): boolean; export interface ParsedReadUrlTarget { path: string; raw: boolean; offset?: number; limit?: number; } export declare function parseReadUrlTarget(readPath: string): ParsedReadUrlTarget | null; export declare function renderHtmlToText(html: string, signal?: AbortSignal): Promise<{ content: string; ok: boolean; method: string; }>; interface FetchImagePayload { data: string; mimeType: string; } type FetchRenderResult = RenderResult & { image?: FetchImagePayload; }; export declare function tryInsaneFallback(args: { url: string; finalUrl: string; timeout: number; raw: boolean; settings: Settings; signal: AbortSignal | undefined; fetchedAt: string; notes: string[]; }): Promise; export interface ReadUrlToolDetails { kind: "url"; url: string; finalUrl: string; contentType: string; method: string; truncated: boolean; notes: string[]; meta?: OutputMeta; } interface ReadUrlCacheEntry { artifactId?: string; details: ReadUrlToolDetails; image?: FetchImagePayload; /** Complete URL output, including its preamble and body. */ output: string; /** UTF-16 code-unit offset of the preamble in `output`. */ preambleChars: number; /** Offset of the preamble after `wrapUntrustedContent(output)` is persisted. */ wrappedPreambleChars?: number; } export declare function loadReadUrlCacheEntry(session: ToolSession, params: { path: string; raw?: boolean; }, signal?: AbortSignal, options?: { ensureArtifact?: boolean; preferCached?: boolean; }): Promise; export declare const WRAP_PREFIX_CHARS: number; export declare function escapeUntrustedContent(content: string): string; export declare function wrapUntrustedContent(content: string): string; /** * Remove only the outer URL-output wrapper before line pagination. The content * remains escaped exactly as persisted; it is deliberately never unescaped. */ export declare function prepareReadUrlSelectorInput(output: string, preambleChars: number, wrappedPreambleChars?: number): { text: string; preambleChars: number; }; export declare function executeReadUrl(session: ToolSession, params: { path: string; raw?: boolean; }, signal?: AbortSignal, direction?: TruncationDirection): Promise>; /** Render URL read call (URL preview) */ export declare function renderReadUrlCall(args: { path?: string; url?: string; raw?: boolean; }, _options: RenderResultOptions, uiTheme?: Theme): Component; /** Render URL read result with tree-based layout */ export declare function renderReadUrlResult(result: { content: Array<{ type: string; text?: string; }>; details?: ReadUrlToolDetails; isError?: boolean; }, options: RenderResultOptions, uiTheme?: Theme): Component; export {};