export interface State { version: 1; fallback: { enabled: boolean; autoEngaged: boolean; }; /** Email pending restore from an interrupted `--as` session, or * undefined when no restore is queued. */ pendingRestore?: string; /** Snapshot of "last account routed to per emailDomain". Used by * project-aware routing to pick deterministically when a * `.claude-switch` constraint matches multiple saved accounts. Keyed * by the lower-cased domain (`acme.com`), value is the chosen email. * Optional — older state files predate the field; resolver tolerates * an empty object. */ lastUsedByDomain?: Record; } /** Read the current state, migrating from legacy marker files if needed. * Migration runs at most once — once `state.json` exists, the legacy * files are ignored even if they reappear (a stray marker can't override * the state we already trust). */ export declare function readState(accountsDirPath: string): State; /** Apply a partial update INSIDE the caller's existing `withLock`. Use * this when the surrounding code already holds the accounts-dir lock * (passthrough's atomic snapshot, switcher's atomic switch+flip). */ export declare function updateStateInLock(accountsDirPath: string, patch: (state: State) => State): State; /** Apply a partial update — acquires the lock first. Use from contexts * with no surrounding `withLock` (CLI command handlers, settings UI). */ export declare function updateState(accountsDirPath: string, patch: (state: State) => State): State;