/** * Subscription auth on an Agent (Python parity: `Agent(auth="claude-code")`, * `agent/agent.py` lines 2087-2100 and `_AUTH_DEFAULT_MODELS`, over * `praisonaiagents/auth`). * * `auth` says "bill this run against my subscription seat, not my API key". * Two consequences follow, and both matter: * * 1. **It fails at construction, never at request time.** A user who asked to * be billed against a subscription must not be silently downgraded to * API-key billing, so an unknown or unregistered provider throws before the * agent exists — where the error is about the option, not about a request. * 2. **It pins the vendor.** A subscription seat belongs to one vendor, so the * OpenAI default model would ship the provider's OAuth token to the wrong * endpoint. When the caller gave no model, `auth` chooses one. * * The credential stores themselves (a Claude Code keychain entry, a Codex CLI * file) are host concerns and are not read here: a provider is registered with * `registerAuthProvider` from `src/llm`, which is also what Python's * `register_subscription_provider` is. */ import { type LLMAuth } from '../../llm/auth'; /** * Default model per subscription provider, used only when the caller gave * `auth` without a model (Python `_AUTH_DEFAULT_MODELS`). */ export declare const AUTH_DEFAULT_MODELS: Readonly>; /** * Fail now if `name` names no registered provider (Python * `resolve_subscription_credentials`, which raises `AuthError` at * construction for exactly this reason). */ export declare function assertAuthProviderRegistered(name: string): void; /** The model `auth` implies when the caller named none. */ export declare function authDefaultModel(name: string): string | undefined; /** Resolve the provider's credentials (Python's `resolve_credentials()`). */ export declare function resolveAgentAuth(name: string): Promise; /** * Wrap `fetchImpl` so every outgoing request carries the provider's headers * (a user agent, beta flags). Existing headers on a request win, so a caller * can still override one deliberately. */ export declare function withAuthHeaders(fetchImpl: typeof fetch | undefined, headers: Record): typeof fetch | undefined;