Skip to main content

Module auth_state

Module auth_state 

Source
Expand description

synaps auth state: what one broker remembers about its accounts (each account’s cooldown, its last usage read and last token refresh exchange, and the last automatic selection), read from memory only.

Building a report makes no network request and refreshes nothing; the account list (labels, access-token expiry, whether an account id is recorded) comes from the credential store. A report never carries token material, emails, account ids or identity hashes. clear drops the in-memory cooldowns, usage readings and stickiness of the matched accounts; it never writes the credential store.

Structs§

AccountState
One stored account and what the broker remembers about it.
AuthStateQuery
Which accounts to report on, and whether to clear their state first.
AuthStateReport
One broker’s in-memory account state.
CooldownState
A reported provider limit.
ObservedOutcome
One observation: when it happened and, if it failed, why.
SelectionState
The last automatic selection for one provider and model.

Enums§

CooldownReason
Why an account is cooling down: one of the known report_cooldown callers, or other. A report carries only this kind, never the string the reporter passed (which may come from another machine); the log line written when the cooldown is reported keeps that string. An unknown kind from a newer daemon reads as other.
IdentityKind
How limits follow an account.

Constants§

AUTH_STATE_SCHEMA_VERSION
Version of AuthStateReport’s JSON shape (synaps auth state --json).

Functions§

render_text
Plain-text rendering, one block per account, then the last selections.