/** * fetch command — direct, evidentiary HTTP client (ADR-0006). * * Consolidates binary-safe direct retrieval and raw REST API calls: * * - Evidentiary GET (default): byte-exact, streaming to --out with --md5 * hash verification, real browser User-Agent, following redirects. * - Structured API: --method, --data (@body.json or inline), --header. * * This command is credential-free (no AI provider, no adapter, no LLM * translation) and is dispatched before credentialed config load. */ import type { CommandResult } from "../command-invocation.js"; import type { OutputMode } from "../lib/output.js"; import type { HandlerDependencies } from "../index.js"; export declare const DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"; export declare const DEFAULT_FETCH_TIMEOUT_MS = 30000; export declare const FETCH_HELP: string; export interface FetchOptions { readonly out?: string; readonly md5?: boolean; readonly sha256?: boolean; readonly raw?: boolean; readonly ua?: string; readonly method?: string; readonly data?: string; readonly headers?: readonly string[]; readonly pdf?: "text" | "raw"; readonly pdfRepair?: boolean; readonly timeout?: number; } export interface FetchResultData { readonly schemaVersion: 1; readonly url: string; readonly finalUrl: string; readonly status: number; readonly statusText: string; readonly headers: Readonly>; readonly bytes: number; readonly md5?: string; readonly sha256?: string; readonly outPath?: string; readonly contentType?: string; readonly content?: string; } /** * Validate that a URL starts with http:// or https://. */ export declare function validateFetchUrl(url: string): void; /** * Parse fetch CLI arguments supporting multi-flag headers (-H / --header). */ export declare function parseFetchArgs(args: readonly string[]): { readonly options: FetchOptions; readonly positional: readonly string[]; readonly showHelp: boolean; }; /** * Pure execution of the fetch operation. */ export declare function executeFetch(url: string, options?: FetchOptions): Promise; /** * Invocation-seam command wrapper returning CommandResult. */ export declare function fetchCommand(url: string, options?: FetchOptions): Promise>; /** * Handler invoked by the dispatcher in `src/index.ts`. */ export declare function handleFetch(args: string[], outputMode: OutputMode, deps: HandlerDependencies, forceRaw?: boolean): Promise; //# sourceMappingURL=fetch.d.ts.map