/** * Z.ai / GLM OAuth flow (GLM Coding Plan ยท Sign in) * * Mirrors ZCode's desktop "Individual Plan" browser sign-in: an * authorization-code flow (no PKCE) against chat.z.ai, a JSON token exchange * that yields a short-lived OAuth access token, and a business-API sequence * that provisions a durable `id.secret` API key. The minted key is placed in * {@link OAuthCredentials.access}; `getOAuthApiKey` returns it verbatim as the * request bearer for the `zai` provider, so no dialect change is needed. */ import { OAuthCallbackFlow } from "./callback-server.js"; import type { OAuthController, OAuthCredentials } from "./types.js"; export declare class ZaiOAuthFlow extends OAuthCallbackFlow { #private; constructor(ctrl: OAuthController); generateAuthUrl(state: string, redirectUri: string): Promise<{ url: string; instructions?: string; }>; exchangeToken(code: string, state: string, redirectUri: string): Promise; } /** * Login with Z.ai OAuth (GLM Coding Plan). */ export declare function loginZaiOAuth(ctrl: OAuthController): Promise;