dsh-codex-subscription 3.1.7 → 3.1.9

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/lib/client.js CHANGED
@@ -1261,6 +1261,11 @@ window.__ModuleLoader__.load({
1261
1261
  "voice/interrupt",
1262
1262
  "voice/preview",
1263
1263
  "voice/catalog",
1264
+ "voice/native/probe",
1265
+ "voice/native/start",
1266
+ "voice/native/status",
1267
+ "voice/native/control",
1268
+ "voice/native/stop",
1264
1269
  "remote/status",
1265
1270
  "remote/enable",
1266
1271
  "remote/disable",
@@ -7147,8 +7152,10 @@ window.__ModuleLoader__.load({
7147
7152
  //#endregion
7148
7153
  //#region src/client-locales.js
7149
7154
  const zh = {
7155
+ voiceNativeCaptureConfirm: "允许本次通话使用此电脑的麦克风和扬声器?挂断或离开会话后会停止收音。",
7150
7156
  voiceMediaHint: "窗口不支持 WebRTC 时,可在浏览器中继续同一会话。音色试听不受影响,仍使用当前订阅,无需 API Key。",
7151
7157
  voiceBrowserContinue: "在浏览器继续此会话",
7158
+ voiceBrowserCall: "在浏览器继续语音通话",
7152
7159
  voiceBrowserCopy: "复制会话链接",
7153
7160
  voiceBrowserCopied: "已复制",
7154
7161
  voiceBrowserCopyFailed: "复制失败,请手动复制链接",
@@ -7227,8 +7234,8 @@ window.__ModuleLoader__.load({
7227
7234
  storageTitle: "存储与缓存",
7228
7235
  storageForecast: "额度预测缓存",
7229
7236
  storageClear: "清除预测历史",
7230
- storageHint: "只清理本地预测历史;原图、草稿、登录信息和共享依赖不受影响。子任务组件在“联网与工具”中管理。",
7231
- storageConfirm: "清除所有已登录账号的本地预测历史后,需要重新积累采样。服务端额度不变,后续查询会重新生成缓存。",
7237
+ storageHint: "仅清除本地预测历史,不影响订阅额度。",
7238
+ storageConfirm: "清除所有已登录账号的本地预测历史?预测需重新积累采样;订阅额度、图片、草稿和登录信息不受影响。",
7232
7239
  storageFailed: "未能读取或清除预测缓存,请重试。",
7233
7240
  runtimeIncompatible: "检测到不兼容的 Codex 子任务组件,请卸载后重启,再安装受支持版本。",
7234
7241
  runtimeManagedElsewhere: "此组件由宿主或其他依赖管理,请在 DSH 插件管理中查看;这里不能直接卸载。",
@@ -7288,6 +7295,18 @@ window.__ModuleLoader__.load({
7288
7295
  connectors_read: "只读",
7289
7296
  connectors_ask: "询问后写入",
7290
7297
  connectors_write: "直接写入",
7298
+ defaultReasoningEffort: "默认推理等级",
7299
+ defaultReasoningEffortHint: "未手动选档时使用;模型不支持时跟随该模型默认值。",
7300
+ defaultUltraHint: "Ultra 是 DSH 主动分工预设,使用模型目录指定的实际推理档,不扩大权限;仅支持的模型显示。",
7301
+ defaultReasoningEffort_ultra: "Ultra(主动分工)",
7302
+ defaultReasoningEffort_auto: "模型默认",
7303
+ defaultReasoningEffort_off: "关闭推理",
7304
+ defaultReasoningEffort_minimal: "极低",
7305
+ defaultReasoningEffort_low: "低",
7306
+ defaultReasoningEffort_medium: "中",
7307
+ defaultReasoningEffort_high: "高",
7308
+ defaultReasoningEffort_xhigh: "超高",
7309
+ defaultReasoningEffort_max: "最高",
7291
7310
  reasoningSummary: "推理摘要",
7292
7311
  reasoningSummaryHint: "让模型在会话的“思考”部分给出推理摘要。自动由模型决定;简洁更短;详细更完整;关闭则不要摘要。",
7293
7312
  reasoningCache: "切换推理强度时复用缓存",
@@ -7722,8 +7741,6 @@ window.__ModuleLoader__.load({
7722
7741
  settingsRestartRequired: "设置已保存,重启 DSH 后生效。",
7723
7742
  historyTitle: "额度去向",
7724
7743
  historyLoading: "正在读取用量历史…",
7725
- historyUnavailable: "当前账户没有提供用量历史。",
7726
- historyEmpty: "还没有已统计完成的额度周期。官方统计有延迟,过一两天再看。",
7727
7744
  historyPeriods: "额度周期",
7728
7745
  historyUsed: "这个周期已用 {value}% 的额度",
7729
7746
  historyPartial: "(统计尚未完成)",
@@ -7815,7 +7832,7 @@ window.__ModuleLoader__.load({
7815
7832
  quickQuotaBeta: "Beta",
7816
7833
  autoQuotaRetry: "额度重置后自动重试",
7817
7834
  autoQuotaRetryHint: "开启后,等待已确认的短时额度重置;对话会显示等待原因且可停止,等待期间切换账号会立即重试。",
7818
- quickQuotaForecastHint: "按最近两小时的用量估算何时用完;稳定时显示时间范围,变化后先校准或给粗估。未来用量变化会影响结果,仅供参考。历史保存在本机。",
7835
+ quickQuotaForecastHint: "输入框仅显示剩余额度,悬浮或点击查看预测。按最近两小时用量估算何时用完;未来用量变化会影响结果,仅供参考。历史保存在本机。",
7819
7836
  contextTitle: "上下文窗口",
7820
7837
  contextStandard: "标准",
7821
7838
  contextStandardHint: "使用模型目录默认值;官方 Agent 预设会自动管理上下文。",
@@ -7870,9 +7887,6 @@ window.__ModuleLoader__.load({
7870
7887
  diagnosticsNotes: "{count} 条提示信息",
7871
7888
  diagnosticsAdvanced: "完整诊断(高级)",
7872
7889
  historyAsOf: "数据截至 {date}",
7873
- historyPending: "还在统计中",
7874
- historyPendingCurrent: "官方尚未提供这一周期的统计结果,稍后可刷新查看。",
7875
- historyPendingPast: "官方尚未统计出这一周期的用量;报告数据截至 {date},稍后可刷新查看。",
7876
7890
  triggerSketchName: "草图 · Beta",
7877
7891
  triggerSketchHint: "让 Agent 画图或改图",
7878
7892
  triggerImageName: "生图",
@@ -7954,8 +7968,8 @@ window.__ModuleLoader__.load({
7954
7968
  quotaWhenRange: "{from}至{to}",
7955
7969
  quotaWhenEarlyMorningRange: "{from}至{to}",
7956
7970
  historyRefresh: "刷新",
7971
+ historyTotalUnavailable: "官方未提供此周期的总用量",
7957
7972
  historyNoBreakdown: "官方尚未提供此周期的明细",
7958
- historyPendingPastUnknown: "官方尚未统计出此周期用量",
7959
7973
  fetchTitle: "网页读取来源",
7960
7974
  fetchDshHint: "使用 DSH 当前配置的网页读取服务;与上面的搜索来源分别设置。",
7961
7975
  fetchCodexHint: "通过 Codex 订阅读取可访问的网页文本。失败会直接提示,不会转到 DeepSeek API。",
@@ -8031,8 +8045,10 @@ window.__ModuleLoader__.load({
8031
8045
  imageRemoveAnnotation: "删除标注"
8032
8046
  };
8033
8047
  const en = {
8048
+ voiceNativeCaptureConfirm: "Use this computer’s microphone and speakers for this call? Capture stops when you hang up or leave the conversation.",
8034
8049
  voiceMediaHint: "If this window does not support WebRTC, continue the same conversation in a browser. Voice samples remain available. Your existing subscription is used; no API key is needed.",
8035
8050
  voiceBrowserContinue: "Continue this conversation in a browser",
8051
+ voiceBrowserCall: "Continue voice in a browser",
8036
8052
  voiceBrowserCopy: "Copy conversation link",
8037
8053
  voiceBrowserCopied: "Copied",
8038
8054
  voiceBrowserCopyFailed: "Copy failed; copy the link manually",
@@ -8111,8 +8127,8 @@ window.__ModuleLoader__.load({
8111
8127
  storageTitle: "Storage and cache",
8112
8128
  storageForecast: "Quota forecast cache",
8113
8129
  storageClear: "Clear forecast history",
8114
- storageHint: "Clears local forecast history only; original images, drafts, sign-in data and shared dependencies are untouched. Subtask components are managed under Web & tools.",
8115
- storageConfirm: "This clears local forecast samples for all signed-in accounts. Forecasts will need new samples. Server quotas stay unchanged; subsequent checks recreate the cache.",
8130
+ storageHint: "Clears local forecast history only. Subscription quota is unchanged.",
8131
+ storageConfirm: "Clear local forecast history for all signed-in accounts? Forecasts will need new samples. Subscription quota, images, drafts and sign-in data are unaffected.",
8116
8132
  storageFailed: "Could not read or clear the forecast cache. Try again.",
8117
8133
  runtimeIncompatible: "An incompatible Codex subtask component was found. Uninstall it, restart DSH, then install the supported version.",
8118
8134
  runtimeManagedElsewhere: "This component is managed by the host or another dependency. Check DSH plugin management; it cannot be removed here.",
@@ -8172,6 +8188,18 @@ window.__ModuleLoader__.load({
8172
8188
  connectors_read: "Read-only",
8173
8189
  connectors_ask: "Write after asking",
8174
8190
  connectors_write: "Write directly",
8191
+ defaultReasoningEffort: "Default reasoning effort",
8192
+ defaultReasoningEffortHint: "Used when no effort is selected manually. Unsupported levels fall back to the model default.",
8193
+ defaultUltraHint: "Ultra is a DSH proactive delegation preset using the catalog-resolved model effort. It grants no additional permissions and appears only for supported models.",
8194
+ defaultReasoningEffort_ultra: "Ultra (proactive delegation)",
8195
+ defaultReasoningEffort_auto: "Model default",
8196
+ defaultReasoningEffort_off: "Off",
8197
+ defaultReasoningEffort_minimal: "Minimal",
8198
+ defaultReasoningEffort_low: "Low",
8199
+ defaultReasoningEffort_medium: "Medium",
8200
+ defaultReasoningEffort_high: "High",
8201
+ defaultReasoningEffort_xhigh: "Extra high",
8202
+ defaultReasoningEffort_max: "Maximum",
8175
8203
  reasoningSummary: "Reasoning summary",
8176
8204
  reasoningSummaryHint: "Shows a summary of the reasoning in the Thinking section of the conversation. Auto lets the model decide; concise is shorter; detailed is fuller; off asks for none.",
8177
8205
  reasoningCache: "Reuse cache when changing effort",
@@ -8606,8 +8634,6 @@ window.__ModuleLoader__.load({
8606
8634
  settingsRestartRequired: "Saved. Restart DSH to apply it.",
8607
8635
  historyTitle: "Where the allowance went",
8608
8636
  historyLoading: "Reading usage history…",
8609
- historyUnavailable: "This account does not provide a usage history.",
8610
- historyEmpty: "No allowance period has been counted yet. The official report lags; check again in a day or two.",
8611
8637
  historyPeriods: "Allowance periods",
8612
8638
  historyUsed: "{value}% of this period's allowance used",
8613
8639
  historyPartial: "(still being counted)",
@@ -8699,7 +8725,7 @@ window.__ModuleLoader__.load({
8699
8725
  quickQuotaBeta: "Beta",
8700
8726
  autoQuotaRetry: "Retry after quota reset",
8701
8727
  autoQuotaRetryHint: "Wait for confirmed short quota resets. The turn shows why it is waiting and can be stopped; switching accounts retries immediately.",
8702
- quickQuotaForecastHint: "Estimates run-out time from recent two-hour usage. Stable readings show a range; changes trigger calibration or a rough estimate. Future usage affects the result. History stays local.",
8728
+ quickQuotaForecastHint: "Shows remaining quota in the composer; hover or click for the forecast. Estimates run-out time from recent two-hour usage. Future usage affects the result. History stays local.",
8703
8729
  contextTitle: "Context window",
8704
8730
  contextStandard: "Standard",
8705
8731
  contextStandardHint: "Use the model catalog default; official agent presets manage context automatically.",
@@ -8754,9 +8780,6 @@ window.__ModuleLoader__.load({
8754
8780
  diagnosticsNotes: "{count} note(s)",
8755
8781
  diagnosticsAdvanced: "Full report (advanced)",
8756
8782
  historyAsOf: "Data as of {date}",
8757
- historyPending: "Still being counted",
8758
- historyPendingCurrent: "The official report has not provided figures for this period yet. Refresh later to check.",
8759
- historyPendingPast: "The official report has not counted this period yet. Data is as of {date}; refresh later to check.",
8760
8783
  triggerSketchName: "Sketch · Beta",
8761
8784
  triggerSketchHint: "Ask the Agent to draw or edit a sketch",
8762
8785
  triggerImageName: "Image",
@@ -8838,8 +8861,8 @@ window.__ModuleLoader__.load({
8838
8861
  quotaWhenRange: "{from}–{to}",
8839
8862
  quotaWhenEarlyMorningRange: "{latest}",
8840
8863
  historyRefresh: "Refresh",
8864
+ historyTotalUnavailable: "Official total usage is unavailable for this period",
8841
8865
  historyNoBreakdown: "Official breakdown not yet available for this period",
8842
- historyPendingPastUnknown: "Official usage for this period is not available yet",
8843
8866
  fetchTitle: "Webpage reading source",
8844
8867
  fetchDshHint: "Use the webpage reader configured in DSH, independently of the search source above.",
8845
8868
  fetchCodexHint: "Read accessible webpage text with your Codex subscription. Failures are reported directly, without falling back to the DeepSeek API.",
@@ -9222,8 +9245,9 @@ window.__ModuleLoader__.load({
9222
9245
  .codexSubscriptionDiagnostics .codexSubscriptionSectionTitle{display:flex;flex-direction:column;gap:5px}
9223
9246
  .codexSubscriptionRemotePair{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin-top:8px}.codexSubscriptionRemoteQr{width:168px;height:168px;flex:none;border-radius:12px;overflow:hidden;background:#fff}.codexSubscriptionRemoteQr svg{display:block;width:100%;height:100%}.codexSubscriptionRemoteCode{margin:6px 0;font:600 20px/28px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.08em;user-select:all}
9224
9247
  .codexSubscriptionStorageMeter{display:flex;flex-direction:column;gap:9px;padding:12px;border-radius:10px;background:var(--dsw-alias-bg-module-platform)}
9225
- .codexSubscriptionStorageMeter>div{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:12px;line-height:18px}
9226
- .codexSubscriptionStorageMeter output{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary)}
9248
+ .codexSubscriptionStorageHead{display:flex;align-items:center;justify-content:space-between;gap:8px 16px;flex-wrap:wrap}
9249
+ .codexSubscriptionStorageTitle{display:flex;align-items:baseline;gap:6px 12px;flex-wrap:wrap;min-width:0}
9250
+ .codexSubscriptionStorageTitle output{font-size:12px;line-height:18px;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary)}
9227
9251
  .codexSubscriptionStorageMeter progress{width:100%;height:4px;border:0;border-radius:4px;overflow:hidden;accent-color:var(--dsw-alias-label-secondary)}
9228
9252
  .codexSubscriptionStorageMeter progress::-webkit-progress-bar{background:var(--dsw-alias-border-l2)}
9229
9253
  .codexSubscriptionStorageMeter progress::-webkit-progress-value{background:var(--dsw-alias-label-secondary)}
@@ -9245,6 +9269,7 @@ window.__ModuleLoader__.load({
9245
9269
  .codexVoiceChoice .codexSubscriptionContextTrigger:first-child:not(:last-child){min-width:0;justify-content:center}
9246
9270
  /* The voice button wears the send button's own classes, so its colours, shape and theme are always the send button's. */
9247
9271
  .codexVoiceCall{position:absolute;z-index:2;margin:0}
9272
+ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizing:border-box;text-decoration:none}
9248
9273
  /* DSH's send button is the light info colour at rest and darkens on hover. The voice button is an action in its own right, so it keeps the stronger colour all the time and only deepens a little on hover. */
9249
9274
  .codexVoiceCall:not(:disabled){background:var(--dsw-alias-button-info-hover,#4176e6)!important;filter:none}
9250
9275
  .codexVoiceCall:not(:disabled):hover{filter:brightness(.92)}
@@ -9325,11 +9350,12 @@ window.__ModuleLoader__.load({
9325
9350
  .codexFlat{display:flex;flex-direction:column;gap:0}.codexFlat[hidden]{display:none}
9326
9351
  .codexFlat .codexSubscriptionAdvancedPreferences{gap:0}
9327
9352
  .codexFlat .codexSubscriptionCard,.codexFlat .codexSubscriptionPreferencesCard,.codexFlat .codexImageSettings{border:1px solid var(--dsw-alias-border-l2);background:transparent;box-shadow:none;border-radius:12px;padding:2px 16px;margin:0 0 8px}
9353
+ .codexFlat .codexSubscriptionPreferencesCard,.codexFlat .codexFeatureOverview{gap:0}
9328
9354
  .codexFlat h3,.codexFlat .codexSubscriptionSectionHead h3{margin:10px 0 2px;font-size:14px;font-weight:500;line-height:20px;color:var(--dsw-alias-label-primary)}
9329
9355
  .codexFlat .codexSubscriptionPreference,.codexFlat .codexFeatureRow>.codexFeatureMain{box-sizing:border-box;padding:8px 0;min-height:52px;gap:6px 16px;align-items:center}
9330
9356
  .codexFlat .codexSubscriptionPreference,.codexFlat .codexFeatureRow{border-bottom:1px solid var(--dsw-alias-border-l2)}
9331
9357
  .codexFlat .codexFeatureRow,.codexFlat .codexSubscriptionPreference{border-top:0}
9332
- .codexFlat section>.codexSubscriptionPreference:last-child,.codexFlat section>.codexFeatureRow:last-of-type,.codexFlat section>div:last-child>.codexSubscriptionPreference:last-child,.codexFlat .codexAdvancedBody>.codexSubscriptionPreference:last-child{border-bottom:0}
9358
+ .codexFlat section>.codexSubscriptionPreference:last-child,.codexFlat .codexSubscriptionCard>.codexSubscriptionPreference:last-child,.codexFlat section>.codexFeatureRow:last-of-type,.codexFlat section>div:last-child>.codexSubscriptionPreference:last-child,.codexFlat .codexAdvancedBody>.codexSubscriptionPreference:last-child{border-bottom:0}
9333
9359
  .codexFlat .codexSubscriptionPreferenceLabel,.codexFlat .codexFeatureTitle{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:400;line-height:20px;min-height:20px;color:var(--dsw-alias-label-primary)}
9334
9360
  .codexFlat .codexSubscriptionPreferenceLabel small,.codexFlat .codexFeatureTitle small{line-height:16px;height:16px;display:inline-flex;align-items:center}
9335
9361
  .codexFlat .codexSubscriptionPreferenceHint,.codexFlat .codexFeatureSummary,.codexFlat .codexSubscriptionHintText{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}
@@ -9352,11 +9378,13 @@ window.__ModuleLoader__.load({
9352
9378
  .codexFlat .codexSubscriptionSearchOptions{margin:0;padding:0}.codexFlat .codexSubscriptionSearchOptions>summary{padding:10px 0;margin:0}
9353
9379
  .codexFlat .codexSubscriptionCard:has(>.codexSubscriptionAccounts),.codexFlat .codexSubscriptionCard:has(>.codexSubscriptionActions),.codexFlat .codexSubscriptionStorage{padding-block:10px}
9354
9380
  .codexFlat .codexSubscriptionCreditSection{display:block}.codexFlat .codexSubscriptionCreditSection[open]>summary{border-bottom:1px solid var(--dsw-alias-border-l2);margin-bottom:8px}
9355
- .codexFlat .codexSubscriptionStorageMeter{background:transparent;padding:6px 0}
9381
+ .codexFlat .codexSubscriptionStorage{gap:6px}
9382
+ .codexFlat .codexSubscriptionStorageTitle h3{margin:0}
9383
+ .codexFlat .codexSubscriptionStorageMeter{background:transparent;padding:0}
9356
9384
  .codexFlat .codexSubscriptionResetBox{border:0;border-radius:0;padding:0}
9357
9385
  .codexFlat :is(button,summary,a):focus-visible,.codexFlat label:has(:focus-visible){outline:2px solid var(--dsw-alias-border-inverted);outline-offset:2px;box-shadow:none}
9358
9386
  .codexSettingsTabs{position:sticky;top:0;z-index:2;background:var(--dsw-alias-bg-layer-1);border-radius:0;padding:6px 0 0;margin-top:-6px;gap:18px;display:flex;overflow-x:auto;scrollbar-width:none;grid-template-columns:none;border-bottom:1px solid var(--dsw-alias-border-l2);margin-bottom:8px}
9359
- .codexSettingsTabs button{min-height:34px;padding:0 2px;border-radius:0;border-bottom:2px solid transparent;margin-bottom:-1px;font-size:14px;color:var(--dsw-alias-label-tertiary);white-space:nowrap}
9387
+ .codexSettingsTabs button{flex:none;min-height:34px;padding:0 2px;border-radius:0;border-bottom:2px solid transparent;margin-bottom:-1px;font-size:14px;color:var(--dsw-alias-label-tertiary);white-space:nowrap}
9360
9388
  .codexSettingsTabs button[aria-selected=true]{background:transparent;box-shadow:none;color:var(--dsw-alias-label-primary);border-bottom-color:var(--dsw-alias-label-primary)}
9361
9389
  .codexSubscriptionNotices{display:flex;flex-direction:column;gap:6px;margin:0 0 8px}
9362
9390
  .codexSubscriptionNotices p{margin:0;padding:8px 12px;border-radius:10px;background:var(--dsw-alias-bg-module-platform)}
@@ -10800,6 +10828,21 @@ window.__ModuleLoader__.load({
10800
10828
  const normalizeVoiceCall = (value) => value === "on" ? "on" : "off";
10801
10829
  const normalizeVoiceVoice = (value) => VOICE_VOICES.includes(value) ? value : "cove";
10802
10830
  const normalizeVoiceLanguage = (value) => VOICE_LANGUAGES.includes(value) ? value : "auto";
10831
+ const DEFAULT_REASONING_EFFORT_FIELD = "defaultReasoningEffort";
10832
+ const DEFAULT_REASONING_EFFORTS = Object.freeze([
10833
+ "auto",
10834
+ "off",
10835
+ "minimal",
10836
+ "low",
10837
+ "medium",
10838
+ "high",
10839
+ "xhigh",
10840
+ "max",
10841
+ "ultra"
10842
+ ]);
10843
+ const DEFAULT_REASONING_EFFORT = "auto";
10844
+ const normalizeDefaultReasoningEffort = (value) => DEFAULT_REASONING_EFFORTS.includes(value) ? value : DEFAULT_REASONING_EFFORT;
10845
+ const normalizeDefaultReasoningEffortChoice = normalizeDefaultReasoningEffort;
10803
10846
  const REASONING_SUMMARY_FIELD = "reasoningSummary";
10804
10847
  const REASONING_SUMMARIES = Object.freeze([
10805
10848
  "auto",
@@ -10933,6 +10976,11 @@ window.__ModuleLoader__.load({
10933
10976
  default: "on",
10934
10977
  error: "Invalid reasoning cache preference"
10935
10978
  },
10979
+ [DEFAULT_REASONING_EFFORT_FIELD]: {
10980
+ choices: DEFAULT_REASONING_EFFORTS,
10981
+ default: DEFAULT_REASONING_EFFORT,
10982
+ error: "Invalid default reasoning effort"
10983
+ },
10936
10984
  connectionMode: {
10937
10985
  choices: ["sse", "websocket"],
10938
10986
  default: "sse",
@@ -11065,6 +11113,7 @@ window.__ModuleLoader__.load({
11065
11113
  let verbosityModels = [];
11066
11114
  let fastModels;
11067
11115
  let ultrafastModels = [];
11116
+ let ultraModels = [];
11068
11117
  let catalogStatus;
11069
11118
  let modelsLoading = false;
11070
11119
  let modelError = false;
@@ -11093,6 +11142,7 @@ window.__ModuleLoader__.load({
11093
11142
  otherModels: value?.otherModels === "off" ? "off" : "on",
11094
11143
  compactionMode: value?.compactionMode === "cloud" ? "cloud" : "dsh",
11095
11144
  reasoningCache: normalizeReasoningCache(value?.reasoningCache),
11145
+ defaultReasoningEffort: normalizeDefaultReasoningEffort(value?.[DEFAULT_REASONING_EFFORT_FIELD]),
11096
11146
  subagentBackend: value?.subagentBackend === "codex" ? "codex" : "dsh",
11097
11147
  subagentBackendAvailable,
11098
11148
  subagentRuntimeInstalled,
@@ -11122,6 +11172,7 @@ window.__ModuleLoader__.load({
11122
11172
  verbosityModels,
11123
11173
  fastModels,
11124
11174
  ultrafastModels,
11175
+ ultraModels,
11125
11176
  catalogStatus,
11126
11177
  modelsLoading,
11127
11178
  modelError,
@@ -11149,6 +11200,7 @@ window.__ModuleLoader__.load({
11149
11200
  verbosityModels = Array.isArray(value?.verbosityModels) ? value.verbosityModels : [];
11150
11201
  fastModels = Array.isArray(value?.fastModels) ? value.fastModels : void 0;
11151
11202
  ultrafastModels = Array.isArray(value?.ultrafastModels) ? value.ultrafastModels : [];
11203
+ ultraModels = Array.isArray(value?.ultraModels) ? value.ultraModels : [];
11152
11204
  catalogStatus = value?.catalogStatus;
11153
11205
  }
11154
11206
  fallback = {
@@ -11163,6 +11215,7 @@ window.__ModuleLoader__.load({
11163
11215
  otherModels: value?.otherModels === "off" ? "off" : "on",
11164
11216
  compactionMode: value?.compactionMode === "cloud" ? "cloud" : "dsh",
11165
11217
  reasoningCache: normalizeReasoningCache(value?.reasoningCache),
11218
+ [DEFAULT_REASONING_EFFORT_FIELD]: normalizeDefaultReasoningEffort(value?.[DEFAULT_REASONING_EFFORT_FIELD]),
11166
11219
  subagentBackend: value?.subagentBackend === "codex" ? "codex" : "dsh",
11167
11220
  ...readCapabilitySettings(value),
11168
11221
  [QUICK_QUOTA_MODE_FIELD]: normalizeQuickQuotaMode(value?.[QUICK_QUOTA_MODE_FIELD], value?.[LEGACY_QUICK_QUOTA_FIELD]),
@@ -11216,14 +11269,16 @@ window.__ModuleLoader__.load({
11216
11269
  const nextVerbosityModels = Array.isArray(value?.verbosityModels) ? value.verbosityModels : [];
11217
11270
  const nextFastModels = Array.isArray(value?.fastModels) ? value.fastModels : void 0;
11218
11271
  const nextUltrafastModels = Array.isArray(value?.ultrafastModels) ? value.ultrafastModels : [];
11272
+ const nextUltraModels = Array.isArray(value?.ultraModels) ? value.ultraModels : [];
11219
11273
  catalogStatus = value?.catalogStatus;
11220
- const changed = !sameModels(contextModels, nextContextModels) || !sameModels(availableModels, nextAvailableModels) || !sameModels(verbosityModels, nextVerbosityModels) || JSON.stringify(fastModels) !== JSON.stringify(nextFastModels) || JSON.stringify(ultrafastModels) !== JSON.stringify(nextUltrafastModels);
11274
+ const changed = !sameModels(contextModels, nextContextModels) || !sameModels(availableModels, nextAvailableModels) || !sameModels(verbosityModels, nextVerbosityModels) || JSON.stringify(fastModels) !== JSON.stringify(nextFastModels) || JSON.stringify(ultrafastModels) !== JSON.stringify(nextUltrafastModels) || JSON.stringify(ultraModels) !== JSON.stringify(nextUltraModels);
11221
11275
  if (changed) {
11222
11276
  contextModels = nextContextModels;
11223
11277
  availableModels = nextAvailableModels;
11224
11278
  verbosityModels = nextVerbosityModels;
11225
11279
  fastModels = nextFastModels;
11226
11280
  ultrafastModels = nextUltrafastModels;
11281
+ ultraModels = nextUltraModels;
11227
11282
  publish();
11228
11283
  }
11229
11284
  return changed;
@@ -11762,7 +11817,7 @@ window.__ModuleLoader__.load({
11762
11817
  }
11763
11818
  //#endregion
11764
11819
  //#region src/version.js
11765
- const PACKAGE_VERSION = "3.1.7";
11820
+ const PACKAGE_VERSION = "3.1.9";
11766
11821
  //#endregion
11767
11822
  //#region src/client-recovery.js
11768
11823
  async function recoveryCall(rpc, endpoint, payload = {}, timeoutMs = 1e4) {
@@ -11995,9 +12050,11 @@ window.__ModuleLoader__.load({
11995
12050
  setOpen(true);
11996
12051
  };
11997
12052
  const leave = () => {
12053
+ clearTimeout(dismissTimer.current);
11998
12054
  if (!pinned.current) dismissTimer.current = setTimeout(() => setOpen(false), 150);
11999
12055
  };
12000
12056
  const dismiss = () => {
12057
+ clearTimeout(dismissTimer.current);
12001
12058
  pinned.current = false;
12002
12059
  setOpen(false);
12003
12060
  };
@@ -12014,7 +12071,7 @@ window.__ModuleLoader__.load({
12014
12071
  });
12015
12072
  useDismissOnOutsidePointer(trigger, visible, dismiss, panel);
12016
12073
  (0, react.useEffect)(() => {
12017
- setOpen(false);
12074
+ dismiss();
12018
12075
  }, [current?.model, quotaEnabled]);
12019
12076
  (0, react.useEffect)(() => {
12020
12077
  if (!visible) return;
@@ -12052,6 +12109,7 @@ window.__ModuleLoader__.load({
12052
12109
  onMouseEnter: enter,
12053
12110
  onMouseLeave: leave,
12054
12111
  onClick: () => {
12112
+ clearTimeout(dismissTimer.current);
12055
12113
  if (pinned.current) dismiss();
12056
12114
  else {
12057
12115
  pinned.current = true;
@@ -12069,7 +12127,7 @@ window.__ModuleLoader__.load({
12069
12127
  value: quota.remainingPercent,
12070
12128
  "aria-hidden": "true"
12071
12129
  }) : null,
12072
- preferenceSnapshot.quickQuotaMode !== "bar" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [`${percent(quota.remainingPercent)}%`, forecastMode ? ` · ${formatQuotaForecast(quota.forecast, t, quota)}` : ""] }) : null
12130
+ preferenceSnapshot.quickQuotaMode !== "bar" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: `${percent(quota.remainingPercent)}%` }) : null
12073
12131
  ]
12074
12132
  }, `${quota.windowSeconds}-${index}`))
12075
12133
  }), visible ? (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
@@ -12604,8 +12662,9 @@ window.__ModuleLoader__.load({
12604
12662
  //#endregion
12605
12663
  //#region src/voice-barge-in.js
12606
12664
  /** Mute playback promptly, and restore it only after interrupted audio has drained. */
12607
- function createBargeInGate({ interrupt, changed, speechMs = 120, silenceMs = 400 }) {
12665
+ function createBargeInGate({ interrupt, changed, speechMs = 120, silenceMs = 400, outputTailMs = 0 }) {
12608
12666
  let speakingAt, quietAt, outputQuietAt, suppressed = false, drained = false;
12667
+ let outputActiveAt;
12609
12668
  return { sample({ mic, output, now }) {
12610
12669
  if (mic > .12) {
12611
12670
  speakingAt ??= now;
@@ -12616,7 +12675,9 @@ window.__ModuleLoader__.load({
12616
12675
  }
12617
12676
  if (output < .025) outputQuietAt ??= now;
12618
12677
  else outputQuietAt = void 0;
12619
- if (!suppressed && speakingAt !== void 0 && now - speakingAt >= speechMs && output > .025) {
12678
+ if (output > .025) outputActiveAt = now;
12679
+ const recentOutput = outputTailMs > 0 && outputActiveAt !== void 0 && now - outputActiveAt <= outputTailMs;
12680
+ if (!suppressed && speakingAt !== void 0 && now - speakingAt >= speechMs && (output > .025 || recentOutput)) {
12620
12681
  suppressed = true;
12621
12682
  drained = false;
12622
12683
  changed(true);
@@ -12648,12 +12709,14 @@ window.__ModuleLoader__.load({
12648
12709
  return {
12649
12710
  "voice-insecure": "voiceInsecure",
12650
12711
  "voice-no-microphone": "voiceMicUnavailable",
12651
- "voice-no-webrtc": "voiceWebRTCUnavailable"
12712
+ "voice-no-webrtc": "voiceWebRTCUnavailable",
12713
+ "voice-native-unavailable": "voiceWebRTCUnavailable"
12652
12714
  }[error?.code] ?? "voiceFailed";
12653
12715
  }
12654
12716
  function voiceCallCapability(surface = globalThis) {
12655
12717
  if (surface.isSecureContext === false) return "voice-insecure";
12656
12718
  if (typeof surface.navigator?.mediaDevices?.getUserMedia !== "function") return "voice-no-microphone";
12719
+ if (surface.__dshWebRtcFallback && Object.getOwnPropertyDescriptor(surface, "RTCPeerConnection")?.get) return "voice-no-webrtc";
12657
12720
  if (typeof surface.RTCPeerConnection !== "function") return "voice-no-webrtc";
12658
12721
  }
12659
12722
  //#endregion
@@ -12855,6 +12918,111 @@ window.__ModuleLoader__.load({
12855
12918
  };
12856
12919
  }
12857
12920
  //#endregion
12921
+ //#region src/voice-native-call.js
12922
+ /** Native devices belong to this computer, never to a remote browser client. */
12923
+ function nativeVoiceEligible(surface = globalThis) {
12924
+ const agent = surface.navigator?.userAgent ?? "";
12925
+ const linuxWebKit = /Linux/u.test(agent) && /AppleWebKit/u.test(agent) && !/Chrome|Chromium|Edg\//u.test(agent);
12926
+ return surface.isSecureContext !== false && Boolean(surface.dshDesktop?.protocolVersion === 1 || surface.__TAURI_INTERNALS__ || surface.__dshWebRtcFallback || linuxWebKit) && [
12927
+ "localhost",
12928
+ "127.0.0.1",
12929
+ "[::1]"
12930
+ ].includes(surface.location?.hostname);
12931
+ }
12932
+ /** The native backend owns media; this handle carries only controls and levels. */
12933
+ async function openNativeVoiceCall({ rpc, sessionId, onEnd, signal, captureAllowed }) {
12934
+ signal?.throwIfAborted();
12935
+ if (captureAllowed !== true) throw Object.assign(/* @__PURE__ */ new Error("Microphone permission is required"), { name: "NotAllowedError" });
12936
+ const result = await rpc.call(CHANNEL, "voice/native/start", {
12937
+ sessionId,
12938
+ captureAllowed: true
12939
+ }, signal);
12940
+ if (!result?.ok) throw Object.assign(/* @__PURE__ */ new Error("Native voice could not start"), { code: result?.error?.code });
12941
+ const leaseToken = result.value?.leaseToken;
12942
+ if (typeof leaseToken !== "string" || leaseToken.length < 16) throw new Error("Invalid native voice response");
12943
+ const owner = {
12944
+ sessionId,
12945
+ leaseToken
12946
+ };
12947
+ let ended = false, timer, micMuted = false, outputMuted = false;
12948
+ let levels = {
12949
+ mic: 0,
12950
+ assistant: 0
12951
+ };
12952
+ const end = async () => {
12953
+ if (ended) return;
12954
+ ended = true;
12955
+ clearTimeout(timer);
12956
+ signal?.removeEventListener("abort", aborted);
12957
+ levels = {
12958
+ mic: 0,
12959
+ assistant: 0
12960
+ };
12961
+ try {
12962
+ await rpc.call(CHANNEL, "voice/native/stop", owner);
12963
+ } catch {}
12964
+ onEnd?.();
12965
+ };
12966
+ const aborted = () => {
12967
+ end();
12968
+ };
12969
+ signal?.addEventListener("abort", aborted, { once: true });
12970
+ if (signal?.aborted) {
12971
+ await end();
12972
+ signal.throwIfAborted();
12973
+ }
12974
+ const poll = async () => {
12975
+ if (ended) return;
12976
+ try {
12977
+ const reply = await rpc.call(CHANNEL, "voice/native/status", owner);
12978
+ if (ended) return;
12979
+ if (!reply?.ok || reply.value?.active !== true) {
12980
+ await end();
12981
+ return;
12982
+ }
12983
+ const value = reply.value.levels ?? {};
12984
+ levels = {
12985
+ mic: Number.isFinite(value.mic) ? Math.max(0, Math.min(1, value.mic)) : 0,
12986
+ assistant: Number.isFinite(value.assistant) ? Math.max(0, Math.min(1, value.assistant)) : 0
12987
+ };
12988
+ } catch {
12989
+ await end();
12990
+ return;
12991
+ }
12992
+ if (!ended) timer = setTimeout(poll, 300);
12993
+ };
12994
+ poll();
12995
+ const control = (action, muted) => {
12996
+ if (ended) return;
12997
+ rpc.call(CHANNEL, "voice/native/control", {
12998
+ ...owner,
12999
+ action,
13000
+ muted
13001
+ }).then((reply) => {
13002
+ if (!reply?.ok) end();
13003
+ }).catch(() => {
13004
+ end();
13005
+ });
13006
+ };
13007
+ return {
13008
+ stop: end,
13009
+ levels: () => ({
13010
+ mic: micMuted ? 0 : levels.mic,
13011
+ assistant: outputMuted ? 0 : levels.assistant
13012
+ }),
13013
+ isMuted: () => micMuted,
13014
+ setMuted: (value) => {
13015
+ micMuted = Boolean(value);
13016
+ control("mute", micMuted);
13017
+ },
13018
+ isOutputMuted: () => outputMuted,
13019
+ setOutputMuted: (value) => {
13020
+ outputMuted = Boolean(value);
13021
+ control("outputMute", outputMuted);
13022
+ }
13023
+ };
13024
+ }
13025
+ //#endregion
12858
13026
  //#region src/voice-browser.js
12859
13027
  const PARAM = "codexVoiceSession";
12860
13028
  const validSession = (value) => typeof value === "string" && /^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,255}$/u.test(value);
@@ -13554,7 +13722,39 @@ void main(){
13554
13722
  const [browserCopied, setBrowserCopied] = (0, react.useState)(false);
13555
13723
  const [micOff, setMicOff] = (0, react.useState)(false);
13556
13724
  const [speakerOff, setSpeakerOff] = (0, react.useState)(false);
13725
+ const [nativeAvailable, setNativeAvailable] = (0, react.useState)(false);
13557
13726
  const enabled = snapshot.status === "ready" && snapshot.voiceCall === "on";
13727
+ const capability = enabled ? voiceCallCapability() : void 0;
13728
+ (0, react.useEffect)(() => {
13729
+ setProblem("");
13730
+ setUnsupported(false);
13731
+ setBrowserCopied(false);
13732
+ }, [sessionId, capability]);
13733
+ (0, react.useEffect)(() => {
13734
+ setNativeAvailable(false);
13735
+ if (!enabled || !["voice-no-webrtc", "voice-no-microphone"].includes(capability) || !nativeVoiceEligible()) return void 0;
13736
+ const controller = new AbortController();
13737
+ let retry;
13738
+ const probe = async (attempt = 0) => {
13739
+ try {
13740
+ const result = await rpc.call(CHANNEL, "voice/native/probe", {}, controller.signal);
13741
+ if (controller.signal.aborted) return;
13742
+ if (result.value?.code === "native-voice-busy" && attempt < 3) retry = setTimeout(() => {
13743
+ probe(attempt + 1);
13744
+ }, 400);
13745
+ else setNativeAvailable(result.ok && result.value?.available === true);
13746
+ } catch {}
13747
+ };
13748
+ probe();
13749
+ return () => {
13750
+ controller.abort();
13751
+ clearTimeout(retry);
13752
+ };
13753
+ }, [
13754
+ enabled,
13755
+ capability,
13756
+ rpc
13757
+ ]);
13558
13758
  (0, react.useLayoutEffect)(() => {
13559
13759
  if (!enabled) {
13560
13760
  setPlace(void 0);
@@ -13630,6 +13830,7 @@ void main(){
13630
13830
  return () => clearTimeout(timer);
13631
13831
  }, [problem, unsupported]);
13632
13832
  const start = async () => {
13833
+ if (nativeAvailable && !window.confirm(t("voiceNativeCaptureConfirm"))) return;
13633
13834
  const controller = new AbortController();
13634
13835
  pendingCall.current?.abort();
13635
13836
  pendingCall.current = controller;
@@ -13640,19 +13841,22 @@ void main(){
13640
13841
  setMicOff(false);
13641
13842
  setSpeakerOff(false);
13642
13843
  setState("connecting");
13844
+ let attemptEnded = false;
13643
13845
  try {
13644
- const opened = await openVoiceCall({
13846
+ const opened = await (nativeAvailable ? openNativeVoiceCall : openVoiceCall)({
13645
13847
  rpc,
13646
13848
  sessionId,
13849
+ captureAllowed: nativeAvailable,
13647
13850
  signal: controller.signal,
13648
13851
  onEnd: () => {
13852
+ attemptEnded = true;
13649
13853
  if (!alive.current || controller.signal.aborted || pendingCall.current !== controller) return;
13650
13854
  call.current = null;
13651
13855
  setLiveCall(null);
13652
13856
  setState("idle");
13653
13857
  }
13654
13858
  });
13655
- if (!alive.current || controller.signal.aborted) {
13859
+ if (!alive.current || controller.signal.aborted || attemptEnded || pendingCall.current !== controller) {
13656
13860
  await opened.stop();
13657
13861
  return;
13658
13862
  }
@@ -13660,14 +13864,15 @@ void main(){
13660
13864
  setLiveCall(call.current);
13661
13865
  setState("live");
13662
13866
  } catch (error) {
13663
- if (!alive.current || controller.signal.aborted) return;
13867
+ if (!alive.current || controller.signal.aborted || pendingCall.current !== controller) return;
13664
13868
  call.current = null;
13665
13869
  setLiveCall(null);
13666
13870
  setState("idle");
13667
13871
  setUnsupported([
13668
13872
  "voice-no-webrtc",
13669
13873
  "voice-no-microphone",
13670
- "voice-insecure"
13874
+ "voice-insecure",
13875
+ "voice-native-unavailable"
13671
13876
  ].includes(error?.code) ? error.code : false);
13672
13877
  setProblem(voiceCallProblem(error));
13673
13878
  }
@@ -13696,10 +13901,26 @@ void main(){
13696
13901
  });
13697
13902
  if (!enabled || !place) return anchor;
13698
13903
  const visible = state !== "idle" || place.idle;
13699
- const browserUrl = unsupported && unsupported !== "voice-insecure" ? voiceBrowserUrl(window.location.href, sessionId) : void 0;
13904
+ const browserUrl = capability === "voice-no-webrtc" || unsupported && unsupported !== "voice-insecure" ? voiceBrowserUrl(window.location.href, sessionId) : void 0;
13700
13905
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
13701
13906
  anchor,
13702
- visible ? (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
13907
+ visible ? (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [state === "idle" && !nativeAvailable && capability === "voice-no-webrtc" && browserUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
13908
+ ref: button,
13909
+ href: browserUrl,
13910
+ target: "_blank",
13911
+ rel: "noopener noreferrer",
13912
+ className: `${place.className} codexVoiceCall`,
13913
+ "data-state": "browser",
13914
+ "aria-label": t("voiceBrowserCall"),
13915
+ title: t("voiceBrowserCall"),
13916
+ style: {
13917
+ left: place.left,
13918
+ top: place.top,
13919
+ width: place.width,
13920
+ height: place.height
13921
+ },
13922
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Bars, {})
13923
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
13703
13924
  ref: button,
13704
13925
  type: "button",
13705
13926
  className: `${place.className} codexVoiceCall`,
@@ -14226,6 +14447,88 @@ void main(){
14226
14447
  })]
14227
14448
  });
14228
14449
  }
14450
+ Object.freeze({
14451
+ imageCapability: ["imageGeneration", "imageEditing"],
14452
+ imageEntryPoints: ["imageShortcut"],
14453
+ sketchCanvas: ["imageSketch"],
14454
+ sketchAgent: ["imageSketchAgent"],
14455
+ imageBrowsing: ["imageViewer", "imageAnnotations"]
14456
+ });
14457
+ //#endregion
14458
+ //#region src/image-preferences.jsx
14459
+ function ImageChoice({ t, label, hint, title, value, text, items, disabled, onSelect }) {
14460
+ const [open, setOpen] = (0, react.useState)(false);
14461
+ const anchor = (0, react.useRef)(null);
14462
+ (0, react.useEffect)(() => {
14463
+ if (!open || disabled) return;
14464
+ const escape = (event) => {
14465
+ if (event.key !== "Escape") return;
14466
+ event.preventDefault();
14467
+ event.stopPropagation();
14468
+ setOpen(false);
14469
+ anchor.current?.focus();
14470
+ };
14471
+ window.addEventListener("keydown", escape, true);
14472
+ return () => window.removeEventListener("keydown", escape, true);
14473
+ }, [open, disabled]);
14474
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
14475
+ className: "codexSubscriptionPreference codexImagePreference",
14476
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
14477
+ className: "codexSubscriptionPreferenceCopy",
14478
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: label }), hint ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Hint, {
14479
+ t,
14480
+ children: hint
14481
+ }) : null]
14482
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Menu, {
14483
+ open: open && !disabled,
14484
+ items,
14485
+ selectedId: value,
14486
+ onSelect: (id) => {
14487
+ setOpen(false);
14488
+ onSelect(id);
14489
+ },
14490
+ onClose: () => setOpen(false),
14491
+ align: "end",
14492
+ side: "bottom",
14493
+ portal: true,
14494
+ compact: true,
14495
+ anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
14496
+ ref: anchor,
14497
+ type: "button",
14498
+ className: "codexSubscriptionContextTrigger",
14499
+ "aria-label": label,
14500
+ "aria-haspopup": "menu",
14501
+ "aria-expanded": open && !disabled,
14502
+ title,
14503
+ disabled,
14504
+ onClick: () => setOpen((current) => !current),
14505
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronDownOutline14, {})]
14506
+ })
14507
+ })]
14508
+ });
14509
+ }
14510
+ //#endregion
14511
+ //#region src/default-reasoning-preferences.jsx
14512
+ function DefaultReasoningEffortPreference({ preference, t }) {
14513
+ const snapshot = usePreferenceSnapshot(preference);
14514
+ const value = normalizeDefaultReasoningEffortChoice(snapshot[DEFAULT_REASONING_EFFORT_FIELD]);
14515
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImageChoice, {
14516
+ t,
14517
+ label: t("defaultReasoningEffort"),
14518
+ hint: t("defaultReasoningEffortHint"),
14519
+ title: t("defaultUltraHint"),
14520
+ value,
14521
+ text: t(`defaultReasoningEffort_${value}`),
14522
+ items: DEFAULT_REASONING_EFFORTS.filter((id) => id !== "ultra" || snapshot.ultraModels?.length > 0).map((id) => ({
14523
+ id,
14524
+ label: t(`defaultReasoningEffort_${id}`)
14525
+ })),
14526
+ disabled: snapshot.status !== "ready" || !snapshot.writable || snapshot.saving,
14527
+ onSelect: (effort) => {
14528
+ preference.set({ [DEFAULT_REASONING_EFFORT_FIELD]: effort });
14529
+ }
14530
+ });
14531
+ }
14229
14532
  //#endregion
14230
14533
  //#region src/client-runtime-management.jsx
14231
14534
  function RuntimeManagement({ rpc, preference, t }) {
@@ -17209,40 +17512,45 @@ void main(){
17209
17512
  }, [rpc]);
17210
17513
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
17211
17514
  className: "codexSubscriptionCard codexSubscriptionStorage",
17212
- "aria-label": t("storageTitle"),
17515
+ "aria-label": t("storageForecast"),
17213
17516
  children: [
17214
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t("storageTitle") }),
17215
17517
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
17518
+ className: "codexSubscriptionStorageHead",
17519
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
17520
+ className: "codexSubscriptionStorageTitle",
17521
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t("storageForecast") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("output", {
17522
+ role: "status",
17523
+ children: usage ? `${(usage.bytes / 1024).toFixed(1)} / ${(usage.limit / 1024).toFixed(0)} KiB` : t("storageLoading")
17524
+ })]
17525
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
17526
+ className: "codexSubscriptionActions",
17527
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
17528
+ type: "button",
17529
+ variant: "outline",
17530
+ disabled: busy,
17531
+ onClick: () => void read(false),
17532
+ children: t("runtimeRefresh")
17533
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
17534
+ type: "button",
17535
+ variant: "outline",
17536
+ disabled: busy || !usage?.bytes,
17537
+ onClick: () => setConfirm(true),
17538
+ children: t("storageClear")
17539
+ })]
17540
+ })]
17541
+ }),
17542
+ usage ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
17216
17543
  className: "codexSubscriptionStorageMeter",
17217
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("storageForecast") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("output", {
17218
- role: "status",
17219
- children: usage ? `${(usage.bytes / 1024).toFixed(1)} / ${(usage.limit / 1024).toFixed(0)} KiB` : t("storageLoading")
17220
- })] }), usage ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("progress", {
17544
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("progress", {
17221
17545
  "aria-label": t("storageForecast"),
17222
17546
  value: usage.bytes,
17223
17547
  max: usage.limit
17224
- }) : null]
17225
- }),
17548
+ })
17549
+ }) : null,
17226
17550
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
17227
17551
  className: "codexSubscriptionHelp",
17228
17552
  children: t("storageHint")
17229
17553
  }),
17230
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
17231
- className: "codexSubscriptionActions",
17232
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
17233
- type: "button",
17234
- variant: "outline",
17235
- disabled: busy,
17236
- onClick: () => void read(false),
17237
- children: t("runtimeRefresh")
17238
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
17239
- type: "button",
17240
- variant: "outline",
17241
- disabled: busy || !usage?.bytes,
17242
- onClick: () => setConfirm(true),
17243
- children: t("storageClear")
17244
- })]
17245
- }),
17246
17554
  confirm ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
17247
17555
  className: "codexSubscriptionConfirm",
17248
17556
  role: "group",
@@ -17919,65 +18227,6 @@ void main(){
17919
18227
  ]
17920
18228
  });
17921
18229
  }
17922
- Object.freeze({
17923
- imageCapability: ["imageGeneration", "imageEditing"],
17924
- imageEntryPoints: ["imageShortcut"],
17925
- sketchCanvas: ["imageSketch"],
17926
- sketchAgent: ["imageSketchAgent"],
17927
- imageBrowsing: ["imageViewer", "imageAnnotations"]
17928
- });
17929
- //#endregion
17930
- //#region src/image-preferences.jsx
17931
- function ImageChoice({ t, label, hint, value, text, items, disabled, onSelect }) {
17932
- const [open, setOpen] = (0, react.useState)(false);
17933
- const anchor = (0, react.useRef)(null);
17934
- (0, react.useEffect)(() => {
17935
- if (!open || disabled) return;
17936
- const escape = (event) => {
17937
- if (event.key !== "Escape") return;
17938
- event.preventDefault();
17939
- event.stopPropagation();
17940
- setOpen(false);
17941
- anchor.current?.focus();
17942
- };
17943
- window.addEventListener("keydown", escape, true);
17944
- return () => window.removeEventListener("keydown", escape, true);
17945
- }, [open, disabled]);
17946
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
17947
- className: "codexSubscriptionPreference codexImagePreference",
17948
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
17949
- className: "codexSubscriptionPreferenceCopy",
17950
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: label }), hint ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Hint, {
17951
- t,
17952
- children: hint
17953
- }) : null]
17954
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Menu, {
17955
- open: open && !disabled,
17956
- items,
17957
- selectedId: value,
17958
- onSelect: (id) => {
17959
- setOpen(false);
17960
- onSelect(id);
17961
- },
17962
- onClose: () => setOpen(false),
17963
- align: "end",
17964
- side: "bottom",
17965
- portal: true,
17966
- compact: true,
17967
- anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
17968
- ref: anchor,
17969
- type: "button",
17970
- className: "codexSubscriptionContextTrigger",
17971
- "aria-label": label,
17972
- "aria-haspopup": "menu",
17973
- "aria-expanded": open && !disabled,
17974
- disabled,
17975
- onClick: () => setOpen((current) => !current),
17976
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronDownOutline14, {})]
17977
- })
17978
- })]
17979
- });
17980
- }
17981
18230
  //#endregion
17982
18231
  //#region src/client-pages.jsx
17983
18232
  const ready = (snapshot) => snapshot.status === "ready" && snapshot.writable === true;
@@ -18235,6 +18484,10 @@ void main(){
18235
18484
  defaultModel,
18236
18485
  t
18237
18486
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "codexSubscriptionDivider" })] }),
18487
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefaultReasoningEffortPreference, {
18488
+ preference,
18489
+ t
18490
+ }),
18238
18491
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PickerModelsPreference, {
18239
18492
  preference,
18240
18493
  t
@@ -19196,9 +19449,8 @@ void main(){
19196
19449
  }
19197
19450
  //#endregion
19198
19451
  //#region src/history-pending.js
19199
- function pendingReason(period, now = Date.now()) {
19200
- if (period.usedPercent !== void 0) return void 0;
19201
- return period.endsAt > now ? "current" : "past";
19452
+ function reportedHistoryPeriods(periods = []) {
19453
+ return periods.filter((period) => Number.isFinite(period.usedPercent) || Object.values(period.breakdowns ?? {}).some((rows) => rows.length > 0)).sort((a, b) => b.startsAt - a.startsAt);
19202
19454
  }
19203
19455
  const historyPeriodKey = (period) => `${period.startsAt}:${period.endsAt}:${period.windowMinutes ?? ""}`;
19204
19456
  function selectHistoryPeriod(periods, selected, now = Date.now()) {
@@ -19410,14 +19662,12 @@ void main(){
19410
19662
  }, row.key))]
19411
19663
  });
19412
19664
  }
19413
- function UsageHistory({ rpc, t, signedIn, resetKey, refreshKey }) {
19414
- const [open, setOpen] = (0, react.useState)(false);
19665
+ function UsageHistory({ rpc, t, signedIn, resetKey, refreshKey, forceRefreshKey }) {
19415
19666
  const [state, setState] = (0, react.useState)({ status: "idle" });
19416
19667
  const [selected, setSelected] = (0, react.useState)();
19417
19668
  const request = (0, react.useRef)(0);
19669
+ const lastForceRefresh = (0, react.useRef)(forceRefreshKey);
19418
19670
  (0, react.useEffect)(() => {
19419
- request.current += 1;
19420
- setState({ status: "idle" });
19421
19671
  setSelected(void 0);
19422
19672
  }, [signedIn, resetKey]);
19423
19673
  const load = (0, react.useCallback)((force) => {
@@ -19425,46 +19675,50 @@ void main(){
19425
19675
  const id = ++request.current;
19426
19676
  setState((previous) => ({
19427
19677
  status: "loading",
19428
- value: previous.value
19678
+ resetKey,
19679
+ value: previous.resetKey === resetKey ? previous.value : void 0
19429
19680
  }));
19430
19681
  recoveryCall(rpc, "usage/history", { force }, 2e4).then((value) => {
19431
19682
  if (request.current === id) setState({
19432
19683
  status: "ready",
19684
+ resetKey,
19433
19685
  value
19434
19686
  });
19435
19687
  }).catch((error) => {
19436
- if (request.current === id) setState({
19688
+ if (request.current === id) setState((previous) => ({
19437
19689
  status: "error",
19690
+ resetKey,
19691
+ value: previous.resetKey === resetKey ? previous.value : void 0,
19438
19692
  message: error.message
19439
- });
19693
+ }));
19440
19694
  });
19441
- }, [signedIn, rpc]);
19695
+ }, [
19696
+ signedIn,
19697
+ rpc,
19698
+ resetKey
19699
+ ]);
19442
19700
  (0, react.useEffect)(() => {
19443
- if (!open || !signedIn) return;
19444
- load(false);
19701
+ const force = lastForceRefresh.current !== forceRefreshKey;
19702
+ lastForceRefresh.current = forceRefreshKey;
19703
+ load(force);
19445
19704
  return () => {
19446
19705
  request.current += 1;
19447
19706
  };
19448
19707
  }, [
19449
- open,
19450
19708
  signedIn,
19451
19709
  resetKey,
19452
19710
  refreshKey,
19711
+ forceRefreshKey,
19453
19712
  load
19454
19713
  ]);
19455
19714
  if (!signedIn) return null;
19456
- const value = state.value;
19457
- const periods = [...value?.periods ?? []].sort((a, b) => b.startsAt - a.startsAt);
19715
+ const value = state.resetKey === resetKey ? state.value : void 0;
19716
+ const periods = value?.available === false ? [] : reportedHistoryPeriods(value?.periods);
19458
19717
  const period = selectHistoryPeriod(periods, selected);
19459
- const reason = period === void 0 ? void 0 : pendingReason(period);
19460
- const asOfDate = value?.asOf ? new Date(value.asOf).toLocaleDateString(uiLocale(), {
19461
- month: "numeric",
19462
- day: "numeric"
19463
- }) : "";
19718
+ if (period === void 0) return null;
19464
19719
  const present = DIMENSIONS.filter((dimension) => period?.breakdowns?.[dimension]?.length > 0);
19465
19720
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
19466
19721
  className: "codexSubscriptionHistory",
19467
- onToggle: (event) => setOpen(event.currentTarget.open),
19468
19722
  children: [
19469
19723
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("historyTitle") }),
19470
19724
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
@@ -19476,73 +19730,57 @@ void main(){
19476
19730
  }),
19477
19731
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
19478
19732
  "aria-live": "polite",
19479
- children: [
19480
- state.status === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19481
- className: "codexSubscriptionEmpty",
19482
- role: "status",
19483
- children: t("historyLoading")
19484
- }) : null,
19485
- state.status === "error" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19486
- className: "codexSubscriptionError",
19487
- role: "alert",
19488
- children: state.message
19489
- }) : null,
19490
- state.status === "ready" && value?.available === false ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19491
- className: "codexSubscriptionEmpty",
19492
- role: "status",
19493
- children: t("historyUnavailable")
19494
- }) : null,
19495
- state.status === "ready" && value?.available !== false && period === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19496
- className: "codexSubscriptionEmpty",
19497
- role: "status",
19498
- children: t("historyEmpty")
19499
- }) : null
19500
- ]
19501
- }),
19502
- period === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
19503
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
19504
- className: "codexSubscriptionHistoryPeriods",
19505
- role: "group",
19506
- "aria-label": t("historyPeriods"),
19507
- children: periods.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
19508
- type: "button",
19509
- "aria-pressed": item === period,
19510
- title: item.usedPercent === void 0 ? t("historyPending") : void 0,
19511
- onClick: () => setSelected(historyPeriodKey(item)),
19512
- children: `${day(item.startsAt)}–${day(item.endsAt)}`
19513
- }, historyPeriodKey(item)))
19514
- }),
19515
- reason === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
19516
- className: "codexSubscriptionHistorySummary",
19517
- children: [fill(t("historyUsed"), { value: amount(period.usedPercent) }), period.complete ? "" : ` ${t("historyPartial")}`]
19518
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19733
+ children: [state.status === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19519
19734
  className: "codexSubscriptionEmpty",
19520
19735
  role: "status",
19521
- children: fill(t(reason === "current" ? "historyPendingCurrent" : asOfDate ? "historyPendingPast" : "historyPendingPastUnknown"), { date: asOfDate })
19522
- }),
19523
- reason === void 0 && present.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19524
- className: "codexSubscriptionEmpty",
19525
- role: "status",
19526
- children: t("historyNoBreakdown")
19527
- }) : null,
19528
- present.map((dimension) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Rows, {
19529
- dimension,
19530
- rows: period.breakdowns[dimension],
19531
- total: period.usedPercent,
19532
- t
19533
- }, dimension)),
19534
- value.asOf ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19535
- className: "codexSubscriptionCreditNote",
19536
- children: fill(t("historyAsOf"), { date: new Date(value.asOf).toLocaleDateString(uiLocale(), {
19537
- month: "numeric",
19538
- day: "numeric"
19539
- }) })
19540
- }) : null,
19541
- value.approximate ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19542
- className: "codexSubscriptionCreditNote",
19543
- children: t("historyApproximate")
19544
- }) : null
19545
- ] })
19736
+ children: t("historyLoading")
19737
+ }) : null, state.status === "error" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19738
+ className: "codexSubscriptionError",
19739
+ role: "alert",
19740
+ children: state.message
19741
+ }) : null]
19742
+ }),
19743
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
19744
+ className: "codexSubscriptionHistoryPeriods",
19745
+ role: "group",
19746
+ "aria-label": t("historyPeriods"),
19747
+ children: periods.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
19748
+ type: "button",
19749
+ "aria-pressed": item === period,
19750
+ onClick: () => setSelected(historyPeriodKey(item)),
19751
+ children: `${day(item.startsAt)}–${day(item.endsAt)}`
19752
+ }, historyPeriodKey(item)))
19753
+ }),
19754
+ period.usedPercent !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
19755
+ className: "codexSubscriptionHistorySummary",
19756
+ children: [fill(t("historyUsed"), { value: amount(period.usedPercent) }), period.complete ? "" : ` ${t("historyPartial")}`]
19757
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19758
+ className: "codexSubscriptionEmpty",
19759
+ role: "status",
19760
+ children: t("historyTotalUnavailable")
19761
+ }),
19762
+ present.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19763
+ className: "codexSubscriptionEmpty",
19764
+ role: "status",
19765
+ children: t("historyNoBreakdown")
19766
+ }) : null,
19767
+ present.map((dimension) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Rows, {
19768
+ dimension,
19769
+ rows: period.breakdowns[dimension],
19770
+ total: period.usedPercent,
19771
+ t
19772
+ }, dimension)),
19773
+ value.asOf ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19774
+ className: "codexSubscriptionCreditNote",
19775
+ children: fill(t("historyAsOf"), { date: new Date(value.asOf).toLocaleDateString(uiLocale(), {
19776
+ month: "numeric",
19777
+ day: "numeric"
19778
+ }) })
19779
+ }) : null,
19780
+ value.approximate ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
19781
+ className: "codexSubscriptionCreditNote",
19782
+ children: t("historyApproximate")
19783
+ }) : null
19546
19784
  ]
