import type { ExtensionContext } from "@earendil-works/pi-coding-agent"; import { type AuthFetchProfile } from "./auth-fetch.ts"; import { type Lookup, type RedirectPolicy } from "./ssrf-protection.ts"; /** Names of the search/fetch tools the caller has actually registered, so * failure guidance never points at tools that do not exist in the session. */ export interface RegisteredToolNames { webSearch?: string; fetchContent?: string; getSearchContent?: string; } export interface VideoFrame { data: string; mimeType: string; timestamp: string; } export type FrameData = { data: string; mimeType: string; }; export type FrameResult = FrameData | { error: string; }; export interface ExtractedContent { url: string; title: string; content: string; error: string | null; thumbnail?: { data: string; mimeType: string; }; frames?: VideoFrame[]; duration?: number; mimeType?: string; status?: number; } export interface ExtractOptions { timeoutMs?: number | undefined; forceClone?: boolean | undefined; prompt?: string | undefined; timestamp?: string | undefined; frames?: number | undefined; model?: string | undefined; mode?: ("readable" | "raw" | "answer") | undefined; answerModel?: string | undefined; authFetchProfile?: AuthFetchProfile | undefined; toolNames?: RegisteredToolNames | undefined; /** Optional HTTP(S) or SOCKS proxy URL; routed through the curl-backed transport. */ proxy?: string | undefined; /** Reject direct image URLs with this error instead of decoding them with Pi's * resizeImage. Hosts without the Pi runtime set it; Pi leaves it unset. */ rejectDirectImages?: string | undefined; /** Custom DNS resolver used for SSRF validation. Primarily a test seam. */ lookup?: Lookup | undefined; /** "same-origin" refuses cross-origin redirects and extraction paths whose redirect * chain cannot be observed. fetchContent.redirects in config is a floor. */ redirects?: RedirectPolicy | undefined; extensionContext?: ExtensionContext | undefined; } /** Resolve the direct HTTP/Jina fetch budget, with a per-call override taking precedence. */ export declare function resolveFetchTimeoutMs(options?: Pick): number; /** * Fetches one URL: safety and config gates, special sources (video, GitHub, YouTube), * the HTTP gate, the configured provider fallback, then final diagnostics. */ export declare function extractContent(url: string, signal?: AbortSignal, options?: ExtractOptions): Promise; export declare function readPDFResponseBuffer(response: Response, maxSizeMB: number): Promise; export declare function extractHeadingTitle(text: string): string | null; export declare function fetchAllContent(urls: string[], signal?: AbortSignal, options?: ExtractOptions): Promise;