tuxevil-rotator 4.0.0 → 4.2.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.
- package/CHANGELOG.md +62 -0
- package/README.md +8 -1
- package/package.json +1 -1
- package/src/audio-transcription.ts +44 -4
- package/src/compat.ts +196 -222
- package/src/config-defaults.ts +5 -0
- package/src/config-overrides.ts +16 -0
- package/src/dashboard-live.ts +10 -8
- package/src/dashboard-types.ts +94 -1
- package/src/dashboard.ts +194 -1
- package/src/effort-levels.ts +43 -0
- package/src/effort-routing.ts +304 -0
- package/src/index.ts +2 -5
- package/src/model-catalog-revision.ts +20 -0
- package/src/model-catalog.ts +304 -0
- package/src/providers/adapter.ts +18 -0
- package/src/providers/google-antigravity/catalog.ts +190 -1
- package/src/providers/google-antigravity/forward.ts +2 -0
- package/src/providers/google-antigravity/index.ts +11 -0
- package/src/providers/google-antigravity/translators.ts +67 -14
- package/src/providers/ollama/index.ts +11 -1
- package/src/providers/ollama/quota-poll-store.ts +22 -1
- package/src/providers/ollama/quota.ts +95 -23
- package/src/providers/openai-codex/catalog.ts +9 -4
- package/src/providers/openai-codex/index.ts +18 -2
- package/src/providers/opencode-zen/index.ts +11 -2
- package/src/proxy.ts +143 -28
- package/src/rotator.ts +296 -21
- package/src/settings-repository.ts +36 -5
- package/src/types.ts +72 -26
- package/src/validators.ts +37 -1
- package/src/web/app.tsx +6 -1
- package/src/web/components/icons.tsx +29 -0
- package/src/web/components/overlays.tsx +13 -1
- package/src/web/components/ui.tsx +6 -1
- package/src/web/lib/accounts.ts +1 -0
- package/src/web/lib/attention.ts +12 -0
- package/src/web/lib/effort.ts +407 -0
- package/src/web/lib/models.ts +284 -0
- package/src/web/lib/pools.ts +53 -9
- package/src/web/lib/status.ts +13 -3
- package/src/web/nav.ts +1 -0
- package/src/web/pages/AccountDetail.tsx +16 -2
- package/src/web/pages/EffortRouting.tsx +1130 -0
- package/src/web/pages/Models.tsx +888 -0
- package/src/web/pages/Overview.tsx +31 -15
- package/src/web/pages/Usage.tsx +3 -3
- package/src/web/state/api.ts +31 -0
- package/src/web/state/model-catalog.ts +103 -0
- package/src/web/state/router.ts +150 -19
- package/src/web/state/store.ts +6 -6
- package/src/web/styles/app.css +854 -0
package/src/types.ts
CHANGED
|
@@ -154,6 +154,17 @@ export interface Config {
|
|
|
154
154
|
effortRouting?: Record<string, EffortRoutingRule> | null;
|
|
155
155
|
/** Optional semantic model routing through TypeSafe Jev. */
|
|
156
156
|
typesafeRouting?: TypeSafeRoutingConfig;
|
|
157
|
+
// Dashboard Models page. Provider priority for model ids more than one
|
|
158
|
+
// provider lists; unlisted providers follow in the default order.
|
|
159
|
+
providerOrder?: string[];
|
|
160
|
+
// Providers turned off: their accounts stay signed in but get no traffic.
|
|
161
|
+
disabledProviders?: string[];
|
|
162
|
+
// "<provider>/<model>" entries turned off, e.g. "ollama/gpt-oss:20b".
|
|
163
|
+
disabledModels?: string[];
|
|
164
|
+
// When false, models a provider adds later stay off until turned on. Default: true.
|
|
165
|
+
autoEnableNewModels?: boolean;
|
|
166
|
+
// "<provider>/<model>" entries already decided while autoEnableNewModels is false.
|
|
167
|
+
reviewedModels?: string[];
|
|
157
168
|
}
|
|
158
169
|
|
|
159
170
|
export interface TypeSafeRoutingConfig {
|
|
@@ -341,9 +352,10 @@ export interface ModelQuota {
|
|
|
341
352
|
percentRemaining: number;
|
|
342
353
|
/** Raw usage fraction (0..1) when the provider reports one (Ollama). */
|
|
343
354
|
usageRaw?: number;
|
|
355
|
+
/** Included monthly credits and optional prepaid credits reported by Ollama. */
|
|
356
|
+
credits?: { balanceUsd: number; allowanceUsd: number; purchasedUsd: number };
|
|
344
357
|
resetTime: string | null;
|
|
345
|
-
// Timer classification based on
|
|
346
|
-
// account-wide pool is monthly and has no provider-supplied reset time.
|
|
358
|
+
// Timer classification based on the provider window.
|
|
347
359
|
timerType: "fresh" | "5h" | "7d" | "monthly";
|
|
348
360
|
}
|
|
349
361
|
|
|
@@ -490,6 +502,10 @@ export function resolveDisplayModelKey(
|
|
|
490
502
|
) {
|
|
491
503
|
return "gemini-3.7-flash-tiered";
|
|
492
504
|
}
|
|
505
|
+
// Gemini 3.5 Flash Lite is its own model, not a Gemini 3 Flash variant.
|
|
506
|
+
if (lower.includes("gemini") && lower.includes("3.5") && lower.includes("flash-lite")) {
|
|
507
|
+
return "gemini-3.5-flash-lite";
|
|
508
|
+
}
|
|
493
509
|
// Flash
|
|
494
510
|
if (lower.includes("gemini") && lower.includes("flash"))
|
|
495
511
|
return "gemini-3-flash";
|
|
@@ -510,6 +526,8 @@ export interface AccountRuntime {
|
|
|
510
526
|
/** Provider-local auth failures/cooldowns; Google/Ollama remain routable. */
|
|
511
527
|
invalidProviders?: Record<string, string>;
|
|
512
528
|
providerCooldowns?: Record<string, number>;
|
|
529
|
+
/** Providers the operator turned off for this account only. */
|
|
530
|
+
disabledProviders?: string[];
|
|
513
531
|
// Rotation tracking (per-model via rotator)
|
|
514
532
|
requestsSinceRotation: number;
|
|
515
533
|
totalRequests: number;
|
|
@@ -592,6 +610,8 @@ export interface PersistedState {
|
|
|
592
610
|
allowFreshWindowStarts?: boolean;
|
|
593
611
|
autoWarmupEnabled?: boolean;
|
|
594
612
|
safety?: PersistedSafetyState;
|
|
613
|
+
/** Models-page account switches keyed by getAccountIdentity; authoritative when present. */
|
|
614
|
+
disabledProvidersByAccount?: Record<string, string[]>;
|
|
595
615
|
accounts: Record<
|
|
596
616
|
string,
|
|
597
617
|
{
|
|
@@ -605,6 +625,7 @@ export interface PersistedState {
|
|
|
605
625
|
flagged: boolean;
|
|
606
626
|
flagReason?: string | null;
|
|
607
627
|
allowFreshWindowStartsOverride?: boolean;
|
|
628
|
+
disabledProviders?: string[];
|
|
608
629
|
}
|
|
609
630
|
>;
|
|
610
631
|
}
|
|
@@ -631,6 +652,8 @@ export interface AdminNotification {
|
|
|
631
652
|
// Dashboard API response
|
|
632
653
|
export interface StatusResponse {
|
|
633
654
|
version: string;
|
|
655
|
+
/** Stable public Models state; changes invalidate the dashboard catalog. */
|
|
656
|
+
modelCatalogRevision?: string;
|
|
634
657
|
proxyPort: number;
|
|
635
658
|
requestsPerRotation: number;
|
|
636
659
|
maxConcurrentRequestsPerAccount: number;
|
|
@@ -693,6 +716,8 @@ export interface StatusResponse {
|
|
|
693
716
|
}
|
|
694
717
|
|
|
695
718
|
export interface AccountStatus {
|
|
719
|
+
/** Stable account identity for exact Models-page targets; email is a legacy fallback. */
|
|
720
|
+
id?: string;
|
|
696
721
|
email: string;
|
|
697
722
|
label: string;
|
|
698
723
|
/** Provider id, e.g. "google-antigravity" | "ollama". */
|
|
@@ -704,7 +729,9 @@ export interface AccountStatus {
|
|
|
704
729
|
| "exhausted"
|
|
705
730
|
| "disabled"
|
|
706
731
|
| "flagged"
|
|
707
|
-
| "error"
|
|
732
|
+
| "error"
|
|
733
|
+
// Every provider on the account is turned off on the Models page.
|
|
734
|
+
| "off";
|
|
708
735
|
// Which models this account is currently active for
|
|
709
736
|
activeForModels: string[];
|
|
710
737
|
requestsSinceRotation: number;
|
|
@@ -722,6 +749,8 @@ export interface AccountStatus {
|
|
|
722
749
|
invalidProviders?: Record<string, string>;
|
|
723
750
|
/** Provider-scoped cooldown deadlines, kept separate from account breakers. */
|
|
724
751
|
providerCooldowns?: Record<string, number>;
|
|
752
|
+
/** Providers the operator turned off for this account only. */
|
|
753
|
+
disabledProviders?: string[];
|
|
725
754
|
quota: ModelQuota[];
|
|
726
755
|
inFlightRequests: number;
|
|
727
756
|
inFlightByModel: Record<string, number>;
|
|
@@ -748,6 +777,8 @@ export interface HealthScoreBreakdown {
|
|
|
748
777
|
}
|
|
749
778
|
|
|
750
779
|
export interface RoutingAccountDiagnostic {
|
|
780
|
+
/** Stable account identity; older diagnostic producers may omit it. */
|
|
781
|
+
id?: string;
|
|
751
782
|
email: string;
|
|
752
783
|
label: string;
|
|
753
784
|
status: AccountStatus["status"];
|
|
@@ -951,29 +982,37 @@ export const MODEL_PRICING: Record<string, ModelPricing> = {
|
|
|
951
982
|
cachingPer1M: 0.02,
|
|
952
983
|
},
|
|
953
984
|
|
|
954
|
-
// Ollama Cloud
|
|
955
|
-
//
|
|
956
|
-
//
|
|
957
|
-
|
|
958
|
-
"gpt-oss:
|
|
959
|
-
"
|
|
960
|
-
"deepseek-v4-
|
|
961
|
-
"
|
|
962
|
-
"
|
|
963
|
-
"glm-5.
|
|
964
|
-
"
|
|
965
|
-
"
|
|
966
|
-
"
|
|
967
|
-
"
|
|
968
|
-
"kimi-
|
|
969
|
-
"
|
|
970
|
-
"
|
|
971
|
-
"
|
|
972
|
-
"
|
|
973
|
-
"mistral-large-3:675b":
|
|
974
|
-
"nemotron-3-nano
|
|
975
|
-
"nemotron-3-
|
|
976
|
-
"nemotron-3-
|
|
985
|
+
// Ollama Cloud standard USD/1M rates, verified 2026-10-11:
|
|
986
|
+
// https://ollama.com/pricing. Aggregates do not track cache hits or off-peak
|
|
987
|
+
// billing, so savings represent standard list-price value, not a net saving.
|
|
988
|
+
"gpt-oss:20b": { inputPer1M: 0.07, outputPer1M: 0.30, cachingPer1M: 0.035 },
|
|
989
|
+
"gpt-oss:120b": { inputPer1M: 0.15, outputPer1M: 0.60, cachingPer1M: 0.014 },
|
|
990
|
+
"deepseek-v4.1-flash": { inputPer1M: 0.30, outputPer1M: 1.20, cachingPer1M: 0.006 },
|
|
991
|
+
"deepseek-v4-pro": { inputPer1M: 1.32, outputPer1M: 3.96, cachingPer1M: 0.044 },
|
|
992
|
+
"glm-5.2": { inputPer1M: 1.40, outputPer1M: 4.40, cachingPer1M: 0.26 },
|
|
993
|
+
"glm-5.3": { inputPer1M: 1.40, outputPer1M: 4.40, cachingPer1M: 0.26 },
|
|
994
|
+
"glm-5.3-flash": { inputPer1M: 0.15, outputPer1M: 0.50, cachingPer1M: 0.03 },
|
|
995
|
+
"gemma4": { inputPer1M: 0.14, outputPer1M: 0.40, cachingPer1M: 0.05 },
|
|
996
|
+
"gemma4:31b": { inputPer1M: 0.14, outputPer1M: 0.40, cachingPer1M: 0.05 },
|
|
997
|
+
"kimi-k2.6": { inputPer1M: 0.95, outputPer1M: 4.00, cachingPer1M: 0.16 },
|
|
998
|
+
"kimi-k2.7-code": { inputPer1M: 0.95, outputPer1M: 4.00, cachingPer1M: 0.19 },
|
|
999
|
+
"kimi-k3": { inputPer1M: 3.00, outputPer1M: 15.00, cachingPer1M: 0.30 },
|
|
1000
|
+
"minimax-m2.7": { inputPer1M: 0.30, outputPer1M: 1.20, cachingPer1M: 0.06 },
|
|
1001
|
+
"minimax-m3": { inputPer1M: 0.60, outputPer1M: 2.40, cachingPer1M: 0.12 },
|
|
1002
|
+
"mistral-large-4": { inputPer1M: 0.68, outputPer1M: 2.09, cachingPer1M: 0.07 },
|
|
1003
|
+
"mistral-large-3": { inputPer1M: 0.50, outputPer1M: 1.50 },
|
|
1004
|
+
"mistral-large-3:675b": { inputPer1M: 0.50, outputPer1M: 1.50 },
|
|
1005
|
+
"nemotron-3-nano": { inputPer1M: 0.06, outputPer1M: 0.24 },
|
|
1006
|
+
"nemotron-3-nano:30b": { inputPer1M: 0.06, outputPer1M: 0.24 },
|
|
1007
|
+
"nemotron-3-super": { inputPer1M: 0.015, outputPer1M: 0.60, cachingPer1M: 0.015 },
|
|
1008
|
+
"nemotron-3-ultra": { inputPer1M: 0.10, outputPer1M: 3.00, cachingPer1M: 0.10 },
|
|
1009
|
+
|
|
1010
|
+
// Retired/versioned models absent from the current official table. Preserve
|
|
1011
|
+
// their historical operator-supplied estimates; do not map to newer releases.
|
|
1012
|
+
"deepseek-v4-flash:0731": { inputPer1M: 0.14, outputPer1M: 0.28, cachingPer1M: 0.0028 },
|
|
1013
|
+
"deepseek-v4-pro:0813": { inputPer1M: 1.74, outputPer1M: 3.48 },
|
|
1014
|
+
"qwen3.5:397b": { inputPer1M: 0.60, outputPer1M: 3.60 },
|
|
1015
|
+
"glm-5.1": { inputPer1M: 0.80, outputPer1M: 2.56 },
|
|
977
1016
|
|
|
978
1017
|
// OpenCode Zen free models — zero provider cost (USD per 1M tokens)
|
|
979
1018
|
"big-pickle": { inputPer1M: 0.00, outputPer1M: 0.00 },
|
|
@@ -994,6 +1033,12 @@ export function getModelPricing(model: string): ModelPricing | undefined {
|
|
|
994
1033
|
if (MODEL_PRICING[model]) return MODEL_PRICING[model];
|
|
995
1034
|
const lower = model.toLowerCase();
|
|
996
1035
|
if (MODEL_PRICING[lower]) return MODEL_PRICING[lower];
|
|
1036
|
+
// Ollama uses -cloud suffixes and provider-prefixed ids. Resolve only exact
|
|
1037
|
+
// aliases, before the unrelated Antigravity GPT-OSS family fallback.
|
|
1038
|
+
const ollamaId = lower.replace(/^ollama\//, "").replace(/(?::cloud|-cloud)$/, "");
|
|
1039
|
+
if (ollamaId !== lower) {
|
|
1040
|
+
return MODEL_PRICING[ollamaId];
|
|
1041
|
+
}
|
|
997
1042
|
// Dynamic family fallbacks for unseen future models. Keep provider and
|
|
998
1043
|
// version checks explicit so an unrelated model containing "flash" cannot
|
|
999
1044
|
// inherit Gemini pricing.
|
|
@@ -1085,6 +1130,7 @@ export const QUOTA_API_URL =
|
|
|
1085
1130
|
// ── Ollama Cloud endpoints ──────────────────────────────────────────
|
|
1086
1131
|
export const OLLAMA_API_BASE = "https://ollama.com/api";
|
|
1087
1132
|
export const OLLAMA_OPENAI_BASE = "https://ollama.com/v1";
|
|
1133
|
+
export const OLLAMA_BALANCE_URL = "https://ollama.com/api/balance";
|
|
1088
1134
|
export const OLLAMA_USAGE_URL = "https://ollama.com/api/usage";
|
|
1089
1135
|
export const OLLAMA_TAGS_URL = "https://ollama.com/api/tags";
|
|
1090
1136
|
// Mutable so tests can redirect to a local stub (same pattern as ANTIGRAVITY_ENDPOINTS).
|
package/src/validators.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
type Config,
|
|
7
7
|
} from "./types.js";
|
|
8
8
|
import { getProxyConfigurationError } from "./providers/proxy-dispatcher.js";
|
|
9
|
+
import { PROVIDER_ORDER } from "./providers/credential-helpers.js";
|
|
9
10
|
import { isCodexRequestModel } from "./providers/openai-codex/catalog.js";
|
|
10
11
|
import { isOpenCodeZenModel } from "./providers/opencode-zen/catalog.js";
|
|
11
12
|
|
|
@@ -43,7 +44,17 @@ function isNonNegativeInteger(value: unknown): value is number {
|
|
|
43
44
|
return isNonNegativeNumber(value) && Number.isInteger(value);
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
function
|
|
47
|
+
function isStringArray(value: unknown): value is string[] {
|
|
48
|
+
return Array.isArray(value) && value.every(isNonEmptyString);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function isProviderModelKey(value: string): boolean {
|
|
52
|
+
const slash = value.indexOf("/");
|
|
53
|
+
return slash > 0 && slash < value.length - 1 && PROVIDER_ORDER.includes(value.slice(0, slash));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Whether a static Codex, OpenCode Zen or Ollama catalog ID claims this model id. */
|
|
57
|
+
export function isKnownNonGoogleModel(model: string): boolean {
|
|
47
58
|
const trimmed = model.trim();
|
|
48
59
|
if (!trimmed) return false;
|
|
49
60
|
const lower = trimmed.toLowerCase();
|
|
@@ -346,6 +357,29 @@ export function validateConfig(value: unknown): ValidationResult<Config> {
|
|
|
346
357
|
}
|
|
347
358
|
}
|
|
348
359
|
|
|
360
|
+
for (const field of ["providerOrder", "disabledProviders"] as const) {
|
|
361
|
+
const list = value[field];
|
|
362
|
+
if (list === undefined) continue;
|
|
363
|
+
if (!isStringArray(list)) {
|
|
364
|
+
errors.push(`config.${field} must be an array of provider ids`);
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
const unknown = list.filter((id) => !PROVIDER_ORDER.includes(id));
|
|
368
|
+
if (unknown.length > 0) {
|
|
369
|
+
errors.push(`config.${field} has unknown providers: ${unknown.join(", ")}. Known: ${PROVIDER_ORDER.join(", ")}`);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
for (const field of ["disabledModels", "reviewedModels"] as const) {
|
|
373
|
+
const list = value[field];
|
|
374
|
+
if (list === undefined) continue;
|
|
375
|
+
if (!isStringArray(list) || !list.every(isProviderModelKey)) {
|
|
376
|
+
errors.push(`config.${field} must be an array of "<provider>/<model>" entries, e.g. "ollama/gpt-oss:20b"`);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
if (value.autoEnableNewModels !== undefined && typeof value.autoEnableNewModels !== "boolean") {
|
|
380
|
+
errors.push("config.autoEnableNewModels must be a boolean");
|
|
381
|
+
}
|
|
382
|
+
|
|
349
383
|
return errors.length > 0 ? fail(errors) : ok(value as unknown as Config);
|
|
350
384
|
}
|
|
351
385
|
|
|
@@ -356,6 +390,7 @@ export interface MinimalProxyRequestBody {
|
|
|
356
390
|
requestType?: string;
|
|
357
391
|
userAgent?: string;
|
|
358
392
|
requestId?: string;
|
|
393
|
+
requestedModel?: string;
|
|
359
394
|
[key: string]: unknown;
|
|
360
395
|
}
|
|
361
396
|
|
|
@@ -369,6 +404,7 @@ export function validateProxyRequestBody(value: unknown): ValidationResult<Minim
|
|
|
369
404
|
if (value.requestType !== undefined && typeof value.requestType !== "string") errors.push("body.requestType must be a string when provided");
|
|
370
405
|
if (value.userAgent !== undefined && typeof value.userAgent !== "string") errors.push("body.userAgent must be a string when provided");
|
|
371
406
|
if (value.requestId !== undefined && typeof value.requestId !== "string") errors.push("body.requestId must be a string when provided");
|
|
407
|
+
if (value.requestedModel !== undefined && typeof value.requestedModel !== "string") errors.push("body.requestedModel must be a string when provided");
|
|
372
408
|
|
|
373
409
|
return errors.length > 0 ? fail(errors) : ok(value as MinimalProxyRequestBody);
|
|
374
410
|
}
|
package/src/web/app.tsx
CHANGED
|
@@ -30,6 +30,7 @@ import { AsyncButton, Button, Link, Spinner } from "./components/ui.js";
|
|
|
30
30
|
import { OverviewPage } from "./pages/Overview.js";
|
|
31
31
|
import { AccountsPage } from "./pages/Accounts.js";
|
|
32
32
|
import { AccountDetail } from "./pages/AccountDetail.js";
|
|
33
|
+
import { ModelsPage } from "./pages/Models.js";
|
|
33
34
|
import { RequestsPage } from "./pages/Requests.js";
|
|
34
35
|
import { UsagePage } from "./pages/Usage.js";
|
|
35
36
|
import { KeysPage } from "./pages/Keys.js";
|
|
@@ -124,6 +125,9 @@ function Shell(): JSX.Element {
|
|
|
124
125
|
case "accounts":
|
|
125
126
|
page = <AccountsPage />;
|
|
126
127
|
break;
|
|
128
|
+
case "models":
|
|
129
|
+
page = <ModelsPage />;
|
|
130
|
+
break;
|
|
127
131
|
case "requests":
|
|
128
132
|
page = <RequestsPage />;
|
|
129
133
|
break;
|
|
@@ -706,7 +710,8 @@ function LoginScreen(): JSX.Element {
|
|
|
706
710
|
if (params.has("auth")) {
|
|
707
711
|
params.delete("auth");
|
|
708
712
|
const rest = params.toString();
|
|
709
|
-
|
|
713
|
+
// Keep the router's state: it records the entry's position in history.
|
|
714
|
+
window.history.replaceState(window.history.state, "", window.location.pathname + (rest ? `?${rest}` : ""));
|
|
710
715
|
}
|
|
711
716
|
}, []);
|
|
712
717
|
|
|
@@ -138,6 +138,35 @@ const PATHS = {
|
|
|
138
138
|
</>
|
|
139
139
|
),
|
|
140
140
|
chevronRight: <path d="m9 18 6-6-6-6" />,
|
|
141
|
+
arrowUp: (
|
|
142
|
+
<>
|
|
143
|
+
<path d="M12 19V5" />
|
|
144
|
+
<path d="m5 12 7-7 7 7" />
|
|
145
|
+
</>
|
|
146
|
+
),
|
|
147
|
+
arrowDown: (
|
|
148
|
+
<>
|
|
149
|
+
<path d="M12 5v14" />
|
|
150
|
+
<path d="m19 12-7 7-7-7" />
|
|
151
|
+
</>
|
|
152
|
+
),
|
|
153
|
+
models: (
|
|
154
|
+
<>
|
|
155
|
+
<path d="M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z" />
|
|
156
|
+
<path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65" />
|
|
157
|
+
<path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65" />
|
|
158
|
+
</>
|
|
159
|
+
),
|
|
160
|
+
grip: (
|
|
161
|
+
<>
|
|
162
|
+
<circle cx="9" cy="6" r="1" />
|
|
163
|
+
<circle cx="15" cy="6" r="1" />
|
|
164
|
+
<circle cx="9" cy="12" r="1" />
|
|
165
|
+
<circle cx="15" cy="12" r="1" />
|
|
166
|
+
<circle cx="9" cy="18" r="1" />
|
|
167
|
+
<circle cx="15" cy="18" r="1" />
|
|
168
|
+
</>
|
|
169
|
+
),
|
|
141
170
|
chevronDown: <path d="m6 9 6 6 6-6" />,
|
|
142
171
|
chevronLeft: <path d="m15 18-6-6 6-6" />,
|
|
143
172
|
more: (
|
|
@@ -76,23 +76,35 @@ export function Drawer({
|
|
|
76
76
|
onClose,
|
|
77
77
|
label,
|
|
78
78
|
children,
|
|
79
|
+
confirmClose,
|
|
79
80
|
}: {
|
|
80
81
|
open: boolean;
|
|
81
82
|
onClose: () => void;
|
|
82
83
|
label: string;
|
|
83
84
|
children?: ComponentChildren;
|
|
85
|
+
/** Asked before Escape or a backdrop click closes the drawer; false keeps it open. */
|
|
86
|
+
confirmClose?: () => boolean | Promise<boolean>;
|
|
84
87
|
}): JSX.Element {
|
|
85
88
|
const ref = useNativeDialog(open);
|
|
89
|
+
const requestClose = async () => {
|
|
90
|
+
if (confirmClose && !(await confirmClose())) return;
|
|
91
|
+
onClose();
|
|
92
|
+
};
|
|
86
93
|
return (
|
|
87
94
|
<dialog
|
|
88
95
|
ref={ref}
|
|
89
96
|
class="drawer"
|
|
90
97
|
aria-label={label}
|
|
98
|
+
onCancel={(event) => {
|
|
99
|
+
if (!confirmClose) return;
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
void requestClose();
|
|
102
|
+
}}
|
|
91
103
|
onClose={() => {
|
|
92
104
|
if (open) onClose();
|
|
93
105
|
}}
|
|
94
106
|
onClick={(event) => {
|
|
95
|
-
if (event.target === ref.current)
|
|
107
|
+
if (event.target === ref.current) void requestClose();
|
|
96
108
|
}}
|
|
97
109
|
>
|
|
98
110
|
{open && <div class="drawer-inner">{children}</div>}
|
|
@@ -154,12 +154,16 @@ export function Switch({
|
|
|
154
154
|
checked,
|
|
155
155
|
onChange,
|
|
156
156
|
label,
|
|
157
|
+
ariaLabel,
|
|
157
158
|
description,
|
|
158
159
|
disabled,
|
|
159
160
|
}: {
|
|
160
161
|
checked: boolean;
|
|
161
162
|
onChange: (next: boolean) => void | Promise<unknown>;
|
|
163
|
+
/** Visible text; empty for a bare switch, which then needs `ariaLabel`. */
|
|
162
164
|
label: string;
|
|
165
|
+
/** Accessible name when the visible label alone is not descriptive. */
|
|
166
|
+
ariaLabel?: string;
|
|
163
167
|
description?: ComponentChildren;
|
|
164
168
|
disabled?: boolean;
|
|
165
169
|
}): JSX.Element {
|
|
@@ -170,6 +174,7 @@ export function Switch({
|
|
|
170
174
|
type="button"
|
|
171
175
|
role="switch"
|
|
172
176
|
aria-checked={checked}
|
|
177
|
+
aria-label={ariaLabel}
|
|
173
178
|
class={`switch${checked ? " is-on" : ""}`}
|
|
174
179
|
disabled={disabled || busy}
|
|
175
180
|
onClick={async () => {
|
|
@@ -184,7 +189,7 @@ export function Switch({
|
|
|
184
189
|
<span class="switch-track" aria-hidden="true">
|
|
185
190
|
<span class="switch-thumb" />
|
|
186
191
|
</span>
|
|
187
|
-
<span class="switch-label">{label}</span>
|
|
192
|
+
{label && <span class="switch-label">{label}</span>}
|
|
188
193
|
</button>
|
|
189
194
|
{description && <div class="switch-description">{description}</div>}
|
|
190
195
|
</div>
|
package/src/web/lib/accounts.ts
CHANGED
package/src/web/lib/attention.ts
CHANGED
|
@@ -127,6 +127,18 @@ export function buildAttention(
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
for (const account of accounts) {
|
|
130
|
+
const codexCredentialError = account.invalidProviders?.["openai-codex"];
|
|
131
|
+
if (codexCredentialError) {
|
|
132
|
+
items.push({
|
|
133
|
+
id: `codex-credential:${account.email}`,
|
|
134
|
+
severity: "warning",
|
|
135
|
+
title: `Codex credential rejected for ${name(account.email)}`,
|
|
136
|
+
detail: truncate(codexCredentialError, 220),
|
|
137
|
+
hint: "Open this account to review the rejected Codex credential and re-authenticate it.",
|
|
138
|
+
actions: [{ kind: "open-account", email: account.email }],
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
130
142
|
if (account.status === "flagged") {
|
|
131
143
|
items.push({
|
|
132
144
|
id: `flagged:${account.email}`,
|