/**
 * SSRF / private-network protection for provider HTTP calls.
 *
 * Provider URLs are mostly user-controllable (cfg.providers.<id>.baseUrl,
 * imageBaseUrl, etc.). Without a guard a malicious config could make xopc
 * fetch internal services (169.254.x.x metadata, 127.0.0.1, RFC1918, …).
 *
 * Policy:
 *   - default: allow only http(s) + non-private hosts
 *   - dev:     allow loopback when XOPC_PROVIDER_HTTP_ALLOW_LOOPBACK=1
 *   - test:    same as dev; vitest sets NODE_ENV=test
 */
import type { SsrfGuardOptions } from './ssrf-guard.js';
export interface PrivateNetworkPolicy {
    /** Permit 127.0.0.0/8, ::1, localhost. Default false. */
    allowLoopback?: boolean;
    /** Permit RFC1918 / link-local / unique-local. Default false. */
    allowPrivate?: boolean;
    /** Extra explicit hostname allowlist (exact match). */
    allowHosts?: ReadonlyArray<string>;
}
export declare class BlockedPrivateNetworkError extends Error {
    readonly url: string;
    readonly host: string;
    constructor(url: string, host: string, reason: string);
}
/** Map URL-layer private-network policy into SSRF guard options for `fetchWithTimeoutGuarded`. */
export declare function privateNetworkPolicyToSsrfGuardOptions(policy?: PrivateNetworkPolicy): SsrfGuardOptions;
export declare function defaultPolicy(): PrivateNetworkPolicy;
/**
 * Throws {@link BlockedPrivateNetworkError} when the URL targets a private host
 * not permitted by the policy. Returns silently otherwise.
 *
 * Note: This is a best-effort guard at the URL layer. A truly hostile host
 * could still resolve a public name to a private IP via DNS rebinding; for
 * production deployments behind untrusted user input, also enforce egress
 * firewall rules.
 */
export declare function assertNotPrivateNetwork(rawUrl: string, policy?: PrivateNetworkPolicy): void;
export type HostClass = 'public' | 'loopback' | 'private' | 'link-local' | 'invalid';
/** Classify a hostname/IP literal. Hostnames are conservatively treated as `public`. */
export declare function classifyHost(host: string): HostClass;
