/** * http_fetch MCP tool — ADR-164 §5.1.8. * * The Operations business pod (templates/ops.json) references `http_fetch` as * an allowed MCP tool for the synthetic-endpoint availability bench (probe * 200/500 from a configured URL, escalate to #ops on 500-rate spikes). * Phase 3 left this as a TODO; Phase 4 ships the tool with secure-by-default * gating per the §5.1.8 contract: URL allowlist (no file://, ftp://, no * RFC-1918 / loopback unless explicitly enabled), header sanitization (no * auth pass-through unless explicitly enabled), hard timeout via * AbortController, response truncation, default User-Agent. * * Architectural constraints (load-bearing): * - DEFAULT-REFUSES private addresses + loopback (CLAUDE_FLOW_HTTP_FETCH_ALLOW_PRIVATE=1 opt-in) * - DEFAULT-REFUSES Authorization / Cookie / X-Auth-* (CLAUDE_FLOW_HTTP_FETCH_ALLOW_AUTH=1 opt-in) * - hard timeout 30s default, 60s ceiling * - response truncated to 256KB default, 1MB ceiling * - no redirects auto-followed beyond fetch's default; status reported as-is * * @module @claude-flow/cli/mcp-tools/http-fetch */ import type { MCPTool } from './types.js'; export declare class HttpFetchValidationError extends Error { readonly code: string; constructor(message: string, code: string); } /** * Decide whether the URL is permitted under the default secure-by-default * allowlist. Block file://, ftp://, RFC-1918 private addresses, loopback, * link-local — unless CLAUDE_FLOW_HTTP_FETCH_ALLOW_PRIVATE=1 is set. */ export declare function validateUrl(rawUrl: string): URL; export declare function validateHeaders(headers: Record): Record; export interface HttpFetchResult { success: boolean; status: number; statusText: string; headers: Record; body: string; bodyTruncated: boolean; bytesRead: number; durationMs: number; url: string; method: string; error?: string; errorCode?: string; } /** * Pure execution path so tests can call it without going through the MCP * dispatcher. Returns a result object (does not throw on validation failure * — it returns success: false with an errorCode). */ export declare function httpFetchExecute(input: Record): Promise; export declare const httpFetchTools: MCPTool[]; //# sourceMappingURL=http-fetch-tools.d.ts.map