dsh-codex-subscription 3.2.14 → 3.2.15

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
@@ -1128,7 +1128,7 @@ window.__ModuleLoader__.load({
1128
1128
  children: rows(items)
1129
1129
  }) : null] });
1130
1130
  }
1131
- function ImageLightbox({ src, alt, labels, onClose }) {
1131
+ function ImageLightbox({ src, alt, labels, onClose, content }) {
1132
1132
  const dialog = (0, react.useRef)(null);
1133
1133
  (0, react.useLayoutEffect)(() => {
1134
1134
  const element = dialog.current, opener = element.ownerDocument.activeElement;
@@ -1151,21 +1151,26 @@ window.__ModuleLoader__.load({
1151
1151
  onClick: (event) => {
1152
1152
  if (event.target === event.currentTarget) onClose();
1153
1153
  },
1154
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
1155
- src,
1156
- alt
1157
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1158
- type: "button",
1159
- "aria-label": labels.close,
1160
- onClick: onClose,
1161
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCloseOutline16, {})
1162
- })]
1154
+ children: [
1155
+ src ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
1156
+ src,
1157
+ alt
1158
+ }) : null,
1159
+ content,
1160
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1161
+ type: "button",
1162
+ "aria-label": labels.close,
1163
+ onClick: onClose,
1164
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCloseOutline16, {})
1165
+ })
1166
+ ]
1163
1167
  });
1164
1168
  }
1165
1169
  const ORIGINAL_IMAGE_ID_PATTERN = /^img_[0-9a-f]{32}$/u;
1170
+ const GENERATED_IMAGE_MEDIA_TYPES = Object.freeze(["image/png", "image/gif"]);
1166
1171
  const positiveInteger = (value) => Number.isSafeInteger(value) && value > 0;
1167
1172
  function decodeOriginalImageRef(value) {
1168
- if (value === null || typeof value !== "object" || Array.isArray(value) || typeof value.assetId !== "string" || !ORIGINAL_IMAGE_ID_PATTERN.test(value.assetId) || value.mediaType !== "image/png" || !positiveInteger(value.bytes) || value.bytes > 48 * 1024 * 1024 || !positiveInteger(value.width) || !positiveInteger(value.height) || typeof value.name !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u.test(value.name) || typeof value.sha256 !== "string" || !/^[0-9a-f]{64}$/u.test(value.sha256)) return void 0;
1173
+ if (value === null || typeof value !== "object" || Array.isArray(value) || typeof value.assetId !== "string" || !ORIGINAL_IMAGE_ID_PATTERN.test(value.assetId) || !GENERATED_IMAGE_MEDIA_TYPES.includes(value.mediaType) || !positiveInteger(value.bytes) || value.bytes > 48 * 1024 * 1024 || !positiveInteger(value.width) || !positiveInteger(value.height) || typeof value.name !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u.test(value.name) || typeof value.sha256 !== "string" || !/^[0-9a-f]{64}$/u.test(value.sha256)) return void 0;
1169
1174
  return {
1170
1175
  assetId: value.assetId,
1171
1176
  mediaType: value.mediaType,
@@ -1310,11 +1315,12 @@ window.__ModuleLoader__.load({
1310
1315
  //#endregion
1311
1316
  //#region src/client-images.jsx
1312
1317
  const imageDownloadName = (attachment) => {
1313
- const fallback = "codex-generated-image.png";
1318
+ const extension = attachment?.mediaType === "image/gif" ? ".gif" : ".png";
1319
+ const fallback = `codex-generated-image${extension}`;
1314
1320
  if (typeof attachment?.name !== "string") return fallback;
1315
1321
  const cleaned = attachment.name.replace(/[<>:"/\\|?*\u0000-\u001f]/gu, "-").replace(/[. ]+$/u, "").trim();
1316
1322
  if (cleaned === "") return fallback;
1317
- return cleaned.toLowerCase().endsWith(".png") ? cleaned : `${cleaned}.png`;
1323
+ return cleaned.toLowerCase().endsWith(extension) ? cleaned : `${cleaned}${extension}`;
1318
1324
  };
1319
1325
  function triggerBlobDownload(data, mediaType, filename) {
1320
1326
  const url = URL.createObjectURL(new Blob([data], { type: mediaType }));
@@ -1331,12 +1337,15 @@ window.__ModuleLoader__.load({
1331
1337
  }
1332
1338
  }
1333
1339
  function CodexGeneratedImage({ attachment, original, gallery, rpc, sessionId, loadImage, openSketchImage, attachForEdit, getImageViewer, getInternalImageViewer, t, features }) {
1340
+ const animated = original?.mediaType === "image/gif";
1334
1341
  const { src, failed: error, fail, retry, attempt, usable, loaded } = useImageSource((0, react.useCallback)(() => loadImage(attachment), [attachment, loadImage]), attachment.attachmentId ?? attachment);
1335
1342
  const [nativePreview, setNativePreview] = (0, react.useState)();
1336
1343
  const triggerRef = (0, react.useRef)(null);
1337
1344
  const opening = (0, react.useRef)(0);
1345
+ const animationRequest = (0, react.useRef)();
1338
1346
  (0, react.useEffect)(() => () => {
1339
1347
  opening.current++;
1348
+ animationRequest.current?.abort();
1340
1349
  }, [attachment]);
1341
1350
  const label = attachment.name ?? t("imageLabel");
1342
1351
  const makeItem = (attachment, original, src) => {
@@ -1358,7 +1367,7 @@ window.__ModuleLoader__.load({
1358
1367
  onProgress
1359
1368
  }), original.mediaType, original.name)
1360
1369
  },
1361
- actions: !features.imageEditing ? [] : [
1370
+ actions: !features.imageEditing || original?.mediaType === "image/gif" ? [] : [
1362
1371
  {
1363
1372
  id: "continue-editing",
1364
1373
  label: t("imageEdit"),
@@ -1396,6 +1405,25 @@ window.__ModuleLoader__.load({
1396
1405
  const openImage = async () => {
1397
1406
  if (src === void 0) return;
1398
1407
  const revision = ++opening.current;
1408
+ if (animated) {
1409
+ animationRequest.current?.abort();
1410
+ const controller = new AbortController();
1411
+ animationRequest.current = controller;
1412
+ setNativePreview({ attachment });
1413
+ try {
1414
+ const bytes = await readOriginalImage(rpc, sessionId, original, { signal: controller.signal });
1415
+ if (!controller.signal.aborted) setNativePreview({
1416
+ attachment,
1417
+ blob: new Blob([bytes], { type: original.mediaType })
1418
+ });
1419
+ } catch {
1420
+ if (!controller.signal.aborted) setNativePreview({
1421
+ attachment,
1422
+ error: true
1423
+ });
1424
+ }
1425
+ return;
1426
+ }
1399
1427
  const selectedIndex = gallery?.findIndex((image) => image.attachment === attachment || attachment.attachmentId && image.attachment.attachmentId === attachment.attachmentId) ?? -1;
1400
1428
  const group = selectedIndex < 0 ? [...gallery ?? [], {
1401
1429
  attachment,
@@ -1436,28 +1464,68 @@ window.__ModuleLoader__.load({
1436
1464
  onClick: retry,
1437
1465
  children: t("imageLoadFailed")
1438
1466
  });
1439
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1440
- ref: triggerRef,
1441
- type: "button",
1442
- className: "codexGeneratedImageFrame",
1443
- title: error ? t("imageLoadFailed") : t("imageOpen"),
1444
- "aria-label": t("imageOpenNamed").replace("{value}", String(label)),
1445
- onClick: error ? retry : openImage,
1446
- children: [src === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("imageLoading") }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
1447
- src,
1448
- onError: fail,
1449
- onLoad: loaded,
1450
- alt: label
1451
- }, attempt), error ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("imageLoadFailed") }) : null]
1452
- }), nativePreview?.attachment === attachment && !features.imageViewer ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImageLightbox, {
1453
- src: nativePreview.src,
1467
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
1468
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1469
+ ref: triggerRef,
1470
+ type: "button",
1471
+ className: "codexGeneratedImageFrame",
1472
+ title: error ? t("imageLoadFailed") : t("imageOpen"),
1473
+ "aria-label": t("imageOpenNamed").replace("{value}", String(label)),
1474
+ onClick: error ? retry : openImage,
1475
+ children: [src === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("imageLoading") }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
1476
+ src,
1477
+ onError: fail,
1478
+ onLoad: loaded,
1479
+ alt: label
1480
+ }, attempt), error ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("imageLoadFailed") }) : null]
1481
+ }),
1482
+ nativePreview?.attachment === attachment && animated ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AnimatedPreview, {
1483
+ preview: nativePreview,
1484
+ name: original.name,
1485
+ label,
1486
+ t,
1487
+ onClose: () => {
1488
+ animationRequest.current?.abort();
1489
+ setNativePreview(void 0);
1490
+ }
1491
+ }) : null,
1492
+ nativePreview?.attachment === attachment && !animated && !features.imageViewer ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImageLightbox, {
1493
+ src: nativePreview.src,
1494
+ alt: label,
1495
+ labels: {
1496
+ dialog: t("imagePreview"),
1497
+ close: t("imageClosePreview")
1498
+ },
1499
+ onClose: () => setNativePreview(void 0)
1500
+ }) : null
1501
+ ] });
1502
+ }
1503
+ function AnimatedPreview({ preview, name, label, t, onClose }) {
1504
+ const [src, setSource] = (0, react.useState)();
1505
+ (0, react.useEffect)(() => {
1506
+ if (!preview.blob) return;
1507
+ const url = URL.createObjectURL(preview.blob);
1508
+ setSource(url);
1509
+ return () => URL.revokeObjectURL(url);
1510
+ }, [preview.blob]);
1511
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImageLightbox, {
1512
+ src,
1454
1513
  alt: label,
1455
1514
  labels: {
1456
1515
  dialog: t("imagePreview"),
1457
1516
  close: t("imageClosePreview")
1458
1517
  },
1459
- onClose: () => setNativePreview(void 0)
1460
- }) : null] });
1518
+ onClose,
1519
+ content: src ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
1520
+ className: "codexSubscriptionLink dcsLightboxDownload",
1521
+ href: src,
1522
+ download: name,
1523
+ children: t("imageDownload")
1524
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1525
+ role: preview.error ? "alert" : "status",
1526
+ children: t(preview.error ? "imageLoadFailed" : "imageLoading")
1527
+ })
1528
+ });
1461
1529
  }
