Documentation
¶
Index ¶
- Constants
- Variables
- func Cancelled(err error) bool
- func CarriedSeats(accounts map[string]string, change provider.Change) (map[string]string, bool)
- func Certificate(dir string) (tls.Certificate, error)
- func Checking(ctx context.Context) context.Context
- func Checks(ctx context.Context) bool
- func Claims(token string) map[string]any
- func Client(env httpx.Env, timeout time.Duration) *http.Client
- func Compact(env httpx.Env, timeout time.Duration) *http.Client
- func Delay(message string) (time.Duration, bool)
- func FailureLines(err error, host string) []string
- func Fingerprint(secret string) string
- func Identity(token string) string
- func JWTExpiry(token string) time.Time
- func PKCE(n int) (verifier, challenge string)
- func Relogin(title string) string
- func Remote() bool
- func Sleep(ctx context.Context, d time.Duration) error
- func SourceName(source string) string
- func Text(value any) string
- func Unreachable(err error) bool
- func Usable(value string) bool
- func Words(credential Credential) string
- type Account
- type AuthError
- type Callback
- type Credential
- type Credentials
- func (c *Credentials) Close() error
- func (c *Credentials) Follow(_ context.Context, cfg *config.Config, change provider.Change) ([]string, error)
- func (c *Credentials) Hooking(host *hooks.Hooks)
- func (c *Credentials) Keep(cfg *config.Config)
- func (c *Credentials) Know(known provider.Knower)
- func (c *Credentials) Register(registrant Registrant)
- type Detail
- type Explainer
- type Files
- type Keyed
- type Lifecycle
- type Look
- func (l *Look) Credential(account Account) (Credential, bool)
- func (l *Look) Missing(account Account) string
- func (l *Look) Report(ctx context.Context, account Account) ([]Detail, bool)
- func (l *Look) State(account Account) (string, time.Time)
- func (l *Look) Status(account Account) Status
- func (l *Look) View(instance provider.Instance, model, held string, ...) (Viewed, error)
- type Origin
- type Poll
- type Profiles
- type Prompter
- func (p *Prompter) Instructions(link, code string)
- func (p *Prompter) OpenBrowser(link, opened, failed string)
- func (p *Prompter) Option(name string) string
- func (p *Prompter) Pending(text string)
- func (p *Prompter) Say(format string, args ...any)
- func (p *Prompter) Tunnel(redirect string)
- func (p *Prompter) Wait(fallback time.Duration) time.Duration
- type Registrant
- type Registry
- func (r *Registry) Adopt(providers *provider.Registry, cfg *config.Config, kind string) (provider.Instance, string, bool)
- func (r *Registry) Counting(count Sessions)
- func (r *Registry) Credential(account Account) (Credential, bool)
- func (r *Registry) Detect(cfg *config.Config, spec provider.Spec) (Credential, bool)
- func (r *Registry) Due(account Account) bool
- func (r *Registry) First(cfg *config.Config, providers *provider.Registry, ...) (provider.Instance, string, error)
- func (r *Registry) Frees(instance provider.Instance, model string) (time.Time, bool)
- func (r *Registry) Kind(ctx context.Context, providers *provider.Registry, cfg *config.Config, ...) (provider.Route, bool)
- func (r *Registry) KindView(providers *provider.Registry, cfg *config.Config, kind string) (provider.Route, bool)
- func (r *Registry) Look() *Look
- func (r *Registry) Missing(account Account) string
- func (r *Registry) Mode(ctx context.Context, instance provider.Instance, route provider.Route) provider.APIMode
- func (r *Registry) Offers(providers *provider.Registry, cfg *config.Config, kind string) bool
- func (r *Registry) Refresh(ctx context.Context, account Account, force bool) error
- func (r *Registry) Register(registrant Registrant)
- func (r *Registry) Renew(ctx context.Context, account Account) (bool, error)
- func (r *Registry) Report(ctx context.Context, account Account) ([]Detail, bool)
- func (r *Registry) Reset(account Account) (bool, error)
- func (r *Registry) Restored(ctx context.Context, account Account) bool
- func (r *Registry) Rotates(account Account) bool
- func (r *Registry) Route(ctx context.Context, instance provider.Instance, model string, seat *Seat) (provider.Route, error)
- func (r *Registry) Stale(account Account, failure *provider.APIError) bool
- func (r *Registry) State(account Account) (string, time.Time)
- func (r *Registry) Status(account Account) Status
- func (r *Registry) View(instance provider.Instance, model, held string, ...) (Viewed, error)
- func (r *Registry) Why(account Account) (string, bool)
- type Renewer
- type Reply
- func Do(client *http.Client, request *http.Request) (*Reply, error)
- func Get(ctx context.Context, client *http.Client, address string, ...) (*Reply, error)
- func PostForm(ctx context.Context, client *http.Client, endpoint string, form url.Values, ...) (*Reply, error)
- func PostJSON(ctx context.Context, client *http.Client, endpoint string, body any, ...) (*Reply, error)
- type Reporter
- type Restorer
- type Rotating
- type Seat
- type Sessions
- type SignIn
- type Signed
- type Staler
- type Status
- type Unready
- type Viewed
Constants ¶
const ( // Waiting out a limit Exhausted = "exhausted" // Refused for good, until signed in again Dead = "dead" )
States an account's credential can be in, as icebath last found it
const ( Ready = "ready" Limited = "limited" NeedsSignIn = "needs_sign_in" Gone = "dead" )
States an account lists with
const ( OAuth = "oauth" APIKey = "api-key" )
Ways of signing in by --type
const Expired = "device_code_timeout"
Code a sign in that waited out its device code fails with
Variables ¶
var ErrCancelled = errors.New("The sign-in was cancelled.")
Sign in the user stopped, or whose prompt closed
var ErrNotRenewable = errors.New("This account can't be renewed because it is an API key or a non-renewable sign-in.")
Error of an account whose credential nothing renews
var Fires = []hooks.Site{ {Point: hooks.AccountExhausted, By: "provider accounts", When: "when an account reaches a limit or its sign-in is refused"}, }
The moments of the accounts of providers the hook points hear of, which the hooks screen and Doctor say of each point
Functions ¶
func CarriedSeats ¶
Accounts a session is on carried through a provider or an account renamed or removed, and whether they changed
func Certificate ¶
func Certificate(dir string) (tls.Certificate, error)
Certificate this computer serves an https redirect of a sign-in with: the one kept in the folder while it reads and holds for a week more, otherwise one made now for 127.0.0.1, ::1 and localhost and kept there, its key readable by this user alone
func Checking ¶
Context of a check of a sign-in the user asked for, under which a report may ask the provider who the sign-in is and whether it gives a token, which a look at a provider never does
func Client ¶
Client for OAuth endpoints through the proxy and authorities of the environment, the profile's, each call ending within the timeout
func Compact ¶
Client as Client gives it whose secure connections offer only the classic key exchanges, leaving out the post-quantum one whose larger first message some networks refuse, so a sign-in such a network stopped can go on without a restart
func FailureLines ¶
Lines a failed sign in prints: why in words the user can act on, then the details when it didn't stop on its own. The sign-in is tried again in /providers
func Fingerprint ¶
Fingerprint returns a short mark that tells two secrets apart without showing either: the last six hex characters of the secret's SHA-256.
func Identity ¶
Who a token signs in as, from its claims: the email, otherwise the user name, empty when it says neither
func PKCE ¶
PKCE returns a code verifier made of n random bytes and its S256 challenge. The verifier keeps at most 128 characters, the limit RFC 7636 sets for a code verifier.
func Relogin ¶
Sentence that tells where a provider is signed in again, the provider by the name a user knows it by, such as its label
func SourceName ¶
Variable or program the source of a credential names, as a provider leaves it out or takes it again by: without the secret store that supplied the variable
func Unreachable ¶
Whether a failure is one of reaching the provider: a refused or reset connection, a name that doesn't resolve, a timeout
func Usable ¶
Whether a secret looks like one that can work rather than nothing or a placeholder of an example file
func Words ¶
func Words(credential Credential) string
Credential outside the accounts as a sentence names it: the key in a variable, or the sign-in another program keeps on this computer
Types ¶
type Account ¶
One account of a provider of the profile: the fields it keeps, under the provider's accounts. Its credential is what it keeps alone: a secret of its own, the variable it reads its key from, or the program whose sign-in it uses. The account with no name and no fields is the provider's credential outside its accounts, which comes from the environment or another program's sign-in on this computer
func Carried ¶
Account whose credential a route of the provider carries: the account the route names, otherwise the credential outside its accounts
func Of ¶
Account of the provider with the name, the one the provider's choice names for no name. With none, its credential outside its accounts
func Outside ¶
Credential the provider takes from outside its accounts: from the variables of its kind or the sign-in of another program on this computer, those it ignores left out
func (Account) Holds ¶
Whether the account keeps text that signs in, usable or not, besides the fields named: a secret or a choice its kind keeps, the variable it reads its key from or the program whose sign-in it uses
func (Account) Ignores ¶
Whether the provider of the account may not take its credential from the source, a variable or another program by name
func (Account) Lookup ¶
func (a Account) Lookup(field string, variables ...string) (Credential, bool)
Credential of a key: for an account, the key kept in its field, otherwise the one in the variable it reads its key from. For the credential outside the accounts, the first of the variables set that its provider doesn't ignore
func (Account) Program ¶
Program whose sign-in on this computer the account uses, empty for one that uses none
type AuthError ¶
type AuthError struct {
// Kind of provider it is of
Provider string
// Stable name of the failure, such as invalid_grant or device_code_timeout
Code string
Message string
// Only signing in again helps
Relogin bool
// Wait the provider asked for before trying again, zero when it asked none
RetryAfter time.Duration
Err error
}
Failure of a sign in or of the renewal of its credential, saying whether only signing in again can fix it
type Callback ¶
type Callback struct {
// Address the provider redirects the browser to
Redirect string
// contains filtered or unexported fields
}
Local server a browser sign in sends its answer back to
func Listen ¶
Listens on the loopback port for the redirect to the path, refusing when the port is taken with the code given. Port 0 takes any
func ListenOn ¶
Listens for a sign-in's redirect at the address as it is registered with the provider, such as http://127.0.0.1:43827/callback: on its host, which must be one of this computer, its port, which must be given, and its path. Over TLS for an https address, with a certificate of this computer kept in the folder certs, which a browser warns of once. Redirect is the address as given, which the provider compares with the one it holds. Refused with the code busy when the port is taken
type Credential ¶
type Credential struct {
APIKey string
BaseURL string
// BaseURL as the settings it was read from write it, every ${NAME} kept, for an address read from settings of the account. Empty for
// one read from nowhere a user writes or made from the provider's own, which the provider's Address puts back
Address provider.Written
Auth provider.AuthKind
Origin Origin
// Variable or program the credential came from, empty for one saved in icebath
Source string
// Headers its requests carry, such as the ChatGPT account a Codex sign-in is of
Headers map[string]string
// When it stops working, zero when it doesn't or that isn't known
Expires time.Time
// Who it signs in as, such as an email. Never a secret
Identity string
// Signs each request, for a credential that signs requests rather than sending a key, such as AWS SigV4
Sign func(request *http.Request, body []byte) error
// Region its requests are signed for and served in, such as an AWS region. Empty when its provider has none
Region string
// Address of another service of its provider in a region, resolved as BaseURL was, such as the control plane of Bedrock. nil for a
// provider of one address
Endpoint func(service, region string) (string, error)
}
type Credentials ¶
type Credentials struct {
Registry
}
func New ¶
func New() *Credentials
func (*Credentials) Close ¶
func (c *Credentials) Close() error
Nothing runs behind the credentials, so closing them ends nothing
func (*Credentials) Follow ¶
func (c *Credentials) Follow(_ context.Context, cfg *config.Config, change provider.Change) ([]string, error)
Carries the ledger along a change of a provider or an account: the statuses of one removed go, those of one renamed move to its new name
func (*Credentials) Hooking ¶
func (c *Credentials) Hooking(host *hooks.Hooks)
Hands over the hooks host, whose hooks hear of an account benched as it reached a limit or its sign-in was refused
func (*Credentials) Keep ¶
func (c *Credentials) Keep(cfg *config.Config)
Renews the credentials of the config's profiles under its folder's locks, reading the config again before each renewal so that what another process renewed is seen, and keeps what it learns of their accounts in each profile's state folder
func (*Credentials) Know ¶
func (c *Credentials) Know(known provider.Knower)
Know makes routes read the providers' model facts from known: the model a route takes when the caller asks for no model, and the API a request for the model uses.
func (*Credentials) Register ¶
func (c *Credentials) Register(registrant Registrant)
Adds a registrant, a nested registry sharing what the host keeps of its accounts
type Explainer ¶
Registrant that can say why it has no credential for an account of a kind it keeps, such as what the token service it asked answered; false when it has nothing to say
type Files ¶
type Files[T any] struct { // contains filtered or unexported fields }
What was made of files on this computer, such as the sign-in another program keeps in one, by the path of each: used again while the file keeps its version and for a minute at most, made again once it moves or the file comes or goes, and made on each use while the file changed a moment ago, as a change right after it may keep its version. What this code writes to a file is seen at once, since a write forgets what was made of it. What is kept is what a read already holds in memory as it is used, and only for that minute
type Keyed ¶
Credential of a kind whose accounts keep an API key, read from the environment when an account keeps none
func (Keyed) Credential ¶
func (k Keyed) Credential(account Account) (Credential, bool)
type Lifecycle ¶
type Lifecycle struct {
Providers *provider.Registry
// What keeps the states of the accounts, whose limits a new key clears
Credentials *Registry
}
What else changes when a credential variable of a profile's .env is set or removed, as config set and unset do: the copies of its value kept in api key settings, the providers that read it, and what holds back the accounts it is the key of
func (Lifecycle) Removed ¶
After the variable was removed: the providers that read it leave it out from now on by the one control of that choice, so a shell that still exports it can't give it back until it is set again, and copies of its old value in api key settings are removed, with the accounts they were the one credential of. Whether a setting held a copy
func (Lifecycle) Saved ¶
After the variable was saved over the value it held: copies of the old value in api key settings take the new one, the providers that read it take it from it again by the one control of that choice, and what held back the accounts it is the key of on the old value is cleared
type Look ¶
type Look struct {
// contains filtered or unexported fields
}
One look at the credentials of providers, for a page or an answer that tells of many accounts at once and asks after the same account more than once: what the registrants find for each account, and why they find none, is asked of them once for the look. It reads as the registry reads, nothing renewed, probed or written, and is made for one call and dropped with it, so it holds no credential longer than the call does
func (*Look) Credential ¶
func (l *Look) Credential(account Account) (Credential, bool)
Credential of the account, as the registry finds it
func (*Look) Report ¶
What the account's registrant says of its sign-in beyond its credential, as the registry's Report says
type Poll ¶
type Poll struct {
Provider string
Post func() (*Reply, error)
Expires time.Duration
Interval time.Duration
// Checks the answer that granted the sign in
Granted func(payload map[string]any) error
}
One RFC 8628 token poll: what to post, how long the code lives and how often to ask
type Profiles ¶
type Profiles struct {
Credentials *Credentials
Providers *provider.Registry
Config *config.Config
}
What the accounts of providers do as profiles are made: a copy of a profile drops the sign-ins whose refresh token works once, a copy made without credentials drops every account that kept a key or a sign-in of its own, and a fresh profile takes the providers and accounts of the profile it is made from without those
type Prompter ¶
type Prompter struct {
Ctx context.Context
// What the sign in says as it goes
Out io.Writer
// Asks for a line of text, masked when secret. false once the user gave up
Ask func(label string, secret bool) (string, bool)
// Shows the address to open and the code to type there, the code empty when there is none
Show func(link, code string)
// Opens an address in a browser of this computer
Open func(link string) error
// Whether the sign in may open the browser by itself
Browser bool
// How long one step may wait, zero for the flow's own
Timeout time.Duration
// Flags of the sign in by name, such as browser for a Codex browser sign in or region for MiniMax's
Options map[string]string
// The sign in runs at the terminal of a command rather than on the app's sign in page, so it may say what only a terminal does, such
// as how ctrl+c stops it
Terminal bool
// Settings of the provider the account is of, by their names below it, as the front end read them
Settings map[string]string
// Variables of the computer the sign in runs on as the front end that runs it reads them: what its requests' proxy and authorities
// come from and what it reads of that computer. The profile's own values come in Settings
Env httpx.Env
// Profile the account is of, as the front end names it. The one of its window when empty
Profile string
}
What a sign in that runs in the front end talks to the user through: the app's sign in page, or the terminal of a command
func (*Prompter) Instructions ¶
Tells the user where to go and what code to type there: through Show on a page that shows them itself, otherwise in lines. Then opens the address when the sign in may
func (*Prompter) OpenBrowser ¶
Opens the address in this computer's browser when the sign in may and one is here, saying how that went
type Registrant ¶
type Registrant interface {
Credential(account Account) (Credential, bool)
}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) Adopt ¶
func (r *Registry) Adopt(providers *provider.Registry, cfg *config.Config, kind string) (provider.Instance, string, bool)
The profile's provider of the kind. When the profile has none and a credential of the kind is found in the profile's environment or in another program on this computer, the provider is added to the profile, the first time it is needed, and the sentence that says so is given. false when there is neither
func (*Registry) Counting ¶
Hands over what counts the ongoing sessions on each account, which "Take turns" gives a new session the account with the fewest of
func (*Registry) Credential ¶
func (r *Registry) Credential(account Account) (Credential, bool)
func (*Registry) Detect ¶
Credential of a kind no provider of the profile has yet, found in the profile's environment or another program
func (*Registry) First ¶
func (r *Registry) First(cfg *config.Config, providers *provider.Registry, wires map[provider.APIMode]provider.Factory) (provider.Instance, string, error)
Provider a new session of the profile uses when its settings name none, which the session keeps from then on. icebath looks in this order: a kind taken first whose credential is found, such as an OpenRouter key. The provider of the profile signed in first, in the order the kinds are registered, unless a key of another kind is set in the profile's environment, which wins. The first kind with a key in the profile's environment. A provider of the profile ready with a credential found anywhere. A kind taken last whose credential is found outside icebath, such as AWS's. Only providers ready by the test the providers page uses are taken, and none on this computer, which a user adds themselves. A kind the profile has no provider of yet is added to it, with the sentence that says so. Keys count only from the profile's own environment, its .env, its secret stores and the files beside them, never the environment of the process that asks, so every terminal on the profile finds the same provider
func (*Registry) Frees ¶
When the first account the provider's choice allows frees up, while none can take a request for the model now. false while one can, or when nothing says when one frees up
func (*Registry) Kind ¶
func (r *Registry) Kind(ctx context.Context, providers *provider.Registry, cfg *config.Config, kind string) (provider.Route, bool)
Route of a tool's call to a kind of model provider, such as an image service that takes the OpenAI key: the profile's provider of the kind, added to the profile the first time a credential of the kind is found for it, with the account its choice gives, renewed when due. False when there is neither
func (*Registry) KindView ¶
func (r *Registry) KindView(providers *provider.Registry, cfg *config.Config, kind string) (provider.Route, bool)
Route of the profile's provider of the kind read as it is kept, for a page or a list that reads what the provider offers: nothing is renewed or added. false while the profile has no provider of the kind or it has no credential
func (*Registry) Missing ¶
Missing explains in sentences why the account has no usable credential now: the program or service it uses to sign in, according to its registrant, an unset variable for its key, an unusable stored credential, or no stored credential. It is empty when the account has a usable credential.
func (*Registry) Mode ¶
func (r *Registry) Mode(ctx context.Context, instance provider.Instance, route provider.Route) provider.APIMode
Mode returns the API that a request for the route's model uses on the provider. It follows the rules of a new route, for a caller that changes the model of an existing route.
func (*Registry) Offers ¶
Whether a tool's call to the kind could go out now, for a page that shows whether the kind can be used: the profile's provider of the kind read as it is kept, otherwise a credential of the kind found where Kind would add the provider from. Nothing is renewed or added
func (*Registry) Refresh ¶
Renews the account's credential when it is due, or now when forced, one renewal at a time across processes. What another process renewed meanwhile is taken instead of renewing again. A refusal that only signing in again fixes leaves the account dead
func (*Registry) Register ¶
func (r *Registry) Register(registrant Registrant)
Adds a source of credentials to the host's one list. A registry registered into another hands over its sources once, and from then on registers into the host and answers as the host does, so no list is nested in another
func (*Registry) Reset ¶
Clears what stands against the account: its limit and its held back models. Whether there was any
func (*Registry) Rotates ¶
Whether the account holds a sign-in its refresh token can renew only once
func (*Registry) Route ¶
func (r *Registry) Route(ctx context.Context, instance provider.Instance, model string, seat *Seat) (provider.Route, error)
Route of a request to the provider for the model, renewed when due, with a keeper that renews it or moves on to the next account when the provider refuses it. A seat keeps the session on its account: the route goes out with the account the seat holds while the provider's choice allows it and it can take the request, otherwise with one chosen again, which the seat keeps on the session's record. A nil seat is a request of no session, which goes out with the account the choice gives now
func (*Registry) State ¶
How an account lists: ready, limited until a time, waiting to be signed in again, gone for good, or without a credential to use
func (*Registry) Status ¶
Status of the account as the ledger of its profile holds it. None for the credential outside the accounts
func (*Registry) View ¶
func (r *Registry) View(instance provider.Instance, model, held string, wires map[provider.APIMode]provider.Factory) (Viewed, error)
What a request to the provider for the model would go out with now, read from what is kept alone: nothing is renewed, probed or written, so a page that shows it never renews a sign-in another process or program shares. Held is the name of the account a session is on, as its record keeps it, empty for none: the view keeps to it while the provider's choice allows it and it can take a request. With wires given, a provider whose API is none that icebath sends is not ready either. Nil while a request can go to the provider, otherwise why not in words a user acts on
type Renewer ¶
type Renewer interface {
// Whether the account's credential is close enough to expiring to be renewed before it is used
Due(account Account) bool
// Renews the account's credential now, keeping what it renewed in the account or where the program it came from keeps it; false
// when the account holds nothing it renews
Renew(ctx context.Context, account Account) (bool, error)
}
Registrant whose credentials expire and that it renews, such as an OAuth sign-in
type Reply ¶
Answer of an OAuth endpoint, read whole
func Do ¶
Sends the request and reads its answer whole, refusing one larger than an OAuth endpoint sends
func Get ¶
func Get(ctx context.Context, client *http.Client, address string, header map[string]string) (*Reply, error)
Gets the address, with the headers given
func PostForm ¶
func PostForm(ctx context.Context, client *http.Client, endpoint string, form url.Values, header map[string]string) (*Reply, error)
Posts a form, with the headers given
func PostJSON ¶
func PostJSON(ctx context.Context, client *http.Client, endpoint string, body any, header map[string]string) (*Reply, error)
Posts a JSON body, with the headers given
func (*Reply) JSON ¶
JSON returns the body as a JSON object, an empty object for other JSON shapes, and an error for anything that isn't JSON.
func (*Reply) RetryAfter ¶
Wait the answer asks for before trying again, false when it asks none
type Reporter ¶
Registrant that says more of an account's sign-in than its credential does, such as the identity and region AWS signs as. A look says only what is kept or on this computer. Under Checking it may ask the provider or mint a token, as a check the user asked for does. False for an account it doesn't keep
type Restorer ¶
Registrant that can tell an account's limit lifted before the time it was given, such as a Codex plan whose window reset early; status is what icebath learned of the account
type Rotating ¶
Registrant whose sign-ins hold a refresh token that works once, so a copy of one in another profile breaks the sign-in it was copied from the first time either renews
type Seat ¶
type Seat struct {
// contains filtered or unexported fields
}
Accounts a session is on, one for each provider its requests went to, its main model's, a fallback's, a mixture's or a helper's, by the account's name: the empty name for the credential outside the accounts. A session is on no account of a provider before its first request there. An account stays the session's until it runs out, is refused, or the user picks another, also after the session is run again in another process, as its record keeps every one. "Take turns" counts the sessions on an account by these
func NewSeat ¶
func NewSeat(session string, accounts map[string]string, keep func(accounts map[string]string) error) *Seat
Seat of the session on the accounts its record names by provider id, none for none yet, kept on its record through keep
func (*Seat) AccountOn ¶
Account the seat holds on the provider, empty for none or the credential outside the accounts
type Sessions ¶
Ongoing sessions of the profile on each account of the provider, by account name, across every process working on the profile: the sessions a live process runs, not ended, whose record keeps them on the account of the provider
type SignIn ¶
type SignIn struct {
// Kind of provider it signs in, by the name of its spec
Spec string
// Shown as the way to connect, such as "ChatGPT account"
Title string
// Name auth add --type takes it by: oauth for a sign in, api-key for a key given some other way
Type string
Run func(p *Prompter) (Signed, error)
}
Way to sign an account of a kind in that runs in the front end, which the plugin's app and cli hooks offer
type Signed ¶
type Signed struct {
Fields map[string]any
// Such as an email, which names an account no name was asked for
Identity string
}
Fields an account keeps after a sign in, by their names below it, and who it signed in as
type Staler ¶
Registrant that knows refusals besides a 401 which renewing its credentials fixes, such as a Copilot token a model was moved off
type Status ¶
type Status struct {
// Exhausted while it waits out a limit, Dead once its credential was refused for good, empty while nothing stands against it
State string `json:"state,omitempty"`
At time.Time `json:"at,omitzero"`
Code int `json:"code,omitempty"`
Reason string `json:"reason,omitempty"`
Message string `json:"message,omitempty"`
// When the limit lifts, zero when the provider didn't say
Resets time.Time `json:"resets,omitzero"`
// Models the account may not use until the time each gives, its other models unaffected
Cooldowns map[string]time.Time `json:"cooldowns,omitempty"`
// When a session last took the account
Used time.Time `json:"used,omitzero"`
}
What icebath learned of one account
type Unready ¶
Why a provider can't take a request now: whole, as a refusal of the request says it. As the first line of its page says it, the one thing wrong and the one thing to do. The other way out, said in the pane of the option whose setting is named below the provider; and when the first account it may use frees up, zero when that isn't known