import type { TruncationResult } from "./truncate.ts";
export declare const FETCH_DEFAULT_MAX_LINES = 300;
export declare const READ_URL_CACHE_MAX_ENTRIES = 100;
export interface LineRange {
    start: number;
    end?: number;
}
export interface ParsedReadUrlTarget {
    url: string;
    raw: boolean;
    offset?: number;
    limit?: number;
    ranges?: readonly LineRange[];
}
export interface ReadUrlToolDetails {
    url: string;
    finalUrl: string;
    contentType: string;
    method: string;
    truncated: boolean;
    notes: string[];
    meta?: {
        artifactId?: string;
        truncation?: TruncationResult;
    };
}
export interface LoadedPage {
    ok: boolean;
    status: number;
    content: string;
    contentType: string;
    finalUrl: string;
}
export declare function repairCollapsedScheme(url: string): string;
export declare function isReadableUrlPath(readPath: string): boolean;
export declare function parseReadUrlTarget(readPath: string): ParsedReadUrlTarget | null;
export declare function getReadUrlCacheKey(scope: string, requestedUrl: string, raw: boolean): string;
export declare function loadPage(url: string, timeoutMs: number, signal?: AbortSignal, accept?: string): Promise<LoadedPage>;
export interface RenderedUrl {
    content: string;
    finalUrl: string;
    contentType: string;
    method: string;
    notes: string[];
    truncated: boolean;
}
export declare function renderUrl(url: string, raw: boolean, signal?: AbortSignal): Promise<RenderedUrl>;
export declare function buildUrlReadOutput(result: RenderedUrl): string;
export interface ExecuteReadUrlResult {
    content: string;
    details: ReadUrlToolDetails;
    artifactId?: string;
}
export interface LoadedReadUrl {
    output: string;
    details: ReadUrlToolDetails;
    artifactId?: string;
    raw: boolean;
}
/**
 * Resolve a URL to its full rendered (or raw) output, using the session-scoped
 * cache and persisting the rendered body as a `read` artifact. Returns the
 * complete untruncated output so callers can apply their own line selection.
 */
export declare function loadReadUrlOutput(scope: string, params: {
    path: string;
    raw?: boolean;
}, artifactsDir: string | undefined, signal?: AbortSignal): Promise<LoadedReadUrl>;
export declare function executeReadUrl(scope: string, params: {
    path: string;
    raw?: boolean;
}, artifactsDir: string | undefined, signal?: AbortSignal): Promise<ExecuteReadUrlResult>;
export declare function resetReadUrlCache(): void;
//# sourceMappingURL=fetch-url.d.ts.map