oc-codex-multi-auth 6.21.0 → 6.23.0

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.
Files changed (182) hide show
  1. package/README.md +168 -10
  2. package/config/README.md +53 -33
  3. package/config/opencode-legacy.json +129 -279
  4. package/config/opencode-modern.json +43 -132
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +293 -57
  7. package/dist/index.js.map +1 -1
  8. package/dist/lib/account-display.d.ts +46 -0
  9. package/dist/lib/account-display.d.ts.map +1 -1
  10. package/dist/lib/account-display.js +260 -0
  11. package/dist/lib/account-display.js.map +1 -1
  12. package/dist/lib/accounts/warm-request.d.ts.map +1 -1
  13. package/dist/lib/accounts/warm-request.js +9 -11
  14. package/dist/lib/accounts/warm-request.js.map +1 -1
  15. package/dist/lib/accounts.d.ts +4 -0
  16. package/dist/lib/accounts.d.ts.map +1 -1
  17. package/dist/lib/accounts.js +20 -15
  18. package/dist/lib/accounts.js.map +1 -1
  19. package/dist/lib/auth/login-runner.d.ts.map +1 -1
  20. package/dist/lib/auth/login-runner.js +79 -2
  21. package/dist/lib/auth/login-runner.js.map +1 -1
  22. package/dist/lib/auto-update-checker.d.ts +17 -1
  23. package/dist/lib/auto-update-checker.d.ts.map +1 -1
  24. package/dist/lib/auto-update-checker.js +49 -3
  25. package/dist/lib/auto-update-checker.js.map +1 -1
  26. package/dist/lib/cli.d.ts +1 -0
  27. package/dist/lib/cli.d.ts.map +1 -1
  28. package/dist/lib/cli.js +9 -3
  29. package/dist/lib/cli.js.map +1 -1
  30. package/dist/lib/codex-usage.d.ts +4 -3
  31. package/dist/lib/codex-usage.d.ts.map +1 -1
  32. package/dist/lib/codex-usage.js +13 -11
  33. package/dist/lib/codex-usage.js.map +1 -1
  34. package/dist/lib/config.d.ts +75 -0
  35. package/dist/lib/config.d.ts.map +1 -1
  36. package/dist/lib/config.js +152 -1
  37. package/dist/lib/config.js.map +1 -1
  38. package/dist/lib/constants.d.ts +13 -0
  39. package/dist/lib/constants.d.ts.map +1 -1
  40. package/dist/lib/constants.js +13 -0
  41. package/dist/lib/constants.js.map +1 -1
  42. package/dist/lib/plan-allotment.d.ts +72 -0
  43. package/dist/lib/plan-allotment.d.ts.map +1 -0
  44. package/dist/lib/plan-allotment.js +142 -0
  45. package/dist/lib/plan-allotment.js.map +1 -0
  46. package/dist/lib/plugin-origin.d.ts +77 -0
  47. package/dist/lib/plugin-origin.d.ts.map +1 -0
  48. package/dist/lib/plugin-origin.js +301 -0
  49. package/dist/lib/plugin-origin.js.map +1 -0
  50. package/dist/lib/prompts/codex.d.ts +12 -2
  51. package/dist/lib/prompts/codex.d.ts.map +1 -1
  52. package/dist/lib/prompts/codex.js +47 -16
  53. package/dist/lib/prompts/codex.js.map +1 -1
  54. package/dist/lib/quota-display.d.ts +40 -0
  55. package/dist/lib/quota-display.d.ts.map +1 -0
  56. package/dist/lib/quota-display.js +45 -0
  57. package/dist/lib/quota-display.js.map +1 -0
  58. package/dist/lib/quota-notifications.d.ts +2 -1
  59. package/dist/lib/quota-notifications.d.ts.map +1 -1
  60. package/dist/lib/quota-notifications.js +34 -14
  61. package/dist/lib/quota-notifications.js.map +1 -1
  62. package/dist/lib/quota-overview.d.ts +253 -0
  63. package/dist/lib/quota-overview.d.ts.map +1 -0
  64. package/dist/lib/quota-overview.js +707 -0
  65. package/dist/lib/quota-overview.js.map +1 -0
  66. package/dist/lib/request/fetch-helpers.d.ts.map +1 -1
  67. package/dist/lib/request/fetch-helpers.js +84 -50
  68. package/dist/lib/request/fetch-helpers.js.map +1 -1
  69. package/dist/lib/request/helpers/model-map.d.ts +10 -0
  70. package/dist/lib/request/helpers/model-map.d.ts.map +1 -1
  71. package/dist/lib/request/helpers/model-map.js +39 -11
  72. package/dist/lib/request/helpers/model-map.js.map +1 -1
  73. package/dist/lib/request/helpers/responses-lite.d.ts.map +1 -1
  74. package/dist/lib/request/helpers/responses-lite.js +4 -1
  75. package/dist/lib/request/helpers/responses-lite.js.map +1 -1
  76. package/dist/lib/request/request-transformer.d.ts.map +1 -1
  77. package/dist/lib/request/request-transformer.js +37 -15
  78. package/dist/lib/request/request-transformer.js.map +1 -1
  79. package/dist/lib/request/retry-budget.d.ts +26 -0
  80. package/dist/lib/request/retry-budget.d.ts.map +1 -1
  81. package/dist/lib/request/retry-budget.js +43 -0
  82. package/dist/lib/request/retry-budget.js.map +1 -1
  83. package/dist/lib/schemas.d.ts +73 -0
  84. package/dist/lib/schemas.d.ts.map +1 -1
  85. package/dist/lib/schemas.js +53 -0
  86. package/dist/lib/schemas.js.map +1 -1
  87. package/dist/lib/storage/backup.d.ts +33 -0
  88. package/dist/lib/storage/backup.d.ts.map +1 -1
  89. package/dist/lib/storage/backup.js +43 -7
  90. package/dist/lib/storage/backup.js.map +1 -1
  91. package/dist/lib/storage/credential-snapshots.d.ts +78 -0
  92. package/dist/lib/storage/credential-snapshots.d.ts.map +1 -0
  93. package/dist/lib/storage/credential-snapshots.js +302 -0
  94. package/dist/lib/storage/credential-snapshots.js.map +1 -0
  95. package/dist/lib/storage/export-import.d.ts.map +1 -1
  96. package/dist/lib/storage/export-import.js +7 -0
  97. package/dist/lib/storage/export-import.js.map +1 -1
  98. package/dist/lib/storage/flagged.d.ts.map +1 -1
  99. package/dist/lib/storage/flagged.js +23 -1
  100. package/dist/lib/storage/flagged.js.map +1 -1
  101. package/dist/lib/storage/load-save.d.ts +4 -0
  102. package/dist/lib/storage/load-save.d.ts.map +1 -1
  103. package/dist/lib/storage/load-save.js +50 -0
  104. package/dist/lib/storage/load-save.js.map +1 -1
  105. package/dist/lib/storage/paths.d.ts +1 -0
  106. package/dist/lib/storage/paths.d.ts.map +1 -1
  107. package/dist/lib/storage/paths.js +1 -1
  108. package/dist/lib/storage/paths.js.map +1 -1
  109. package/dist/lib/storage/test-home-guard.d.ts +35 -0
  110. package/dist/lib/storage/test-home-guard.d.ts.map +1 -0
  111. package/dist/lib/storage/test-home-guard.js +59 -0
  112. package/dist/lib/storage/test-home-guard.js.map +1 -0
  113. package/dist/lib/tools/codex-dashboard.d.ts.map +1 -1
  114. package/dist/lib/tools/codex-dashboard.js +3 -2
  115. package/dist/lib/tools/codex-dashboard.js.map +1 -1
  116. package/dist/lib/tools/codex-doctor.d.ts.map +1 -1
  117. package/dist/lib/tools/codex-doctor.js +16 -0
  118. package/dist/lib/tools/codex-doctor.js.map +1 -1
  119. package/dist/lib/tools/codex-health.d.ts.map +1 -1
  120. package/dist/lib/tools/codex-health.js +10 -2
  121. package/dist/lib/tools/codex-health.js.map +1 -1
  122. package/dist/lib/tools/codex-label.d.ts.map +1 -1
  123. package/dist/lib/tools/codex-label.js +1 -0
  124. package/dist/lib/tools/codex-label.js.map +1 -1
  125. package/dist/lib/tools/codex-limits.d.ts.map +1 -1
  126. package/dist/lib/tools/codex-limits.js +13 -9
  127. package/dist/lib/tools/codex-limits.js.map +1 -1
  128. package/dist/lib/tools/codex-list.d.ts.map +1 -1
  129. package/dist/lib/tools/codex-list.js +28 -3
  130. package/dist/lib/tools/codex-list.js.map +1 -1
  131. package/dist/lib/tools/codex-note.d.ts.map +1 -1
  132. package/dist/lib/tools/codex-note.js +4 -1
  133. package/dist/lib/tools/codex-note.js.map +1 -1
  134. package/dist/lib/tools/codex-pool.d.ts.map +1 -1
  135. package/dist/lib/tools/codex-pool.js +6 -2
  136. package/dist/lib/tools/codex-pool.js.map +1 -1
  137. package/dist/lib/tools/codex-refresh.d.ts.map +1 -1
  138. package/dist/lib/tools/codex-refresh.js +4 -1
  139. package/dist/lib/tools/codex-refresh.js.map +1 -1
  140. package/dist/lib/tools/codex-remove.d.ts.map +1 -1
  141. package/dist/lib/tools/codex-remove.js +1 -0
  142. package/dist/lib/tools/codex-remove.js.map +1 -1
  143. package/dist/lib/tools/codex-reset.d.ts.map +1 -1
  144. package/dist/lib/tools/codex-reset.js +13 -7
  145. package/dist/lib/tools/codex-reset.js.map +1 -1
  146. package/dist/lib/tools/codex-status.d.ts.map +1 -1
  147. package/dist/lib/tools/codex-status.js +25 -2
  148. package/dist/lib/tools/codex-status.js.map +1 -1
  149. package/dist/lib/tools/codex-switch.d.ts.map +1 -1
  150. package/dist/lib/tools/codex-switch.js +1 -0
  151. package/dist/lib/tools/codex-switch.js.map +1 -1
  152. package/dist/lib/tools/codex-tag.d.ts.map +1 -1
  153. package/dist/lib/tools/codex-tag.js +4 -1
  154. package/dist/lib/tools/codex-tag.js.map +1 -1
  155. package/dist/lib/tools/codex-warm.d.ts.map +1 -1
  156. package/dist/lib/tools/codex-warm.js +1 -0
  157. package/dist/lib/tools/codex-warm.js.map +1 -1
  158. package/dist/lib/tools/index.d.ts +9 -0
  159. package/dist/lib/tools/index.d.ts.map +1 -1
  160. package/dist/lib/tools/index.js.map +1 -1
  161. package/dist/lib/tui-quota-cache.d.ts +35 -0
  162. package/dist/lib/tui-quota-cache.d.ts.map +1 -1
  163. package/dist/lib/tui-quota-cache.js +76 -11
  164. package/dist/lib/tui-quota-cache.js.map +1 -1
  165. package/dist/lib/tui-quota-overview.d.ts +55 -0
  166. package/dist/lib/tui-quota-overview.d.ts.map +1 -0
  167. package/dist/lib/tui-quota-overview.js +209 -0
  168. package/dist/lib/tui-quota-overview.js.map +1 -0
  169. package/dist/lib/tui-status.d.ts +55 -0
  170. package/dist/lib/tui-status.d.ts.map +1 -1
  171. package/dist/lib/tui-status.js +155 -14
  172. package/dist/lib/tui-status.js.map +1 -1
  173. package/dist/lib/ui/auth-menu.d.ts +2 -0
  174. package/dist/lib/ui/auth-menu.d.ts.map +1 -1
  175. package/dist/lib/ui/auth-menu.js +10 -6
  176. package/dist/lib/ui/auth-menu.js.map +1 -1
  177. package/dist/tui.d.ts +55 -0
  178. package/dist/tui.d.ts.map +1 -1
  179. package/dist/tui.js +511 -29
  180. package/dist/tui.js.map +1 -1
  181. package/package.json +1 -1
  182. package/scripts/install-oc-codex-multi-auth-core.js +583 -66