1462
1530
  function CodexImageToolRow({ presentation = "tool", block, gallery, sessionId, rpc, loadImage, openSketchImage, attachForEdit, getImageViewer, getInternalImageViewer, t, preference }) {
1463
1531
  const features = (0, react.useSyncExternalStore)(preference.subscribe, preference.getSnapshot);
@@ -1537,10 +1605,14 @@ window.__ModuleLoader__.load({
1537
1605
  });
1538
1606
  }
1539
1607
  function CodexImageOutput({ node, ...props }) {
1540
- const gallery = node.data.blocks.flatMap((block) => block.content.filter((item) => item?.type === "image" && item.attachment).map((item) => ({
1541
- attachment: item.attachment,
1542
- original: decodeImagePresentation(block?.meta)?.original
1543
- })));
1608
+ const gallery = node.data.blocks.flatMap((block) => {
1609
+ const original = decodeImagePresentation(block?.meta)?.original;
1610
+ if (original?.mediaType === "image/gif") return [];
1611
+ return block.content.filter((item) => item?.type === "image" && item.attachment).map((item) => ({
1612
+ attachment: item.attachment,
1613
+ original
1614
+ }));
1615
+ });
1544
1616
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1545
1617
  className: "codexImageOutput",
1546
1618
  children: node.data.blocks.map((block) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CodexImageToolRow, {
@@ -2092,6 +2164,7 @@ window.__ModuleLoader__.load({
2092
2164
  "diagnosticsHostUnknown": "宿主界面检查不可用或未挂载,不能据此判断插件干扰。",
2093
2165
  "diagnosticsDetails": "展开脱敏详情",
2094
2166
  "diagnosticsCopyFailed": "复制失败,可展开详情手动复制。",
2167
+ "diagnosticsPreview": "查看报告",
2095
2168
  "diagnosticSource_rpc": "接口响应",
2096
2169
  "diagnosticSource_tool": "工具",
2097
2170
  "diagnosticOutcome_completed": "完成",
@@ -2474,7 +2547,7 @@ window.__ModuleLoader__.load({
2474
2547
  imageModel: "请求型号",
2475
2548
  imageQuality: "请求质量",
2476
2549
  imageExperimental: "实验",
2477
- imageModelHint: "2.5 为实验选项:请求已成功出图,但尚无法确认指定型号或质量是否生效。",
2550
+ imageModelHint: "Flare 和 Sunburst 为实验选项。订阅服务可能不采用请求的型号或质量。",
2478
2551
  sketchTool_pen: "画笔",
2479
2552
  sketchTool_rectangle: "矩形",
2480
2553
  sketchTool_circle: "椭圆",
@@ -2613,7 +2686,7 @@ window.__ModuleLoader__.load({
2613
2686
  diagnostics: "支持诊断",
2614
2687
  diagnosticsLoad: "生成诊断",
2615
2688
  diagnosticsLoading: "生成中…",
2616
- diagnosticsCopy: "复制诊断(精简)",
2689
+ diagnosticsCopy: "复制报告",
2617
2690
  diagnosticsCopyFull: "复制完整诊断",
2618
2691
  diagnosticsCopied: "已复制",
2619
2692
  diagnosticsFailed: "服务端诊断不可用,已生成可复制的本地脱敏诊断。请检查 DSH 服务连接与插件版本。",
@@ -2906,7 +2979,7 @@ window.__ModuleLoader__.load({
2906
2979
  fetchCodexHint: "通过 Codex 订阅读取可访问的网页文本。失败会直接提示,不会转到 DeepSeek API。",
2907
2980
  fetchUnavailableHint: "当前 DSH 不支持切换到 Codex 网页读取,请先升级宿主。",
2908
2981
  quotaForecastCalibrating: "续航正在校准",
2909
- quotaForecastIdle: "当前用量稳定",
2982
+ quotaForecastIdle: "近期剩余额度百分比未变化",
2910
2983
  quotaForecastUntilReset: "按最近用量,预计可用到重置",
2911
2984
  runwayDaysHours: "{days} 天 {hours}h",
2912
2985
  runwayDays: "{days} 天",
@@ -3037,6 +3110,7 @@ window.__ModuleLoader__.load({
3037
3110
  "diagnosticsHostUnknown": "Host inspection unavailable or unmounted; interference cannot be determined.",
3038
3111
  "diagnosticsDetails": "Redacted details",
3039
3112
  "diagnosticsCopyFailed": "Copy failed. Expand the details to copy manually.",
3113
+ "diagnosticsPreview": "View report",
3040
3114
  "diagnosticSource_rpc": "RPC response",
3041
3115
  "diagnosticSource_tool": "Tool",
3042
3116
  "diagnosticOutcome_completed": "Completed",
@@ -3419,7 +3493,7 @@ window.__ModuleLoader__.load({
3419
3493
  imageModel: "Requested model",
3420
3494
  imageQuality: "Requested quality",
3421
3495
  imageExperimental: "Experimental",
3422
- imageModelHint: "Image 2.5 options are experimental: requests generated images successfully, but the requested model and quality are not confirmed.",
3496
+ imageModelHint: "Flare and Sunburst are experimental. The subscription service may use a different model or quality.",
3423
3497
  sketchTool_pen: "Pen",
3424
3498
  sketchTool_rectangle: "Rectangle",
3425
3499
  sketchTool_circle: "Ellipse",
@@ -3558,7 +3632,7 @@ window.__ModuleLoader__.load({
3558
3632
  diagnostics: "Support diagnostics",
3559
3633
  diagnosticsLoad: "Create report",
3560
3634
  diagnosticsLoading: "Creating…",
3561
- diagnosticsCopy: "Copy report (short)",
3635
+ diagnosticsCopy: "Copy report",
3562
3636
  diagnosticsCopyFull: "Copy full report",
3563
3637
  diagnosticsCopied: "Copied",
3564
3638
  diagnosticsFailed: "Server diagnostics unavailable. A local, redacted report is available to copy. Check the DSH service and plugin version.",
@@ -3851,7 +3925,7 @@ window.__ModuleLoader__.load({
3851
3925
  fetchCodexHint: "Read accessible webpage text with your Codex subscription. Failures are reported directly, without falling back to the DeepSeek API.",
3852
3926
  fetchUnavailableHint: "This DSH version cannot switch to the Codex webpage reader. Update DSH first.",
3853
3927
  quotaForecastCalibrating: "Runway calibrating",
3854
- quotaForecastIdle: "Usage currently stable",
3928
+ quotaForecastIdle: "No recent change in the reported percentage",
3855
3929
  quotaForecastUntilReset: "Estimated to last until reset at recent usage",
3856
3930
  runwayDaysHours: "{days}d {hours}h",
3857
3931
  runwayDays: "{days}d",
@@ -4364,7 +4438,7 @@ window.__ModuleLoader__.load({
4364
4438
  "imageModel": "リクエストしたモデル",
4365
4439
  "imageQuality": "リクエストした品質",
4366
4440
  "imageExperimental": "実験的",
4367
- "imageModelHint": "Image 2.5 のオプションは実験的です。画像の生成リクエストは成功しますが、指定したモデルと品質は保証されません。",
4441
+ "imageModelHint": "Flare と Sunburst は試験的な選択肢です。購読サービスが別のモデルや品質で処理する場合があります。",
4368
4442
  "sketchTool_pen": "ペン",
4369
4443
  "sketchTool_rectangle": "長方形",
4370
4444
  "sketchTool_circle": "楕円",
@@ -4503,7 +4577,8 @@ window.__ModuleLoader__.load({
4503
4577
  "diagnostics": "サポート用診断情報",
4504
4578
  "diagnosticsLoad": "レポートを作成",
4505
4579
  "diagnosticsLoading": "作成中…",
4506
- "diagnosticsCopy": "レポートをコピー(概要)",
4580
+ "diagnosticsCopy": "レポートをコピー",
4581
+ "diagnosticsPreview": "レポートを表示",
4507
4582
  "diagnosticsCopyFull": "レポート全体をコピー",
4508
4583
  "diagnosticsCopied": "コピーしました",
4509
4584
  "diagnosticsFailed": "サーバーの診断情報を利用できません。ローカルで作成した、機密情報を削除済みのレポートをコピーできます。DSHサービスとプラグインのバージョンを確認してください。",
@@ -4796,7 +4871,7 @@ window.__ModuleLoader__.load({
4796
4871
  "fetchCodexHint": "Codex サブスクリプションを使って、アクセス可能なウェブページのテキストを読み取ります。失敗時はそのまま通知され、DeepSeek API にはフォールバックしません。",
4797
4872
  "fetchUnavailableHint": "このバージョンの DSH では Codex のウェブページリーダーに切り替えられません。先に DSH を更新してください。",
4798
4873
  "quotaForecastCalibrating": "残り時間を予測中",
4799
- "quotaForecastIdle": "現在、利用状況は安定しています",
4874
+ "quotaForecastIdle": "直近の残量表示に変化なし",
4800
4875
  "quotaForecastUntilReset": "最近の利用ペースなら、リセットまで持つ見込みです",
4801
4876
  "runwayDaysHours": "{days}日 {hours}時間",
4802
4877
  "runwayDays": "{days}日",
@@ -5309,7 +5384,7 @@ window.__ModuleLoader__.load({
5309
5384
  "imageModel": "Modelo solicitado",
5310
5385
  "imageQuality": "Calidad solicitada",
5311
5386
  "imageExperimental": "Experimental",
5312
- "imageModelHint": "Las opciones de Image 2.5 son experimentales: las solicitudes generan imágenes correctamente, pero no se confirma el modelo ni la calidad solicitados.",
5387
+ "imageModelHint": "Flare y Sunburst son experimentales. El servicio puede usar otro modelo u otra calidad.",
5313
5388
  "sketchTool_pen": "Pluma",
5314
5389
  "sketchTool_rectangle": "Rectángulo",
5315
5390
  "sketchTool_circle": "Elipse",
@@ -5448,7 +5523,8 @@ window.__ModuleLoader__.load({
5448
5523
  "diagnostics": "Diagnóstico de soporte",
5449
5524
  "diagnosticsLoad": "Crear informe",
5450
5525
  "diagnosticsLoading": "Creando…",
5451
- "diagnosticsCopy": "Copiar informe (breve)",
5526
+ "diagnosticsCopy": "Copiar informe",
5527
+ "diagnosticsPreview": "Ver informe",
5452
5528
  "diagnosticsCopyFull": "Copiar informe completo",
5453
5529
  "diagnosticsCopied": "Copiado",
5454
5530
  "diagnosticsFailed": "El diagnóstico del servidor no está disponible. Puedes copiar un informe local con datos confidenciales ocultos. Comprueba el servicio DSH y la versión del complemento.",
@@ -5741,7 +5817,7 @@ window.__ModuleLoader__.load({
5741
5817
  "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.",
5742
5818
  "fetchUnavailableHint": "Esta versión de DSH no permite cambiar al lector de páginas web de Codex. Actualiza DSH primero.",
5743
5819
  "quotaForecastCalibrating": "Calibrando autonomía",
5744
- "quotaForecastIdle": "El uso está estable",
5820
+ "quotaForecastIdle": "Sin cambios recientes en el porcentaje",
5745
5821
  "quotaForecastUntilReset": "Según el uso reciente, se estima que durará hasta el restablecimiento",
5746
5822
  "runwayDaysHours": "{days} d {hours} h",
5747
5823
  "runwayDays": "{days} d",
@@ -6254,7 +6330,7 @@ window.__ModuleLoader__.load({
6254
6330
  "imageModel": "Modèle demandé",
6255
6331
  "imageQuality": "Qualité demandée",
6256
6332
  "imageExperimental": "Expérimental",
6257
- "imageModelHint": "Les options Image 2.5 sont expérimentales : les demandes génèrent bien des images, mais le modèle et la qualité demandés ne sont pas confirmés.",
6333
+ "imageModelHint": "Flare et Sunburst sont expérimentaux. Le service peut utiliser un autre modèle ou une autre qualité.",
6258
6334
  "sketchTool_pen": "Stylo",
6259
6335
  "sketchTool_rectangle": "Rectangle",
6260
6336
  "sketchTool_circle": "Ellipse",
@@ -6393,7 +6469,8 @@ window.__ModuleLoader__.load({
6393
6469
  "diagnostics": "Diagnostic d’assistance",
6394
6470
  "diagnosticsLoad": "Créer un rapport",
6395
6471
  "diagnosticsLoading": "Création…",
6396
- "diagnosticsCopy": "Copier le rapport (court)",
6472
+ "diagnosticsCopy": "Copier le rapport",
6473
+ "diagnosticsPreview": "Voir le rapport",
6397
6474
  "diagnosticsCopyFull": "Copier le rapport complet",
6398
6475
  "diagnosticsCopied": "Copié",
6399
6476
  "diagnosticsFailed": "Les diagnostics du serveur sont indisponibles. Un rapport local expurgé peut être copié. Vérifiez le service DSH et la version du plugin.",
@@ -6686,7 +6763,7 @@ window.__ModuleLoader__.load({
6686
6763
  "fetchCodexHint": "Lire le texte accessible des pages Web avec votre abonnement Codex. Les échecs sont signalés directement, sans recours à l’API DeepSeek.",
6687
6764
  "fetchUnavailableHint": "Cette version de DSH ne permet pas de passer au lecteur de pages Web Codex. Mettez d’abord DSH à jour.",
6688
6765
  "quotaForecastCalibrating": "Estimation de l’autonomie en cours",
6689
- "quotaForecastIdle": "Utilisation actuellement stable",
6766
+ "quotaForecastIdle": "Aucune variation récente du pourcentage",
6690
6767
  "quotaForecastUntilReset": "Au rythme récent, le quota devrait suffire jusqu’à sa réinitialisation",
6691
6768
  "runwayDaysHours": "{days} j {hours} h",
6692
6769
  "runwayDays": "{days} j",
@@ -7199,7 +7276,7 @@ window.__ModuleLoader__.load({
7199
7276
  "imageModel": "Angefordertes Modell",
7200
7277
  "imageQuality": "Angeforderte Qualität",
7201
7278
  "imageExperimental": "Experimentell",
7202
- "imageModelHint": "Die Optionen für Image 2.5 sind experimentell: Bildanfragen werden erfolgreich ausgeführt, aber das angeforderte Modell und die Qualität werden nicht bestätigt.",
7279
+ "imageModelHint": "Flare und Sunburst sind experimentell. Der Dienst kann ein anderes Modell oder eine andere Qualität verwenden.",
7203
7280
  "sketchTool_pen": "Stift",
7204
7281
  "sketchTool_rectangle": "Rechteck",
7205
7282
  "sketchTool_circle": "Ellipse",
@@ -7338,7 +7415,8 @@ window.__ModuleLoader__.load({
7338
7415
  "diagnostics": "Supportdiagnose",
7339
7416
  "diagnosticsLoad": "Bericht erstellen",
7340
7417
  "diagnosticsLoading": "Wird erstellt…",
7341
- "diagnosticsCopy": "Bericht kopieren (kurz)",
7418
+ "diagnosticsCopy": "Bericht kopieren",
7419
+ "diagnosticsPreview": "Bericht ansehen",
7342
7420
  "diagnosticsCopyFull": "Vollständigen Bericht kopieren",
7343
7421
  "diagnosticsCopied": "Kopiert",
7344
7422
  "diagnosticsFailed": "Serverdiagnose nicht verfügbar. Ein lokaler, bereinigter Bericht kann kopiert werden. DSH-Dienst und Plugin-Version prüfen.",
@@ -7631,7 +7709,7 @@ window.__ModuleLoader__.load({
7631
7709
  "fetchCodexHint": "Liest zugängliche Webseitentexte mit deinem Codex-Abo. Fehler werden direkt gemeldet; es gibt keinen Rückgriff auf die DeepSeek-API.",
7632
7710
  "fetchUnavailableHint": "Diese DSH-Version kann nicht zum Codex-Webseitenleser wechseln. Aktualisiere zuerst DSH.",
7633
7711
  "quotaForecastCalibrating": "Restlaufzeit wird kalibriert",
7634
- "quotaForecastIdle": "Verbrauch derzeit stabil",
7712
+ "quotaForecastIdle": "Zuletzt keine Änderung der angezeigten Quote",
7635
7713
  "quotaForecastUntilReset": "Reicht bei jüngster Nutzung voraussichtlich bis zur Zurücksetzung",
7636
7714
  "runwayDaysHours": "{days} Tg. {hours} Std.",
7637
7715
  "runwayDays": "{days} Tg.",
@@ -8144,7 +8222,7 @@ window.__ModuleLoader__.load({
8144
8222
  "imageModel": "Запрошенная модель",
8145
8223
  "imageQuality": "Запрошенное качество",
8146
8224
  "imageExperimental": "Экспериментальная функция",
8147
- "imageModelHint": "Варианты Image 2.5 — экспериментальные: запросы на создание изображений выполняются успешно, но запрошенные модель и качество не подтверждаются.",
8225
+ "imageModelHint": "Flare и Sunburst — экспериментальные варианты. Сервис может использовать другую модель или качество.",
8148
8226
  "sketchTool_pen": "Перо",
8149
8227
  "sketchTool_rectangle": "Прямоугольник",
8150
8228
  "sketchTool_circle": "Эллипс",
@@ -8283,7 +8361,8 @@ window.__ModuleLoader__.load({
8283
8361
  "diagnostics": "Диагностика для поддержки",
8284
8362
  "diagnosticsLoad": "Создать отчёт",
8285
8363
  "diagnosticsLoading": "Создание…",
8286
- "diagnosticsCopy": "Скопировать краткий отчёт",
8364
+ "diagnosticsCopy": "Скопировать отчёт",
8365
+ "diagnosticsPreview": "Посмотреть отчёт",
8287
8366
  "diagnosticsCopyFull": "Скопировать полный отчёт",
8288
8367
  "diagnosticsCopied": "Скопировано",
8289
8368
  "diagnosticsFailed": "Диагностика сервера недоступна. Можно скопировать локальный отчёт с удалёнными личными данными. Проверьте службу DSH и версию плагина.",
@@ -8576,7 +8655,7 @@ window.__ModuleLoader__.load({
8576
8655
  "fetchCodexHint": "Читать доступный текст веб-страниц с подпиской Codex. Об ошибках сообщается напрямую, без перехода на API DeepSeek.",
8577
8656
  "fetchUnavailableHint": "Эта версия DSH не поддерживает переключение на средство чтения веб-страниц Codex. Сначала обновите DSH.",
8578
8657
  "quotaForecastCalibrating": "Прогноз остатка калибруется",
8579
- "quotaForecastIdle": "Расход сейчас стабилен",
8658
+ "quotaForecastIdle": "Процент остатка недавно не менялся",
8580
8659
  "quotaForecastUntilReset": "При недавнем темпе лимита должно хватить до сброса",
8581
8660
  "runwayDaysHours": "{days} д {hours} ч",
8582
8661
  "runwayDays": "{days} д",
@@ -9089,7 +9168,7 @@ window.__ModuleLoader__.load({
9089
9168
  "imageModel": "Modelo solicitado",
9090
9169
  "imageQuality": "Qualidade solicitada",
9091
9170
  "imageExperimental": "Experimental",
9092
- "imageModelHint": "As opções Image 2.5 são experimentais: as solicitações geram imagens com sucesso, mas o modelo e a qualidade solicitados não são confirmados.",
9171
+ "imageModelHint": "Flare e Sunburst são experimentais. O serviço pode usar outro modelo ou outra qualidade.",
9093
9172
  "sketchTool_pen": "Caneta",
9094
9173
  "sketchTool_rectangle": "Retângulo",
9095
9174
  "sketchTool_circle": "Elipse",
@@ -9228,7 +9307,8 @@ window.__ModuleLoader__.load({
9228
9307
  "diagnostics": "Diagnóstico para suporte",
9229
9308
  "diagnosticsLoad": "Criar relatório",
9230
9309
  "diagnosticsLoading": "Criando…",
9231
- "diagnosticsCopy": "Copiar relatório (resumido)",
9310
+ "diagnosticsCopy": "Copiar relatório",
9311
+ "diagnosticsPreview": "Ver relatório",
9232
9312
  "diagnosticsCopyFull": "Copiar relatório completo",
9233
9313
  "diagnosticsCopied": "Copiado",
9234
9314
  "diagnosticsFailed": "Os diagnósticos do servidor estão indisponíveis. Há um relatório local com dados ocultados para copiar. Verifique o serviço DSH e a versão do plugin.",
@@ -9521,7 +9601,7 @@ window.__ModuleLoader__.load({
9521
9601
  "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.",
9522
9602
  "fetchUnavailableHint": "Esta versão do DSH não permite usar o leitor de páginas do Codex. Atualize o DSH primeiro.",
9523
9603
  "quotaForecastCalibrating": "Previsão em calibração",
9524
- "quotaForecastIdle": "Uso estável no momento",
9604
+ "quotaForecastIdle": "Sem alteração recente no percentual",
9525
9605
  "quotaForecastUntilReset": "Previsão de duração até a redefinição, com base no uso recente",
9526
9606
  "runwayDaysHours": "{days}d {hours}h",
9527
9607
  "runwayDays": "{days}d",
@@ -10062,16 +10142,7 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
10062
10142
  .codexSubscriptionLimit[data-pace=true] progress{accent-color:var(--dsw-alias-state-warning-primary,#f5a300)}
10063
10143
  .codexSubscriptionLimit[data-pace=true] progress::-webkit-progress-value{background:var(--dsw-alias-state-warning-primary,#f5a300)}
10064
10144
  .codexSubscriptionLimit[data-pace=true] progress::-moz-progress-bar{background:var(--dsw-alias-state-warning-primary,#f5a300)}
10065
- .codexDiagResult{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0;border-top:1px solid var(--dsw-alias-border-l2)}
10066
- .codexDiagBadge{font-size:13px;line-height:20px;font-weight:500;color:var(--dsw-alias-label-primary)}
10067
- .codexDiagResult[data-state=attention] .codexDiagBadge::before{content:'';display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:8px;background:var(--dsw-alias-state-warning-primary,#f5a300)}
10068
- .codexDiagTime{font-size:12px;color:var(--dsw-alias-label-tertiary)}
10069
- .codexDiagFindings{list-style:none;margin:0;padding:0 0 6px;display:flex;flex-direction:column;gap:8px}
10070
- .codexDiagFindings>li{display:flex;flex-direction:column;gap:2px;font-size:13px;line-height:20px}
10071
- .codexDiagNext{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}
10072
- .codexDiagTable{width:100%;font-size:12px;text-align:left;border-spacing:0 6px}
10073
10145
  .codexFlat .codexSubscriptionDiagnostics details.codexAdvancedFold{margin:0;padding:0;border-top:1px solid var(--dsw-alias-border-l2)}.codexFlat .codexSubscriptionDiagnostics details>summary{margin:0}
10074
- .codexDiagFindings>li{padding:0;margin:0}.codexDiagFindings{padding-left:0!important}
10075
10146
  .codexModelsHead{display:flex;align-items:center;gap:6px 12px;flex-wrap:wrap;padding:8px 0 2px}.codexModelsHead h3{margin:0!important;flex:0 0 auto}
10076
10147
  .codexModelsHead>span{flex:1 1 auto;min-width:0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}
10077
10148
  .codexModelsHead>button{flex:0 0 auto;margin-left:auto;height:28px;min-height:28px;padding:0 10px;font-size:12px}
@@ -10121,6 +10192,7 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
10121
10192
  .dcsLightbox[open]{display:grid;place-items:center}
10122
10193
  .dcsLightbox::backdrop{background:var(--dsw-alias-bg-mask-1);backdrop-filter:var(--dsw-mask-blur);clip-path:inset(var(--dsh-frame-chrome-top,0px) 0 0)}
10123
10194
  .dcsLightbox img{max-width:100%;max-height:100%;object-fit:contain}
10195
+ .dcsLightboxDownload{position:absolute;inset-block-end:24px;inset-inline-end:24px;padding:8px 12px;border-radius:8px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary)}
10124
10196
  .dcsLightbox button{position:absolute;inset-block-start:calc(var(--dsh-frame-chrome-top,0px) + 16px);inset-inline-end:16px;display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);cursor:pointer}
10125
10197
  @media(prefers-reduced-motion:reduce){.dcsSwitch>span{transition:none}}
10126
10198
  `;
@@ -10409,6 +10481,14 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
10409
10481
  //#endregion
10410
10482
  //#region src/image-models.js
10411
10483
  const DEFAULT_IMAGE_MODEL = "gpt-image-2";
10484
+ const experimentalQuality = Object.freeze([
10485
+ "auto",
10486
+ "low",
10487
+ "medium",
10488
+ "high",
10489
+ "xhigh",
10490
+ "max"
10491
+ ]);
10412
10492
  const IMAGE_MODELS = Object.freeze({
10413
10493
  "gpt-image-2": Object.freeze([
10414
10494
  "auto",
@@ -10416,23 +10496,13 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
10416
10496
  "medium",
10417
10497
  "high"
10418
10498
  ]),
10419
- "gpt-image-2.5-flare": Object.freeze([
10420
- "auto",
10421
- "low",
10422
- "medium",
10423
- "high",
10424
- "xhigh",
10425
- "max"
10426
- ]),
10427
- "gpt-image-2.5-sunburst": Object.freeze([
10428
- "auto",
10429
- "low",
10430
- "medium",
10431
- "high",
10432
- "xhigh",
10433
- "max"
10434
- ])
10499
+ "gpt-image-2.5-flare": experimentalQuality,
10500
+ "gpt-image-2.5-sunburst": experimentalQuality,
10501
+ "gpt-image-2.6-flare": experimentalQuality,
10502
+ "gpt-image-2.6-sunburst": experimentalQuality
10435
10503
  });
10504
+ const isExperimentalImageModel = (model) => model !== "gpt-image-2" && Object.hasOwn(IMAGE_MODELS, model);
10505
+ const imageModelLabel = (model) => model.replace("gpt-image-", "GPT Image ").replace("-flare", " Flare").replace("-sunburst", " Sunburst");
10436
10506
  //#endregion
10437
10507
  //#region src/image-features.js
10438
10508
  const IMAGE_FEATURE_DEFAULTS = Object.freeze({
@@ -11512,10 +11582,13 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
11512
11582
  if (anchor + min * 1e3 <= now) return { kind: "stale" };
11513
11583
  const grid = min < 3600 ? 5 * 6e4 : 36e5;
11514
11584
  const round = (value) => Math.round(value / grid) * grid;
11585
+ const earliest = round(anchor + min * 1e3), latest = round(anchor + max * 1e3);
11586
+ const rawMax = !forecast.provisional && Number.isFinite(forecast.runwayMaxSeconds) ? forecast.runwayMaxSeconds : forecast.runwaySeconds;
11587
+ if (Number.isFinite(resetsAt) && Math.max(latest, anchor + rawMax * 1e3) >= resetsAt * 1e3) return { kind: "calibrating" };
11515
11588
  return {
11516
11589
  kind: "time",
11517
- earliest: round(anchor + min * 1e3),
11518
- latest: round(anchor + max * 1e3),
11590
+ earliest,
11591
+ latest,
11519
11592
  provisional: forecast.provisional === true
11520
11593
  };
11521
11594
  }
@@ -11683,7 +11756,7 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
11683
11756
  }
11684
11757
  //#endregion
11685
11758
  //#region src/version.js
11686
- const PACKAGE_VERSION = "3.2.14";
11759
+ const PACKAGE_VERSION = "3.2.15";
11687
11760
  //#endregion
11688
11761
  //#region src/client-recovery.js
11689
11762
  async function recoveryCall(rpc, endpoint, payload = {}, timeoutMs = endpoint === "usage" || endpoint.startsWith("usage/") ? 3e4 : 1e4) {
@@ -17172,239 +17245,134 @@ void main(){
17172
17245
  ] }) : null]
17173
17246
  });
17174
17247
  }
17175
- const areas = {
17176
- catalog: "models",
17177
- quota: "quota",
17178
- search: "search",
17179
- image: "images",
17180
- model: "transport",
17181
- voice: "transport",
17182
- login: "account",
17183
- "quota-reset": "quota"
17248
+ //#endregion
17249
+ //#region src/diagnostic-compact.js
17250
+ const preferences = {
17251
+ connectionMode: ["sse", "websocket"],
17252
+ compactionMode: ["dsh", "cloud"],
17253
+ composerModelPicker: [
17254
+ "auto",
17255
+ "dsh",
17256
+ "legacy"
17257
+ ],
17258
+ contextMode: [
17259
+ "standard",
17260
+ "extended",
17261
+ "custom"
17262
+ ],
17263
+ searchProvider: [
17264
+ "auto",
17265
+ "dsh",
17266
+ "codex"
17267
+ ],
17268
+ speedMode: [
17269
+ "standard",
17270
+ "fast",
17271
+ "ultrafast"
17272
+ ],
17273
+ outputVerbosity: [
17274
+ "default",
17275
+ "low",
17276
+ "medium",
17277
+ "high"
17278
+ ]
17184
17279
  };
17185
- function diagnosticEvidence({ operations, history }, now) {
17186
- return [...(operations?.events ?? []).map((e) => ({
17187
- capability: e.capability,
17188
- action: e.action,
17189
- source: e.source,
17190
- status: e.status,
17191
- observedAt: e.observedAt
17192
- })), ...(history?.events ?? []).map((e) => ({
17193
- capability: areas[e.area],
17194
- action: e.area,
17195
- source: "network",
17196
- status: e.status === "ok" ? "completed" : e.status,
17197
- observedAt: e.observedAt
17198
- }))].filter((e) => Number.isSafeInteger(e.observedAt) && now >= e.observedAt && now - e.observedAt <= 9e5).sort((a, b) => a.observedAt - b.observedAt);
17199
- }
17200
- function unresolvedFailures(events) {
17201
- const failed = /* @__PURE__ */ new Map();
17202
- for (const event of events) {
17203
- const key = `${event.source}:${event.action}`;
17204
- if (event.status === "failed") failed.set(key, event);
17205
- else if (event.status === "completed") failed.delete(key);
17280
+ function recentOperations(events, key, attemptAlias = () => void 0) {
17281
+ const latest = /* @__PURE__ */ new Map(), failures = /* @__PURE__ */ new Map();
17282
+ for (const event of events ?? []) {
17283
+ latest.set(key(event), event);
17284
+ if (event.status === "failed") failures.set(key(event), event);
17206
17285
  }
17207
- return [...failed.values()];
17208
- }
17209
- //#endregion
17210
- //#region src/diagnostic-summary.js
17211
- function diagnosticSummary(report, now = Date.now()) {
17212
- const findings = [];
17213
- const checks = [...report.inspection?.checks ?? [], ...report.client?.checks ?? []];
17214
- if (report.version && report.client?.version && report.version !== report.client.version) findings.push({
17215
- code: "version-mismatch",
17216
- severity: "warning",
17217
- next: "restart",
17218
- evidence: ["version", "client.version"]
17219
- });
17220
- if (!report.inspection || report.client?.status === "unknown" || checks.some((check) => ["inspection-failed", "inspection-timeout"].includes(check.reason))) findings.push({
17221
- code: "collection-incomplete",
17222
- severity: "warning",
17223
- next: "regenerate",
17224
- evidence: checks.filter((c) => c.status === "unknown").map((c) => c.id)
17225
- });
17226
- if (report.catalog?.unsupported?.length) findings.push({
17227
- code: "catalog-gap",
17228
- severity: "info",
17229
- next: "supported-options",
17230
- evidence: ["catalog.unsupported"]
17286
+ return [.../* @__PURE__ */ new Set([...latest.values(), ...failures.values()])].sort((a, b) => a.observedAt - b.observedAt).map(({ observedAt, sequence, attemptId, capability, ...event }) => {
17287
+ const attempt = attemptAlias(attemptId);
17288
+ return {
17289
+ at: new Date(observedAt).toISOString(),
17290
+ ...event,
17291
+ ...attempt ? { attempt } : {}
17292
+ };
17231
17293
  });
17232
- const capturedAt = Date.parse(report.generatedAt);
17233
- const failures = unresolvedFailures(diagnosticEvidence({
17234
- operations: report.operations,
17235
- history: report.requestHistory
17236
- }, Number.isFinite(capturedAt) ? capturedAt : now));
17237
- if (failures.length) findings.push({
17238
- code: "recent-failure",
17239
- severity: "warning",
17240
- next: "reproduce",
17241
- evidence: failures
17294
+ }
17295
+ function compactDiagnostic(report) {
17296
+ const attempts = /* @__PURE__ */ new Map();
17297
+ const network = recentOperations(report.requestHistory?.events, (event) => event.model ? `${event.area}:${event.model}` : event.area, (id) => {
17298
+ if (typeof id !== "string" || !/^[a-f0-9-]{36}$/u.test(id)) return void 0;
17299
+ if (!attempts.has(id)) attempts.set(id, `op${attempts.size + 1}`);
17300
+ return attempts.get(id);
17242
17301
  });
17243
- if ((report.requestHistory?.dropped ?? 0) + (report.operations?.dropped ?? 0) > 0 || report.client?.truncated) findings.push({
17244
- code: "evidence-truncated",
17245
- severity: "info",
17246
- next: "regenerate",
17247
- evidence: [
17248
- "requestHistory.dropped",
17249
- "operations.dropped",
17250
- "client.truncated"
17251
- ]
17302
+ const failureAttempt = attempts.get(report.streamFailure?.attemptId);
17303
+ const configuration = Object.fromEntries(Object.entries(preferences).flatMap(([key, allowed]) => allowed.includes(report.configuration?.[key]) ? [[key, report.configuration[key]]] : []));
17304
+ const slots = (report.client?.topology ?? []).flatMap(({ scope, slots: items }) => {
17305
+ const observed = items.filter((item) => item.declared && item.occupants.length > 0);
17306
+ return observed.length ? [{
17307
+ scope,
17308
+ slots: observed.map(({ name, occupants }) => ({
17309
+ name,
17310
+ occupants: occupants.map(({ registrant, active }) => ({
17311
+ registrant,
17312
+ active
17313
+ }))
17314
+ }))
17315
+ }] : [];
17252
17316
  });
17253
- return {
17254
- scope: "recorded-evidence-only",
17255
- findings,
17256
- unverified: (report.inspection?.capabilities ?? []).filter((c) => c.execution === "not-verified" && c.readiness !== "not-applicable").length
17257
- };
17258
- }
17259
- //#endregion
17260
- //#region src/diagnostic-log-format.js
17261
- function formatLogLine(entry) {
17262
- const stamp = new Date(entry.time).toISOString().replace("T", " ").slice(0, 19);
17263
- const repeat = entry.count > 1 ? ` (x${entry.count})` : "";
17264
- return `${stamp} ${entry.level.toUpperCase().padEnd(5)} [${entry.area}] ${entry.message}${entry.detail ? ` — ${entry.detail}` : ""}${repeat}`;
17265
- }
17266
- //#endregion
17267
- //#region src/model-stream-health.js
17268
- function safeStreamHealth(value) {
17269
- if (!Array.isArray(value)) return [];
17270
- return value.slice(-20).filter((item) => [
17271
- "completed",
17272
- "failed",
17273
- "cancelled"
17274
- ].includes(item?.status)).map((item) => ({
17275
- status: item.status,
17276
- ...Object.fromEntries([
17277
- "configured",
17278
- "selected",
17279
- "effective"
17280
- ].filter((key) => [
17281
- "sse",
17282
- "websocket",
17283
- "unknown"
17284
- ].includes(item[key])).map((key) => [key, item[key]])),
17285
- ...Object.fromEntries([
17286
- "durationMs",
17287
- "firstEventMs",
17288
- "lastEventAgoMs",
17289
- "eventCount",
17290
- "consecutiveFailures",
17291
- "httpStatus"
17292
- ].filter((key) => Number.isSafeInteger(item[key]) && item[key] >= 0).map((key) => [key, item[key]])),
17293
- ...["provider", "adapter"].includes(item.eventSource) ? { eventSource: item.eventSource } : {},
17294
- ...typeof item.outputStarted === "boolean" ? { outputStarted: item.outputStarted } : {},
17295
- ...[
17296
- "ECONNRESET",
17297
- "ETIMEDOUT",
17298
- "ECONNREFUSED",
17299
- "ERR_STREAM_PREMATURE_CLOSE",
17300
- "TIMEOUT",
17301
- "WS_CLOSED",
17302
- "OTHER"
17303
- ].includes(item.code) ? { code: item.code } : {}
17317
+ const truncated = (report.requestHistory?.dropped ?? 0) > 0 || (report.operations?.dropped ?? 0) > 0 || report.client?.truncated === true;
17318
+ const unavailable = [...report.inspection?.checks ?? [], ...report.client?.checks ?? []].filter((check) => [
17319
+ "inspection-failed",
17320
+ "inspection-timeout",
17321
+ "host-inspection-unavailable"
17322
+ ].includes(check.reason)).map(({ id, reason }) => ({
17323
+ id,
17324
+ reason
17304
17325
  }));
17305
- }
17306
- //#endregion
17307
- //#region src/diagnostic-compact.js
17308
- function compactDiagnostic(report) {
17309
- const summary = report.summary ?? { findings: [] };
17310
17326
  return {
17311
- format: "compact-1",
17312
- plugin: report.version,
17327
+ format: "support-2",
17328
+ plugin: report.version ?? report.pluginVersion,
17313
17329
  dsh: report.runtime?.dsh,
17314
- ...report.client?.version && report.client.version !== report.version ? { pluginClient: report.client.version } : {},
17315
- platform: report.runtime ? `${report.runtime.platform}-${report.runtime.arch}` : void 0,
17330
+ ...report.client?.version && report.version && report.client.version !== report.version ? { pluginClient: report.client.version } : {},
17331
+ ...report.runtime ? { runtime: report.runtime } : {},
17316
17332
  generatedAt: report.generatedAt,
17333
+ ...report.serverDiagnostics === "unavailable" ? {
17334
+ serverDiagnostics: "unavailable",
17335
+ error: report.error
17336
+ } : {},
17337
+ ...!report.client?.topology?.length ? { clientDiagnostics: "unavailable" } : {},
17317
17338
  account: report.account?.status,
17318
- catalog: report.catalog ? {
17319
- source: report.catalog.source,
17320
- refresh: report.catalog.refresh
17321
- } : void 0,
17322
- configuration: report.configuration,
17323
- ...report.streamHealth ? { streamHealth: safeStreamHealth(report.streamHealth).slice(-5) } : {},
17324
- findings: summary.findings.map((item) => ({
17325
- code: item.code,
17326
- severity: item.severity,
17327
- ...item.code === "recent-failure" ? { failures: item.evidence.map((event) => ({
17328
- action: event.action,
17329
- source: event.source,
17330
- at: new Date(event.observedAt).toISOString()
17331
- })) } : {}
17332
- })),
17333
- capabilities: (report.inspection?.capabilities ?? []).filter((item) => item.readiness !== "not-applicable").map((item) => ({
17334
- id: item.id,
17335
- reason: item.reason,
17336
- ...item.latest ? { latest: `${item.latest.action} ${item.latest.status}` } : { latest: "not-verified" }
17337
- })),
17338
- log: (report.log?.entries ?? []).slice(-150).map(formatLogLine),
17339
- ...report.client?.status === "unknown" ? { hostCollected: false } : {}
17339
+ catalog: report.catalog,
17340
+ configuration,
17341
+ ...report.login?.phase !== void 0 ? { login: report.login } : {},
17342
+ ...unavailable.length ? { unavailable } : {},
17343
+ ...truncated ? { historyTruncated: true } : {},
17344
+ ...slots.length ? { uiSlots: slots } : {},
17345
+ ...report.requestHistory ? { network } : {},
17346
+ ...failureAttempt ? { lastModelStreamFailure: { attempt: failureAttempt } } : {},
17347
+ ...report.operations ? { operations: recentOperations(report.operations.events, (event) => `${event.source}:${event.action}`) } : {},
17348
+ ...report.compaction?.requests ? { pluginCompaction: report.compaction } : {}
17340
17349
  };
17341
17350
  }
17342
17351
  //#endregion
17343
17352
  //#region src/client-diagnostics.jsx
17344
- const LEVELS = {
17345
- all: [
17346
- "info",
17347
- "warn",
17348
- "error"
17349
- ],
17350
- warn: ["warn", "error"],
17351
- error: ["error"]
17352
- };
17353
17353
  function DiagnosticsCard({ rpc, t, diagnostics }) {
17354
- const radioId = (0, react.useId)();
17355
17354
  const [report, setReport] = (0, react.useState)();
17356
17355
  const [busy, setBusy] = (0, react.useState)(false);
17357
17356
  const [copied, setCopied] = (0, react.useState)(false);
17358
- const [error, setError] = (0, react.useState)(false);
17359
17357
  const [copyError, setCopyError] = (0, react.useState)(false);
17360
- const [level, setLevel] = (0, react.useState)("all");
17361
- const [logCopied, setLogCopied] = (0, react.useState)(false);
17362
17358
  const load = () => {
17363
17359
  setBusy(true);
17364
- setError(false);
17360
+ setReport(void 0);
17365
17361
  setCopied(false);
17366
17362
  setCopyError(false);
17367
17363
  Promise.allSettled([recoveryCall(rpc, "diagnostics"), Promise.resolve().then(() => diagnostics?.collect())]).then(([server, client]) => {
17368
- setError(server.status === "rejected");
17369
17364
  const combined = {
17370
17365
  ...server.status === "fulfilled" ? server.value : clientDiagnostic(server.reason),
17371
17366
  client: client.status === "fulfilled" && client.value ? client.value : { status: "unknown" }
17372
17367
  };
17373
- setReport({
17374
- ...combined,
17375
- summary: diagnosticSummary(combined)
17376
- });
17368
+ setReport(compactDiagnostic(combined));
17377
17369
  }).finally(() => setBusy(false));
17378
17370
  };
17379
- const copy = (full = false) => {
17380
- if (report === void 0) return;
17371
+ const text = report === void 0 ? void 0 : JSON.stringify(report, null, 2);
17372
+ const copy = () => {
17381
17373
  setCopyError(false);
17382
- Promise.resolve().then(() => navigator.clipboard.writeText(JSON.stringify(full ? report : compactDiagnostic(report), null, 2))).then(() => setCopied(true)).catch(() => setCopyError(true));
17374
+ Promise.resolve().then(() => navigator.clipboard.writeText(text)).then(() => setCopied(true)).catch(() => setCopyError(true));
17383
17375
  };
17384
- const lines = (report?.log?.entries ?? []).filter((entry) => LEVELS[level].includes(entry.level));
17385
- const copyLog = () => {
17386
- Promise.resolve().then(() => navigator.clipboard.writeText(lines.map(formatLogLine).join(String.fromCharCode(10)))).then(() => setLogCopied(true)).catch(() => setCopyError(true));
17387
- };
17388
- const findings = report?.summary?.findings ?? [];
17389
- const attention = findings.filter((item) => item.severity !== "info");
17390
- const notes = findings.filter((item) => item.severity === "info");
17391
- const finding = (item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [
17392
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
17393
- className: "codexDiagTitle",
17394
- children: t(`diagnosticFinding_${item.code}`)
17395
- }),
17396
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
17397
- className: "codexDiagNext",
17398
- children: t(`diagnosticNext_${item.next}`)
17399
- }),
17400
- item.code === "recent-failure" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { children: item.evidence.map((event) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [
17401
- event.action,
17402
- " · ",
17403
- t(`diagnosticSource_${event.source}`),
17404
- " · ",
17405
- new Date(event.observedAt).toLocaleTimeString(uiLocale())
17406
- ] }, `${event.source}:${event.action}`)) }) : null
17407
- ] }, item.code);
17408
17376
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
17409
17377
  className: "codexSubscriptionCard codexSubscriptionDiagnostics",
17410
17378
  children: [
@@ -17426,10 +17394,10 @@ void main(){
17426
17394
  onClick: load,
17427
17395
  children: busy ? t("diagnosticsLoading") : t("diagnosticsLoad")
17428
17396
  }),
17429
- report === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
17397
+ text === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
17430
17398
  type: "button",
17431
17399
  variant: "outline",
17432
- onClick: () => copy(),
17400
+ onClick: copy,
17433
17401
  children: copied ? t("diagnosticsCopied") : t("diagnosticsCopy")
17434
17402
  }),
17435
17403
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
@@ -17442,127 +17410,15 @@ void main(){
17442
17410
  ]
17443
17411
  })]
17444
17412
  }),
17445
- report === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
17446
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
17447
- className: "codexDiagResult",
17448
- role: "status",
17449
- "data-state": attention.length ? "attention" : void 0,
17450
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
17451
- className: "codexDiagBadge",
17452
- children: attention.length ? t("diagnosticsAttention").replace("{count}", String(attention.length)) : t("diagnosticsNoRecordedFailure")
17453
- }), report.generatedAt ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
17454
- className: "codexDiagTime",
17455
- children: new Date(report.generatedAt).toLocaleString(uiLocale())
17456
- }) : null]
17457
- }),
17458
- attention.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
17459
- className: "codexDiagFindings",
17460
- children: attention.map(finding)
17461
- }) : null,
17462
- notes.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
17463
- className: "codexAdvancedFold codexAdvancedInline",
17464
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("diagnosticsNotes").replace("{count}", String(notes.length)) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
17465
- className: "codexDiagFindings",
17466
- children: notes.map(finding)
17467
- })]
17468
- }) : null,
17469
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
17470
- className: "codexAdvancedFold codexAdvancedInline",
17471
- children: [
17472
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SettingsLabel, {
17473
- as: "summary",
17474
- className: "",
17475
- openOnClick: false,
17476
- description: t("diagnosticsLogHint"),
17477
- children: [t("diagnosticsLog"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: lines.length })]
17478
- }),
17479
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
17480
- className: "codexSubscriptionLogHead",
17481
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
17482
- className: "codexSubscriptionQuotaModes",
17483
- role: "radiogroup",
17484
- "aria-label": t("diagnosticsLog"),
17485
- children: Object.keys(LEVELS).map((value) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
17486
- className: "codexSubscriptionQuotaMode",
17487
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
17488
- type: "radio",
17489
- name: `${radioId}-codex-log-level`,
17490
- checked: level === value,
17491
- onChange: () => {
17492
- setLevel(value);
17493
- setLogCopied(false);
17494
- }
17495
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t(`logLevel_${value}`) })]
17496
- }, value))
17497
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
17498
- type: "button",
17499
- variant: "outline",
17500
- disabled: lines.length === 0,
17501
- onClick: copyLog,
17502
- children: logCopied ? t("logCopied") : t("logCopy")
17503
- })]
17504
- }),
17505
- lines.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
17506
- className: "codexSubscriptionHelp",
17507
- children: t("logEmpty")
17508
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
17509
- className: "codexSubscriptionLog",
17510
- tabIndex: 0,
17511
- children: lines.slice().reverse().map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
17512
- className: `codexSubscriptionLogLine codexSubscriptionLog_${entry.level}`,
17513
- children: [
17514
- formatLogLine(entry),
17515
- entry.earlier ? ` (${t("logEarlier")})` : "",
17516
- String.fromCharCode(10)
17517
- ]
17518
- }, entry.sequence))
17519
- })
17520
- ]
17521
- }),
17522
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
17523
- className: "codexAdvancedFold codexAdvancedInline",
17524
- children: [
17525
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsLabel, {
17526
- as: "summary",
17527
- className: "",
17528
- openOnClick: false,
17529
- description: t("diagnosticsCoverageHint"),
17530
- children: t("diagnosticsAdvanced")
17531
- }),
17532
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
17533
- className: "codexSubscriptionHelp",
17534
- children: report.client?.topology?.length ? t("diagnosticsHostCollected") : t("diagnosticsHostUnknown")
17535
- }),
17536
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", {
17537
- className: "codexDiagTable",
17538
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
17539
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("diagnosticsCapability") }),
17540
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("diagnosticsReadiness") }),
17541
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("diagnosticsEvidence") })
17542
- ] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: (report.inspection?.capabilities ?? []).map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
17543
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: t(`diagnosticCapability_${item.id}`) }),
17544
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("td", { children: [t(`diagnosticReason_${item.reason}`), item.blockedBy ? ` · ${t(`diagnosticCapability_${item.blockedBy}`)}` : ""] }),
17545
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("td", { children: [item.latest ? `${item.latest.action} · ${t(`diagnosticSource_${item.latest.source}`)} · ${t(`diagnosticOutcome_${item.latest.status}`)} · ${new Date(item.latest.observedAt).toLocaleTimeString(uiLocale())}` : t("diagnosticsUnverified"), item.unresolved?.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("diagnosticsUnresolved") }) : null] })
17546
- ] }, item.id)) })]
17547
- }),
17548
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
17549
- className: "codexSubscriptionActions",
17550
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
17551
- type: "button",
17552
- variant: "outline",
17553
- onClick: () => copy(true),
17554
- children: t("diagnosticsCopyFull")
17555
- })
17556
- }),
17557
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
17558
- className: "codexSubscriptionLog",
17559
- tabIndex: 0,
17560
- children: JSON.stringify(report, null, 2)
17561
- })
17562
- ]
17563
- })
17564
- ] }),
17565
- error ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
17413
+ text === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
17414
+ className: "codexAdvancedFold codexAdvancedInline",
17415
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("diagnosticsPreview") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
17416
+ className: "codexSubscriptionLog",
17417
+ tabIndex: 0,
17418
+ children: text
17419
+ })]
17420
+ }),
17421
+ report?.serverDiagnostics === "unavailable" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
17566
17422
  className: "codexSubscriptionError",
17567
17423
  role: "alert",
17568
17424
  children: t("diagnosticsFailed")
@@ -18318,7 +18174,6 @@ void main(){
18318
18174
  //#endregion
18319
18175
  //#region src/client-pages.jsx
18320
18176
  const ready = (snapshot) => snapshot.status === "ready" && snapshot.writable === true;
18321
- const modelLabel = (model) => model.replace("gpt-image-", "GPT Image ").replace("-flare", " Flare").replace("-sunburst", " Sunburst");
18322
18177
  /** One feature in the overview: what it does, its on/off switch (or current state) and an arrow to the page that owns its options. */
18323
18178
  function FeatureRow({ t, title, summary, beta, checked, onChange, disabled, reason, status, onMore }) {
18324
18179
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -18948,17 +18803,17 @@ void main(){
18948
18803
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
18949
18804
  className: "codexAdvancedFold codexAdvancedInline",
18950
18805
  children: [
18951
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("summary", { children: [t("imageAdvancedTitle"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: imagesOn ? `${modelLabel(snapshot.imageModel)} · ${t(`imageQuality_${snapshot.imageQuality}`)}` : t("imageCapability_off") })] }),
18806
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("summary", { children: [t("imageAdvancedTitle"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: imagesOn ? `${imageModelLabel(snapshot.imageModel)} · ${t(`imageQuality_${snapshot.imageQuality}`)}` : t("imageCapability_off") })] }),
18952
18807
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImageChoice, {
18953
18808
  t,
18954
18809
  label: t("imageModel"),
18955
- hint: snapshot.imageModel.includes("2.5") ? t("imageModelHint") : void 0,
18810
+ hint: t("imageModelHint"),
18956
18811
  value: snapshot.imageModel,
18957
- text: modelLabel(snapshot.imageModel),
18812
+ text: imageModelLabel(snapshot.imageModel),
18958
18813
  disabled: disabled || !imagesOn,
18959
18814
  items: Object.keys(IMAGE_MODELS).map((id) => ({
18960
18815
  id,
18961
- label: `${modelLabel(id)}${id.includes("2.5") ? ` · ${t("imageExperimental")}` : ""}`
18816
+ label: `${imageModelLabel(id)}${isExperimentalImageModel(id) ? ` · ${t("imageExperimental")}` : ""}`
18962
18817
  })),
18963
18818
  onSelect: (imageModel) => set({
18964
18819
  imageModel,
@@ -20969,6 +20824,8 @@ void main(){
20969
20824
  "settings.section",
20970
20825
  "conversation.input.right",
20971
20826
  "conversation.input.model",
20827
+ "conversation.input.model.options",
20828
+ "conversation.input.model.label",
20972
20829
  "conversation.input.attachments",
20973
20830
  "conversation.chat.message.images",
20974
20831
  "conversation.chat.user.images",