/**
 * OllamaAdapter -- Ollama self-hosted LLM transport adapter.
 *
 * Implements LlmProviderAdapter for the Ollama REST API.
 *
 * Wire format:
 *   POST <baseUrl>/api/chat    -- chat (non-streaming and streaming)
 *
 * Streaming: NDJSON -- each line is a JSON object with `message.content`
 * and a `done` boolean on the final line.
 *
 * Tool use: Ollama 0.3.x tool-use format (tools array in request,
 * tool_calls array in response).
 *
 * SSRF: Ollama runs at loopback (127.0.0.1:11434 by default).
 * The adapter registers a session-scoped loopback allowance with
 * ssrf-guard.ts on initialize() and revokes it on teardown.
 *
 * BAA: None. Emits WARN at initialize() if a HIPAA-active compliance
 * pack is detected in the runtime context.
 *
 * Spec: P3-SUB-01 AC 16-19 (OllamaAdapter)
 *
 * @connexum/ai-governance
 */
import { BaseProviderAdapter } from './base';
import type { LlmAdapterConfig, LlmAdapterCapabilities, LlmChatRequest, LlmChatResponse, LlmStreamChunk, LlmToolUseRequest, LlmToolUseResponse, LlmModelDescriptor } from './index';
import { LlmProviderError } from './index';
/**
 * Ollama API version this adapter was tested against.
 * Ollama does not publish a formal API version header. We pin to the
 * minimum version that introduced tool use (0.3.x).
 * TODO (Vera/Legal, Kai): Verify against https://ollama.com/blog/tool-support
 * before enabling in production. Flag DEFERRED-OLLAMA-API-VERSION.
 */
export declare const TESTED_API_VERSION = "0.3";
export interface OllamaAdapterConfig extends LlmAdapterConfig {
    /**
     * Base URL for the Ollama server.
     * Default: 'http://127.0.0.1:11434'.
     * If overridden and the value is not a valid URL, initialize() throws.
     */
    baseUrl?: string;
    /**
     * Opaque document reference for an offline BAA with the infrastructure
     * provider. If supplied, it is emitted in the audit chain.
     * This adapter does not validate the reference -- it is the caller's
     * responsibility to ensure the referenced document covers PHI workloads.
     */
    offlineBaaReference?: string;
    /**
     * Set to true if a HIPAA-active compliance pack is detected in the
     * runtime context. The adapter will emit a WARN event at initialize().
     * The governance runtime should set this flag when loading the adapter
     * into a HIPAA-enabled environment.
     */
    hipaaPackActive?: boolean;
}
export declare class OllamaAdapter extends BaseProviderAdapter {
    readonly adapterId = "ollama";
    readonly providerId = "ollama";
    private ollamaConfig;
    private loopbackSessionToken;
    initialize(config: LlmAdapterConfig): void;
    /**
     * Revoke the loopback session when the adapter is no longer needed.
     * Call this when tearing down an OllamaAdapter instance.
     */
    teardown(): void;
    /**
     * Returns the session token registered with the SSRF guard.
     * The governance runtime passes this to checkUrlWithSession().
     */
    getLoopbackSessionToken(): string | null;
    private emitHipaaWarning;
    private buildUrl;
    private convertMessages;
    private validateModelId;
    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 handleHttpErrors;
    private mapDoneReason;
}
//# sourceMappingURL=ollama.d.ts.map