/**
 * Resolves provider/model wiring for Claude-compatible runtimes and
 * OpenAI-compatible Pi runtimes, including 9Router's Claude vs GPT split.
 */
import Anthropic from "@anthropic-ai/sdk";
import { type Api, type Model as PiModel } from "@earendil-works/pi-ai";
import type { z } from "zod";
import { type Model, type Provider, type VisionClawConfig } from "../config/types.js";
export declare const OPENAI_MODEL: "gpt-5.5";
export type LlmModelTier = "heavy" | "balanced" | "fast";
export type LlmUseCase = "main_general" | "main_coding" | "fast_responder" | "tool_alarm" | "health_probe" | "summary" | "disk_cleanup" | "daily_report";
export interface LlmProviderRoute {
    provider: string;
    enabled?: boolean;
    api_protocols: {
        api_protocol: string;
        enabled: boolean;
        models: Partial<Record<LlmModelTier, string>>;
        lastVerifiedAt?: string | null;
        lastError?: string | null;
    }[];
}
export declare function setLlmProviderRoutes(routes: LlmProviderRoute[] | undefined): void;
export declare function isOpenAIProvider(provider: Provider): provider is "openai" | "azure-openai";
export declare function isGptModel(model: Model): model is "gpt-5.5";
export declare function getProviderLabel(provider: Provider): string;
export declare function getRuntimeLabel(config: VisionClawConfig): string;
/**
 * Create an Anthropic-compatible client for Claude model paths.
 *
 * - `"anthropic"`: uses the direct API with `anthropicApiKey`.
 * - `"bedrock"`: uses `AnthropicBedrock` with explicit AWS credentials when
 *   provided, otherwise falls back to the default AWS credential provider chain.
 * - `"vertex"`: uses `AnthropicVertex` with Google Cloud project/region config.
 * - `"9router"`: uses 9Router as an Anthropic-compatible proxy for Claude models.
 *
 * OpenAI-compatible providers and GPT models use the Pi Agent SDK instead.
 */
export declare function createClient(config: VisionClawConfig): Anthropic;
export declare function hasProviderCredentials(provider: Provider, config: VisionClawConfig): boolean;
/**
 * Return the correct model identifier for direct SDK calls
 * (fast-responder, tool-alarm-evaluator, etc.).
 *
 * Agent SDK `query()` calls do NOT need this - the SDK maps models
 * internally when `CLAUDE_CODE_USE_BEDROCK=1` or `CLAUDE_CODE_USE_VERTEX=1` is set.
 */
export declare function getModelId(config: VisionClawConfig, options?: {
    tier?: LlmModelTier;
    useCase?: LlmUseCase;
}): string;
/**
 * Return the Sonnet model identifier for lightweight side-calls
 * (fast-responder, etc.) that don't need the full Opus model.
 * For non-Claude providers, falls back to the main model.
 */
export declare function getFastResponderModelId(config: VisionClawConfig): string;
/**
 * Build the `env` record for runtime SDK calls.
 *
 * - Anthropic: passes `ANTHROPIC_API_KEY`.
 * - Bedrock: passes `CLAUDE_CODE_USE_BEDROCK`, `AWS_REGION`, and either
 *   IAM credentials or `AWS_BEARER_TOKEN_BEDROCK`. IAM credentials take
 *   precedence over bearer token when both are configured. If neither is
 *   configured, process.env AWS credentials are inherited untouched so
 *   local dev (`.env` / `~/.aws/credentials`) still works.
 * - Vertex: passes `CLAUDE_CODE_USE_VERTEX`, `CLOUD_ML_REGION`,
 *   and `GOOGLE_APPLICATION_CREDENTIALS` for service account auth.
 * - OpenAI: passes `OPENAI_API_KEY` for Pi Agent SDK calls.
 * - Azure OpenAI: passes Azure OpenAI endpoint/key/deployment env vars.
 * - 9Router: passes Anthropic-compatible env vars for Claude models and
 *   OpenAI-compatible env vars for GPT models.
 */
export declare function buildAgentEnv(config: VisionClawConfig): Record<string, string | undefined>;
/**
 * Start the API logging proxy for Claude-compatible dev-mode API calls.
 * No-ops in production, for Bedrock/Vertex, for OpenAI-compatible providers,
 * and for 9Router GPT models.
 *
 * Call once at startup, before the first `buildAgentEnv()` call.
 */
export declare function maybeStartApiProxy(config: VisionClawConfig): Promise<void>;
/**
 * Resolve the Pi `Model<Api>` + API key for the configured provider, so Pi
 * side-calls (fast-responder, tool alarm evaluator, etc.) go through the same
 * provider routing the main Pi agent uses.
 *
 * Mirrors `PiAgentSession.resolvePiModel()` / `getApiKey()` — keep them in
 * sync if you change one.
 */
export declare function resolvePiSideCallModel(config: VisionClawConfig, options?: {
    tier?: LlmModelTier;
    useCase?: LlmUseCase;
}): {
    model: PiModel<Api>;
    apiKey: string;
};
interface BaseSideCallOptions {
    systemPrompt: string;
    userMessage: string;
    /** Override the Claude-compatible model id. Pi side calls resolve the model from config. */
    modelId?: string;
    /** Business use-case for provider route tier selection when no explicit modelId is provided. */
    useCase?: LlmUseCase;
    /** Hard cap on tokens. Defaults to 2048. */
    maxTokens?: number;
    /** Request timeout in ms. Defaults to the SDK default. */
    timeoutMs?: number;
}
export interface StructuredSideCallOptions<TSchema extends z.ZodType> extends BaseSideCallOptions {
    schema: TSchema;
    /** Optional human-readable label for the schema. */
    schemaName?: string;
}
export type TextSideCallOptions = BaseSideCallOptions;
/**
 * Run a one-shot side call against the configured agent engine.
 *
 * - Pass `schema` for native structured-output JSON, parsed and validated with zod.
 * - Omit `schema` for free-form text.
 *
 * Throws on transport or parse errors — callers decide whether to swallow or escalate.
 */
export declare function runSideCall<TSchema extends z.ZodType>(config: VisionClawConfig, options: StructuredSideCallOptions<TSchema>): Promise<z.infer<TSchema>>;
export declare function runSideCall(config: VisionClawConfig, options: TextSideCallOptions): Promise<string>;
export {};
//# sourceMappingURL=model-provider.d.ts.map