/**
 * LLM API endpoint detection + response body parsing.
 *
 * Used by the fetch interceptor to recognize LLM provider calls and extract
 * usage metadata (model, input/output token counts) from response bodies.
 *
 * The body is read in-process inside the customer's harness. Prompt and
 * completion content (`messages`, `content`, `choices[].message.content`)
 * never crosses the wire to AgentVault — only the extracted metadata.
 */
export type LlmProvider = "anthropic" | "openai" | "openrouter" | "groq" | "together" | "mistral" | "deepseek" | "azure";
export interface ParsedLlmResponse {
    model: string;
    tokensInput: number;
    tokensOutput: number;
}
/**
 * Detect whether a URL is a known LLM API endpoint we can parse.
 * Returns the provider key, or null if not recognized.
 *
 * Coverage as of 2026-05-01: Anthropic + 7 OpenAI-compatible providers.
 * Bedrock and Gemini intentionally NOT included — they require dedicated
 * parser branches (region routing for Bedrock, different usage shape for
 * Gemini). Add via separate PR when needed.
 */
export declare function detectLlmEndpoint(url: string): LlmProvider | null;
/**
 * Parse an LLM API response body, returning normalized usage metadata.
 *
 * Returns null if the body is not parseable or usage fields are missing.
 * Treats a missing `model` as `"unknown"` to avoid losing token counts when
 * a provider response shape varies. Does NOT extract prompt/completion
 * content — that is irrelevant to billing/observability and would violate
 * the plaintext constraint if transmitted.
 */
export declare function parseLlmResponse(provider: LlmProvider, body: unknown): ParsedLlmResponse | null;
/**
 * Parse a Server-Sent Events (SSE) stream body and extract usage metadata.
 *
 * Modern LLM SDKs (Anthropic SDK, OpenAI SDK, OpenRouter via OpenAI SDK)
 * default to streaming, returning `Content-Type: text/event-stream` rather
 * than `application/json`. The body is a sequence of `data: {json}\n\n`
 * blocks; usage is reported in a terminal event.
 *
 * - Anthropic emits `message_start` (input tokens) and `message_delta`
 *   (cumulative output tokens) events. The final `message_delta` carries
 *   the authoritative output_tokens count.
 * - OpenAI/OpenRouter only include a `usage` field in the final chunk
 *   (just before `data: [DONE]`) when the harness sets
 *   `stream_options.include_usage = true`. If not requested, this returns
 *   null cleanly — no false data shipped.
 *
 * Returns null on empty/malformed streams or when usage is not present.
 */
export declare function parseLlmSseStream(provider: LlmProvider, text: string): ParsedLlmResponse | null;
//# sourceMappingURL=llm-response-parser.d.ts.map