/**
 * HTTP proxy for forwarding requests to the local OpenCode server.
 *
 * Proxies non-local routes (session, permission, provider, global/health)
 * to the OpenCode server running at localhost:4096 with Basic auth.
 */
import type { OpenCodeAuth } from "./spawn.js";
export interface ProxyRequest {
    method: string;
    path: string;
    headers?: Record<string, string>;
    body?: string;
    query?: Record<string, string>;
}
export interface ProxyResponse {
    status: number;
    headers: Record<string, string>;
    body?: string;
}
/**
 * Set the OpenCode auth credentials for proxying.
 * Called after spawnOpenCode() completes successfully.
 */
export declare function setOpenCodeAuth(auth: OpenCodeAuth): void;
/**
 * Clear the OpenCode auth credentials (e.g., on shutdown).
 */
export declare function clearOpenCodeAuth(): void;
/**
 * Get the current OpenCode auth credentials.
 * Returns null if OpenCode is not running.
 */
export declare function getOpenCodeAuth(): OpenCodeAuth | null;
/**
 * Proxy an HTTP request to the OpenCode server.
 *
 * Adds the Basic auth header automatically. Forwards the request method,
 * path, headers, body, and query parameters. Returns the response status,
 * headers, and body.
 *
 * @throws Error with code OPENCODE_UNREACHABLE if OpenCode is not configured
 * @throws Error with code TIMEOUT if the request times out
 */
export declare function proxyToOpenCode(request: ProxyRequest, timeoutMs?: number): Promise<ProxyResponse>;
//# sourceMappingURL=proxy.d.ts.map