import type { AgentStorage } from "../../session/agent-storage"; import type { AddressResolver } from "../insane/url-guard"; export { formatNumber } from "@gajae-code/utils"; export interface RenderResult { url: string; finalUrl: string; contentType: string; method: string; content: string; fetchedAt: string; truncated: boolean; notes: string[]; } export type SpecialHandler = (url: string, timeout: number, signal?: AbortSignal, storage?: AgentStorage | null) => Promise; export declare const MAX_OUTPUT_CHARS = 500000; export declare const MAX_BYTES: number; /** * Truncate and cleanup output */ export declare function finalizeOutput(content: string): { content: string; truncated: boolean; }; export interface LoadPageOptions { timeout?: number; headers?: Record; method?: string; body?: string; maxBytes?: number; signal?: AbortSignal; publicUrlGuard?: boolean; resolver?: AddressResolver; maxRedirects?: number; } export interface LoadPageResult { content: string; contentType: string; finalUrl: string; ok: boolean; status?: number; error?: string; } /** * Fetch a page with timeout and size limit */ export declare function loadPage(url: string, options?: LoadPageOptions): Promise; export { htmlToBasicMarkdown } from "./html-to-markdown"; /** * Build a RenderResult from markdown content. Calls finalizeOutput internally. */ export declare function buildResult(md: string, opts: { url: string; finalUrl?: string; method: string; fetchedAt: string; notes?: string[]; contentType?: string; }): RenderResult; /** * Format a date value as YYYY-MM-DD. Returns empty string on invalid input. */ export declare function formatIsoDate(value?: string | number | Date): string; /** * Decode common HTML entities. */ export declare function decodeHtmlEntities(text: string): string; /** * Format seconds into HH:MM:SS or MM:SS. */ export declare function formatMediaDuration(totalSeconds: number): string; /** * Extract localized text, preferring en-US/en. */ export type LocalizedText = string | Record | null | undefined; export declare function getLocalizedText(value: LocalizedText, defaultLocale?: string): string | undefined; /** * Check if content looks like HTML by inspecting the leading tag. */ export declare function looksLikeHtml(content: string): boolean;