import type { Tool } from '../../types/tools.js'; import type { FetchInput, FetchSanitizeMode } from './schema.js'; import type { FetchOutput, FetchUrlResult } from './types.js'; import type { ServiceRegistry } from '../../config/service-registry.js'; import type { FeatureFlagManager } from '../../runtime/feature-flags/index.js'; export interface FetchRuntimeDeps { readonly serviceRegistry?: Pick | null | undefined; readonly featureFlags?: Pick | null | undefined; /** * Default sanitize mode applied when a fetch call omits sanitize_mode. * Sourced from config (fetch.sanitizeMode) by SDK runtime services; a per-call * sanitize_mode still overrides. Absent → the built-in 'safe-text' default. */ readonly defaultSanitizeMode?: FetchSanitizeMode | undefined; /** * Default trusted hosts (from config fetch.trustedHosts). Merged with, never * replaced by, per-call trusted_hosts. */ readonly defaultTrustedHosts?: readonly string[] | undefined; /** * Default blocked hosts (from config fetch.blockedHosts). Merged with per-call * blocked_hosts. */ readonly defaultBlockedHosts?: readonly string[] | undefined; /** * Cooperative cancellation: an externally-supplied signal, * combined with each request's own per-URL timeout signal via * `AbortSignal.any`. Optional and additive, omitted, behavior is * unchanged from before this field existed. */ readonly signal?: AbortSignal | undefined; /** * Live read of the per-project localhost approval (fetch.allowLocalhost). * When true, fetches to loopback dev servers proceed without an ask. */ readonly isLocalhostAllowed?: (() => boolean) | undefined; /** * One-tap "allow for this project" ask for a loopback fetch. Wired to the * shared approval broker by the runtime composition root; resolving true * means the approval was granted (and persisted per project by the wiring), * so it is never asked again. Absent → unapproved localhost fetches are * refused with an honest reason naming fetch.allowLocalhost. */ readonly approveLocalhostFetch?: ((input: { url: string; host: string; }) => Promise) | undefined; } interface CacheEntry { data: FetchUrlResult; timestamp: number; ttl: number; } export declare class FetchRuntimeService { private readonly responseCache; private cacheWriteCount; getCached(key: string, cacheTtlSeconds: number): FetchUrlResult | null; cacheSet(key: string, entry: CacheEntry): void; execute(input: FetchInput, deps?: FetchRuntimeDeps): Promise; } export declare function executeFetchInput(input: FetchInput, deps?: FetchRuntimeDeps): Promise; export declare function createFetchTool(deps?: FetchRuntimeDeps, runtime?: FetchRuntimeService): Tool; export {}; //# sourceMappingURL=runtime.d.ts.map