dsh-codex-subscription 3.2.27 → 3.2.29
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.de.md +4 -4
- package/README.en.md +4 -4
- package/README.es.md +4 -4
- package/README.fr.md +4 -4
- package/README.ja.md +4 -4
- package/README.md +4 -4
- package/README.pt.md +4 -4
- package/README.ru.md +4 -4
- package/README.zh-CN.md +4 -4
- package/compatibility.json +2 -1
- package/lib/client.js +238 -13
- package/lib/index.js +704 -23
- package/package.json +19 -19
package/lib/client.js
CHANGED
|
@@ -3001,6 +3001,17 @@ window.__ModuleLoader__.load({
|
|
|
3001
3001
|
searchLegacyCost: "搜索不另收费,仅按 DeepSeek 模型 Token 计费。",
|
|
3002
3002
|
searchApiCost: "每 1,000 次成功搜索 5 元。",
|
|
3003
3003
|
fetchUnavailableHint: "当前 DSH 不支持切换到 Codex 网页读取,请先升级宿主。",
|
|
3004
|
+
"quotaResetOutlookLasts": "预计够用",
|
|
3005
|
+
"quotaResetOutlookUncertain": "暂难判断",
|
|
3006
|
+
"quotaResetOutlookIfExhausted": "若用完:{when}左右",
|
|
3007
|
+
"quotaResetOutlookExpectedWhen": "预计{when}用完",
|
|
3008
|
+
"quotaResetOutlookLastsSure": "预计有余",
|
|
3009
|
+
"quotaOutlookPart": "{day}{part}",
|
|
3010
|
+
"quotaOutlookEarly": "{day}凌晨",
|
|
3011
|
+
"quotaOutlookRange": "{from}至{to}",
|
|
3012
|
+
"quotaResetOutlookBudget": "目前每天约用 {used}\n剩余天数每天可用约 {budget}",
|
|
3013
|
+
"quotaForecastIdleFor": "最近{duration},显示的剩余额度没有变化",
|
|
3014
|
+
"quotaPopoverResetAt": "重置:{value}",
|
|
3004
3015
|
quotaForecastCalibrating: "续航正在校准",
|
|
3005
3016
|
quotaForecastIdle: "近期剩余额度百分比未变化",
|
|
3006
3017
|
quotaForecastUntilReset: "按最近用量,预计可用到重置",
|
|
@@ -3964,6 +3975,17 @@ window.__ModuleLoader__.load({
|
|
|
3964
3975
|
searchLegacyCost: "No separate search fee. DeepSeek model tokens are billed.",
|
|
3965
3976
|
searchApiCost: "CNY 5 per 1,000 successful searches.",
|
|
3966
3977
|
fetchUnavailableHint: "This DSH version cannot switch to the Codex webpage reader. Update DSH first.",
|
|
3978
|
+
"quotaResetOutlookLasts": "Likely to last",
|
|
3979
|
+
"quotaResetOutlookUncertain": "Too early to tell",
|
|
3980
|
+
"quotaResetOutlookIfExhausted": "If it runs out: {when}",
|
|
3981
|
+
"quotaResetOutlookExpectedWhen": "Likely to run out: {when}",
|
|
3982
|
+
"quotaResetOutlookLastsSure": "Should last comfortably",
|
|
3983
|
+
"quotaOutlookPart": "{day} {part}",
|
|
3984
|
+
"quotaOutlookEarly": "early {day} morning",
|
|
3985
|
+
"quotaOutlookRange": "{from} to {to}",
|
|
3986
|
+
"quotaResetOutlookBudget": "You’ve used about {used} a day\nYou have about {budget} a day left",
|
|
3987
|
+
"quotaForecastIdleFor": "No change in the displayed balance for {duration}",
|
|
3988
|
+
"quotaPopoverResetAt": "Resets: {value}",
|
|
3967
3989
|
quotaForecastCalibrating: "Runway calibrating",
|
|
3968
3990
|
quotaForecastIdle: "No recent change in the reported percentage",
|
|
3969
3991
|
quotaForecastUntilReset: "Estimated to last until reset at recent usage",
|
|
@@ -4923,6 +4945,17 @@ window.__ModuleLoader__.load({
|
|
|
4923
4945
|
"fetchCodexHint": "Codex サブスクリプションを使って、アクセス可能なウェブページのテキストを読み取ります。失敗時はそのまま通知され、DeepSeek API にはフォールバックしません。",
|
|
4924
4946
|
"fetchUnavailableHint": "このバージョンの DSH では Codex のウェブページリーダーに切り替えられません。先に DSH を更新してください。",
|
|
4925
4947
|
"quotaForecastCalibrating": "残り時間を予測中",
|
|
4948
|
+
"quotaResetOutlookLasts": "足りる見込み",
|
|
4949
|
+
"quotaResetOutlookUncertain": "まだ判断できません",
|
|
4950
|
+
"quotaResetOutlookIfExhausted": "使い切るなら{when}ごろ",
|
|
4951
|
+
"quotaResetOutlookExpectedWhen": "{when}ごろに使い切る見込み",
|
|
4952
|
+
"quotaResetOutlookLastsSure": "余裕がある見込み",
|
|
4953
|
+
"quotaOutlookPart": "{day}の{part}",
|
|
4954
|
+
"quotaOutlookEarly": "{day}の早朝",
|
|
4955
|
+
"quotaOutlookRange": "{from}~{to}",
|
|
4956
|
+
"quotaResetOutlookBudget": "これまでの消費は1日約{used}\n残りの日数で使えるのは1日約{budget}",
|
|
4957
|
+
"quotaForecastIdleFor": "この{duration}、残量表示に変化なし",
|
|
4958
|
+
"quotaPopoverResetAt": "リセット:{value}",
|
|
4926
4959
|
"quotaForecastIdle": "直近の残量表示に変化なし",
|
|
4927
4960
|
"quotaForecastUntilReset": "最近の利用ペースなら、リセットまで持つ見込みです",
|
|
4928
4961
|
"runwayDaysHours": "{days}日 {hours}時間",
|
|
@@ -5891,6 +5924,17 @@ window.__ModuleLoader__.load({
|
|
|
5891
5924
|
"fetchCodexHint": "Lee el texto accesible de las páginas web con tu suscripción a Codex. Los errores se indican directamente, sin recurrir a la API de DeepSeek.",
|
|
5892
5925
|
"fetchUnavailableHint": "Esta versión de DSH no permite cambiar al lector de páginas web de Codex. Actualiza DSH primero.",
|
|
5893
5926
|
"quotaForecastCalibrating": "Calibrando autonomía",
|
|
5927
|
+
"quotaResetOutlookLasts": "Debería alcanzar",
|
|
5928
|
+
"quotaResetOutlookUncertain": "Aún sin estimación",
|
|
5929
|
+
"quotaResetOutlookIfExhausted": "Si se agota: {when}",
|
|
5930
|
+
"quotaResetOutlookExpectedWhen": "Fin previsto: {when}",
|
|
5931
|
+
"quotaResetOutlookLastsSure": "Debería sobrar",
|
|
5932
|
+
"quotaOutlookPart": "{day} {part}",
|
|
5933
|
+
"quotaOutlookEarly": "{day} de madrugada",
|
|
5934
|
+
"quotaOutlookRange": "{from} a {to}",
|
|
5935
|
+
"quotaResetOutlookBudget": "Has usado cerca del {used} al día\nTe queda cerca del {budget} por día",
|
|
5936
|
+
"quotaForecastIdleFor": "El saldo mostrado lleva {duration} sin cambiar",
|
|
5937
|
+
"quotaPopoverResetAt": "Reinicio: {value}",
|
|
5894
5938
|
"quotaForecastIdle": "Sin cambios recientes en el porcentaje",
|
|
5895
5939
|
"quotaForecastUntilReset": "Según el uso reciente, se estima que durará hasta el restablecimiento",
|
|
5896
5940
|
"runwayDaysHours": "{days} d {hours} h",
|
|
@@ -6854,6 +6898,17 @@ window.__ModuleLoader__.load({
|
|
|
6854
6898
|
"fetchCodexHint": "Lire le texte accessible des pages Web avec votre abonnement Codex. Les échecs sont signalés directement, sans recours à l’API DeepSeek.",
|
|
6855
6899
|
"fetchUnavailableHint": "Cette version de DSH ne permet pas de passer au lecteur de pages Web Codex. Mettez d’abord DSH à jour.",
|
|
6856
6900
|
"quotaForecastCalibrating": "Estimation de l’autonomie en cours",
|
|
6901
|
+
"quotaResetOutlookLasts": "Devrait suffire",
|
|
6902
|
+
"quotaResetOutlookUncertain": "Encore incertain",
|
|
6903
|
+
"quotaResetOutlookIfExhausted": "Si épuisé : {when}",
|
|
6904
|
+
"quotaResetOutlookExpectedWhen": "Épuisement prévu : {when}",
|
|
6905
|
+
"quotaResetOutlookLastsSure": "Marge confortable",
|
|
6906
|
+
"quotaOutlookPart": "{day} {part}",
|
|
6907
|
+
"quotaOutlookEarly": "{day} tôt le matin",
|
|
6908
|
+
"quotaOutlookRange": "{from} à {to}",
|
|
6909
|
+
"quotaResetOutlookBudget": "Vous avez utilisé environ {used} par jour\nIl vous reste environ {budget} par jour",
|
|
6910
|
+
"quotaForecastIdleFor": "Solde affiché inchangé depuis {duration}",
|
|
6911
|
+
"quotaPopoverResetAt": "Réinitialisation : {value}",
|
|
6857
6912
|
"quotaForecastIdle": "Aucune variation récente du pourcentage",
|
|
6858
6913
|
"quotaForecastUntilReset": "Au rythme récent, le quota devrait suffire jusqu’à sa réinitialisation",
|
|
6859
6914
|
"runwayDaysHours": "{days} j {hours} h",
|
|
@@ -7817,6 +7872,17 @@ window.__ModuleLoader__.load({
|
|
|
7817
7872
|
"fetchCodexHint": "Liest zugängliche Webseitentexte mit deinem Codex-Abo. Fehler werden direkt gemeldet; es gibt keinen Rückgriff auf die DeepSeek-API.",
|
|
7818
7873
|
"fetchUnavailableHint": "Diese DSH-Version kann nicht zum Codex-Webseitenleser wechseln. Aktualisiere zuerst DSH.",
|
|
7819
7874
|
"quotaForecastCalibrating": "Restlaufzeit wird kalibriert",
|
|
7875
|
+
"quotaResetOutlookLasts": "Reicht wohl aus",
|
|
7876
|
+
"quotaResetOutlookUncertain": "Noch unklar",
|
|
7877
|
+
"quotaResetOutlookIfExhausted": "Falls aufgebraucht: {when}",
|
|
7878
|
+
"quotaResetOutlookExpectedWhen": "Wohl aufgebraucht: {when}",
|
|
7879
|
+
"quotaResetOutlookLastsSure": "Reicht gut aus",
|
|
7880
|
+
"quotaOutlookPart": "{day} {part}",
|
|
7881
|
+
"quotaOutlookEarly": "{day} frühmorgens",
|
|
7882
|
+
"quotaOutlookRange": "{from} bis {to}",
|
|
7883
|
+
"quotaResetOutlookBudget": "Bisher etwa {used} pro Tag verbraucht\nFür die restlichen Tage bleiben etwa {budget} pro Tag",
|
|
7884
|
+
"quotaForecastIdleFor": "Seit {duration} keine Änderung beim angezeigten Rest",
|
|
7885
|
+
"quotaPopoverResetAt": "Zurücksetzung: {value}",
|
|
7820
7886
|
"quotaForecastIdle": "Zuletzt keine Änderung der angezeigten Quote",
|
|
7821
7887
|
"quotaForecastUntilReset": "Reicht bei jüngster Nutzung voraussichtlich bis zur Zurücksetzung",
|
|
7822
7888
|
"runwayDaysHours": "{days} Tg. {hours} Std.",
|
|
@@ -8780,6 +8846,17 @@ window.__ModuleLoader__.load({
|
|
|
8780
8846
|
"fetchCodexHint": "Читать доступный текст веб-страниц с подпиской Codex. Об ошибках сообщается напрямую, без перехода на API DeepSeek.",
|
|
8781
8847
|
"fetchUnavailableHint": "Эта версия DSH не поддерживает переключение на средство чтения веб-страниц Codex. Сначала обновите DSH.",
|
|
8782
8848
|
"quotaForecastCalibrating": "Прогноз остатка калибруется",
|
|
8849
|
+
"quotaResetOutlookLasts": "Должно хватить",
|
|
8850
|
+
"quotaResetOutlookUncertain": "Пока неясно",
|
|
8851
|
+
"quotaResetOutlookIfExhausted": "Если закончится: {when}",
|
|
8852
|
+
"quotaResetOutlookExpectedWhen": "Ожидаемый срок: {when}",
|
|
8853
|
+
"quotaResetOutlookLastsSure": "Хватит с запасом",
|
|
8854
|
+
"quotaOutlookPart": "{day} {part}",
|
|
8855
|
+
"quotaOutlookEarly": "{day} рано утром",
|
|
8856
|
+
"quotaOutlookRange": "{from} — {to}",
|
|
8857
|
+
"quotaResetOutlookBudget": "В среднем уходит около {used} в день\nНа оставшиеся дни есть примерно по {budget} в день",
|
|
8858
|
+
"quotaForecastIdleFor": "Отображаемый остаток не меняется уже {duration}",
|
|
8859
|
+
"quotaPopoverResetAt": "Сброс: {value}",
|
|
8783
8860
|
"quotaForecastIdle": "Процент остатка недавно не менялся",
|
|
8784
8861
|
"quotaForecastUntilReset": "При недавнем темпе лимита должно хватить до сброса",
|
|
8785
8862
|
"runwayDaysHours": "{days} д {hours} ч",
|
|
@@ -9743,6 +9820,17 @@ window.__ModuleLoader__.load({
|
|
|
9743
9820
|
"fetchCodexHint": "Ler o texto acessível das páginas da web usando sua assinatura do Codex. Falhas são informadas diretamente, sem recorrer à API do DeepSeek.",
|
|
9744
9821
|
"fetchUnavailableHint": "Esta versão do DSH não permite usar o leitor de páginas do Codex. Atualize o DSH primeiro.",
|
|
9745
9822
|
"quotaForecastCalibrating": "Previsão em calibração",
|
|
9823
|
+
"quotaResetOutlookLasts": "Deve durar",
|
|
9824
|
+
"quotaResetOutlookUncertain": "Ainda incerto",
|
|
9825
|
+
"quotaResetOutlookIfExhausted": "Se acabar: {when}",
|
|
9826
|
+
"quotaResetOutlookExpectedWhen": "Fim previsto: {when}",
|
|
9827
|
+
"quotaResetOutlookLastsSure": "Deve sobrar",
|
|
9828
|
+
"quotaOutlookPart": "{day} {part}",
|
|
9829
|
+
"quotaOutlookEarly": "{day} de madrugada",
|
|
9830
|
+
"quotaOutlookRange": "{from} até {to}",
|
|
9831
|
+
"quotaResetOutlookBudget": "Você usou cerca de {used} por dia\nRestam cerca de {budget} por dia",
|
|
9832
|
+
"quotaForecastIdleFor": "Saldo exibido sem mudança há {duration}",
|
|
9833
|
+
"quotaPopoverResetAt": "Redefinição: {value}",
|
|
9746
9834
|
"quotaForecastIdle": "Sem alteração recente no percentual",
|
|
9747
9835
|
"quotaForecastUntilReset": "Previsão de duração até a redefinição, com base no uso recente",
|
|
9748
9836
|
"runwayDaysHours": "{days}d {hours}h",
|
|
@@ -10293,6 +10381,9 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
|
|
|
10293
10381
|
.codexSubscriptionNotices button{margin-left:6px;border:0;background:transparent;padding:0;font:inherit;color:var(--dsw-alias-label-primary);text-decoration:underline;cursor:pointer}
|
|
10294
10382
|
.codexSubscriptionPace{margin:0;font-size:12px;line-height:18px;color:var(--dsw-alias-state-warning-primary,#b45309)}
|
|
10295
10383
|
.codexSubscriptionForecast{margin:0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}
|
|
10384
|
+
.codexSubscriptionForecast p{margin:0}
|
|
10385
|
+
.codexQuotaDetail p,.codexSubscriptionForecast p{white-space:pre-line}
|
|
10386
|
+
.codexQuotaDetail p.codexQuotaOutlook,.codexSubscriptionForecast .codexQuotaOutlook{color:var(--dsw-alias-label-secondary)}
|
|
10296
10387
|
.codexSubscriptionLimit[data-pace=true] progress{accent-color:var(--dsw-alias-state-warning-primary,#f5a300)}
|
|
10297
10388
|
.codexSubscriptionLimit[data-pace=true] progress::-webkit-progress-value{background:var(--dsw-alias-state-warning-primary,#f5a300)}
|
|
10298
10389
|
.codexSubscriptionLimit[data-pace=true] progress::-moz-progress-bar{background:var(--dsw-alias-state-warning-primary,#f5a300)}
|
|
@@ -11736,8 +11827,67 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
|
|
|
11736
11827
|
function quotaReadingIsStale({ fetchedAt, now = Date.now(), resetsAt, refreshError = false }) {
|
|
11737
11828
|
return refreshError || Number.isFinite(fetchedAt) && (fetchedAt > now || now - fetchedAt > 5 * 6e4) || Number.isFinite(resetsAt) && resetsAt * 1e3 <= now;
|
|
11738
11829
|
}
|
|
11830
|
+
const DISPLAY_RISK_BANDS = {
|
|
11831
|
+
low: [0, .15],
|
|
11832
|
+
possible: [.15, .5],
|
|
11833
|
+
likely: [.5, .8],
|
|
11834
|
+
"very-likely": [.8, 1]
|
|
11835
|
+
};
|
|
11836
|
+
const HOUR_MS = 36e5;
|
|
11837
|
+
function riskView(forecast, { windowSeconds } = {}) {
|
|
11838
|
+
const outlook = forecast?.exhaustion, level = forecast?.risk?.shown;
|
|
11839
|
+
if (outlook === void 0 || outlook.status === "exhausted") return void 0;
|
|
11840
|
+
if (outlook.status !== "ready" || level === void 0 || level === "hold") return {
|
|
11841
|
+
level: "hold",
|
|
11842
|
+
reason: outlook.reason ?? "early-cycle"
|
|
11843
|
+
};
|
|
11844
|
+
const [floor, ceiling] = DISPLAY_RISK_BANDS[level];
|
|
11845
|
+
const probability = Math.min(ceiling, Math.max(floor, Math.round(outlook.probability * 20) / 20));
|
|
11846
|
+
const view = {
|
|
11847
|
+
level,
|
|
11848
|
+
runOutProbability: probability,
|
|
11849
|
+
lastsProbability: 1 - probability,
|
|
11850
|
+
extreme: level === "low" && outlook.probability < .05 || level === "very-likely" && outlook.probability > .95,
|
|
11851
|
+
uncertain: outlook.probabilityHigh - outlook.probabilityLow > .25 || outlook.misfit === true,
|
|
11852
|
+
runOutBy: outlook.runOutCurve
|
|
11853
|
+
};
|
|
11854
|
+
if (outlook.horizonHours >= 24 && outlook.elapsedHours > 0) {
|
|
11855
|
+
view.dailyUsed = outlook.usedPercent / outlook.elapsedHours * 24;
|
|
11856
|
+
view.dailyBudget = outlook.needPacePerHour * 24;
|
|
11857
|
+
}
|
|
11858
|
+
const range = outlook.runOutAt;
|
|
11859
|
+
if (range && !view.uncertain && level !== "low") {
|
|
11860
|
+
const width = range.q90 - range.q10;
|
|
11861
|
+
const limit = Math.max(12 * HOUR_MS, .3 * (windowSeconds ?? 604800) * 1e3);
|
|
11862
|
+
if (width <= 24 * HOUR_MS) view.ifRunsOut = {
|
|
11863
|
+
grain: "part",
|
|
11864
|
+
earliest: range.q50,
|
|
11865
|
+
latest: range.q50
|
|
11866
|
+
};
|
|
11867
|
+
else if (width <= limit) view.ifRunsOut = {
|
|
11868
|
+
grain: "part",
|
|
11869
|
+
earliest: range.q10,
|
|
11870
|
+
latest: range.q90
|
|
11871
|
+
};
|
|
11872
|
+
else view.ifRunsOut = {
|
|
11873
|
+
grain: "day",
|
|
11874
|
+
earliest: range.q50,
|
|
11875
|
+
latest: range.q50
|
|
11876
|
+
};
|
|
11877
|
+
}
|
|
11878
|
+
return view;
|
|
11879
|
+
}
|
|
11739
11880
|
/** A time estimate is anchored to the reading, never advanced by opening another view later. */
|
|
11740
|
-
function quotaForecastView(forecast,
|
|
11881
|
+
function quotaForecastView(forecast, options = {}) {
|
|
11882
|
+
const view = shortHorizonView(forecast, options);
|
|
11883
|
+
if (view.kind === "stale" || view.kind === "exhausted") return view;
|
|
11884
|
+
const risk = riskView(forecast, options);
|
|
11885
|
+
return risk === void 0 ? view : {
|
|
11886
|
+
...view,
|
|
11887
|
+
risk
|
|
11888
|
+
};
|
|
11889
|
+
}
|
|
11890
|
+
function shortHorizonView(forecast, { fetchedAt, now = Date.now(), resetsAt, remainingPercent, refreshError = false } = {}) {
|
|
11741
11891
|
if (quotaReadingIsStale({
|
|
11742
11892
|
fetchedAt,
|
|
11743
11893
|
now,
|
|
@@ -11748,7 +11898,8 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
|
|
|
11748
11898
|
if (forecast?.status === "calibrating") return { kind: forecast.reason ?? "calibrating" };
|
|
11749
11899
|
if (forecast?.status === "flat" || forecast?.status === "idle") return {
|
|
11750
11900
|
kind: "idle",
|
|
11751
|
-
upperPacePerHour: forecast.upperPacePerHour
|
|
11901
|
+
upperPacePerHour: forecast.upperPacePerHour,
|
|
11902
|
+
spanMs: forecast.observedSpanMs
|
|
11752
11903
|
};
|
|
11753
11904
|
if (!Number.isFinite(fetchedAt)) return { kind: "calibrating" };
|
|
11754
11905
|
if (forecast?.status === "ready" && !forecast.provisional && (typeof forecast.survivesReset !== "string" || forecast.survivesReset === "yes") && Number.isFinite(forecast.runwayMinSeconds) && forecast.runwayMinSeconds > 0 && Number.isFinite(resetsAt) && fetchedAt + forecast.runwayMinSeconds * 1e3 >= resetsAt * 1e3) return { kind: "reset" };
|
|
@@ -11793,9 +11944,18 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
|
|
|
11793
11944
|
};
|
|
11794
11945
|
const today = local(now).day;
|
|
11795
11946
|
const render = (key, values) => Object.entries(values).reduce((text, [name, value]) => text.replace(`{${name}}`, value), t(key));
|
|
11947
|
+
const weekday = (time) => {
|
|
11948
|
+
const japanese = locale?.toLowerCase().split("-")[0] === "ja";
|
|
11949
|
+
const day = new Intl.DateTimeFormat(locale, {
|
|
11950
|
+
timeZone,
|
|
11951
|
+
weekday: japanese || locale?.startsWith("zh") ? "short" : "long"
|
|
11952
|
+
}).format(time);
|
|
11953
|
+
return japanese ? `${day}曜` : day;
|
|
11954
|
+
};
|
|
11955
|
+
if (view.grain === "day") return weekday(view.earliest);
|
|
11796
11956
|
const when = (time) => {
|
|
11797
11957
|
const date = local(time), gap = (date.day - today) / 864e5;
|
|
11798
|
-
const day = gap === 0 ? t("paceDay_today") : gap === 1 ? t("paceDay_tomorrow") : new Intl.DateTimeFormat(locale, gap > 1 && gap < 7 ? {
|
|
11958
|
+
const day = view.grain === "part" ? weekday(time) : gap === 0 ? t("paceDay_today") : gap === 1 ? t("paceDay_tomorrow") : new Intl.DateTimeFormat(locale, gap > 1 && gap < 7 ? {
|
|
11799
11959
|
timeZone,
|
|
11800
11960
|
weekday: locale?.startsWith("zh") ? "short" : "long"
|
|
11801
11961
|
} : {
|
|
@@ -11805,7 +11965,7 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
|
|
|
11805
11965
|
}).format(time);
|
|
11806
11966
|
const part = date.hour < 5 ? "early" : date.hour < 12 ? "morning" : date.hour < 18 ? "afternoon" : date.hour < 23 ? "evening" : "night";
|
|
11807
11967
|
const partText = t(`pacePart_${part}`);
|
|
11808
|
-
const key = gap === 0 ? part === "early" ? "quotaWhenEarlyToday" : part === "night" ? "quotaWhenTonight" : "quotaWhenToday" : part === "early" ? "quotaWhenEarly" : "paceWhen";
|
|
11968
|
+
const key = view.grain === "part" ? part === "early" ? "quotaOutlookEarly" : "quotaOutlookPart" : gap === 0 ? part === "early" ? "quotaWhenEarlyToday" : part === "night" ? "quotaWhenTonight" : "quotaWhenToday" : part === "early" ? "quotaWhenEarly" : "paceWhen";
|
|
11809
11969
|
return {
|
|
11810
11970
|
day: date.day,
|
|
11811
11971
|
period: part,
|
|
@@ -11818,7 +11978,11 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
|
|
|
11818
11978
|
};
|
|
11819
11979
|
if (view.kind !== "time") return void 0;
|
|
11820
11980
|
const from = when(view.earliest), to = when(view.latest);
|
|
11821
|
-
if (from.label === to.label) return from.label;
|
|
11981
|
+
if (from.day === to.day && from.label === to.label) return from.label;
|
|
11982
|
+
if (view.grain === "part" && from.day !== to.day) return render("quotaOutlookRange", {
|
|
11983
|
+
from: from.label,
|
|
11984
|
+
to: to.label
|
|
11985
|
+
});
|
|
11822
11986
|
const end = from.day === to.day ? render("quotaWhenRangeEnd", {
|
|
11823
11987
|
part: to.part,
|
|
11824
11988
|
label: to.label
|
|
@@ -11896,8 +12060,7 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
|
|
|
11896
12060
|
const usePreferenceSnapshot = (preference) => (0, react.useSyncExternalStore)(preference.subscribe, preference.getSnapshot);
|
|
11897
12061
|
const useAccountStatusSnapshot = (accountStatus) => (0, react.useSyncExternalStore)(accountStatus.subscribe, accountStatus.getSnapshot);
|
|
11898
12062
|
const notifyQuickQuota = () => window.dispatchEvent(new Event(QUICK_QUOTA_REFRESH_EVENT));
|
|
11899
|
-
const
|
|
11900
|
-
const view = quotaForecastView(forecast, options);
|
|
12063
|
+
const formatQuotaForecastView = (view, t, options) => {
|
|
11901
12064
|
if (view.kind !== "time") return t({
|
|
11902
12065
|
resolution: "forecastResolution",
|
|
11903
12066
|
"changing-pace": "forecastChanging",
|
|
@@ -11914,6 +12077,62 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
|
|
|
11914
12077
|
});
|
|
11915
12078
|
return fill(t(view.provisional ? "quotaForecastRoughAt" : "quotaForecastAt"), { when });
|
|
11916
12079
|
};
|
|
12080
|
+
function formatQuotaForecastLines(forecast, t, options = {}) {
|
|
12081
|
+
const view = quotaForecastView(forecast, options);
|
|
12082
|
+
const locale = options.locale ?? uiLocale();
|
|
12083
|
+
const risk = view.risk;
|
|
12084
|
+
if (!risk || risk.level === "hold") {
|
|
12085
|
+
if (view.kind === "idle" && view.spanMs >= 6e4) {
|
|
12086
|
+
const minutes = Math.round(view.spanMs / 6e4);
|
|
12087
|
+
const hours = minutes >= 120;
|
|
12088
|
+
const duration = new Intl.NumberFormat(locale, {
|
|
12089
|
+
style: "unit",
|
|
12090
|
+
unit: hours ? "hour" : "minute",
|
|
12091
|
+
unitDisplay: "long"
|
|
12092
|
+
}).format(hours ? Math.round(minutes / 60) : minutes);
|
|
12093
|
+
return [{
|
|
12094
|
+
role: "status",
|
|
12095
|
+
text: fill(t("quotaForecastIdleFor"), { duration })
|
|
12096
|
+
}];
|
|
12097
|
+
}
|
|
12098
|
+
return [{
|
|
12099
|
+
role: "status",
|
|
12100
|
+
text: formatQuotaForecastView(view, t, options)
|
|
12101
|
+
}];
|
|
12102
|
+
}
|
|
12103
|
+
const percent = new Intl.NumberFormat(locale, {
|
|
12104
|
+
style: "percent",
|
|
12105
|
+
maximumFractionDigits: 0
|
|
12106
|
+
});
|
|
12107
|
+
let text = t("quotaResetOutlookUncertain");
|
|
12108
|
+
if (risk.ifRunsOut) {
|
|
12109
|
+
const when = formatQuotaRunout({
|
|
12110
|
+
kind: "time",
|
|
12111
|
+
...risk.ifRunsOut
|
|
12112
|
+
}, {
|
|
12113
|
+
...options,
|
|
12114
|
+
t,
|
|
12115
|
+
locale
|
|
12116
|
+
});
|
|
12117
|
+
text = fill(t(risk.level === "very-likely" ? "quotaResetOutlookExpectedWhen" : "quotaResetOutlookIfExhausted"), { when });
|
|
12118
|
+
} else if (!risk.uncertain && risk.level === "low") text = t(risk.extreme ? "quotaResetOutlookLastsSure" : "quotaResetOutlookLasts");
|
|
12119
|
+
const lines = [{
|
|
12120
|
+
role: "outlook",
|
|
12121
|
+
text
|
|
12122
|
+
}];
|
|
12123
|
+
if ((risk.level !== "low" || risk.uncertain) && Number.isFinite(risk.dailyUsed) && Number.isFinite(risk.dailyBudget)) lines.push({
|
|
12124
|
+
role: "budget",
|
|
12125
|
+
text: fill(t("quotaResetOutlookBudget"), {
|
|
12126
|
+
used: percent.format(risk.dailyUsed / 100),
|
|
12127
|
+
budget: percent.format(risk.dailyBudget / 100)
|
|
12128
|
+
})
|
|
12129
|
+
});
|
|
12130
|
+
if (view.kind === "time") lines.push({
|
|
12131
|
+
role: "status",
|
|
12132
|
+
text: formatQuotaForecastView(view, t, options)
|
|
12133
|
+
});
|
|
12134
|
+
return lines;
|
|
12135
|
+
}
|
|
11917
12136
|
//#endregion
|
|
11918
12137
|
//#region src/sidebar-quota.js
|
|
11919
12138
|
const isDisplayableWindow = (window) => Number.isFinite(window?.remainingPercent) && window.remainingPercent >= 0 && window.remainingPercent <= 100 && Number.isFinite(window?.windowSeconds) && window.windowSeconds > 0;
|
|
@@ -11939,7 +12158,7 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
|
|
|
11939
12158
|
}
|
|
11940
12159
|
//#endregion
|
|
11941
12160
|
//#region src/version.js
|
|
11942
|
-
const PACKAGE_VERSION = "3.2.
|
|
12161
|
+
const PACKAGE_VERSION = "3.2.29";
|
|
11943
12162
|
//#endregion
|
|
11944
12163
|
//#region src/client-recovery.js
|
|
11945
12164
|
async function recoveryCall(rpc, endpoint, payload = {}, timeoutMs = endpoint === "usage" || endpoint.startsWith("usage/") ? 3e4 : 1e4) {
|
|
@@ -12277,7 +12496,10 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
|
|
|
12277
12496
|
className: "codexQuotaReset",
|
|
12278
12497
|
children: shortReset(quota, t)
|
|
12279
12498
|
})
|
|
12280
|
-
] }), forecastMode ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
12499
|
+
] }), forecastMode ? formatQuotaForecastLines(quota.forecast, t, quota).map(({ role, text }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
12500
|
+
className: role === "outlook" ? "codexQuotaOutlook" : void 0,
|
|
12501
|
+
children: text
|
|
12502
|
+
}, role)) : null]
|
|
12281
12503
|
}, `${quota.windowSeconds}-${index}`)), openSettings ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
12282
12504
|
type: "button",
|
|
12283
12505
|
className: "codexQuotaSettingsLink",
|
|
@@ -12302,7 +12524,7 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
|
|
|
12302
12524
|
hour: "2-digit",
|
|
12303
12525
|
minute: "2-digit"
|
|
12304
12526
|
});
|
|
12305
|
-
return fill(t("
|
|
12527
|
+
return fill(t("quotaPopoverResetAt"), { value });
|
|
12306
12528
|
}
|
|
12307
12529
|
//#endregion
|
|
12308
12530
|
//#region node_modules/.pnpm/@heroicons+react@2.2.0_react@18.3.1/node_modules/@heroicons/react/16/solid/esm/BoltIcon.js
|
|
@@ -21021,15 +21243,18 @@ void main(){
|
|
|
21021
21243
|
t
|
|
21022
21244
|
})]
|
|
21023
21245
|
}),
|
|
21024
|
-
forecastMode ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
21246
|
+
forecastMode ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21025
21247
|
className: "codexSubscriptionForecast",
|
|
21026
21248
|
role: "status",
|
|
21027
|
-
children:
|
|
21249
|
+
children: formatQuotaForecastLines(window.forecast, t, {
|
|
21028
21250
|
...window,
|
|
21029
21251
|
fetchedAt: visibleUsage.fetchedAt,
|
|
21030
21252
|
now,
|
|
21031
21253
|
refreshError: error !== void 0
|
|
21032
|
-
})
|
|
21254
|
+
}).map(({ role, text }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
21255
|
+
className: role === "outlook" ? "codexQuotaOutlook" : void 0,
|
|
21256
|
+
children: text
|
|
21257
|
+
}, role))
|
|
21033
21258
|
}) : null
|
|
21034
21259
|
]
|
|
21035
21260
|
}, `${limit.id}-${window.windowSeconds}-${index}`)))
|