import type { RuntimeContext } from "../runtime/state/context.js";
import type { StateStack } from "../runtime/state/stateStack.js";
import type { ThreadStore } from "../runtime/state/threadStore.js";
/**
 * Run an HTTP request, translating any abort-shaped error into the
 * runtime's `AgencyCancelledError`. Node's `fetch` surfaces an
 * aborted request as a `DOMException` with `name === "AbortError"`,
 * which `isAbortError` matches. Translating to `AgencyCancelledError`
 * lets `__tryCall` re-throw it (alongside `GuardExceededError`) so
 * the agency-side `try` wrapper doesn't silently convert it into a
 * `Failure` value — the cancellation propagates to the runner the
 * same way an aborted LLM call does.
 *
 * Exported so other stdlib JS modules that do their own `fetch`
 * (oauth.ts token exchange, speech.ts whisper upload, browserUse.ts
 * session creation/polling) can share the same abort-error translation
 * without each one re-implementing it. Each caller still has to thread
 * the `AbortSignal` from `ctx.getAbortSignal(stack)` into its `fetch`
 * call — this helper only handles the catch side.
 */
export declare function runHttp<T>(fn: () => Promise<T>, url: string): Promise<T>;
/** Deprecated context-injected wrapper kept during the ALS migration;
 *  see `_fetch`. */
export declare function __internal_fetch(ctx: RuntimeContext<any>, stack: StateStack, _threads: ThreadStore, baseUrl: string, urlPath: string, headers: Record<string, string>, allowedDomains: string[]): Promise<string>;
/** ALS-reading replacement for `__internal_fetch`. */
export declare function _fetch(baseUrl: string, urlPath: string, headers: Record<string, string>, allowedDomains: string[]): Promise<string>;
/** Deprecated; see `_fetchJSON`. */
export declare function __internal_fetchJSON(ctx: RuntimeContext<any>, stack: StateStack, _threads: ThreadStore, baseUrl: string, urlPath: string, headers: Record<string, string>, allowedDomains: string[]): Promise<any>;
/** ALS-reading replacement for `__internal_fetchJSON`. */
export declare function _fetchJSON(baseUrl: string, urlPath: string, headers: Record<string, string>, allowedDomains: string[]): Promise<any>;
/** Deprecated; see `_fetchMarkdown`. */
export declare function __internal_fetchMarkdown(ctx: RuntimeContext<any>, stack: StateStack, _threads: ThreadStore, baseUrl: string, urlPath: string, headers: Record<string, string>, allowedDomains: string[]): Promise<string>;
/** ALS-reading replacement for `__internal_fetchMarkdown`. */
export declare function _fetchMarkdown(baseUrl: string, urlPath: string, headers: Record<string, string>, allowedDomains: string[]): Promise<string>;
export declare function resolveUrl(baseUrl: string, path: string): string;
export declare function checkAllowedDomains(url: string, allowedDomains: string[]): string | null;