@@ -0,0 +1,253 @@
1
+ /**
2
+ * One constant line describing the whole account pool.
3
+ *
4
+ * The prompt status line names whichever account served the most recent
5
+ * request, so on a pool of several accounts it changes identity as rotation
6
+ * moves - and a reader who wants to know where the pool stands has to watch it
7
+ * long enough to see every account go past. This module renders the pool
8
+ * instead: every account at once, in a fixed order, so the line only changes
9
+ * when the underlying quota does.
10
+ *
11
+ * ```text
12
+ * 24%: #1 5x 13%, #2 20x 100% 3d 1r, #3 1x 12%
13
+ * ```
14
+ *
15
+ * The leading figure is the pool total, and it is a WEIGHTED mean rather than
16
+ * a plain one. A Pro seat spent to 50% has given up twenty times the capacity
17
+ * a Business Standard seat does at 50%, so averaging the percentages
18
+ * unweighted describes a pool nobody has; `lib/plan-allotment.ts` supplies the
19
+ * per-plan ratio the mean is taken over.
20
+ *
21
+ * Percentages follow `quotaDisplay` like every other surface, so the same pool
22
+ * reads `24%` as headroom or `76%` as consumption. Only the wording changes:
23
+ * every decision here - which window governs an account, which account is
24
+ * closest to recovering, whether a reset time is worth the characters - stays
25
+ * keyed on the percentage remaining.
26
+ *
27
+ * Everything below is pure string work over already-gathered readings, so the
28
+ * whole rendering can be exercised without a network, a clock or a terminal.
29
+ */
30
+ import { toQuotaDisplayPercent, type QuotaDisplayMode } from "./quota-display.js";
31
+ /**
32
+ * Under `resetTimes: "low"`, only an account at or below this headroom gets
33
+ * its reset time printed.
34
+ *
35
+ * Every account has a reset, and printing all of them triples the length of
36
+ * the line to say "this account you are not waiting on recovers at some point
37
+ * too". The threshold matches the one the single-account status line already
38
+ * uses to decide the same question, so an account near exhaustion reads the
39
+ * same way in either mode. `resetTimes: "always"` opts out of the threshold,
40
+ * because 90% spent with an hour to go and 90% spent with six days to go are
41
+ * not the same situation.
42
+ */
43
+ export declare const OVERVIEW_RESET_LEFT_PERCENT = 25;
44
+ export type QuotaOverviewWindow = {
45
+ /** Percentage of this window still free, 0-100. */
46
+ leftPercent?: number;
47
+ resetAtMs?: number;
48
+ };
49
+ export type QuotaOverviewAccount = {
50
+ /** 1-based position, as `codex-list` and `codex-switch` number accounts. */
51
+ index: number;
52
+ /**
53
+ * The account's own name for itself: a `codex-label` label when one is
54
+ * set, otherwise whatever identity the account storage carries. May be an
55
+ * email address, which is why every rendering of it goes through
56
+ * {@link resolveAccountName} rather than printing it directly.
57
+ */
58
+ label?: string;
59
+ /** ChatGPT email, used by the reset-credit line and as a label fallback. */
60
+ email?: string;
61
+ /** `plan_type` as reported by `/wham/usage`, used for the weighting only. */
62
+ planType?: string;
63
+ windows: readonly QuotaOverviewWindow[];
64
+ /** Banked rate-limit resets redeemable now, rendered as `1r`. */
65
+ resetCredits?: number;
66
+ };
67
+ /** How the accounts are arranged on the line. */
68
+ export type QuotaOverviewLayout =
69
+ /** One segment per account: `#1 13%, #2 100% 3d`. */
70
+ "accounts"
71
+ /** Accounts sharing a percentage collapse: `100% 3d 4d 5d`. */
72
+ | "aggregate"
73
+ /** No accounts at all, just how many there are: `3 accounts`. */
74
+ | "count";
75
+ /** What identifies an account on the line. */
76
+ export type QuotaOverviewNames =
77
+ /** `#1`, the number `codex-switch` takes. */
78
+ "number"
79
+ /** The account's label, or its email's local part: `damian`, `work`. */
80
+ | "label"
81
+ /** Nothing; the accounts are told apart by position alone. */
82
+ | "none";
83
+ /** The order accounts appear in. */
84
+ export type QuotaOverviewOrder = "number"
85
+ /** Least headroom first - the accounts rotation is about to stop using. */
86
+ | "most-used"
87
+ /** Most headroom first - the accounts with work left in them. */
88
+ | "least-used"
89
+ /** Soonest reset first. Accounts with no known reset sort last. */
90
+ | "renewing-earliest"
91
+ /** Latest reset first, which is redemption order for a banked reset. */
92
+ | "renewing-latest";
93
+ /** Which accounts get a reset countdown printed beside them. */
94
+ export type QuotaOverviewResetTimes = "never"
95
+ /** Only accounts at or below {@link OVERVIEW_RESET_LEFT_PERCENT}. */
96
+ | "low" | "always";
97
+ export type QuotaOverviewOptions = {
98
+ mode: QuotaDisplayMode;
99
+ layout: QuotaOverviewLayout;
100
+ names: QuotaOverviewNames;
101
+ order: QuotaOverviewOrder;
102
+ /** `5x` / `20x` allotment badges beside each account. */
103
+ multipliers: boolean;
104
+ /** `66% of 65x`: what the pool the percentage is taken over adds up to. */
105
+ allotment: boolean;
106
+ resetTimes: QuotaOverviewResetTimes;
107
+ /** `1r` for redeemable banked resets. */
108
+ resetCredits: boolean;
109
+ /** `+12% in 3d`: how far the pool total moves at the next reset. */
110
+ recovery: boolean;
111
+ /** Masks any email this line would otherwise print in full. */
112
+ maskEmail?: boolean;
113
+ now?: number;
114
+ };
115
+ export type QuotaOverviewRecovery = {
116
+ /**
117
+ * Pool-total movement at {@link atMs}, in percentage points, always
118
+ * positive - it is capacity returning. The rendered sign follows the
119
+ * display mode, since the number a reader is watching moves up under
120
+ * `free` and down under `used`.
121
+ */
122
+ deltaPercent: number;
123
+ atMs: number;
124
+ };
125
+ /**
126
+ * Render a duration the way a countdown reads: the largest unit that fits,
127
+ * floored, so `2d` never claims more time remains than actually does. A gap
128
+ * under a minute still reads `1m` rather than `0m`, because a reset that has
129
+ * not happened yet is not zero away.
130
+ */
131
+ export declare function formatCompactDuration(ms: number): string | undefined;
132
+ /**
133
+ * The window that decides what an account can still do.
134
+ *
135
+ * An account reports several windows at once - typically a 5-hour and a weekly
136
+ * one - and the one with the least headroom is the one that stops a request,
137
+ * so it is the one the account is described by. On a tie the window that
138
+ * blocks for longer governs: two windows both fully spent are not equally
139
+ * costly when one returns in four hours and the other in three days.
140
+ */
141
+ export declare function resolveGoverningWindow(account: QuotaOverviewAccount): QuotaOverviewWindow | undefined;
142
+ /**
143
+ * Weighted mean headroom across the pool, or `undefined` when no account
144
+ * reported a readable window.
145
+ *
146
+ * Accounts with no readable window are left out rather than counted as full:
147
+ * a quota we could not read is not capacity we know we have.
148
+ */
149
+ export declare function computeWeightedLeftPercent(accounts: readonly QuotaOverviewAccount[]): number | undefined;
150
+ /**
151
+ * What the pool the percentage is taken over adds up to, in 1x seats.
152
+ *
153
+ * Deliberately the same sum {@link computeWeightedLeftPercent} divides by, and
154
+ * over the same accounts, so `66% of 65x` is one statement rather than two
155
+ * that can disagree. An account whose plan states no ratio therefore
156
+ * contributes its fallback weight here exactly as it does to the mean.
157
+ */
158
+ export declare function computePoolAllotment(accounts: readonly QuotaOverviewAccount[]): number | undefined;
159
+ /**
160
+ * The next moment the pool gets capacity back, and how much.
161
+ *
162
+ * Only the window that actually resets is refilled, and the account's
163
+ * governing window is then resolved again: an account whose 5-hour window
164
+ * resets while its weekly window is still spent gains nothing, and reporting
165
+ * the 5-hour refill as pool recovery would promise headroom that does not
166
+ * arrive. Movement below one point is dropped rather than rendered as `+0%`.
167
+ */
168
+ export declare function resolveQuotaOverviewRecovery(accounts: readonly QuotaOverviewAccount[], now?: number): QuotaOverviewRecovery | undefined;
169
+ /**
170
+ * Whether nothing in the pool has capacity left.
171
+ *
172
+ * This is the condition the reset-credit line exists for: while any account
173
+ * can still serve a request, which one recovers when is a detail, and once
174
+ * none can it is the only question left. Accounts whose quota could not be
175
+ * read do not count either way - an unknown reading is not evidence of
176
+ * exhaustion, but it is not capacity either, so a pool of nothing but
177
+ * unreadable accounts is reported as not spent rather than as dead.
178
+ */
179
+ export declare function isPoolFullySpent(accounts: readonly QuotaOverviewAccount[]): boolean;
180
+ /**
181
+ * Arrange the accounts for display.
182
+ *
183
+ * Every comparison falls back to the account number, so two accounts reading
184
+ * the same percentage never trade places between renders. An order that let
185
+ * them would reintroduce exactly the movement this mode exists to remove.
186
+ */
187
+ export declare function orderOverviewAccounts(accounts: readonly QuotaOverviewAccount[], order: QuotaOverviewOrder): QuotaOverviewAccount[];
188
+ /**
189
+ * What this account is called on the line.
190
+ *
191
+ * Under `label` a user-set label wins, because it is the one name the user
192
+ * chose; an account that only knows its email falls back to that email's local
193
+ * part, and an account with neither falls back to its number rather than
194
+ * rendering nothing - a nameless segment in a named line reads as a missing
195
+ * account.
196
+ */
197
+ export declare function resolveAccountName(account: QuotaOverviewAccount, names: QuotaOverviewNames, maskEmail?: boolean): string | undefined;
198
+ /** `3 accounts` -> `3 acct.` -> `3`, in the order they are given up. */
199
+ export type QuotaOverviewCountStyle = "long" | "short" | "bare";
200
+ /**
201
+ * Every rendering of this pool, longest first.
202
+ *
203
+ * The caller takes the first that fits its width. Detail is dropped in the
204
+ * order that costs a reader the least: the recovery clause and then the
205
+ * annotations (badges, banked resets) that sit beside a figure which stays
206
+ * either way, then the per-account breakdown, leaving the pool total - the one
207
+ * thing the line exists to say - as the last to go.
208
+ *
209
+ * Order is preference, NOT length: a stripped-down rung is occasionally a
210
+ * character or two longer than the rung above it. Sorting by length instead
211
+ * would let a form win or lose by two characters as a percentage crosses from
212
+ * `9%` to `10%`, and the line would change shape while the reader watches -
213
+ * the flicker this whole mode exists to remove.
214
+ *
215
+ * Candidates never exceed what {@link QuotaOverviewOptions} asked for, so a
216
+ * switch left off cannot reappear because the terminal happened to be wide.
217
+ */
218
+ export declare function formatQuotaOverviewCandidates(accounts: readonly QuotaOverviewAccount[], options: QuotaOverviewOptions): string[];
219
+ /** The fullest rendering, for surfaces with a line to themselves. */
220
+ export declare function formatQuotaOverviewText(accounts: readonly QuotaOverviewAccount[], options: QuotaOverviewOptions): string;
221
+ /**
222
+ * Every rendering of the banked reset credits, longest first.
223
+ *
224
+ * ```text
225
+ * Free resets: 6d 1r damian@nowaker.net, 4d 2r work@example.com
226
+ * ```
227
+ *
228
+ * Sorted by the LATEST reset first, which is redemption order rather than
229
+ * reading order: redeeming a credit on an account that renews by itself
230
+ * tomorrow throws the credit away, while the account six days out is the one
231
+ * worth spending it on.
232
+ *
233
+ * Returns nothing at all unless the pool is spent and something is redeemable.
234
+ * A reset credit is only an answer to "everything is used up"; offered while
235
+ * accounts still have headroom it is an invitation to waste it.
236
+ */
237
+ export declare function formatQuotaResetsCandidates(accounts: readonly QuotaOverviewAccount[], options: Pick<QuotaOverviewOptions, "maskEmail"> & {
238
+ names?: QuotaOverviewNames;
239
+ now?: number;
240
+ }): string[];
241
+ /**
242
+ * Headroom of the account with the most room left, for the caller that
243
+ * colours the line.
244
+ *
245
+ * Deliberately the best account rather than the worst: a pool is only in
246
+ * trouble when nothing in it has room left, and keying on the worst account
247
+ * would paint the line red for one spent seat that rotation has already
248
+ * stopped selecting while every other account serves requests normally.
249
+ */
250
+ export declare function resolveQuotaOverviewTonePercent(accounts: readonly QuotaOverviewAccount[]): number | undefined;
251
+ /** Re-exported so callers rendering a bare total need only this module. */
252
+ export { toQuotaDisplayPercent };
253
+ //# sourceMappingURL=quota-overview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota-overview.d.ts","sourceRoot":"","sources":["../../lib/quota-overview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,EAEN,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,MAAM,oBAAoB,CAAC;AAM5B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAK9C,MAAM,MAAM,mBAAmB,GAAG;IACjC,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACxC,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,iDAAiD;AACjD,MAAM,MAAM,mBAAmB;AAC9B,qDAAqD;AACnD,UAAU;AACZ,+DAA+D;GAC7D,WAAW;AACb,iEAAiE;GAC/D,OAAO,CAAC;AAEX,8CAA8C;AAC9C,MAAM,MAAM,kBAAkB;AAC7B,6CAA6C;AAC3C,QAAQ;AACV,wEAAwE;GAC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