/**
 * GoogleAdapter -- Google Generative AI / Vertex AI transport adapter.
 *
 * Implements LlmProviderAdapter for both:
 *   - Google Generative Language API (generativelanguage.googleapis.com)
 *   - Google Vertex AI endpoint (<region>-aiplatform.googleapis.com)
 *
 * Wire format: Google Gen AI REST API v1beta
 * Spec: P3-SUB-01 AC 4-7 (GoogleAdapter)
 *
 * SDK note (AC 6): The spec mandates @google/genai SDK. That package is not
 * installed in this repository and its exact import surface could not be
 * verified without web access. This implementation uses direct REST calls to
 * the Google Gen AI v1beta REST endpoints, which expose identical semantics.
 * TODO (Vera/Legal + Kai): Once @google/genai is installed and its API shape
 * verified, replace the inline REST implementation with the SDK wrapper. Track
 * as DEFERRED-GOOGLE-SDK in the follow-up queue.
 *
 * Deployment targets:
 *   'vertex-ai'            -- enterprise Vertex AI endpoint (default, has BAA)
 *   'generative-language'  -- Google AI Studio / direct API key endpoint
 *                            (no BAA -- emits WARN audit event on init)
 *
 * Auth:
 *   vertex-ai:            apiKey = service-account JSON or OAuth2 bearer token
 *   generative-language:  apiKey = Google AI Studio API key (x-goog-api-key header)
 *
 * @connexum/ai-governance
 */
import { BaseProviderAdapter } from './base';
import type { LlmAdapterConfig, LlmAdapterCapabilities, LlmChatRequest, LlmChatResponse, LlmStreamChunk, LlmToolUseRequest, LlmToolUseResponse, LlmModelDescriptor } from './index';
import { LlmProviderError } from './index';
/**
 * Google Gen AI REST API version this adapter was tested against.
 * Corresponds to the v1beta REST surface (also used by @google/genai SDK).
 * TODO: update when AC 6 SDK migration is complete.
 */
export declare const TESTED_API_VERSION = "v1beta";
export type GoogleDeploymentTarget = 'generative-language' | 'vertex-ai';
/**
 * Family classification for a Google-served model ID.
 *
 * - `'gemini'`: closed-weight, Google's hosted-only flagship family
 *   (gemini-1.5-pro / gemini-2.5-flash / etc.).
 * - `'gemma'`: open-weight family (gemma-2-2b-it / gemma-2-9b-it /
 *   gemma-2-27b-it / paligemma-3b-mix-224 / etc.) — the open-weight
 *   nature is governance-relevant: customers can re-host Gemma weights
 *   off-Google-infra, which means a "Gemma deployment" might NOT be
 *   the Google-hosted endpoint at all. The adapter only governs
 *   Google-hosted Gemma calls.
 * - `'unknown'`: model ID does not match a known prefix; allowed but
 *   not classified for capability bundles. (F-NEW-GEMMA-ADAPTER)
 */
export type GoogleModelFamily = 'gemini' | 'gemma' | 'unknown';
/**
 * Model metadata derived from the model ID + deployment target.
 * Does not require an external API call — purely lexical.
 *
 * F-NEW-GEMMA-ADAPTER (2026-05-08): Gemma support extension. The
 * deployment-target fact governs BAA inheritance (vertex-ai inherits
 * BAA; generative-language does not), independent of family.
 */
export interface GoogleModelMetadata {
    family: GoogleModelFamily;
    isOpenWeight: boolean;
    /** True when the model is reachable via a BAA-covered endpoint. */
    baaInherits: boolean;
    /** Display label for enumerate/list surfaces. */
    displayName: string;
}
/**
 * Lexical family detection. Returns `'unknown'` for IDs that match
 * neither prefix. Caller can still pass an unknown-family modelId to
 * the adapter; this helper just classifies.
 */
export declare function getGoogleModelFamily(modelId: string): GoogleModelFamily;
/**
 * Per-model metadata bundle. Combines the lexical family with the
 * deployment-target BAA fact so callers (capability registry, audit
 * chain entry) get a single record per call.
 */
export declare function getGoogleModelMetadata(modelId: string, deploymentTarget: GoogleDeploymentTarget): GoogleModelMetadata;
/**
 * The list of Gemma model IDs the adapter is known to handle without
 * surprise. Customers can pass other Gemma IDs and the adapter will
 * still route the request — this list drives enumerateModels() output
 * and the capability-bundle registration.
 *
 * Source: Google AI Studio + Vertex AI Model Garden Gemma 2 / paligemma
 * listings.
 *
 * F-NEW-GEMMA-VISION (2026-05-09): paligemma family is multimodal
 * (image+text in, text out). The text-only Gemma 2 variants (2b/9b/27b)
 * remain non-multimodal. multimodal flag is queried via
 * `isGemmaMultimodal()` so the adapter can reject array-shaped content
 * for text-only models with UNSUPPORTED_MULTIMODAL.
 */
