import { type ToolSet } from "ai";
import type { RuntimeModelReference } from "#runtime/agent/bootstrap.js";
import type { JsonObject } from "#shared/json.js";
/**
 * The provider backend resolved for one web search tool invocation.
 */
export type WebSearchBackend = "anthropic" | "google" | "openai" | "parallel";
/**
 * Returns the framework tool name that produced an upstream provider tool
 * `type`, or `null` when the type is not one we know how to remove.
 *
 * Used by the harness recovery path to decide which tools to drop when a
 * gateway fallback provider rejects a tool. Unknown types fall through to
 * the existing terminal/recoverable handling.
 */
export declare function resolveFrameworkToolFromUpstreamType(type: string): string | null;
/**
 * Returns the output schema for the provider-managed web search tool that
 * will be injected for `backend`.
 */
export declare function resolveWebSearchOutputSchema(backend: WebSearchBackend): JsonObject;
/**
 * Determines the web search backend for a model reference.
 *
 * - All AI Gateway models: Parallel search via gateway
 * - Direct/BYO OpenAI models: native OpenAI search
 * - Direct/BYO Anthropic models: native Anthropic search
 * - Direct/BYO Google models: native Google search grounding
 * - Other BYO models: not available (returns `null`)
 */
export declare function resolveWebSearchBackend(modelRef: RuntimeModelReference): WebSearchBackend | null;
/**
 * Constructs the AI SDK provider tool for web search based on the resolved
 * backend. Called once per harness step when web search is enabled.
 *
 * Dynamic imports keep unused provider SDKs out of the bundle — only the
 * provider matching the current model is loaded.
 */
export declare function resolveWebSearchProviderTool(backend: WebSearchBackend): Promise<ToolSet[string]>;
