/** * Anthropic (Claude Pro/Max) sign-in residue. The OAuth flow itself is * declared in `rules/auth/anthropic.kdl`; this module supplies the * `anthropic-identity` after-exchange hook that recovers account / * organization identity from `/api/claude_cli/bootstrap` when the token * response omits it. */ import type { FetchImpl } from "../../types.js"; import type { AfterExchangeHook } from "../hooks/types.js"; export { ANTHROPIC_OAUTH_GRANT_TTL_MS } from "./anthropic-constants.js"; /** * Account + organization identity slice resolved from the * `/api/claude_cli/bootstrap` endpoint. The organization is the subscription * workspace the token draws limits from — one account email can hold several * (e.g. a Team seat plus a personal Max plan). */ interface AnthropicIdentity { accountId?: string; email?: string; orgId?: string; orgName?: string; } /** Fetches the signed-in account/org identity Claude Code's CLI bootstrap reports. */ export declare function fetchAnthropicBootstrapIdentity(accessToken: string, fetchImpl: FetchImpl): Promise; /** * `anthropic-identity` hook: fills account (and, at login only, organization) * identity from the bootstrap endpoint when the token response left it * unset. The org an access token is scoped to is captured once at login and * deliberately never refreshed — rewriting identity during background * refreshes could silently re-key stored credentials. */ export declare const anthropicIdentityHook: AfterExchangeHook;