/**
 * @license
 * Copyright 2026 Amodal Labs, Inc.
 * SPDX-License-Identifier: MIT
 */
/**
 * Error thrown when a runtime API call returns a non-OK status.
 */
export declare class RuntimeFetchError extends Error {
    readonly path: string;
    readonly status: number;
    constructor(path: string, status: number);
}
/**
 * Get the configured runtime base URL from env, or throw if not set.
 */
export declare function getRuntimeUrl(): string;
export interface ResolvedRuntime {
    runtimeUrl: string;
    agentId: string;
    deployId?: string;
}
export interface RuntimeResolverOptions {
    deployId?: string;
}
/**
 * A function that resolves the runtime URL and agent ID from a request.
 * Cloud deployments inject their own implementation (e.g. JWT → platform API).
 */
export type RuntimeResolver = (req: Request, options?: RuntimeResolverOptions) => Promise<ResolvedRuntime>;
/**
 * Inject a custom runtime resolver. Called by cloud-studio at startup
 * to resolve runtime URL from the JWT via the platform API.
 */
export declare function setRuntimeResolver(resolver: RuntimeResolver): void;
/**
 * Resolve the runtime URL and agent ID for a request.
 * Delegates to the registered resolver (default: env vars).
 */
export declare function resolveRuntimeContext(req: Request, options?: RuntimeResolverOptions): Promise<ResolvedRuntime>;
/**
 * Fetch JSON data from the runtime API.
 *
 * Uses AbortSignal.timeout to ensure we never hang on a broken
 * runtime process. Logs request duration on both success and failure.
 */
export declare function fetchFromRuntime<T>(path: string): Promise<T>;
