dsh-codex-subscription 2.5.5 → 2.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +7 -6
- package/README.md +7 -6
- package/lib/client.js +109 -194
- package/lib/index.js +126 -40
- package/package.json +1 -2
- package/lib/sketch-psd-worker.js +0 -11
package/README.en.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**Use your ChatGPT / Codex subscription directly in DeepSeek Harness**
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Sign in with ChatGPT Plus / Pro to use GPT-6 and other Codex models, quota, web search, and image generation inside DSH. No OpenAI API key or Codex CLI.
|
|
12
12
|
|
|
13
13
|
[](https://github.com/WSL043/dsh-codex-subscription/actions/workflows/ci.yml)
|
|
14
14
|
[](https://www.npmjs.com/package/dsh-codex-subscription)
|
|
@@ -61,7 +61,7 @@ Subscription access, model controls, quota management, and image creation in one
|
|
|
61
61
|
|
|
62
62
|
| Feature | What you can do | Availability / setup |
|
|
63
63
|
| --- | --- | --- |
|
|
64
|
-
| **Image generation** | Generate through your subscription and adjust available request model / quality options | Beta; on by default, can be disabled |
|
|
64
|
+
| **Image generation** | Generate through your subscription and adjust available request model / quality options; ask for a transparent-background PNG when needed | Beta; on by default, can be disabled |
|
|
65
65
|
| **Reference image editing** | Continue refining an image with references | Beta; on by default, can be disabled |
|
|
66
66
|
| **Image viewing and download** | Completed images appear after the answer without expanding tool activity; zoom, pan, fit to window, and download verified originals | Built-in viewer; older images may only have previews |
|
|
67
67
|
| **Region-based editing** | Mark regions, add notes, and continue editing with location references | Fills the composer for you to review and send |
|
|
@@ -70,7 +70,7 @@ Subscription access, model controls, quota management, and image creation in one
|
|
|
70
70
|
| **Layers and image import** | Work in layers and bring images into the canvas | Images are managed as layers |
|
|
71
71
|
| **Smoothing and navigation** | Smooth complete strokes after release; pan, zoom, undo, and redo | Shortcuts can be customized or disabled |
|
|
72
72
|
| **Multiple drafts** | Save and reopen up to 20 local drafts | Stored in the current browser |
|
|
73
|
-
| **Import and export** | Export PNG,
|
|
73
|
+
| **Import and export** | Export PNG, or native drafts that preserve editable strokes | Drafts can be imported again to keep editing |
|
|
74
74
|
| **Agent drawing** | Ask the agent to draw with `@sketch`, follow progress, and stop it; the agent can draw whole stages in SVG, imported as editable native strokes | Beta; off by default, requires the canvas |
|
|
75
75
|
| **Result preview for the model** | Return a canvas image after drawing for subsequent review | Beta; off by default, adds image input usage |
|
|
76
76
|
|
|
@@ -82,6 +82,7 @@ Subscription access, model controls, quota management, and image creation in one
|
|
|
82
82
|
| **Subtask component management** | Install, disable, or uninstall the official Codex subtask component from settings | Managed by supported DSH hosts; no extra login |
|
|
83
83
|
| **Cloud context compaction** | Continue long conversations using Codex compaction while retaining DSH history and native compaction | Beta / experimental; off by default, enabled requests use SSE |
|
|
84
84
|
| **WebSocket transport** | Experimentally reuse connections and context transfers, with SSE fallback on connection failure | Beta / experimental; SSE by default, no speed guarantee |
|
|
85
|
+
| **Codex reviewer for Auto review** | DSH Auto review judges tool calls with Codex's own review model; DSH keeps its review policy and allow/deny flow | Beta; off by default, applies when your account catalog offers the model |
|
|
85
86
|
| **Support diagnostics** | Inspect prerequisites and recent operation results, and copy a short report (about 1 KB; the full one can be copied separately) without credentials or conversation text | Settings → Maintenance; unverified does not mean broken |
|
|
86
87
|
| **Forecast cache cleanup** | Inspect and clear local quota forecast history | Keeps sign-in, drafts, originals, and shared dependencies |
|
|
87
88
|
|
|
@@ -105,7 +106,7 @@ This plugin supports the latest DeepSeek Harness release recorded in its package
|
|
|
105
106
|
2. Paste this package name, with its version, into the **Package name or address** field:
|
|
106
107
|
|
|
107
108
|
```text
|
|
108
|
-
dsh-codex-subscription@2.5.
|
|
109
|
+
dsh-codex-subscription@2.5.7
|
|
109
110
|
```
|
|
110
111
|
|
|
111
112
|
3. Click **Install** and wait for completion. Follow the page instructions; save your work before restarting if requested.
|
|
@@ -239,9 +240,9 @@ Settings shown directly as cropped screenshots from the actual DSH interface.
|
|
|
239
240
|
|
|
240
241
|
</details>
|
|
241
242
|
|
|
242
|
-
Layers, native curves, brushes, undo/redo, and shortcuts are supported. Save multiple drafts, export PNG or
|
|
243
|
+
Layers, native curves, brushes, undo/redo, and shortcuts are supported. Save multiple drafts, export PNG or editable drafts, and annotate generated images before continuing an edit.
|
|
243
244
|
|
|
244
|
-
[Image editing
|
|
245
|
+
[Image editing and draft storage →](docs/GUIDE.en.md#image-generation-and-editing-beta)
|
|
245
246
|
|
|
246
247
|
<a id="codex-subtask-runtime"></a>
|
|
247
248
|
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**把 ChatGPT / Codex 订阅直接接入 DeepSeek Harness**
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
用 ChatGPT Plus / Pro 订阅登录,即可在 DSH 中使用 GPT-6 等 Codex 模型、查额度、联网搜索和生图。无需 OpenAI API Key,也不依赖 Codex CLI。
|
|
12
12
|
|
|
13
13
|
[](https://github.com/WSL043/dsh-codex-subscription/actions/workflows/ci.yml)
|
|
14
14
|
[](https://www.npmjs.com/package/dsh-codex-subscription)
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
| 功能 | 你可以做什么 | 使用方式 / 条件 |
|
|
63
63
|
| --- | --- | --- |
|
|
64
|
-
| **图片生成** |
|
|
64
|
+
| **图片生成** | 通过订阅生成图片,调整可用的请求型号与质量;需要时可生成透明背景 PNG | Beta;默认开启,可关闭 |
|
|
65
65
|
| **参考图编辑** | 带上参考图继续修改作品 | Beta;默认开启,可关闭 |
|
|
66
66
|
| **图片查看与下载** | 完成的出图结果直接显示在回答后,无需展开工具过程;可缩放、拖动、适合窗口、下载校验后的原图 | 内置查看器,无需另装;旧图可能只有预览 |
|
|
67
67
|
| **区域标注编辑** | 在图上圈定区域、填写备注,带定位参考继续编辑 | 回填输入框后由你确认发送 |
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
| **图层与图片导入** | 分层创作,将图片加入草图继续画 | 图片作为图层管理 |
|
|
71
71
|
| **笔画平滑与导航** | 抬笔后平滑整条路径;拖动、缩放、撤销重做 | 快捷键可自定义和关闭 |
|
|
72
72
|
| **多份草稿** | 保存并重新编辑最多 20 份本地草稿 | 保存在当前浏览器 |
|
|
73
|
-
| **导入与导出** | 导出 PNG
|
|
73
|
+
| **导入与导出** | 导出 PNG,或交换保留原生笔画的草稿文件 | 草稿文件可重新导入继续编辑 |
|
|
74
74
|
| **Agent 绘图** | 用 `@sketch` 让 Agent 绘制,查看进度并随时停止;Agent 可用 SVG 整段作画,导入为可编辑原生笔画 | Beta;默认关闭,需同时开启画板 |
|
|
75
75
|
| **绘图结果回看** | 完成后向模型返回画布预览,帮助后续检查 | Beta;默认关闭,会增加图片输入用量 |
|
|
76
76
|
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
| **子任务组件管理** | 在设置里安装、停用或卸载官方 Codex 子任务组件 | 由支持的 DSH 宿主管理,无需额外登录 |
|
|
83
83
|
| **云端上下文压缩** | 使用 Codex 云端压缩继续长对话,同时保留 DSH 历史与原生压缩 | Beta / 实验性;默认关闭,开启的请求使用 SSE |
|
|
84
84
|
| **WebSocket 连接** | 实验性复用连接和上下文传输,连接失败可回退 SSE | Beta / 实验性;默认 SSE,不保证更快 |
|
|
85
|
+
| **Auto review 官方审查模型** | DSH Auto review 改用 Codex 自带的审查模型判断工具调用,审查规则与放行流程仍由 DSH 负责 | Beta;默认关闭,账号目录提供该模型时生效 |
|
|
85
86
|
| **支持诊断** | 查看功能前置条件和近期操作结果,一键复制约 1 KB 的精简报告(完整报告可另行复制);不含凭据和会话正文 | 设置 → 维护;未验证不代表故障 |
|
|
86
87
|
| **预测缓存清理** | 查看并清理本地额度预测历史 | 保留登录、草稿、原图和共享依赖 |
|
|
87
88
|
|
|
@@ -105,7 +106,7 @@
|
|
|
105
106
|
2. 在 **包名或地址** 输入框中粘贴下面的包名(已带版本号):
|
|
106
107
|
|
|
107
108
|
```text
|
|
108
|
-
dsh-codex-subscription@2.5.
|
|
109
|
+
dsh-codex-subscription@2.5.7
|
|
109
110
|
```
|
|
110
111
|
|
|
111
112
|
3. 点击 **安装**,等待安装完成;按页面提示操作,需要重启时先保存工作。
|
|
@@ -268,9 +269,9 @@ DSH 实机设置截图。
|
|
|
268
269
|
|
|
269
270
|
</details>
|
|
270
271
|
|
|
271
|
-
支持图层、原生曲线、笔刷、撤销重做和快捷键;可保存多份草稿,导出 PNG
|
|
272
|
+
支持图层、原生曲线、笔刷、撤销重做和快捷键;可保存多份草稿,导出 PNG 或可编辑草稿。生成图可标注区域后继续编辑。
|
|
272
273
|
|
|
273
|
-
[
|
|
274
|
+
[图片编辑与草稿保存 →](docs/GUIDE.zh-CN.md#图片生成与编辑beta)
|
|
274
275
|
|
|
275
276
|
<a id="codex-subtask-runtime"></a>
|
|
276
277
|
|
package/lib/client.js
CHANGED
|
@@ -1928,59 +1928,6 @@ window.__ModuleLoader__.load({
|
|
|
1928
1928
|
});
|
|
1929
1929
|
}
|
|
1930
1930
|
//#endregion
|
|
1931
|
-
//#region src/sketch-import-confirm.jsx
|
|
1932
|
-
function useSketchImportConfirm(t) {
|
|
1933
|
-
const [pending, setPending] = (0, react.useState)(false);
|
|
1934
|
-
const resolve = (0, react.useRef)(null);
|
|
1935
|
-
const dialog = (0, react.useRef)(null);
|
|
1936
|
-
const finish = (accepted) => {
|
|
1937
|
-
const done = resolve.current;
|
|
1938
|
-
resolve.current = null;
|
|
1939
|
-
setPending(false);
|
|
1940
|
-
done?.(accepted);
|
|
1941
|
-
};
|
|
1942
|
-
(0, react.useEffect)(() => {
|
|
1943
|
-
if (pending) dialog.current?.showModal();
|
|
1944
|
-
else dialog.current?.close();
|
|
1945
|
-
}, [pending]);
|
|
1946
|
-
(0, react.useEffect)(() => () => {
|
|
1947
|
-
resolve.current?.(false);
|
|
1948
|
-
resolve.current = null;
|
|
1949
|
-
}, []);
|
|
1950
|
-
return {
|
|
1951
|
-
confirmPsd: () => new Promise((done) => {
|
|
1952
|
-
resolve.current?.(false);
|
|
1953
|
-
resolve.current = done;
|
|
1954
|
-
setPending(true);
|
|
1955
|
-
}),
|
|
1956
|
-
prompt: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dialog", {
|
|
1957
|
-
ref: dialog,
|
|
1958
|
-
className: "codexSketchImportConfirm",
|
|
1959
|
-
"aria-label": t("sketchPsdConfirmTitle"),
|
|
1960
|
-
onKeyDown: (event) => event.stopPropagation(),
|
|
1961
|
-
onCancel: (event) => {
|
|
1962
|
-
event.preventDefault();
|
|
1963
|
-
event.stopPropagation();
|
|
1964
|
-
finish(false);
|
|
1965
|
-
},
|
|
1966
|
-
children: [
|
|
1967
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t("sketchPsdConfirmTitle") }),
|
|
1968
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("sketchPsdConfirmBody") }),
|
|
1969
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1970
|
-
type: "button",
|
|
1971
|
-
autoFocus: true,
|
|
1972
|
-
onClick: () => finish(false),
|
|
1973
|
-
children: t("sketchCancel")
|
|
1974
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1975
|
-
type: "button",
|
|
1976
|
-
onClick: () => finish(true),
|
|
1977
|
-
children: t("sketchImport")
|
|
1978
|
-
})] })
|
|
1979
|
-
]
|
|
1980
|
-
})
|
|
1981
|
-
};
|
|
1982
|
-
}
|
|
1983
|
-
//#endregion
|
|
1984
1931
|
//#region src/sketch-objects.js
|
|
1985
1932
|
const objectId = (stroke, index) => stroke.id ?? `legacy-${index}`;
|
|
1986
1933
|
const identifyObjects = (doc) => ({
|
|
@@ -3418,30 +3365,7 @@ window.__ModuleLoader__.load({
|
|
|
3418
3365
|
}
|
|
3419
3366
|
//#endregion
|
|
3420
3367
|
//#region src/sketch-formats.js
|
|
3421
|
-
const SKETCH_FILE_ACCEPT = ".
|
|
3422
|
-
const canvas = (w, h) => {
|
|
3423
|
-
const c = document.createElement("canvas");
|
|
3424
|
-
c.width = w;
|
|
3425
|
-
c.height = h;
|
|
3426
|
-
return c;
|
|
3427
|
-
};
|
|
3428
|
-
function runPsdCodec(action, payload) {
|
|
3429
|
-
return new Promise((resolve, reject) => {
|
|
3430
|
-
const worker = new Worker("/api/codex-subscription/sketch-psd-worker", { type: "module" });
|
|
3431
|
-
const finish = (callback, value) => {
|
|
3432
|
-
clearTimeout(timer);
|
|
3433
|
-
worker.terminate();
|
|
3434
|
-
callback(value);
|
|
3435
|
-
};
|
|
3436
|
-
const timer = setTimeout(() => finish(reject, Error("PSD operation timed out")), 3e4);
|
|
3437
|
-
worker.onerror = () => finish(reject, Error("PSD codec could not be loaded"));
|
|
3438
|
-
worker.onmessage = (event) => event.data.ok ? finish(resolve, event.data.value) : finish(reject, Error(event.data.error));
|
|
3439
|
-
worker.postMessage({
|
|
3440
|
-
action,
|
|
3441
|
-
payload
|
|
3442
|
-
});
|
|
3443
|
-
});
|
|
3444
|
-
}
|
|
3368
|
+
const SKETCH_FILE_ACCEPT = ".dsh-sketch.json,image/png,image/jpeg,image/webp";
|
|
3445
3369
|
function encodeSketchDocument(doc) {
|
|
3446
3370
|
return JSON.stringify({
|
|
3447
3371
|
format: "dsh-sketch",
|
|
@@ -3521,81 +3445,9 @@ window.__ModuleLoader__.load({
|
|
|
3521
3445
|
doc.active = doc.layers[Math.max(0, activeIndex)].id;
|
|
3522
3446
|
return doc;
|
|
3523
3447
|
}
|
|
3524
|
-
async function exportSketchPsd(doc, images, composite) {
|
|
3525
|
-
const width = doc.width ?? 1024, height = doc.height ?? 1024;
|
|
3526
|
-
const children = doc.layers.map((layer, i) => {
|
|
3527
|
-
const ctx = canvas(width, height).getContext("2d"), ref = layer.image;
|
|
3528
|
-
if (ref) ctx.drawImage(images.get(ref.src), ref.x * width, ref.y * height, ref.width * width, ref.height * height);
|
|
3529
|
-
paintSketch(ctx, layer.strokes, width, true, height);
|
|
3530
|
-
return {
|
|
3531
|
-
name: layer.name || `Layer ${i + 1}`,
|
|
3532
|
-
hidden: !layer.visible,
|
|
3533
|
-
opacity: 1,
|
|
3534
|
-
blendMode: "normal",
|
|
3535
|
-
imageData: ctx.getImageData(0, 0, width, height)
|
|
3536
|
-
};
|
|
3537
|
-
});
|
|
3538
|
-
const context = canvas(width, height).getContext("2d");
|
|
3539
|
-
context.fillStyle = "#fff";
|
|
3540
|
-
context.fillRect(0, 0, width, height);
|
|
3541
|
-
if (children[0] && !children[0].hidden) {
|
|
3542
|
-
const bottom = canvas(width, height);
|
|
3543
|
-
bottom.getContext("2d").putImageData(children[0].imageData, 0, 0);
|
|
3544
|
-
context.drawImage(bottom, 0, 0);
|
|
3545
|
-
children[0].imageData = context.getImageData(0, 0, width, height);
|
|
3546
|
-
} else {
|
|
3547
|
-
if (children.length >= 8) throw Error("Show the bottom layer before exporting this eight-layer drawing");
|
|
3548
|
-
children.unshift({
|
|
3549
|
-
name: "Paper",
|
|
3550
|
-
opacity: 1,
|
|
3551
|
-
blendMode: "normal",
|
|
3552
|
-
imageData: context.getImageData(0, 0, width, height)
|
|
3553
|
-
});
|
|
3554
|
-
}
|
|
3555
|
-
return runPsdCodec("write", {
|
|
3556
|
-
width,
|
|
3557
|
-
height,
|
|
3558
|
-
children,
|
|
3559
|
-
imageData: composite.getContext("2d").getImageData(0, 0, width, height)
|
|
3560
|
-
});
|
|
3561
|
-
}
|
|
3562
|
-
async function importSketchPsd(file) {
|
|
3563
|
-
if (file.size > 32 * 1024 * 1024) throw Error("PSD exceeds 32 MB");
|
|
3564
|
-
const psd = await runPsdCodec("read", await file.arrayBuffer());
|
|
3565
|
-
const scale = Math.min(1, 1024 / Math.max(psd.width, psd.height)), width = Math.max(1, Math.round(psd.width * scale)), height = Math.max(1, Math.round(psd.height * scale));
|
|
3566
|
-
const doc = {
|
|
3567
|
-
...createSketchLayers(),
|
|
3568
|
-
width,
|
|
3569
|
-
height,
|
|
3570
|
-
ratio: Object.keys(SKETCH_RATIOS).find((k) => SKETCH_RATIOS[k][0] === width && SKETCH_RATIOS[k][1] === height) ?? "custom",
|
|
3571
|
-
layers: [],
|
|
3572
|
-
nextId: psd.layers.length + 1
|
|
3573
|
-
};
|
|
3574
|
-
for (const [i, layer] of psd.layers.entries()) {
|
|
3575
|
-
const src = canvas(layer.imageData.width, layer.imageData.height);
|
|
3576
|
-
src.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(layer.imageData.data), layer.imageData.width, layer.imageData.height), 0, 0);
|
|
3577
|
-
const out = canvas(width, height), ctx = out.getContext("2d");
|
|
3578
|
-
ctx.globalAlpha = layer.opacity;
|
|
3579
|
-
ctx.drawImage(src, layer.left * scale, layer.top * scale, src.width * scale, src.height * scale);
|
|
3580
|
-
doc.layers.push({
|
|
3581
|
-
id: i + 1,
|
|
3582
|
-
name: layer.name,
|
|
3583
|
-
visible: !layer.hidden,
|
|
3584
|
-
strokes: [],
|
|
3585
|
-
image: {
|
|
3586
|
-
src: out.toDataURL("image/png"),
|
|
3587
|
-
x: 0,
|
|
3588
|
-
y: 0,
|
|
3589
|
-
width: 1,
|
|
3590
|
-
height: 1
|
|
3591
|
-
}
|
|
3592
|
-
});
|
|
3593
|
-
}
|
|
3594
|
-
return doc;
|
|
3595
|
-
}
|
|
3596
3448
|
//#endregion
|
|
3597
3449
|
//#region src/sketch-document-lifecycle.js
|
|
3598
|
-
function createSketchDocumentLifecycle(state, { sessionId, t, schedule, checkpoint, cache, setSelection, setTextEdit, setRecovered,
|
|
3450
|
+
function createSketchDocumentLifecycle(state, { sessionId, t, schedule, checkpoint, cache, setSelection, setTextEdit, setRecovered, store = sketchDrafts, decodeImages = decodeSketchImages, readImage = importSketchImage }) {
|
|
3599
3451
|
const { doc, undo, redo, images, saved, dirty, documentId, documentRevision } = state;
|
|
3600
3452
|
const hasContent = () => doc.current.layers.some((layer) => layer.image || layer.strokes.length);
|
|
3601
3453
|
const save = async (name) => {
|
|
@@ -3665,10 +3517,9 @@ window.__ModuleLoader__.load({
|
|
|
3665
3517
|
});
|
|
3666
3518
|
};
|
|
3667
3519
|
const importImage = async (file, { visible = true } = {}) => {
|
|
3668
|
-
if (file.name?.toLowerCase().endsWith(".
|
|
3520
|
+
if (file.name?.toLowerCase().endsWith(".dsh-sketch.json")) {
|
|
3669
3521
|
if (file.size > 32 * 1024 * 1024) throw Error("File exceeds 32 MB");
|
|
3670
|
-
|
|
3671
|
-
const next = file.name.toLowerCase().endsWith(".psd") ? await importSketchPsd(file) : decodeSketchDocument(await file.text());
|
|
3522
|
+
const next = decodeSketchDocument(await file.text());
|
|
3672
3523
|
const decoded = /* @__PURE__ */ new Map();
|
|
3673
3524
|
await decodeImages(next, decoded);
|
|
3674
3525
|
await saveChanges();
|
|
@@ -4054,11 +3905,7 @@ window.__ModuleLoader__.load({
|
|
|
4054
3905
|
className: "codexSketchExportFormats codexSketchSegment",
|
|
4055
3906
|
role: "group",
|
|
4056
3907
|
"aria-label": t("sketchExportFormat"),
|
|
4057
|
-
children: [
|
|
4058
|
-
["png", "PNG"],
|
|
4059
|
-
["psd", "PSD"],
|
|
4060
|
-
["draft", t("sketchEditableFile")]
|
|
4061
|
-
].map(([value, label]) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3908
|
+
children: [["png", "PNG"], ["draft", t("sketchEditableFile")]].map(([value, label]) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4062
3909
|
type: "button",
|
|
4063
3910
|
"aria-pressed": format === value,
|
|
4064
3911
|
disabled: disabled || working,
|
|
@@ -4364,7 +4211,6 @@ window.__ModuleLoader__.load({
|
|
|
4364
4211
|
//#region src/sketch-studio.jsx
|
|
4365
4212
|
function SketchStudio({ open, agentEnabled, onOpen, onClose, attachSketch, enabled, t, incoming, sessionId, rpc, sessionState }) {
|
|
4366
4213
|
const localSession = (0, react.useRef)(null);
|
|
4367
|
-
const psdImport = useSketchImportConfirm(t);
|
|
4368
4214
|
localSession.current ??= sessionState ?? createSketchSessionState();
|
|
4369
4215
|
const { doc, undo, redo, images, saved, dirty, documentId, documentRevision, agentAdapter, agentSession, agentRun } = localSession.current;
|
|
4370
4216
|
const dialog = (0, react.useRef)(null), canvas = (0, react.useRef)(null), cache = (0, react.useRef)(/* @__PURE__ */ new Map());
|
|
@@ -4483,7 +4329,6 @@ window.__ModuleLoader__.load({
|
|
|
4483
4329
|
cache,
|
|
4484
4330
|
setSelection,
|
|
4485
4331
|
setTextEdit,
|
|
4486
|
-
confirmPsd: psdImport.confirmPsd,
|
|
4487
4332
|
setRecovered
|
|
4488
4333
|
});
|
|
4489
4334
|
(0, react.useEffect)(() => localSession.current.retain?.(), []);
|
|
@@ -4786,10 +4631,6 @@ window.__ModuleLoader__.load({
|
|
|
4786
4631
|
blob: new Blob([encodeSketchDocument(doc.current)], { type: "application/json" }),
|
|
4787
4632
|
extension: "dsh-sketch.json"
|
|
4788
4633
|
};
|
|
4789
|
-
if (format === "psd") return {
|
|
4790
|
-
blob: new Blob([await exportSketchPsd(doc.current, images.current, canvas.current)], { type: "image/vnd.adobe.photoshop" }),
|
|
4791
|
-
extension: "psd"
|
|
4792
|
-
};
|
|
4793
4634
|
if (format !== "png") throw Error("Unsupported format");
|
|
4794
4635
|
return {
|
|
4795
4636
|
blob: await new Promise((resolve, reject) => canvas.current.toBlob((blob) => blob ? resolve(blob) : reject(Error("PNG")), "image/png")),
|
|
@@ -5303,15 +5144,14 @@ window.__ModuleLoader__.load({
|
|
|
5303
5144
|
onClick: () => retryRestore((value) => value + 1),
|
|
5304
5145
|
children: t("accountRetry")
|
|
5305
5146
|
}) : null]
|
|
5306
|
-
}) : null
|
|
5307
|
-
psdImport.prompt
|
|
5147
|
+
}) : null
|
|
5308
5148
|
]
|
|
5309
5149
|
})] });
|
|
5310
5150
|
}
|
|
5311
5151
|
//#endregion
|
|
5312
5152
|
//#region src/sketch-styles.js
|
|
5313
5153
|
const SKETCH_CSS = `
|
|
5314
|
-
|
|
5154
|
+
|
|
5315
5155
|
.codexSketchSizeModes{display:flex;flex-direction:column;gap:3px}.codexSketchSizeModes button{font-size:11px;padding:4px 6px;border-radius:10px;color:var(--sketch-muted)}.codexSketchSizeModes button[aria-pressed=true]{background:var(--sketch-line);color:var(--sketch-fg)}
|
|
5316
5156
|
|
|
5317
5157
|
.codexSketchSizeControl{position:absolute;left:10px;top:50%;transform:translateY(-50%);z-index:2;display:flex;flex-direction:column;align-items:center;gap:10px;padding:12px 6px;border:1px solid var(--sketch-line);border-radius:24px;background:var(--sketch-glass);backdrop-filter:blur(18px);box-shadow:0 3px 14px #0001}
|
|
@@ -5593,8 +5433,6 @@ window.__ModuleLoader__.load({
|
|
|
5593
5433
|
storageHint: "仅清理本地预测历史,保留原图、草稿、登录信息和共享依赖。子任务组件可在“模型与运行”中管理。",
|
|
5594
5434
|
storageConfirm: "清除所有已登录账号的本地预测历史后,需要重新积累采样。服务端额度不变,后续查询会重新生成缓存。",
|
|
5595
5435
|
storageFailed: "未能读取或清除预测缓存,请重试。",
|
|
5596
|
-
sketchPsdConfirmTitle: "导入 PSD 副本",
|
|
5597
|
-
sketchPsdConfirmBody: "支持最多 8 层、8 位 RGB 的简单 PSD(32 MB 内,边长不超过 4096)。导入后各层转为图片,最长边缩至 1024;不支持蒙版、调整层和特殊混合效果。原文件不会修改。需要保留草图对象的可编辑性,请使用 DSH 草图格式。继续导入?",
|
|
5598
5436
|
runtimeIncompatible: "检测到不兼容的 Codex 子任务组件,请卸载后重启,再安装受支持版本。",
|
|
5599
5437
|
runtimeManagedElsewhere: "此组件由宿主或其他依赖管理,请在 DSH 插件管理中查看;这里不能直接卸载。",
|
|
5600
5438
|
runtimeLoading: "正在检查组件…",
|
|
@@ -5641,6 +5479,10 @@ window.__ModuleLoader__.load({
|
|
|
5641
5479
|
subagentBackend_dsh: "DSH",
|
|
5642
5480
|
subagentBackend_codex: "Codex",
|
|
5643
5481
|
connectionTitle: "连接方式",
|
|
5482
|
+
reviewModelTitle: "Auto review 审查模型",
|
|
5483
|
+
reviewModel_session: "当前模型",
|
|
5484
|
+
reviewModel_official: "Codex 官方审查模型",
|
|
5485
|
+
reviewModelHint: "实验功能,默认使用当前模型。选择官方后,DSH Auto review 用 Codex 自带的审查模型判断工具调用(账号目录提供时),审查规则与放行、拒绝流程仍由 DSH 负责;不可用时沿用当前模型。",
|
|
5644
5486
|
connectionHint: "默认 SSE。WebSocket 实验性复用连接与上下文传输;连接失败可回退 SSE。下次请求生效,不扩大上下文容量。",
|
|
5645
5487
|
streamIdleTimeoutTitle: "流无响应超时",
|
|
5646
5488
|
streamIdleTimeoutHint: "连续多久没有收到任何流式数据时中断本次请求,不是整体回答时限。调低可能中断较慢但仍在推理的回答,并交由 DSH 重试处理。默认 10 分钟。",
|
|
@@ -5681,7 +5523,7 @@ window.__ModuleLoader__.load({
|
|
|
5681
5523
|
sketchDownload: "下载",
|
|
5682
5524
|
sketchExportFormat: "导出格式",
|
|
5683
5525
|
sketchEditableFile: "可编辑草稿",
|
|
5684
|
-
sketchFormatHint: "PNG
|
|
5526
|
+
sketchFormatHint: "PNG 为合并图片;可编辑草稿保留原生笔画,可重新导入(32 MB 内)。",
|
|
5685
5527
|
imageToSketch: "进入草图",
|
|
5686
5528
|
sketchPictures: "图片",
|
|
5687
5529
|
sketchPictureAdd: "添加",
|
|
@@ -5939,15 +5781,18 @@ window.__ModuleLoader__.load({
|
|
|
5939
5781
|
unlimited: "不限额",
|
|
5940
5782
|
monthlyCreditLimit: "Credits 月度消费上限",
|
|
5941
5783
|
resetCredits: "额度重置",
|
|
5784
|
+
resetCreditsHint: "使用重置可恢复短周期额度、每周额度,或两者同时恢复。",
|
|
5785
|
+
resetAvailableTab: "可用",
|
|
5786
|
+
resetFull: "完全重置",
|
|
5942
5787
|
resetCreditsAvailable: "额度重置(可用 {count} 次)",
|
|
5943
5788
|
resetCreditDefaultName: "额度重置",
|
|
5944
|
-
resetUse: "
|
|
5789
|
+
resetUse: "使用重置",
|
|
5945
5790
|
resetPreparing: "准备中…",
|
|
5946
5791
|
resetConfirmTitle: "确认使用额度重置",
|
|
5947
5792
|
resetWarning: "执行后会消耗 1 次,且无法撤销。",
|
|
5948
5793
|
resetEarlyWarning: "当前额度未用尽,服务可能不执行重置。",
|
|
5949
5794
|
resetAcknowledge: "我知道这次操作可能立即消耗 1 次重置",
|
|
5950
|
-
resetCreditExpires: "
|
|
5795
|
+
resetCreditExpires: "有效期至:{value}",
|
|
5951
5796
|
resetCreditExpiryUnknown: "到期时间未提供",
|
|
5952
5797
|
resetCreditExpiryLoading: "正在读取到期时间…",
|
|
5953
5798
|
resetCreditExpiryFailed: "无法读取到期时间",
|
|
@@ -6160,8 +6005,6 @@ window.__ModuleLoader__.load({
|
|
|
6160
6005
|
storageHint: "Clears local forecast history only. Original images, drafts, sign-in data and shared dependencies are preserved. Manage subtask components under Models & runtime.",
|
|
6161
6006
|
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.",
|
|
6162
6007
|
storageFailed: "Could not read or clear the forecast cache. Try again.",
|
|
6163
|
-
sketchPsdConfirmTitle: "Import a PSD copy",
|
|
6164
|
-
sketchPsdConfirmBody: "Supports simple 8-bit RGB PSDs with up to 8 layers, 32 MB and 4096 pixels per side. Layers become images and the longest side is reduced to 1024 pixels. Masks, adjustments and special blending effects are unsupported. The original file stays unchanged. Use the DSH sketch format to preserve editable sketch objects. Continue?",
|
|
6165
6008
|
runtimeIncompatible: "An incompatible Codex subtask component was found. Uninstall it, restart DSH, then install the supported version.",
|
|
6166
6009
|
runtimeManagedElsewhere: "This component is managed by the host or another dependency. Check DSH plugin management; it cannot be removed here.",
|
|
6167
6010
|
runtimeLoading: "Checking component…",
|
|
@@ -6208,6 +6051,10 @@ window.__ModuleLoader__.load({
|
|
|
6208
6051
|
subagentBackend_dsh: "DSH",
|
|
6209
6052
|
subagentBackend_codex: "Codex",
|
|
6210
6053
|
connectionTitle: "Connection",
|
|
6054
|
+
reviewModelTitle: "Auto review model",
|
|
6055
|
+
reviewModel_session: "Current model",
|
|
6056
|
+
reviewModel_official: "Codex reviewer",
|
|
6057
|
+
reviewModelHint: "Experimental; uses the current model by default. With Codex reviewer, DSH Auto review judges tool calls with Codex's own review model when your account catalog offers it. DSH keeps its review policy and allow/deny flow; otherwise the current model is used.",
|
|
6211
6058
|
connectionHint: "SSE by default. Experimental WebSocket reuses connections and context transfers and can fall back to SSE on connection failure. Applies to the next request; context limits stay the same.",
|
|
6212
6059
|
streamIdleTimeoutTitle: "Stream inactivity timeout",
|
|
6213
6060
|
streamIdleTimeoutHint: "How long a request may receive no streamed data before it is aborted. This is not an overall response deadline. Lower values can abort slow but valid reasoning and hand the request to DSH retry handling. Default: 10 minutes.",
|
|
@@ -6248,7 +6095,7 @@ window.__ModuleLoader__.load({
|
|
|
6248
6095
|
sketchDownload: "Download",
|
|
6249
6096
|
sketchExportFormat: "Export format",
|
|
6250
6097
|
sketchEditableFile: "Editable draft",
|
|
6251
|
-
sketchFormatHint: "PNG is flattened;
|
|
6098
|
+
sketchFormatHint: "PNG is flattened; editable drafts retain native strokes and can be imported again (up to 32 MB).",
|
|
6252
6099
|
imageToSketch: "Open in sketch",
|
|
6253
6100
|
sketchPictures: "Images",
|
|
6254
6101
|
sketchPictureAdd: "Add",
|
|
@@ -6506,15 +6353,18 @@ window.__ModuleLoader__.load({
|
|
|
6506
6353
|
unlimited: "Unlimited",
|
|
6507
6354
|
monthlyCreditLimit: "Monthly Credits spending cap",
|
|
6508
6355
|
resetCredits: "Quota resets",
|
|
6356
|
+
resetCreditsHint: "A reset restores your short-window limit, weekly limit, or both.",
|
|
6357
|
+
resetAvailableTab: "Available",
|
|
6358
|
+
resetFull: "Full reset",
|
|
6509
6359
|
resetCreditsAvailable: "Quota resets ({count} available)",
|
|
6510
6360
|
resetCreditDefaultName: "Quota reset",
|
|
6511
|
-
resetUse: "Use",
|
|
6361
|
+
resetUse: "Use reset",
|
|
6512
6362
|
resetPreparing: "Preparing…",
|
|
6513
6363
|
resetConfirmTitle: "Confirm quota reset",
|
|
6514
6364
|
resetWarning: "This consumes one reset and cannot be undone.",
|
|
6515
6365
|
resetEarlyWarning: "Quota remains. The service may decline the reset.",
|
|
6516
6366
|
resetAcknowledge: "I understand this may consume one reset now",
|
|
6517
|
-
resetCreditExpires: "
|
|
6367
|
+
resetCreditExpires: "Valid until {value}",
|
|
6518
6368
|
resetCreditExpiryUnknown: "Expiration time not provided",
|
|
6519
6369
|
resetCreditExpiryLoading: "Reading expiration…",
|
|
6520
6370
|
resetCreditExpiryFailed: "Could not read expiration",
|
|
@@ -6790,9 +6640,21 @@ window.__ModuleLoader__.load({
|
|
|
6790
6640
|
.codexSubscriptionCreditBalance strong{font:600 18px/24px ui-monospace,SFMono-Regular,Consolas,monospace;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
|
|
6791
6641
|
.codexSubscriptionCreditRows{display:flex;flex-direction:column;gap:6px}
|
|
6792
6642
|
.codexSubscriptionResetMeta{display:flex;min-width:0;flex-direction:column;gap:1px}
|
|
6793
|
-
.
|
|
6794
|
-
.
|
|
6795
|
-
.
|
|
6643
|
+
.codexSubscriptionResetPanel{display:flex;flex-direction:column;gap:10px;margin-top:6px}
|
|
6644
|
+
.codexSubscriptionResetHead{display:flex;flex-direction:column;gap:2px}
|
|
6645
|
+
.codexSubscriptionResetHead strong{font-size:14px;line-height:20px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
6646
|
+
.codexSubscriptionResetHead span{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary)}
|
|
6647
|
+
.codexSubscriptionResetBox{border:1px solid var(--dsw-alias-border-l2);border-radius:12px;padding:6px 14px 2px}
|
|
6648
|
+
.codexSubscriptionResetTabs{display:flex;gap:8px;padding:6px 0 10px;border-bottom:1px solid var(--dsw-alias-border-l2)}
|
|
6649
|
+
.codexSubscriptionResetTabs span{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:8px;background:var(--dsw-alias-bg-module-platform);font-size:12px;line-height:18px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
6650
|
+
.codexSubscriptionResetTabs b{font-weight:400;color:var(--dsw-alias-label-secondary)}
|
|
6651
|
+
.codexSubscriptionResetBox .codexSubscriptionResetBalance{gap:0}
|
|
6652
|
+
.codexSubscriptionResetBox .codexSubscriptionResetCard{padding:12px 0;border:0;border-radius:0;background:none}
|
|
6653
|
+
.codexSubscriptionResetBox .codexSubscriptionResetCard+.codexSubscriptionResetCard{border-top:1px solid var(--dsw-alias-border-l2)}
|
|
6654
|
+
.codexSubscriptionResetBox .codexSubscriptionResetCard strong{font-size:13px;line-height:20px;font-weight:600}
|
|
6655
|
+
.codexSubscriptionResetBox .codexSubscriptionResetExpiry{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary)}
|
|
6656
|
+
.codexSubscriptionResetBox .codexSubscriptionResetUse{min-height:28px;padding:0 12px;border:0!important;border-radius:8px;background:var(--dsw-alias-bg-module-platform);font-size:12px;font-weight:600}
|
|
6657
|
+
.codexSubscriptionResetBox>.codexSubscriptionResetBalance>.codexSubscriptionCreditNote{padding:12px 0}
|
|
6796
6658
|
.codexSubscriptionResetBalance{display:flex;flex-direction:column;gap:8px}
|
|
6797
6659
|
.codexSubscriptionResetCard{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;padding:9px 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:9px;background:var(--dsw-alias-bg-module-platform)}
|
|
6798
6660
|
.codexSubscriptionResetCard{flex-wrap:wrap}
|
|
@@ -8093,6 +7955,7 @@ window.__ModuleLoader__.load({
|
|
|
8093
7955
|
...capabilities,
|
|
8094
7956
|
autoQuotaRetry: normalizeAutoQuotaRetry(value?.[AUTO_QUOTA_RETRY_FIELD]),
|
|
8095
7957
|
connectionMode: value?.connectionMode === "websocket" ? "websocket" : "sse",
|
|
7958
|
+
reviewModel: value?.reviewModel === "official" ? "official" : "session",
|
|
8096
7959
|
compactionMode: value?.compactionMode === "cloud" ? "cloud" : "dsh",
|
|
8097
7960
|
subagentBackend: value?.subagentBackend === "codex" ? "codex" : "dsh",
|
|
8098
7961
|
subagentBackendAvailable,
|
|
@@ -8152,6 +8015,7 @@ window.__ModuleLoader__.load({
|
|
|
8152
8015
|
[DISABLED_MODELS_FIELD]: normalizeDisabledModels(value?.[DISABLED_MODELS_FIELD]),
|
|
8153
8016
|
[AUTO_QUOTA_RETRY_FIELD]: normalizeAutoQuotaRetry(value?.[AUTO_QUOTA_RETRY_FIELD]),
|
|
8154
8017
|
connectionMode: value?.connectionMode === "websocket" ? "websocket" : "sse",
|
|
8018
|
+
reviewModel: value?.reviewModel === "official" ? "official" : "session",
|
|
8155
8019
|
compactionMode: value?.compactionMode === "cloud" ? "cloud" : "dsh",
|
|
8156
8020
|
subagentBackend: value?.subagentBackend === "codex" ? "codex" : "dsh",
|
|
8157
8021
|
...readCapabilitySettings(value),
|
|
@@ -8685,7 +8549,7 @@ window.__ModuleLoader__.load({
|
|
|
8685
8549
|
}
|
|
8686
8550
|
//#endregion
|
|
8687
8551
|
//#region src/version.js
|
|
8688
|
-
const PACKAGE_VERSION = "2.5.
|
|
8552
|
+
const PACKAGE_VERSION = "2.5.7";
|
|
8689
8553
|
//#endregion
|
|
8690
8554
|
//#region src/client-recovery.js
|
|
8691
8555
|
async function recoveryCall(rpc, endpoint, payload = {}, timeoutMs = 1e4) {
|
|
@@ -10357,6 +10221,44 @@ window.__ModuleLoader__.load({
|
|
|
10357
10221
|
})
|
|
10358
10222
|
]
|
|
10359
10223
|
}),
|
|
10224
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
10225
|
+
className: "codexSubscriptionCard codexSubscriptionPreferencesCard",
|
|
10226
|
+
"aria-label": t("reviewModelTitle"),
|
|
10227
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10228
|
+
className: "codexSubscriptionPreference",
|
|
10229
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10230
|
+
className: "codexSubscriptionPreferenceCopy",
|
|
10231
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10232
|
+
className: "codexSubscriptionPreferenceLabel",
|
|
10233
|
+
children: [
|
|
10234
|
+
t("reviewModelTitle"),
|
|
10235
|
+
" ",
|
|
10236
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: "Beta" })
|
|
10237
|
+
]
|
|
10238
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10239
|
+
className: "codexSubscriptionPreferenceHint",
|
|
10240
|
+
children: t("reviewModelHint")
|
|
10241
|
+
})]
|
|
10242
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
10243
|
+
className: "codexSubscriptionQuotaModes",
|
|
10244
|
+
role: "radiogroup",
|
|
10245
|
+
"aria-label": t("reviewModelTitle"),
|
|
10246
|
+
"aria-busy": snapshot.saving || void 0,
|
|
10247
|
+
children: ["session", "official"].map((value) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
10248
|
+
className: "codexSubscriptionQuotaMode",
|
|
10249
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10250
|
+
type: "radio",
|
|
10251
|
+
name: "codex-review-model",
|
|
10252
|
+
checked: snapshot.reviewModel === value,
|
|
10253
|
+
disabled: !snapshot.writable,
|
|
10254
|
+
onChange: () => {
|
|
10255
|
+
preference.set({ reviewModel: value });
|
|
10256
|
+
}
|
|
10257
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t(`reviewModel_${value}`) })]
|
|
10258
|
+
}, value))
|
|
10259
|
+
})]
|
|
10260
|
+
})
|
|
10261
|
+
}),
|
|
10360
10262
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
10361
10263
|
className: "codexSubscriptionCard codexSubscriptionPreferencesCard",
|
|
10362
10264
|
"aria-label": t("compactionTitle"),
|
|
@@ -11363,7 +11265,10 @@ window.__ModuleLoader__.load({
|
|
|
11363
11265
|
children: date === void 0 ? t("resetCreditExpiryUnknown") : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("time", {
|
|
11364
11266
|
dateTime: date.toISOString(),
|
|
11365
11267
|
title: date.toLocaleString(),
|
|
11366
|
-
children: fill(t("resetCreditExpires"), { value: date.
|
|
11268
|
+
children: fill(t("resetCreditExpires"), { value: date.toLocaleDateString(void 0, {
|
|
11269
|
+
month: "long",
|
|
11270
|
+
day: "numeric"
|
|
11271
|
+
}) })
|
|
11367
11272
|
})
|
|
11368
11273
|
});
|
|
11369
11274
|
}
|
|
@@ -11465,7 +11370,7 @@ window.__ModuleLoader__.load({
|
|
|
11465
11370
|
children: [
|
|
11466
11371
|
challenge === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11467
11372
|
className: "codexSubscriptionResetMeta",
|
|
11468
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: credit.name
|
|
11373
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: credit.name === void 0 ? t("resetCreditDefaultName") : /^full reset$/iu.test(credit.name) ? t("resetFull") : credit.name }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResetCreditExpiry, {
|
|
11469
11374
|
expiresAt: credit.expiresAt,
|
|
11470
11375
|
t
|
|
11471
11376
|
})]
|
|
@@ -11742,17 +11647,27 @@ window.__ModuleLoader__.load({
|
|
|
11742
11647
|
cloud: visibleUsage.credits.approxCloudMessages ? `${count(visibleUsage.credits.approxCloudMessages[0])}–${count(visibleUsage.credits.approxCloudMessages[1])}` : t("unavailable")
|
|
11743
11648
|
})
|
|
11744
11649
|
}) : null,
|
|
11745
|
-
visibleUsage?.resetCredits?.availableCount > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
11746
|
-
className: "
|
|
11747
|
-
|
|
11748
|
-
|
|
11749
|
-
|
|
11750
|
-
|
|
11751
|
-
|
|
11752
|
-
|
|
11753
|
-
|
|
11754
|
-
|
|
11755
|
-
|
|
11650
|
+
visibleUsage?.resetCredits?.availableCount > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
11651
|
+
className: "codexSubscriptionResetPanel",
|
|
11652
|
+
"aria-label": t("resetCredits"),
|
|
11653
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11654
|
+
className: "codexSubscriptionResetHead",
|
|
11655
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("resetCredits") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("resetCreditsHint") })]
|
|
11656
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11657
|
+
className: "codexSubscriptionResetBox",
|
|
11658
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
11659
|
+
className: "codexSubscriptionResetTabs",
|
|
11660
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [t("resetAvailableTab"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: visibleUsage.resetCredits.availableCount })] })
|
|
11661
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResetCreditList, {
|
|
11662
|
+
rpc,
|
|
11663
|
+
t,
|
|
11664
|
+
count: visibleUsage.resetCredits.availableCount,
|
|
11665
|
+
nextExpiresAt: visibleUsage.resetCredits.nextExpiresAt,
|
|
11666
|
+
initialCredits: visibleUsage.resetCredits.credits,
|
|
11667
|
+
refreshKey: `${resetKey}:${usageRefreshGeneration}`,
|
|
11668
|
+
hasExhaustedQuota: exhausted,
|
|
11669
|
+
onConsumed: () => load(true)
|
|
11670
|
+
})]
|
|
11756
11671
|
})]
|
|
11757
11672
|
}) : null,
|
|
11758
11673
|
visibleUsage?.individualLimit ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|