export declare const KNOWN_GEMMA_MODEL_IDS: readonly string[];
/**
 * Subset of KNOWN_GEMMA_MODEL_IDS that are multimodal (image+text in).
 * The adapter consults this set to decide whether array-shaped
 * `LlmMessage.content` is permitted for the requested model.
 *
 * F-NEW-GEMMA-VISION 2026-05-09.
 */
export declare const KNOWN_GEMMA_VISION_MODEL_IDS: readonly string[];
/**
 * Returns true if the modelId names a known multimodal Gemma variant.
 * Falls back to a prefix check for forward compatibility with future
 * paligemma releases (paligemma2-*, etc.). Text-only Gemma 2 models
 * return false.
 *
 * F-NEW-GEMMA-VISION 2026-05-09.
 */
export declare function isGemmaMultimodal(modelId: string): boolean;
export interface GoogleAdapterConfig extends LlmAdapterConfig {
    /**
     * Deployment target:
     *   'vertex-ai'           -- Vertex AI endpoint (default, carries BAA)
     *   'generative-language' -- Google AI Studio direct endpoint (no BAA)
     */
    deploymentTarget?: GoogleDeploymentTarget;
    /**
     * Google Cloud project ID (required for vertex-ai target)
     */
    projectId?: string;
    /**
     * Google Cloud region (required for vertex-ai target, e.g. 'us-central1')
     */
    region?: string;
}
export declare class GoogleAdapter extends BaseProviderAdapter {
    readonly adapterId = "google";
    readonly providerId = "google";
    private googleConfig;
    initialize(config: LlmAdapterConfig): void;
    private buildUrl;
    private buildAuthHeaders;
    /**
     * Convert one LlmContentPart (vision-aware) to a GooglePart. Supports
     * three URL shapes for image_url:
     *   - data:<mime>;base64,<bytes>  → inlineData { mimeType, data }
     *   - gs://bucket/path            → fileData   { mimeType, fileUri }
     *   - https://...                 → fileData   { mimeType, fileUri }
     *                                   (Vertex AI fetches it; AI Studio
     *                                   does not — adapter passes it
     *                                   through and lets the provider
     *                                   reject if unsupported.)
     *
     * The MIME type is taken from the part's `mimeType` field if present,
     * otherwise inferred from the URL/data-URI prefix, otherwise defaults
     * to 'image/jpeg' (paligemma's training default). Inferred MIME is
     * advisory; provider may reject if mismatched.
     *
     * F-NEW-GEMMA-VISION 2026-05-09.
     */
    private convertImagePart;
    private inferMimeFromUrl;
    /**
     * Convert one LlmMessage to its part list. Plain-string content is
     * wrapped to `[{ text }]`. Array content (multimodal) is mapped
     * part-by-part. Rejects array content for non-multimodal models with
     * UNSUPPORTED_MULTIMODAL.
     *
     * F-NEW-GEMMA-VISION 2026-05-09.
     */
    private convertMessageToParts;
    /**
     * Returns true if the requested model supports image content.
     * F-NEW-GEMMA-VISION 2026-05-09.
     */
    private modelSupportsMultimodal;
    /**
     * Extract every image-URL string referenced by this request. Used by
     * the pre-call governance hook so pack classifiers see image URIs as
     * governance-relevant data alongside text. Returns the empty array
     * for text-only requests.
     *
     * Public so framework adapters and the runtime governance check can
     * read it without needing access to the private parts.
     *
     * F-NEW-GEMMA-VISION 2026-05-09.
     */
    static extractImageUrls(request: LlmChatRequest | LlmToolUseRequest): string[];
    private convertMessages;
    private buildGoogleTools;
    chat(request: LlmChatRequest): Promise<LlmChatResponse>;
    private chatOnce;
    chatStream(request: LlmChatRequest): AsyncIterable<LlmStreamChunk>;
    invokeToolUse(request: LlmToolUseRequest): Promise<LlmToolUseResponse>;
    private invokeToolUseOnce;
    enumerateModels(): Promise<LlmModelDescriptor[]>;
    translateError(raw: unknown): LlmProviderError;
    getCapabilities(): LlmAdapterCapabilities;
    private validateModelId;
    private handleHttpErrors;
    /**
     * Map Google HarmCategory safety ratings to normalized LlmSafetySignal[].
     * AC 4: safety signal pass-through.
     */
    private mapSafetyRatings;
    private normalizeProbability;
    /**
     * Emit a `llm:multimodal-input` audit event when a request contains
     * image_url parts. Fires BEFORE the wire request goes out, so
     * downstream pack classifiers (e.g. PHI image leak detector, public
     * Cloud Storage exposure check) see the image URIs as governance-
     * relevant data alongside text. Suppressed for text-only requests.
     *
     * F-NEW-GEMMA-VISION 2026-05-09. Locked Invariant 10 (push-receive
     * only) is preserved: we DO NOT fetch the image — we only emit the
     * URIs through the audit channel.
     */
    private emitMultimodalAuditIfPresent;
    /**
     * Emit audit event for safety signals (AC 4 -- always emit when signals present).
     */
    private emitSafetyEvent;
    private mapFinishReason;
}
//# sourceMappingURL=google.d.ts.map