dsh-agy 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,8 +15,9 @@ fingerprinting, and both CLI and web management.
15
15
  paste-URL mode and a remote paste-credential blob channel.
16
16
  - **Two management surfaces**: web and CLI, either one works, core features are
17
17
  the same.
18
- - **Multi-account pool**: encrypted account store, automatic rotation on rate
19
- limits, per-account cooldown with tiered backoff, per-account device
18
+ - **Multi-account pool**: encrypted account store, usage-aware account
19
+ selection (family-scoped quotas, OMP-aligned ranking), automatic rotation on
20
+ rate limits, per-account cooldown to the real reset time, per-account device
20
21
  fingerprints.
21
22
  - **Quota dashboard**: only active when DSH Web is running; append `/agy` to
22
23
  your dsh web address: login, account management, per-model quota bars, model
@@ -63,6 +64,7 @@ npm install -g dsh-agy
63
64
  dsh-agy login # interactive OAuth (browser, --headless paste, or --blob)
64
65
  dsh-agy status # list accounts + quota summary
65
66
  dsh-agy verify # refresh + health check
67
+ dsh-agy health # batch health check (optionally on an interval)
66
68
  dsh-agy import <file> # import agy auth.json or credential blob (--blob)
67
69
  dsh-agy logout # remove account
68
70
  ```
@@ -76,6 +78,7 @@ dsh-agy logout # remove account
76
78
  | `dsh-agy import <files...>` | `--blob` — the pasted value is a credential blob<br>`--email <email>` — set the account email (skips userinfo verification)<br>`--overwrite` — replace an existing account with the same email | Import agy auth.json files or credential blobs (multiple files / multi-line paste = batch import) |
77
79
  | `dsh-agy export` | `--index <n>` — export one account by index (default: all)<br>`--out <dir>` — write one `dsh-agy-<index>.blob` per account (default: print to stdout, one blob per line) | Export account credentials as paste blobs |
78
80
  | `dsh-agy verify` | `--index <n>` — verify one account by index (default: all) | Refresh + health check |
81
+ | `dsh-agy health` | `--index <n...>` — check only these accounts (default: all enabled)<br>`--interval <ms>` — repeat on an interval instead of once | Batch health check (refresh + userinfo), re-enables accounts whose credentials are live again |
79
82
  | `dsh-agy logout` | `--index <n>` — account index (default: active)<br>`--email <email>` — account email | Remove an account |
80
83
 
81
84
  ### Path C: Local Development & Link
@@ -114,18 +117,34 @@ valid until it expires or you revoke it in your Google account security settings
114
117
 
115
118
  ### Rotation mechanics
116
119
 
120
+ Usage-aware selection: when several accounts are available, requests rank them
121
+ by the requested model's backend counter family (`gemini-*` → Google,
122
+ `claude-*` → Anthropic, `gpt-*` → OpenAI): accounts whose quota is about to
123
+ reset with headroom left are used first ("use it or lose it"), near-exhausted
124
+ families are avoided, and exhausted families block the account until the real
125
+ reset time.
126
+
117
127
  429 (Too Many Requests) responses:
118
128
 
119
129
  | Category | Behavior |
120
130
  |---|---|
121
131
  | `soft_rate_limit` (Retry-After < 3s) | immediate retry on the same account, no cooldown |
122
- | `rate_limited` | 5-minute cooldown + switch to the next account (same account when single) |
123
- | `quota_exhausted` ("quota reached", "individual quota", RESOURCE_EXHAUSTED…) | 24-hour cooldown — no further calls to that account for the day |
132
+ | `rate_limited` | cooldown until the server-reported reset time (capped 30min, 5min fallback) + switch to the next account (same account when single) |
133
+ | `quota_exhausted` ("quota reached", "individual quota", RESOURCE_EXHAUSTED…) | cooldown until the server-reported reset time (capped 24h) — no further calls to that account until then |
124
134
  | `unknown` | exponential backoff |
125
135
 
126
136
  401/403 → account revoked (marked for re-authentication). Success resets the failure
127
137
  counter.
128
138
 
139
+ ### Risk controls (environment switches)
140
+
141
+ | Env | Effect |
142
+ |---|---|
143
+ | `DSH_AGY_DISABLE=1` | Kill switch: the plugin registers nothing (provider + `/agy` routes) and the CLI refuses to run. |
144
+ | `DSH_AGY_FINGERPRINT_MODE=stable` | One fixed client identity per account — no per-request header randomization, no fingerprint regeneration (OMP-style fixed-client posture). Default `dynamic` keeps per-request randomization. |
145
+ | `DSH_AGY_HEALTH_INTERVAL_MS=<ms>` | Background batch health probe inside the harness (refresh + userinfo on the configured interval); off by default. |
146
+ | `AGY_CLIENT_ID` / `AGY_CLIENT_SECRET` | BYO OAuth app escape hatch: override the embedded public Antigravity client credentials. |
147
+
129
148
  ### About cache hits: why not 99% like DeepSeek V4?
130
149
 
131
150
  Bottom line: the cache hit strategy is decided by the model provider's cache