19547
19785
  });
19548
19786
  }
@@ -19791,9 +20029,12 @@ void main(){
19791
20029
  }
19792
20030
  function UsageCard({ rpc, t, signedIn, resetKey, preference }) {
19793
20031
  const { usage, busy, error, now, refresh } = useQuotaUsage(rpc, signedIn);
20032
+ const [historyRefreshKey, setHistoryRefreshKey] = (0, react.useState)(0);
19794
20033
  const forecastMode = usePreferenceSnapshot(preference).quickQuotaMode === QUICK_QUOTA_MODE_FORECAST;
19795
20034
  const load = (force) => {
19796
- if (signedIn) refresh(force).catch(() => {});
20035
+ if (!signedIn) return;
20036
+ if (force) setHistoryRefreshKey((value) => value + 1);
20037
+ refresh(force).catch(() => {});
19797
20038
  };
19798
20039
  const usageRefreshGeneration = usage?.fetchedAt ?? 0;
19799
20040
  const visibleUsage = signedIn ? usage : void 0;
@@ -19903,7 +20144,8 @@ void main(){
19903
20144
  t,
19904
20145
  signedIn,
19905
20146
  resetKey,
19906
- refreshKey: usageRefreshGeneration
20147
+ refreshKey: usageRefreshGeneration,
20148
+ forceRefreshKey: historyRefreshKey
19907
20149
  }),
19908
20150
  visibleUsage?.chatPass === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
19909
20151
  className: "codexSubscriptionLimits",