import { type PollResult } from "../tools/account-register.js"; import type { MailboxRegistry } from "./mailbox-registry.js"; import type { PendingStore } from "./pending-store.js"; /** * Drive one account's device-code flow to a terminal outcome by looping the * unchanged single-poll primitive `runAccountRegisterPoll`. This is the shared * completion logic the server-spawned dispatcher calls, so a sign-in completes * without any agent calling `outlook-account-register-poll`. * * The device-code flow is poll-driven: Microsoft's confirmation page pushes * nothing back to this plugin, so only a poll harvests the token. The per-cycle * `devicecode-autopoll` line attributes completion to this path, distinct from * the tool's `devicecode-poll`. The TTL check inside `runAccountRegisterPoll` * guarantees the loop terminates within the code lifetime. * * Loop rules: * - `registered` / `expired` / `denied` — terminal, returned as-is. * - `pending` — wait `intervalSec` (already bumped by `runAccountRegisterPoll` * on `slow_down`) and poll again. * - `error` — a 4xx already cleared the pending entry (dead code, terminal); a * 5xx kept it (transient), so retry the same code after a short pause. */ export declare function pollRegistrationToTerminal(args: { accountId: string; clientId: string; tenantId: string; registry: MailboxRegistry; pendingStore: PendingStore; sleep?: (ms: number) => Promise; }): Promise; //# sourceMappingURL=complete-registration.d.ts.map