import { type Credentials } from "./auth.js"; interface DeviceCodeResponse { device_code: string; user_code: string; verification_uri: string; expires_in: number; interval: number; } export declare function startDeviceFlow(): Promise; /** Human-facing instructions. This is what the agent shows in the IDE. */ export declare function signInMessage(d: DeviceCodeResponse): string; /** One redemption attempt. `null` means "not yet", a throw means "start over". */ export declare function redeemOnce(d: DeviceCodeResponse): Promise; /** * Wait out a sign-in the human has already been shown. Resolves with * credentials, or `null` if they are still not done — never throws on "pending", * because "not finished yet" is a normal answer, not an error. */ export declare function awaitApproval(d: DeviceCodeResponse): Promise; /** * Run a tool call, handling "you need an account" without ever blocking on a * code the human has not seen. * * First 401 -> start a flow and return the code IMMEDIATELY. The agent shows * it; nothing is gained by waiting, because until that message is * on screen there is nobody to approve anything. * Later 401 -> they have seen it, so wait out the browser round trip, then * retry the call once. * * If the backend has no device endpoints (an old deployment, or a client newer * than the server) the original error is re-thrown untouched, so a version skew * degrades to exactly today's behaviour instead of a hard wall. */ export declare function withSignIn(call: () => Promise): Promise; export {};