antigravity-claude-proxy 3.0.0 → 3.1.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/bin/cli.js +4 -11
- package/package.json +1 -1
- package/public/app.js +7 -4
- package/public/css/src/input.css +379 -216
- package/public/css/style.css +1 -1
- package/public/favicon.svg +4 -8
- package/public/index.html +78 -72
- package/public/js/components/claude-config.js +0 -8
- package/public/js/components/dashboard/charts.js +25 -51
- package/public/js/components/dashboard/stats.js +1 -1
- package/public/js/components/dashboard.js +16 -21
- package/public/js/components/logs-viewer.js +1 -1
- package/public/js/components/models.js +12 -12
- package/public/js/components/server-config.js +1 -9
- package/public/js/data-store.js +2 -2
- package/public/js/store.js +1 -1
- package/public/js/translations/en.js +37 -39
- package/public/js/translations/id.js +36 -37
- package/public/js/translations/pt.js +37 -38
- package/public/js/translations/tr.js +37 -39
- package/public/js/translations/zh.js +0 -2
- package/public/js/utils/error-handler.js +0 -2
- package/public/js/utils/ui-logger.js +4 -3
- package/public/views/accounts.html +34 -38
- package/public/views/dashboard.html +86 -99
- package/public/views/logs.html +4 -4
- package/public/views/models.html +32 -36
- package/public/views/settings.html +50 -50
- package/src/account-manager/index.js +0 -4
- package/src/account-manager/rate-limits.js +0 -5
- package/src/account-manager/strategies/base-strategy.js +4 -4
- package/src/account-manager/strategies/hybrid-strategy.js +3 -3
- package/src/auth/database.js +1 -0
- package/src/auth/oauth.js +43 -41
- package/src/auth/token-extractor.js +1 -1
- package/src/cli/accounts.js +2 -1
- package/src/cloudcode/model-registry.js +0 -3
- package/src/cloudcode/rate-limit-state.js +1 -7
- package/src/config.js +1 -1
- package/src/constants.js +0 -2
- package/src/format/content-converter.js +0 -4
- package/src/format/request-converter.js +1 -6
- package/src/format/response-converter.js +0 -3
- package/src/format/schema-sanitizer.js +3 -22
- package/src/format/thinking-utils.js +1 -13
- package/src/index.js +1 -6
- package/src/modules/usage-stats.js +1 -1
- package/src/server.js +1 -28
- package/src/utils/claude-config.js +2 -6
- package/src/utils/native-module-helper.js +0 -4
- package/src/utils/proxy.js +1 -10
- package/src/utils/version-detector.js +14 -5
- package/src/webui/index.js +1 -37
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
|
|
218
218
|
<!-- Mode Toggle (Proxy/Paid) -->
|
|
219
219
|
<div class="card bg-space-900/30 border border-space-border/50 p-5">
|
|
220
|
-
<label class="label text-xs
|
|
220
|
+
<label class="label text-xs text-gray-500 font-semibold mb-3"
|
|
221
221
|
x-text="$store.global.t('connectionMode')">Connection Mode</label>
|
|
222
222
|
<div class="flex items-center justify-between">
|
|
223
223
|
<div class="flex flex-col gap-1">
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
<div>
|
|
263
263
|
<p class="text-sm font-semibold text-neon-green" x-text="$store.global.t('paidModeTitle')">Claude CLI is using the official Anthropic API</p>
|
|
264
264
|
<p class="text-[11px] text-gray-400 mt-1" x-text="$store.global.t('paidModeDesc')">All proxy configuration has been removed. Claude CLI uses your Anthropic subscription directly.</p>
|
|
265
|
-
<p class="text-[
|
|
265
|
+
<p class="text-[11px] text-gray-500 mt-2" x-text="$store.global.t('paidModeHint')">Switch to Proxy mode to configure model routing and presets.</p>
|
|
266
266
|
</div>
|
|
267
267
|
</div>
|
|
268
268
|
</div>
|
|
@@ -276,7 +276,7 @@
|
|
|
276
276
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
277
277
|
d="M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z" />
|
|
278
278
|
</svg>
|
|
279
|
-
<label class="text-xs
|
|
279
|
+
<label class="text-xs text-neon-cyan font-semibold"
|
|
280
280
|
x-text="$store.global.t('configPresets') || 'Configuration Presets'">Configuration
|
|
281
281
|
Presets</label>
|
|
282
282
|
</div>
|
|
@@ -317,12 +317,12 @@
|
|
|
317
317
|
<span x-show="deletingPreset" class="loading loading-spinner loading-xs"></span>
|
|
318
318
|
</button>
|
|
319
319
|
</div>
|
|
320
|
-
<p class="text-[
|
|
320
|
+
<p class="text-[11px] text-gray-600 mt-2" x-text="$store.global.t('presetHint') || 'Select a preset to load it. Click "Apply to Claude CLI" to save changes.'">Select a preset to load it. Click "Apply to Claude CLI" to save changes.</p>
|
|
321
321
|
</div>
|
|
322
322
|
|
|
323
323
|
<!-- Base URL -->
|
|
324
324
|
<div x-show="currentMode === 'proxy'" class="card bg-space-900/30 border border-space-border/50 p-5">
|
|
325
|
-
<label class="label text-xs
|
|
325
|
+
<label class="label text-xs text-gray-500 font-semibold mb-2"
|
|
326
326
|
x-text="$store.global.t('proxyConnection')">Proxy Connection</label>
|
|
327
327
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
328
328
|
<div>
|
|
@@ -341,7 +341,7 @@
|
|
|
341
341
|
|
|
342
342
|
<!-- Models Selection -->
|
|
343
343
|
<div x-show="currentMode === 'proxy'" class="card bg-space-900/30 border border-space-border/50 p-5">
|
|
344
|
-
<label class="label text-xs
|
|
344
|
+
<label class="label text-xs text-gray-500 font-semibold mb-2"
|
|
345
345
|
x-text="$store.global.t('modelSelection')">Model Selection</label>
|
|
346
346
|
|
|
347
347
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
|
|
@@ -387,7 +387,7 @@
|
|
|
387
387
|
<!-- Grouped models -->
|
|
388
388
|
<template x-for="group in groupedModels" :key="group.family">
|
|
389
389
|
<li>
|
|
390
|
-
<div class="text-[
|
|
390
|
+
<div class="text-[11px] font-medium capitalize px-2 pt-2 pb-1 select-none"
|
|
391
391
|
:class="group.family === 'claude' ? 'text-purple-400/70' : (group.family === 'gemini' ? 'text-green-400/70' : 'text-gray-500')"
|
|
392
392
|
x-text="group.label"></div>
|
|
393
393
|
<ul>
|
|
@@ -403,7 +403,7 @@
|
|
|
403
403
|
<span x-text="modelId"></span>
|
|
404
404
|
</div>
|
|
405
405
|
<template x-if="gemini1mSuffix && $store.data.getModelFamily(modelId) === 'gemini'">
|
|
406
|
-
<span class="text-[
|
|
406
|
+
<span class="text-[11px] bg-neon-green/10 text-neon-green px-1.5 py-0.5 rounded border border-neon-green/20 font-medium tracking-tighter">[1M]</span>
|
|
407
407
|
</template>
|
|
408
408
|
</a>
|
|
409
409
|
</li>
|
|
@@ -417,7 +417,7 @@
|
|
|
417
417
|
</li>
|
|
418
418
|
</ul>
|
|
419
419
|
</div>
|
|
420
|
-
<span class="text-[
|
|
420
|
+
<span class="text-[11px] text-gray-600 mt-1 font-mono" x-text="field"></span>
|
|
421
421
|
</div>
|
|
422
422
|
|
|
423
423
|
<!-- Sub-agent -->
|
|
@@ -460,7 +460,7 @@
|
|
|
460
460
|
</li>
|
|
461
461
|
<template x-for="group in groupedModels" :key="group.family">
|
|
462
462
|
<li>
|
|
463
|
-
<div class="text-[
|
|
463
|
+
<div class="text-[11px] font-medium capitalize px-2 pt-2 pb-1 select-none"
|
|
464
464
|
:class="group.family === 'claude' ? 'text-purple-400/70' : (group.family === 'gemini' ? 'text-green-400/70' : 'text-gray-500')"
|
|
465
465
|
x-text="group.label"></div>
|
|
466
466
|
<ul>
|
|
@@ -476,7 +476,7 @@
|
|
|
476
476
|
<span x-text="modelId"></span>
|
|
477
477
|
</div>
|
|
478
478
|
<template x-if="gemini1mSuffix && $store.data.getModelFamily(modelId) === 'gemini'">
|
|
479
|
-
<span class="text-[
|
|
479
|
+
<span class="text-[11px] bg-neon-green/10 text-neon-green px-1.5 py-0.5 rounded border border-neon-green/20 font-medium tracking-tighter">[1M]</span>
|
|
480
480
|
</template>
|
|
481
481
|
</a>
|
|
482
482
|
</li>
|
|
@@ -490,7 +490,7 @@
|
|
|
490
490
|
</li>
|
|
491
491
|
</ul>
|
|
492
492
|
</div>
|
|
493
|
-
<span class="text-[
|
|
493
|
+
<span class="text-[11px] text-gray-600 mt-1 font-mono" x-text="field"></span>
|
|
494
494
|
</div>
|
|
495
495
|
</div>
|
|
496
496
|
|
|
@@ -501,7 +501,7 @@
|
|
|
501
501
|
<div class="space-y-4">
|
|
502
502
|
<!-- Opus -->
|
|
503
503
|
<div class="form-control" x-data="window.Components.modelDropdown('ANTHROPIC_DEFAULT_OPUS_MODEL', 'opusAlias', 'cyan')">
|
|
504
|
-
<label class="label pt-0 pb-1 text-[
|
|
504
|
+
<label class="label pt-0 pb-1 text-[11px] text-gray-500 font-medium"
|
|
505
505
|
x-text="$store.global.t(labelKey)">Opus Alias</label>
|
|
506
506
|
<div class="relative w-full">
|
|
507
507
|
<input type="text" :value="open ? searchTerm : currentValue"
|
|
@@ -538,7 +538,7 @@
|
|
|
538
538
|
</li>
|
|
539
539
|
<template x-for="group in groupedModels" :key="group.family">
|
|
540
540
|
<li>
|
|
541
|
-
<div class="text-[
|
|
541
|
+
<div class="text-[11px] font-medium capitalize px-2 pt-2 pb-1 select-none"
|
|
542
542
|
:class="group.family === 'claude' ? 'text-purple-400/70' : (group.family === 'gemini' ? 'text-green-400/70' : 'text-gray-500')"
|
|
543
543
|
x-text="group.label"></div>
|
|
544
544
|
<ul>
|
|
@@ -554,7 +554,7 @@
|
|
|
554
554
|
<span x-text="modelId"></span>
|
|
555
555
|
</div>
|
|
556
556
|
<template x-if="gemini1mSuffix && $store.data.getModelFamily(modelId) === 'gemini'">
|
|
557
|
-
<span class="text-[
|
|
557
|
+
<span class="text-[11px] bg-neon-green/10 text-neon-green px-1.5 py-0.5 rounded border border-neon-green/20 font-medium tracking-tighter">[1M]</span>
|
|
558
558
|
</template>
|
|
559
559
|
</a>
|
|
560
560
|
</li>
|
|
@@ -571,7 +571,7 @@
|
|
|
571
571
|
</div>
|
|
572
572
|
<!-- Sonnet -->
|
|
573
573
|
<div class="form-control" x-data="window.Components.modelDropdown('ANTHROPIC_DEFAULT_SONNET_MODEL', 'sonnetAlias', 'cyan')">
|
|
574
|
-
<label class="label pt-0 pb-1 text-[
|
|
574
|
+
<label class="label pt-0 pb-1 text-[11px] text-gray-500 font-medium"
|
|
575
575
|
x-text="$store.global.t(labelKey)">Sonnet Alias</label>
|
|
576
576
|
<div class="relative w-full">
|
|
577
577
|
<input type="text" :value="open ? searchTerm : currentValue"
|
|
@@ -608,7 +608,7 @@
|
|
|
608
608
|
</li>
|
|
609
609
|
<template x-for="group in groupedModels" :key="group.family">
|
|
610
610
|
<li>
|
|
611
|
-
<div class="text-[
|
|
611
|
+
<div class="text-[11px] font-medium capitalize px-2 pt-2 pb-1 select-none"
|
|
612
612
|
:class="group.family === 'claude' ? 'text-purple-400/70' : (group.family === 'gemini' ? 'text-green-400/70' : 'text-gray-500')"
|
|
613
613
|
x-text="group.label"></div>
|
|
614
614
|
<ul>
|
|
@@ -624,7 +624,7 @@
|
|
|
624
624
|
<span x-text="modelId"></span>
|
|
625
625
|
</div>
|
|
626
626
|
<template x-if="gemini1mSuffix && $store.data.getModelFamily(modelId) === 'gemini'">
|
|
627
|
-
<span class="text-[
|
|
627
|
+
<span class="text-[11px] bg-neon-green/10 text-neon-green px-1.5 py-0.5 rounded border border-neon-green/20 font-medium tracking-tighter">[1M]</span>
|
|
628
628
|
</template>
|
|
629
629
|
</a>
|
|
630
630
|
</li>
|
|
@@ -641,7 +641,7 @@
|
|
|
641
641
|
</div>
|
|
642
642
|
<!-- Haiku -->
|
|
643
643
|
<div class="form-control" x-data="window.Components.modelDropdown('ANTHROPIC_DEFAULT_HAIKU_MODEL', 'haikuAlias', 'cyan')">
|
|
644
|
-
<label class="label pt-0 pb-1 text-[
|
|
644
|
+
<label class="label pt-0 pb-1 text-[11px] text-gray-500 font-medium"
|
|
645
645
|
x-text="$store.global.t(labelKey)">Haiku Alias</label>
|
|
646
646
|
<div class="relative w-full">
|
|
647
647
|
<input type="text" :value="open ? searchTerm : currentValue"
|
|
@@ -678,7 +678,7 @@
|
|
|
678
678
|
</li>
|
|
679
679
|
<template x-for="group in groupedModels" :key="group.family">
|
|
680
680
|
<li>
|
|
681
|
-
<div class="text-[
|
|
681
|
+
<div class="text-[11px] font-medium capitalize px-2 pt-2 pb-1 select-none"
|
|
682
682
|
:class="group.family === 'claude' ? 'text-purple-400/70' : (group.family === 'gemini' ? 'text-green-400/70' : 'text-gray-500')"
|
|
683
683
|
x-text="group.label"></div>
|
|
684
684
|
<ul>
|
|
@@ -694,7 +694,7 @@
|
|
|
694
694
|
<span x-text="modelId"></span>
|
|
695
695
|
</div>
|
|
696
696
|
<template x-if="gemini1mSuffix && $store.data.getModelFamily(modelId) === 'gemini'">
|
|
697
|
-
<span class="text-[
|
|
697
|
+
<span class="text-[11px] bg-neon-green/10 text-neon-green px-1.5 py-0.5 rounded border border-neon-green/20 font-medium tracking-tighter">[1M]</span>
|
|
698
698
|
</template>
|
|
699
699
|
</a>
|
|
700
700
|
</li>
|
|
@@ -746,7 +746,7 @@
|
|
|
746
746
|
<span class="text-[11px] text-gray-500" x-text="$store.global.t('gemini1mDesc')">
|
|
747
747
|
Appends [1m] suffix to Gemini models for 1M context window support.
|
|
748
748
|
</span>
|
|
749
|
-
<span class="text-[
|
|
749
|
+
<span class="text-[11px] text-yellow-500/80" x-text="$store.global.t('gemini1mWarning')">
|
|
750
750
|
⚠ Large context may reduce Gemini performance.
|
|
751
751
|
</span>
|
|
752
752
|
</div>
|
|
@@ -772,7 +772,7 @@
|
|
|
772
772
|
<span x-show="!restoring" x-text="$store.global.t('restoreDefault')">Restore Default</span>
|
|
773
773
|
<span x-show="restoring" class="loading loading-spinner loading-xs"></span>
|
|
774
774
|
</button>
|
|
775
|
-
<button class="btn btn-sm bg-neon-purple hover:bg-
|
|
775
|
+
<button class="btn btn-sm bg-neon-purple hover:bg-[#7fdbe4] border-none text-space-950 px-6 gap-2"
|
|
776
776
|
@click="saveClaudeConfig" :disabled="loading">
|
|
777
777
|
<svg x-show="!loading" class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
778
778
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
@@ -1102,7 +1102,7 @@
|
|
|
1102
1102
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
|
|
1103
1103
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
|
1104
1104
|
</svg>
|
|
1105
|
-
<label class="text-xs
|
|
1105
|
+
<label class="text-xs text-neon-purple font-semibold"
|
|
1106
1106
|
x-text="$store.global.t('serverPresets')">Server Presets</label>
|
|
1107
1107
|
</div>
|
|
1108
1108
|
<button class="btn btn-xs btn-ghost text-neon-purple hover:bg-neon-purple/10 gap-1"
|
|
@@ -1172,7 +1172,7 @@
|
|
|
1172
1172
|
<template x-if="selectedServerPreset && getPresetPreviewSections()">
|
|
1173
1173
|
<div class="mt-2" x-data="{ get preview() { return getPresetPreviewSections() } }">
|
|
1174
1174
|
<div class="flex items-center gap-2">
|
|
1175
|
-
<button class="flex items-center gap-1 text-[
|
|
1175
|
+
<button class="flex items-center gap-1 text-[11px] text-gray-500 hover:text-neon-purple transition-colors"
|
|
1176
1176
|
@click="presetPreviewExpanded = !presetPreviewExpanded">
|
|
1177
1177
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-3 h-3 transition-transform duration-200"
|
|
1178
1178
|
:class="presetPreviewExpanded ? 'rotate-90' : ''" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
@@ -1183,7 +1183,7 @@
|
|
|
1183
1183
|
<!-- Edit Config button -->
|
|
1184
1184
|
<button x-show="presetPreviewExpanded && !isSelectedPresetBuiltIn() && !editingPresetConfig"
|
|
1185
1185
|
@click="enterPresetConfigEdit()"
|
|
1186
|
-
class="text-[
|
|
1186
|
+
class="text-[11px] text-neon-cyan hover:text-neon-cyan/80 transition-colors flex items-center gap-0.5">
|
|
1187
1187
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
1188
1188
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
|
|
1189
1189
|
</svg>
|
|
@@ -1219,7 +1219,7 @@
|
|
|
1219
1219
|
<div x-show="configEditMode === 'ui' || !editingPresetConfig">
|
|
1220
1220
|
<!-- Strategy dropdown (editing) -->
|
|
1221
1221
|
<div class="mb-2" x-show="editingPresetConfig">
|
|
1222
|
-
<label class="text-[
|
|
1222
|
+
<label class="text-[11px] text-gray-600 font-semibold">Strategy</label>
|
|
1223
1223
|
<select class="select select-sm bg-space-800 border-space-border text-white text-xs w-full mt-0.5"
|
|
1224
1224
|
x-model="editingConfigDraft.accountSelection.strategy">
|
|
1225
1225
|
<option value="sticky" x-text="$store.global.t('strategyStickyLabel') || 'Sticky'"></option>
|
|
@@ -1230,7 +1230,7 @@
|
|
|
1230
1230
|
<!-- Sections -->
|
|
1231
1231
|
<template x-for="section in preview.sections" :key="section.label">
|
|
1232
1232
|
<div class="mb-1.5 last:mb-0">
|
|
1233
|
-
<div class="text-[
|
|
1233
|
+
<div class="text-[11px] capitalize text-gray-600 font-semibold mb-0.5" x-text="section.label"></div>
|
|
1234
1234
|
<template x-for="row in section.rows" :key="row.key">
|
|
1235
1235
|
<div class="flex justify-between items-center py-px gap-2">
|
|
1236
1236
|
<span class="text-[11px] text-gray-500 shrink-0" x-text="row.label"></span>
|
|
@@ -1257,7 +1257,7 @@
|
|
|
1257
1257
|
@change="validatePresetConfigField(row.key, $event.target.value)"
|
|
1258
1258
|
@input="editingConfigDraft[row.key] = Number($event.target.value)">
|
|
1259
1259
|
</template>
|
|
1260
|
-
<span x-show="row.suffix" class="text-[
|
|
1260
|
+
<span x-show="row.suffix" class="text-[11px] text-gray-600 w-5" x-text="row.suffix"></span>
|
|
1261
1261
|
</div>
|
|
1262
1262
|
</div>
|
|
1263
1263
|
</template>
|
|
@@ -1268,7 +1268,7 @@
|
|
|
1268
1268
|
<div x-show="editingPresetConfig && configEditMode === 'json'">
|
|
1269
1269
|
<textarea class="textarea w-full font-mono text-[11px] bg-space-800 border-space-border text-white leading-relaxed"
|
|
1270
1270
|
rows="22" x-model="editingJsonText" @input="validateJsonText()"></textarea>
|
|
1271
|
-
<p x-show="jsonParseError" class="text-[
|
|
1271
|
+
<p x-show="jsonParseError" class="text-[11px] text-red-400 mt-1" x-text="jsonParseError"></p>
|
|
1272
1272
|
</div>
|
|
1273
1273
|
<!-- Save/Cancel buttons -->
|
|
1274
1274
|
<div x-show="editingPresetConfig" class="flex justify-end gap-2 mt-2 pt-2 border-t border-space-border/20">
|
|
@@ -1286,7 +1286,7 @@
|
|
|
1286
1286
|
</div>
|
|
1287
1287
|
</div>
|
|
1288
1288
|
</template>
|
|
1289
|
-
<p class="text-[
|
|
1289
|
+
<p class="text-[11px] text-gray-600 mt-2"
|
|
1290
1290
|
x-text="$store.global.t('serverPresetsHint')">
|
|
1291
1291
|
Select a preset and click the download icon to apply it. Built-in presets (🔒) cannot be deleted.
|
|
1292
1292
|
</p>
|
|
@@ -1314,7 +1314,7 @@
|
|
|
1314
1314
|
<form method="dialog">
|
|
1315
1315
|
<button class="btn btn-sm btn-ghost" x-text="$store.global.t('cancel')">Cancel</button>
|
|
1316
1316
|
</form>
|
|
1317
|
-
<button class="btn btn-sm bg-neon-purple text-
|
|
1317
|
+
<button class="btn btn-sm bg-neon-purple text-space-950 border-none hover:bg-[#7fdbe4]"
|
|
1318
1318
|
@click="editingPresetMode ? executeEditServerPreset() : executeSaveServerPreset(newServerPresetName)"
|
|
1319
1319
|
:disabled="!newServerPresetName.trim() || savingServerPreset">
|
|
1320
1320
|
<span x-show="!savingServerPreset" x-text="editingPresetMode ? ($store.global.t('saveChanges') || 'Save Changes') : $store.global.t('savePreset')">Save Preset</span>
|
|
@@ -1330,7 +1330,7 @@
|
|
|
1330
1330
|
<!-- ⚡ Common Settings -->
|
|
1331
1331
|
<div class="space-y-3">
|
|
1332
1332
|
<div class="flex items-center gap-2 mb-1 px-1">
|
|
1333
|
-
<span class="text-[
|
|
1333
|
+
<span class="text-[11px] text-gray-500 font-medium"
|
|
1334
1334
|
x-text="$store.global.t('runtimeConfig')">Common Settings</span>
|
|
1335
1335
|
<div class="h-px flex-1 bg-space-border/30"></div>
|
|
1336
1336
|
</div>
|
|
@@ -1530,7 +1530,7 @@
|
|
|
1530
1530
|
<!-- 🔀 Account Selection Strategy -->
|
|
1531
1531
|
<div class="space-y-3">
|
|
1532
1532
|
<div class="flex items-center gap-2 mb-1 px-1">
|
|
1533
|
-
<span class="text-[
|
|
1533
|
+
<span class="text-[11px] text-gray-500 font-medium"
|
|
1534
1534
|
x-text="$store.global.t('accountSelectionStrategy')">Account Selection Strategy</span>
|
|
1535
1535
|
<div class="h-px flex-1 bg-space-border/30"></div>
|
|
1536
1536
|
</div>
|
|
@@ -1573,7 +1573,7 @@
|
|
|
1573
1573
|
<div>
|
|
1574
1574
|
<span class="text-sm font-semibold text-gray-200"
|
|
1575
1575
|
x-text="$store.global.t('advancedSettings')">Advanced Settings</span>
|
|
1576
|
-
<span class="text-[
|
|
1576
|
+
<span class="text-[11px] text-gray-600 block"
|
|
1577
1577
|
x-text="$store.global.t('serverReadOnly')">Settings managed via config.json</span>
|
|
1578
1578
|
</div>
|
|
1579
1579
|
</div>
|
|
@@ -1591,7 +1591,7 @@
|
|
|
1591
1591
|
<!-- Network Retry Settings -->
|
|
1592
1592
|
<div class="space-y-4">
|
|
1593
1593
|
<div class="flex items-center gap-2 mb-2">
|
|
1594
|
-
<span class="text-[
|
|
1594
|
+
<span class="text-[11px] text-gray-500 font-medium"
|
|
1595
1595
|
x-text="$store.global.t('networkRetry')">Network Retry Settings</span>
|
|
1596
1596
|
</div>
|
|
1597
1597
|
|
|
@@ -1663,7 +1663,7 @@
|
|
|
1663
1663
|
<!-- Account Rate Limiting -->
|
|
1664
1664
|
<div class="space-y-4 pt-2 border-t border-space-border/10">
|
|
1665
1665
|
<div class="flex items-center gap-2 mb-2">
|
|
1666
|
-
<span class="text-[
|
|
1666
|
+
<span class="text-[11px] text-gray-500 font-medium"
|
|
1667
1667
|
x-text="$store.global.t('rateLimiting')">Rate Limiting & Timeouts</span>
|
|
1668
1668
|
</div>
|
|
1669
1669
|
|
|
@@ -1687,7 +1687,7 @@
|
|
|
1687
1687
|
@change="toggleDefaultCooldownMs($event.target.value)"
|
|
1688
1688
|
aria-label="Default cooldown value">
|
|
1689
1689
|
</div>
|
|
1690
|
-
<p class="text-[
|
|
1690
|
+
<p class="text-[10px] text-gray-600 mt-1 leading-tight"
|
|
1691
1691
|
x-text="$store.global.t('defaultCooldownDesc')">Fallback cooldown when API doesn't
|
|
1692
1692
|
provide a reset time.</p>
|
|
1693
1693
|
</div>
|
|
@@ -1712,7 +1712,7 @@
|
|
|
1712
1712
|
@change="toggleMaxWaitBeforeErrorMs($event.target.value)"
|
|
1713
1713
|
aria-label="Max wait before error value">
|
|
1714
1714
|
</div>
|
|
1715
|
-
<p class="text-[
|
|
1715
|
+
<p class="text-[10px] text-gray-600 mt-1 leading-tight"
|
|
1716
1716
|
x-text="$store.global.t('maxWaitDesc')">If all accounts are rate-limited longer than
|
|
1717
1717
|
this, error immediately.</p>
|
|
1718
1718
|
</div>
|
|
@@ -1721,7 +1721,7 @@
|
|
|
1721
1721
|
<!-- Quota Protection -->
|
|
1722
1722
|
<div class="space-y-4 pt-2 border-t border-space-border/10">
|
|
1723
1723
|
<div class="flex items-center gap-2 mb-2">
|
|
1724
|
-
<span class="text-[
|
|
1724
|
+
<span class="text-[11px] text-gray-500 font-medium"
|
|
1725
1725
|
x-text="$store.global.t('quotaProtection')">Quota Protection</span>
|
|
1726
1726
|
</div>
|
|
1727
1727
|
|
|
@@ -1745,7 +1745,7 @@
|
|
|
1745
1745
|
@change="toggleGlobalQuotaThreshold($event.target.value)"
|
|
1746
1746
|
aria-label="Minimum quota level value">
|
|
1747
1747
|
</div>
|
|
1748
|
-
<p class="text-[
|
|
1748
|
+
<p class="text-[10px] text-gray-600 mt-1 leading-tight"
|
|
1749
1749
|
x-text="$store.global.t('minimumQuotaLevelDesc')">Switch accounts when quota drops below this level. Per-account overrides take priority.</p>
|
|
1750
1750
|
</div>
|
|
1751
1751
|
</div>
|
|
@@ -1753,8 +1753,8 @@
|
|
|
1753
1753
|
<!-- Request Throttling -->
|
|
1754
1754
|
<div class="space-y-4 pt-2 border-t border-space-border/10">
|
|
1755
1755
|
<div class="flex items-center gap-2 mb-2">
|
|
1756
|
-
<span class="text-[
|
|
1757
|
-
<span class="px-1.5 py-0.5 text-[
|
|
1756
|
+
<span class="text-[11px] text-gray-500 font-medium">Request Throttling</span>
|
|
1757
|
+
<span class="px-1.5 py-0.5 text-[10px] font-semibold rounded bg-amber-500/20 text-amber-400 border border-amber-500/40">Experimental</span>
|
|
1758
1758
|
</div>
|
|
1759
1759
|
|
|
1760
1760
|
<!-- Request Throttling Card -->
|
|
@@ -1801,7 +1801,7 @@
|
|
|
1801
1801
|
@change="toggleRequestDelayMs($event.target.value)"
|
|
1802
1802
|
aria-label="Request delay value">
|
|
1803
1803
|
</div>
|
|
1804
|
-
<p class="text-[
|
|
1804
|
+
<p class="text-[10px] text-amber-100/40 mt-2 leading-tight">
|
|
1805
1805
|
Milliseconds to wait before each API call (token refresh, quota check, messages, etc).</p>
|
|
1806
1806
|
</div>
|
|
1807
1807
|
</div>
|
|
@@ -1811,7 +1811,7 @@
|
|
|
1811
1811
|
<!-- Error Handling Tuning -->
|
|
1812
1812
|
<div class="space-y-4 pt-2 border-t border-space-border/10">
|
|
1813
1813
|
<div class="flex items-center gap-2 mb-2">
|
|
1814
|
-
<span class="text-[
|
|
1814
|
+
<span class="text-[11px] text-gray-500 font-medium"
|
|
1815
1815
|
x-text="$store.global.t('errorHandlingTuning')">Error Handling Tuning</span>
|
|
1816
1816
|
</div>
|
|
1817
1817
|
|
|
@@ -1835,7 +1835,7 @@
|
|
|
1835
1835
|
@change="toggleRateLimitDedupWindowMs($event.target.value)"
|
|
1836
1836
|
aria-label="Rate limit dedup window value">
|
|
1837
1837
|
</div>
|
|
1838
|
-
<p class="text-[
|
|
1838
|
+
<p class="text-[10px] text-gray-600 mt-1 leading-tight"
|
|
1839
1839
|
x-text="$store.global.t('rateLimitDedupWindowDesc')">Prevents concurrent retry
|
|
1840
1840
|
storms.</p>
|
|
1841
1841
|
</div>
|
|
@@ -1861,7 +1861,7 @@
|
|
|
1861
1861
|
@change="toggleMaxConsecutiveFailures($event.target.value)"
|
|
1862
1862
|
aria-label="Max consecutive failures value">
|
|
1863
1863
|
</div>
|
|
1864
|
-
<p class="text-[
|
|
1864
|
+
<p class="text-[10px] text-gray-600 mt-1 leading-tight"
|
|
1865
1865
|
x-text="$store.global.t('maxConsecutiveFailuresDesc')">Failures before extended
|
|
1866
1866
|
cooldown.</p>
|
|
1867
1867
|
</div>
|
|
@@ -1886,7 +1886,7 @@
|
|
|
1886
1886
|
@change="toggleExtendedCooldownMs($event.target.value)"
|
|
1887
1887
|
aria-label="Extended cooldown value">
|
|
1888
1888
|
</div>
|
|
1889
|
-
<p class="text-[
|
|
1889
|
+
<p class="text-[10px] text-gray-600 mt-1 leading-tight"
|
|
1890
1890
|
x-text="$store.global.t('extendedCooldownDesc')">Applied after max consecutive
|
|
1891
1891
|
failures.</p>
|
|
1892
1892
|
</div>
|
|
@@ -1911,7 +1911,7 @@
|
|
|
1911
1911
|
@change="toggleMaxCapacityRetries($event.target.value)"
|
|
1912
1912
|
aria-label="Max capacity retries value">
|
|
1913
1913
|
</div>
|
|
1914
|
-
<p class="text-[
|
|
1914
|
+
<p class="text-[10px] text-gray-600 mt-1 leading-tight"
|
|
1915
1915
|
x-text="$store.global.t('maxCapacityRetriesDesc')">Retries before switching
|
|
1916
1916
|
accounts.</p>
|
|
1917
1917
|
</div>
|
|
@@ -1976,7 +1976,7 @@
|
|
|
1976
1976
|
<div class="flex justify-end gap-2 mt-6">
|
|
1977
1977
|
<button class="btn btn-sm btn-ghost text-gray-400" @click="hidePasswordDialog()"
|
|
1978
1978
|
x-text="$store.global.t('cancel')">Cancel</button>
|
|
1979
|
-
<button class="btn btn-sm bg-neon-purple hover:bg-
|
|
1979
|
+
<button class="btn btn-sm bg-neon-purple hover:bg-[#7fdbe4] border-none text-space-950"
|
|
1980
1980
|
@click="changePassword()" x-text="$store.global.t('changePassword')">
|
|
1981
1981
|
Change Password
|
|
1982
1982
|
</button>
|
|
@@ -328,10 +328,6 @@ export class AccountManager {
|
|
|
328
328
|
return getLimitInfo(this.#accounts, email, modelId);
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
// ============================================================================
|
|
332
|
-
// Cooldown Methods (matches opencode-antigravity-auth)
|
|
333
|
-
// ============================================================================
|
|
334
|
-
|
|
335
331
|
/**
|
|
336
332
|
* Mark an account as cooling down for a specified duration
|
|
337
333
|
* Used for temporary backoff separate from rate limits
|
|
@@ -309,11 +309,6 @@ export function incrementConsecutiveFailures(accounts, email) {
|
|
|
309
309
|
return account.consecutiveFailures;
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
-
// ============================================================================
|
|
313
|
-
// Cooldown Mechanism (matches opencode-antigravity-auth)
|
|
314
|
-
// Separate from rate limits - used for temporary backoff after failures
|
|
315
|
-
// ============================================================================
|
|
316
|
-
|
|
317
312
|
/**
|
|
318
313
|
* Cooldown reasons for debugging/logging
|
|
319
314
|
*/
|
|
@@ -36,7 +36,7 @@ export class BaseStrategy {
|
|
|
36
36
|
* @param {Function} [options.onSave] - Callback to save changes
|
|
37
37
|
* @returns {SelectionResult} The selected account and index
|
|
38
38
|
*/
|
|
39
|
-
selectAccount(
|
|
39
|
+
selectAccount(_accounts, _modelId, _options = {}) {
|
|
40
40
|
throw new Error('selectAccount must be implemented by subclass');
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -45,7 +45,7 @@ export class BaseStrategy {
|
|
|
45
45
|
* @param {Object} account - The account that was used
|
|
46
46
|
* @param {string} modelId - The model ID that was used
|
|
47
47
|
*/
|
|
48
|
-
onSuccess(
|
|
48
|
+
onSuccess(_account, _modelId) {
|
|
49
49
|
// Default: no-op, override in subclass if needed
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -54,7 +54,7 @@ export class BaseStrategy {
|
|
|
54
54
|
* @param {Object} account - The account that was rate-limited
|
|
55
55
|
* @param {string} modelId - The model ID that was rate-limited
|
|
56
56
|
*/
|
|
57
|
-
onRateLimit(
|
|
57
|
+
onRateLimit(_account, _modelId) {
|
|
58
58
|
// Default: no-op, override in subclass if needed
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -63,7 +63,7 @@ export class BaseStrategy {
|
|
|
63
63
|
* @param {Object} account - The account that failed
|
|
64
64
|
* @param {string} modelId - The model ID that failed
|
|
65
65
|
*/
|
|
66
|
-
onFailure(
|
|
66
|
+
onFailure(_account, _modelId) {
|
|
67
67
|
// Default: no-op, override in subclass if needed
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -117,7 +117,7 @@ export class HybridStrategy extends BaseStrategy {
|
|
|
117
117
|
/**
|
|
118
118
|
* Called after a successful request
|
|
119
119
|
*/
|
|
120
|
-
onSuccess(account,
|
|
120
|
+
onSuccess(account, _modelId) {
|
|
121
121
|
if (account && account.email) {
|
|
122
122
|
this.#healthTracker.recordSuccess(account.email);
|
|
123
123
|
}
|
|
@@ -126,7 +126,7 @@ export class HybridStrategy extends BaseStrategy {
|
|
|
126
126
|
/**
|
|
127
127
|
* Called when a request is rate-limited
|
|
128
128
|
*/
|
|
129
|
-
onRateLimit(account,
|
|
129
|
+
onRateLimit(account, _modelId) {
|
|
130
130
|
if (account && account.email) {
|
|
131
131
|
this.#healthTracker.recordRateLimit(account.email);
|
|
132
132
|
}
|
|
@@ -135,7 +135,7 @@ export class HybridStrategy extends BaseStrategy {
|
|
|
135
135
|
/**
|
|
136
136
|
* Called when a request fails
|
|
137
137
|
*/
|
|
138
|
-
onFailure(account,
|
|
138
|
+
onFailure(account, _modelId) {
|
|
139
139
|
if (account && account.email) {
|
|
140
140
|
this.#healthTracker.recordFailure(account.email);
|
|
141
141
|
// Refund the token since the request didn't complete
|
package/src/auth/database.js
CHANGED
|
@@ -55,6 +55,7 @@ function loadDatabaseModule() {
|
|
|
55
55
|
return Database;
|
|
56
56
|
} catch (retryError) {
|
|
57
57
|
// Rebuild succeeded but reload failed - user needs to restart
|
|
58
|
+
logger.debug(`[Database] Reload after rebuild failed: ${retryError.message}`);
|
|
58
59
|
moduleLoadError = new NativeModuleError(
|
|
59
60
|
'Native module rebuild completed. Please restart the server to apply the fix.',
|
|
60
61
|
true, // rebuildSucceeded
|