import type { OAuthCredentials } from "../../registry/oauth/types.js"; import type { FetchImpl } from "../../types.js"; export declare const AGY_OAUTH_CLIENT_ID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com"; /** Parse the native consumer grant, not Gemini CLI's oauth_creds.json. */ export declare function parseAgyStoredCredentials(value: unknown): OAuthCredentials; /** Read only the isolated directory supplied to the successful login process. */ export declare function exportAgyCredentials(geminiDir: string): Promise; /** Decode the existing registry's api-key-format "structured" envelope. */ export declare function parseAgyApiKey(apiKey: string): OAuthCredentials; /** Stable account namespace: token rotation never changes conversation ownership. */ export declare function agyCredentialKey(apiKey: string): string; /** Non-secret revision for restarting a host whose cached token source is stale. */ export declare function agyCredentialVersion(apiKey: string): string; /** * Apply ONLY to agy's subprocess, never omp or host-executed tools. * agy has no file-storage flag. Its native sshDetector checks SSH_TTY for a * nonempty value (it does not open the path), selecting file-only storage for * the process lifetime. This explicit headless marker prevents both reads and * writes of the user's global keychain, including during login and refresh. */ export declare function agyCredentialEnv(): Record; /** * Atomically import a resolved grant into the account's private --gemini-dir. * The caller must use agyCredentialEnv and agyCredentialKey-isolated directories. * Broker refresh sentinels are NEVER sent to Google: the host must reload its * persisted conversation when agyCredentialVersion changes after broker refresh. */ export declare function stageAgyCredentials(apiKey: string, geminiDir: string): Promise; /** Bounded, secret-safe refresh; only known OAuth error codes reach callers. */ export declare function refreshAgyCredentials(credentials: OAuthCredentials, signal?: AbortSignal, fetchImpl?: FetchImpl): Promise;