/**
 * Kimi Code OAuth — Device Authorization Grant (RFC 8628).
 *
 * Mirrors MoonshotAI/kimi-code's managed-auth flow. Three form-encoded
 * POST endpoints against the OAuth host (default `https://auth.kimi.com`):
 *
 *  - `/api/oauth/device_authorization` (client_id)           → device + user code
 *  - `/api/oauth/token` (grant_type=device_code)             → poll until authorized
 *  - `/api/oauth/token` (grant_type=refresh_token)           → refresh access token
 *
 * Unlike Anthropic/OpenAI/Gemini (browser-redirect PKCE), this is a
 * device-code/poll flow: we show the user a URL + code, they authorize in a
 * browser on any device, and we poll for the token.
 *
 * After login the issued token is used against the managed coding API
 * (`https://api.kimi.com/coding/v1`, distinct from the `api.moonshot.ai`
 * API-key endpoint) via `Authorization: Bearer <access_token>`. We persist
 * that base URL on the credential so the runtime routes there automatically.
 */
import type { OAuthCredentials, OAuthLoginCallbacks } from "./types.js";
/** Managed coding API base URL the issued OAuth token is used against. */
export declare function kimiCodeBaseUrl(): string;
/**
 * Headers the Kimi For Coding API requires on every model request. The
 * managed endpoint gates access to recognized coding agents: requests must
 * carry a `kimi_code_cli` platform identity and matching `User-Agent`, or the
 * server rejects with "only available for Coding Agents". Attach these to the
 * inference client's default headers whenever the Kimi OAuth token is used.
 */
export declare function kimiCodingHeaders(): Record<string, string>;
/**
 * True if `baseUrl` targets the Kimi For Coding managed endpoint (the URL
 * persisted on Kimi OAuth credentials). Callers use this to decide whether to
 * attach `kimiCodingHeaders()` — the Moonshot API-key path uses a different
 * host and must NOT receive the coding-agent identity headers.
 */
export declare function isKimiCodingEndpoint(baseUrl: string | undefined): boolean;
/**
 * Drive the Kimi device-code flow end-to-end. Shows the verification URL +
 * user code via callbacks, opens the browser, and polls until the user
 * authorizes (or a 15-minute local timeout elapses).
 */
export declare function loginKimi(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials>;
/** Exchange a refresh token for a fresh Kimi access token. */
export declare function refreshKimiToken(refreshToken: string): Promise<OAuthCredentials>;
//# sourceMappingURL=kimi.d.ts.map