import type { DaoCoreConfig } from "../config/types.daocore.js";
import { type SecretInput } from "../config/types.secrets.js";
/**
 * Wizard default for non-Azure custom APIs when context length is unknown.
 * Mirrors the generic persisted custom-model catalog fallback and leaves enough
 * room above the default compaction reserve floor in `pi-settings.ts`.
 */
export declare const CUSTOM_PROVIDER_DEFAULT_CONTEXT_WINDOW_TOKENS = 128000;
export type CustomModelImageInputInference = {
    supportsImageInput: boolean;
    confidence: "known" | "unknown";
};
export declare function resolveCustomModelImageInputInference(modelId: string): CustomModelImageInputInference;
export declare function inferCustomModelSupportsImageInput(modelId: string): boolean;
export type CustomApiCompatibility = "openai" | "anthropic";
export type CustomApiResult = {
    config: DaoCoreConfig;
    providerId?: string;
    modelId?: string;
    providerIdRenamedFrom?: string;
};
export type ApplyCustomApiConfigParams = {
    config: DaoCoreConfig;
    baseUrl: string;
    modelId: string;
    compatibility: CustomApiCompatibility;
    apiKey?: SecretInput;
    providerId?: string;
    alias?: string;
    supportsImageInput?: boolean;
};
export type ParseNonInteractiveCustomApiFlagsParams = {
    baseUrl?: string;
    modelId?: string;
    compatibility?: string;
    apiKey?: string;
    providerId?: string;
    supportsImageInput?: boolean;
};
export type ParsedNonInteractiveCustomApiFlags = {
    baseUrl: string;
    modelId: string;
    compatibility: CustomApiCompatibility;
    apiKey?: string;
    providerId?: string;
    supportsImageInput?: boolean;
};
export type CustomApiErrorCode = "missing_required" | "invalid_compatibility" | "invalid_base_url" | "invalid_model_id" | "invalid_provider_id" | "invalid_alias";
export declare class CustomApiError extends Error {
    readonly code: CustomApiErrorCode;
    constructor(code: CustomApiErrorCode, message: string);
}
export type ResolveCustomProviderIdParams = {
    config: DaoCoreConfig;
    baseUrl: string;
    providerId?: string;
};
export type ResolvedCustomProviderId = {
    providerId: string;
    providerIdRenamedFrom?: string;
};
export declare function normalizeEndpointId(raw: string): string;
export declare function buildEndpointIdFromUrl(baseUrl: string): string;
export declare function resolveCustomModelAliasError(params: {
    raw: string;
    cfg: DaoCoreConfig;
    modelRef: string;
}): string | undefined;
type VerificationRequest = {
    endpoint: string;
    headers: Record<string, string>;
    body: Record<string, unknown>;
};
export declare function normalizeOptionalProviderApiKey(value: unknown): SecretInput | undefined;
export declare function buildOpenAiVerificationProbeRequest(params: {
    baseUrl: string;
    apiKey: string;
    modelId: string;
}): VerificationRequest;
export declare function buildAnthropicVerificationProbeRequest(params: {
    baseUrl: string;
    apiKey: string;
    modelId: string;
}): VerificationRequest;
export declare function resolveCustomProviderId(params: ResolveCustomProviderIdParams): ResolvedCustomProviderId;
export declare function parseNonInteractiveCustomApiFlags(params: ParseNonInteractiveCustomApiFlagsParams): ParsedNonInteractiveCustomApiFlags;
export declare function applyCustomApiConfig(params: ApplyCustomApiConfigParams): CustomApiResult;
export {};
