dsh-codex-subscription 3.1.1 → 3.1.3

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 CHANGED
@@ -18,7 +18,7 @@ Sign in with ChatGPT Plus / Pro to use GPT-6 and other Codex models, quota, web
18
18
  [![MIT](https://img.shields.io/badge/license-MIT-111111.svg)](LICENSE)
19
19
  [![Star](https://img.shields.io/github/stars/WSL043/dsh-codex-subscription?style=flat&logo=github&label=Star)](https://github.com/WSL043/dsh-codex-subscription/stargazers)
20
20
 
21
- [Install](#install) · [Highlights](#highlights) · [Phone remote control](#phone-remote-control-beta) · [Sketch drawing](#sketch-drawing-measured) · [All features](#all-features) · [User guide](docs/GUIDE.en.md) · [Troubleshooting](#troubleshooting)
21
+ [Install](#install) · [Highlights](#highlights) · [Phone remote control](#phone-remote-control-beta) · [All features](#all-features) · [User guide](docs/GUIDE.en.md) · [Troubleshooting](#troubleshooting)
22
22
 
23
23
  </div>
24
24
 
@@ -42,7 +42,7 @@ This plugin supports the latest DeepSeek Harness release recorded in its package
42
42
  2. Paste this package name, with its version, into the **Package name or address** field:
43
43
 
44
44
  ```text
45
- dsh-codex-subscription@3.1.1
45
+ dsh-codex-subscription@3.1.3
46
46
  ```
47
47
 
48
48
  3. Click **Install** and wait for completion. Follow the page instructions; save your work before restarting if requested.
@@ -54,7 +54,7 @@ Why the version is included: DSH's plugin page only installs versions that are a
54
54
  <summary>Terminal installation (with an existing dsh command)</summary>
55
55
 
56
56
  ```sh
57
- dsh plugin --profile web add dsh-codex-subscription@3.1.1
57
+ dsh plugin --profile web add dsh-codex-subscription@3.1.3
58
58
  ```
59
59
 
60
60
  Follow the restart instructions, then sign in under **Settings → Codex**. Both the Plugins page and the terminal use DSH's installation management.
@@ -67,7 +67,7 @@ Follow the restart instructions, then sign in under **Settings → Codex**. Both
67
67
  After signing in and selecting a Codex model in Web, install the same plugin in the Headless profile:
68
68
 
69
69
  ```sh
70
- dsh plugin --profile headless add dsh-codex-subscription@3.1.1
70
+ dsh plugin --profile headless add dsh-codex-subscription@3.1.3
71
71
  dsh --profile headless "Reply with only the word: ok"
72
72
  ```
73
73
 
@@ -83,8 +83,13 @@ Sign in to ChatGPT under **Settings → Codex** in DSH, then pick GPT-6 and the
83
83
 
84
84
  Short-window and weekly quota, reset times, extra Credits and reset cards live in settings; the composer can keep the remaining quota in view and warn you below a threshold.
85
85
 
86
+ <details>
87
+ <summary>Show screenshot</summary>
88
+
86
89
  <p align="center"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/ui-quota-en-dark.png"><img src="docs/assets/ui-quota-en-light.png" width="560" alt="Quota card: weekly quota and reset time, with usage overview and where the allowance went below"></picture></p>
87
90
 
91
+ </details>
92
+
88
93
  <details>
89
94
  <summary>Usage overview and where the allowance went: lifetime usage, streaks, a daily heatmap and the weekly breakdown</summary>
90
95
  <br>
@@ -95,8 +100,13 @@ Short-window and weekly quota, reset times, extra Credits and reset cards live i
95
100
 
96
101
  Pick the model, the reasoning level and the speed tier while the remaining quota stays in view, without opening settings for every request.
97
102
 
103
+ <details>
104
+ <summary>Show screenshot</summary>
105
+
98
106
  <p align="center"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/ui-composer-en-dark.png"><img src="docs/assets/ui-composer-en-light.png" width="760" alt="Composer: permission, sketch, remaining quota, the lightning mark for Fast mode and the model picker"></picture></p>
99
107
 
108
+ </details>
109
+
100
110
  ### Phone remote control (Beta)
101
111
 
102
112
  Pair the ChatGPT mobile app's Codex section with a QR code and the DSH on your computer shows up as a host on your phone. DeepSeek and any other DSH model work from the phone:
@@ -111,15 +121,25 @@ Pair the ChatGPT mobile app's Codex section with a QR code and the DSH on your c
111
121
 
112
122
  Off by default: **Settings → Codex subscription → Phone & more → Phone remote control**. The computer must stay on, online and running DSH. This feature is a third-party host compatibility layer built on the Codex Remote Control protocol and uses OpenAI's remote connection service. Codex has an official remote control implementation, but connecting DSH as a third-party host is not something OpenAI has explicitly committed to support, and later service updates may affect compatibility, hence Beta. It is off by default; you can turn it on, manage paired devices or turn it off at any time. It does not mean OpenAI has certified or endorsed it.
113
123
 
124
+ <details>
125
+ <summary>Show screenshot</summary>
126
+
114
127
  <p align="center"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/ui-remote-en-dark.png"><img src="docs/assets/ui-remote-en-light.png" width="560" alt="Phone remote control in settings: the switch, pairing QR code and manual code, paired phones"></picture></p>
115
128
 
129
+ </details>
130
+
116
131
  ### Images and sketching
117
132
 
118
133
  Generate images with your subscription, circle a region and write a note to keep editing, or open the sketch board to draw yourself or let the agent draw, then use the sketch as the reference for the finished image. The board supports gradients, blur, blend modes and shape clipping; when the agent draws from a reference it can compare side by side, read a difference heat map, measure colours and positions, and undo; a finished drawing can be replayed stroke by stroke and recorded as a video.
119
134
 
135
+ <details>
136
+ <summary>Show screenshot</summary>
137
+
120
138
  <p align="center"><img src="docs/assets/annotate-en.webp" width="900" alt="Image preview: a region above the chimney is marked with a note, then editing continues with the note"></p>
121
139
 
122
- Examples are in [Sketch drawing, measured](#sketch-drawing-measured); the switches are under **Settings → Codex → Images & sketch**.
140
+ </details>
141
+
142
+ Details are in [Sketch board](#sketch-board-beta); the switches are under **Settings → Codex → Images & sketch**.
123
143
 
124
144
  ### ChatGPT connectors
125
145
 
@@ -249,42 +269,9 @@ Subscription failures remain visible: no silent fallback to another paid route.
249
269
 
250
270
  [Read the complete user guide →](docs/GUIDE.en.md)
251
271
 
252
- ## Sketch drawing, measured
272
+ ## Sketch board (Beta)
253
273
 
254
- The sketch board and agent drawing are **Beta** and off by default; turn them on under Images & sketch. Draw by hand with the sketch button in the composer, or send `@sketch` plus a request to let the agent draw. With a reference, the agent can compare side by side, read a difference heat map, zoom into a region, measure colours and edge positions, and undo; a finished drawing can be replayed stroke by stroke in the board's Replay and recorded as a video. The tools only measure and show; they never draw for the model.
255
-
256
- Both examples below were **drawn on the board only, with no image generation**, one run each, so they do not show consistent performance. "Error" is the mean per-pixel colour difference from the reference (smaller is closer, 0 is identical).
257
-
258
- **DeepSeek-chan, copied from a reference**
259
-
260
- <table>
261
- <tr><th width="33%">Reference</th><th width="33%">Before: best of the old tools</th><th width="33%">Now: new tools</th></tr>
262
- <tr><td><img src="docs/assets/sketch-niang-reference.webp" alt="DeepSeek-chan meme reference" width="240"></td><td><img src="docs/assets/sketch-niang-astra-compare.webp" alt="DeepSeek-chan drawn with the old tools" width="240"><br><sub>GPT-6-Astra Medium · 20 min 57 s · 686 strokes<br>error 8.8%</sub></td><td><img src="docs/assets/sketch-niang-astra-new.webp" alt="DeepSeek-chan drawn with the new tools" width="240"><br><sub>GPT-6-Astra Medium · 8 min 11 s · 481 strokes<br>error 9.3%</sub></td></tr>
263
- </table>
264
-
265
- By the numbers they are close and the new run took less than half the time; the hands-on-hips pose and the small whale on the apron are more accurate, while fine hair strands and lace are still less delicate than the original.
266
-
267
- **Hatsune Miku, portrait, copied from a reference**
268
-
269
- <table>
270
- <tr><th width="50%">Before: overlay compare and grid</th><th width="50%">Now: new tools</th></tr>
271
- <tr><td><img src="docs/assets/sketch-miku-sol-before.webp" alt="Miku drawn with the old tools" width="330"><br><sub>GPT-6.1-Sol Xhigh · error 6.7%</sub></td><td><img src="docs/assets/sketch-miku-sol-new.webp" alt="Miku drawn with the new tools" width="330"><br><sub>GPT-6.1-Sol Xhigh · 21 min · 685 strokes · error 5.2%</sub></td></tr>
272
- </table>
273
-
274
- The error fell by about a quarter, and the shoulder "01", the sleeve screen and the thigh lacing were added. Reading the model's full tool trace shows that what remains is mostly the tone and colour of large masses (hair, skin, legs) rather than edge placement: four whole-layer SVG stages in the first three minutes took the error from 18% to 6.5%, and the next 17 minutes of refinement only lowered it by 1.3 points. The experiment log, the problems found in the trace and the changes made are in [Drawing experiments](docs/sketch-drawing-experiments.md).
275
-
276
- <details>
277
- <summary>Show the full prompts</summary>
278
-
279
- ```text
280
- @sketch Using a 1:1 square board, copy the attached reference as faithfully as possible (a chibi anime meme). Scene: white background; a chibi two-head-tall blue-haired whale girl kneels right of centre, blue gradient long hair (dark roots, light tips), one ahoge, a white lace maid headband and a blue bow, dark-blue whale fins with white lining on both sides of the head, big blue eyes with highlights, a cat-mouth pout "ω" expression, blushing cheeks, hands on hips; a dark-blue maid dress, a white lace apron with a small blue whale on it, a black bow tie, white lace frills on cuffs and hem; a dark-blue whale tail behind her. Top left a white speech bubble (black outline, pointer toward her) with the bold black text "你这吃白饭的蓝色大肥鱼。"; from the left edge a hand in a black sleeve points at her; lower left blue-outlined text "没吃饱喵!"; an empty white porcelain bowl on the floor by her feet, with a small blue whale printed inside. Draw in layers: white background, hair and fins and tail, body and clothes, face, bowl, arms and bubble text; keep native editable strokes; pay special attention to proportions, hair gradient and strand direction, lace frills and facial expression. Draw only on the sketch canvas this time, do not call any image generation or editing tool; when done, check the differences from the reference, fix them, then save and finish.
281
- ```
282
-
283
- ```text
284
- Use the sketch board (codex_sketch) to draw Hatsune Miku from this reference, portrait, as close to 100% as possible: composition, proportions, pose, colours and details all the same.
285
- ```
286
-
287
- </details>
274
+ The sketch board and Agent drawing are **Beta** and off by default; turn them on in the Create page. Draw by hand from the sketch button in the composer, or send `@sketch` with a request to have the Agent draw.
288
275
 
289
276
  <details>
290
277
  <summary>View Images & sketch settings</summary>
@@ -307,7 +294,7 @@ Find this plugin on the DSH **Plugins** page and use its update or uninstall act
307
294
  <summary>Terminal commands</summary>
308
295
 
309
296
  ```sh
310
- dsh plugin --profile web update dsh-codex-subscription@3.1.1
297
+ dsh plugin --profile web update dsh-codex-subscription@3.1.3
311
298
  ```
312
299
 
313
300
  Run only when you want to uninstall:
@@ -376,4 +363,11 @@ Read [SECURITY.md](SECURITY.md) before reporting sensitive issues.
376
363
 
377
364
  If this project is useful, the [Star button](https://github.com/WSL043/dsh-codex-subscription/stargazers) helps more DSH users find it.
378
365
 
366
+ <a href="https://star-history.com/#WSL043/dsh-codex-subscription&Date">
367
+ <picture>
368
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=WSL043/dsh-codex-subscription&type=Date&theme=dark" />
369
+ <img alt="Star history" src="https://api.star-history.com/svg?repos=WSL043/dsh-codex-subscription&type=Date" />
370
+ </picture>
371
+ </a>
372
+
379
373
  [简体中文](README.md) · [MIT](LICENSE)
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
  [![MIT](https://img.shields.io/badge/license-MIT-111111.svg)](LICENSE)
19
19
  [![Star](https://img.shields.io/github/stars/WSL043/dsh-codex-subscription?style=flat&logo=github&label=Star)](https://github.com/WSL043/dsh-codex-subscription/stargazers)
20
20
 
21
- [安装](#安装) · [核心功能](#核心功能) · [手机远程控制](#手机远程控制beta) · [草图作画实测](#草图作画实测) · [全部功能](#全部功能) · [使用指南](docs/GUIDE.zh-CN.md) · [常见问题](#常见问题)
21
+ [安装](#安装) · [核心功能](#核心功能) · [手机远程控制](#手机远程控制beta) · [草图画板](#草图画板beta) · [全部功能](#全部功能) · [使用指南](docs/GUIDE.zh-CN.md) · [常见问题](#常见问题)
22
22
 
23
23
  </div>
24
24
 
@@ -42,7 +42,7 @@
42
42
  2. 在 **包名或地址** 输入框中粘贴下面的包名(已带版本号):
43
43
 
44
44
  ```text
45
- dsh-codex-subscription@3.1.1
45
+ dsh-codex-subscription@3.1.3
46
46
  ```
47
47
 
48
48
  3. 点击 **安装**,等待安装完成;按页面提示操作,需要重启时先保存工作。
@@ -54,7 +54,7 @@
54
54
  <summary>终端安装(已能运行 dsh 命令)</summary>
55
55
 
56
56
  ```sh
57
- dsh plugin --profile web add dsh-codex-subscription@3.1.1
57
+ dsh plugin --profile web add dsh-codex-subscription@3.1.3
58
58
  ```
59
59
 
60
60
  安装完成后按提示重启 DSH,再到 **设置 → Codex 订阅** 登录。插件页面和终端均由 DSH 管理安装。
@@ -67,7 +67,7 @@ dsh plugin --profile web add dsh-codex-subscription@3.1.1
67
67
  先在 Web 中完成登录并选择一次 Codex 模型,再把同一个插件安装到 Headless profile:
68
68
 
69
69
  ```sh
70
- dsh plugin --profile headless add dsh-codex-subscription@3.1.1
70
+ dsh plugin --profile headless add dsh-codex-subscription@3.1.3
71
71
  dsh --profile headless "只回复:ok"
72
72
  ```
73
73
 
@@ -83,8 +83,13 @@ dsh --profile headless "只回复:ok"
83
83
 
84
84
  短周期和每周额度、重置时间、额外 Credits 与重置卡都在设置里;输入框旁可以常驻显示剩余额度,低于阈值会提醒。
85
85
 
86
+ <details>
87
+ <summary>查看截图</summary>
88
+
86
89
  <p align="center"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/ui-quota-zh-dark.png"><img src="docs/assets/ui-quota-zh-light.png" width="560" alt="额度卡片:每周额度与重置时间,下方可展开使用概览和额度去向"></picture></p>
87
90
 
91
+ </details>
92
+
88
93
  <details>
89
94
  <summary>使用概览与额度去向:累计用量、连续天数、每日热力图,以及每周额度花在哪</summary>
90
95
  <br>
@@ -95,8 +100,13 @@ dsh --profile headless "只回复:ok"
95
100
 
96
101
  选模型、调推理档位、切换速度档位,同时查看剩余额度,无需为每次请求打开设置。
97
102
 
103
+ <details>
104
+ <summary>查看截图</summary>
105
+
98
106
  <p align="center"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/ui-composer-zh-dark.png"><img src="docs/assets/ui-composer-zh-light.png" width="760" alt="输入框:权限、草图、剩余额度、闪电标识的 Fast 模式和模型选择"></picture></p>
99
107
 
108
+ </details>
109
+
100
110
  ### 手机远程控制(Beta)
101
111
 
102
112
  用 ChatGPT 手机 App 的 Codex 扫码配对,这台电脑上的 DSH 就出现在手机的主机列表里,DeepSeek 等任意 DSH 模型都能在手机上用:
@@ -111,17 +121,32 @@ dsh --profile headless "只回复:ok"
111
121
 
112
122
  默认关闭:**设置 → Codex 订阅 → 手机与更多 → 手机远程控制**。电脑需要保持开机、联网并打开 DSH。本功能基于 Codex Remote Control 协议实现第三方主机兼容,使用 OpenAI 的远程连接服务。Codex 的远程控制能力已有官方实现,但 DSH 作为第三方主机的接入方式尚不属于官方明确承诺支持的范围,后续服务更新可能影响兼容性,所以标为 Beta。功能默认关闭,你可以自行开启、管理已配对设备或随时停用。该功能不代表获得 OpenAI 官方认证或背书。
113
123
 
124
+ <details>
125
+ <summary>查看截图</summary>
126
+
114
127
  <p align="center"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/ui-remote-zh-dark.png"><img src="docs/assets/ui-remote-zh-light.png" width="560" alt="设置里的手机远程控制:开关、配对二维码和手动码、已配对的手机"></picture></p>
115
128
 
129
+ </details>
130
+
116
131
  ### 图片与草图
117
132
 
118
133
  用订阅生成图片,在图上圈出区域写备注继续修改,或者打开草图画板自己画、让 Agent 画,再以草图为参考生成成品。画板支持渐变、模糊、混合模式和形状裁剪;Agent 照着参考图画时能并排对比、看差异热图、量颜色和位置、撤销重来,画完还能一笔一笔回放并录成视频。
119
134
 
135
+ <details>
136
+ <summary>查看截图</summary>
137
+
120
138
  <p align="center"><img src="docs/assets/annotate-zh.webp" width="900" alt="图片预览:在烟囱上方圈出区域并写下备注,再带着备注继续编辑"></p>
121
139
 
140
+ </details>
141
+
142
+ <details>
143
+ <summary>查看截图</summary>
144
+
122
145
  <p align="center"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/ui-replay-zh-dark.webp"><img src="docs/assets/ui-replay-zh-light.webp" width="640" alt="草图画板的回放:按落笔顺序重放整幅画,可调速、拖动进度,并录成视频"></picture></p>
123
146
 
124
- 实测见 [草图作画实测](#草图作画实测),开关在 **设置 → Codex 订阅 → 创作**。
147
+ </details>
148
+
149
+ 草图画板见 [草图画板](#草图画板beta),开关在 **设置 → Codex 订阅 → 创作**。
125
150
 
126
151
  ### ChatGPT 连接器
127
152
 
@@ -131,8 +156,13 @@ dsh --profile headless "只回复:ok"
131
156
 
132
157
  联网搜索来源、ChatGPT 连接器和官方 Codex 子任务在 **设置 → Codex 订阅 → 联网与工具**,页首一个总开关:关闭后,用 DeepSeek 等非 Codex 模型对话时不再使用订阅的联网搜索(改用 DSH 搜索)、图片生成和 ChatGPT 连接器,Codex 订阅模型不受影响。默认开启。
133
158
 
159
+ <details>
160
+ <summary>查看截图</summary>
161
+
134
162
  <p align="center"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/ui-interop-zh-dark.webp"><img src="docs/assets/ui-interop-zh-light.webp" width="640" alt="联网与工具设置页"></picture></p>
135
163
 
164
+ </details>
165
+
136
166
  [详细用法、限制与可选组件 →](docs/GUIDE.zh-CN.md)
137
167
 
138
168
  ## 全部功能
@@ -253,42 +283,9 @@ dsh --profile headless "只回复:ok"
253
283
 
254
284
  [查看完整使用指南 →](docs/GUIDE.zh-CN.md)
255
285
 
256
- ## 草图作画实测
257
-
258
- 草图画板和 Agent 绘图为 **Beta**,默认关闭,在“创作”页按需开启。手动画图点输入框的草图按钮;让 Agent 画发送 `@sketch` 加要求。有参考图时 Agent 可以并排对比、看差异热图、局部放大、量颜色和边缘位置、撤销重画;画完可以点画板里的“回放”,把过程一笔一笔重放并录成视频。这些工具只测量和展示,不替模型画。
259
-
260
- 下面两个例子都是**只在画板上画、没有调用生图**,每个都跑一次,不代表稳定水平。“误差”是画作与参考图逐像素颜色差的平均值(越小越接近,0 为一致)。
261
-
262
- **《DeepSeek 娘》· 照着参考图临摹**
263
-
264
- <table>
265
- <tr><th width="33%">参考图</th><th width="33%">之前:旧工具里的最好成绩</th><th width="33%">现在:新工具</th></tr>
266
- <tr><td><img src="docs/assets/sketch-niang-reference.webp" alt="DeepSeek 娘表情包参考图" width="240"></td><td><img src="docs/assets/sketch-niang-astra-compare.webp" alt="旧工具画的 DeepSeek 娘" width="240"><br><sub>GPT-6-Astra Medium · 20 分 57 秒 · 686 笔<br>误差 8.8%</sub></td><td><img src="docs/assets/sketch-niang-astra-new.webp" alt="新工具画的 DeepSeek 娘" width="240"><br><sub>GPT-6-Astra Medium · 8 分 11 秒 · 481 笔<br>误差 9.3%</sub></td></tr>
267
- </table>
268
-
269
- 数字上两者接近,新版用时不到一半;双手叉腰的姿势和围裙上的小鲸鱼更准,发丝和蕾丝的细腻程度仍不及原图。
270
-
271
- **《初音未来》· 竖图,照着参考图临摹**
286
+ ## 草图画板(Beta)
272
287
 
273
- <table>
274
- <tr><th width="50%">之前:叠图对照和网格</th><th width="50%">现在:新工具</th></tr>
275
- <tr><td><img src="docs/assets/sketch-miku-sol-before.webp" alt="旧工具画的初音未来" width="330"><br><sub>GPT-6.1-Sol Xhigh · 误差 6.7%</sub></td><td><img src="docs/assets/sketch-miku-sol-new.webp" alt="新工具画的初音未来" width="330"><br><sub>GPT-6.1-Sol Xhigh · 21 分钟 · 685 笔 · 误差 5.2%</sub></td></tr>
276
- </table>
277
-
278
- 误差降了约四分之一,肩上的“01”、袖屏、腿部的系带细节补全了。读了模型的完整操作记录,剩下的误差主要是大块头发、皮肤和腿部的明暗色调,而不是边缘位置;前 3 分钟的四次整层 SVG 就把误差从 18% 压到 6.5%,之后 17 分钟的细化只降了 1.3 个百分点。实验过程、记录里发现的问题和改进见 [绘图实验记录](docs/sketch-drawing-experiments.md)。
279
-
280
- <details>
281
- <summary>展开完整提示词</summary>
282
-
283
- ```text
284
- @sketch 用 1:1 方形画板,尽可能忠实地临摹我附上的这张参考图(一张 Q 版二次元表情包)。画面:白色底;Q 版二头身的蓝发鲸鱼娘跪坐在画面右侧偏中,蓝色渐变长发披肩(发根深蓝、发梢浅蓝),头顶一根呆毛,戴白色蕾丝女仆头饰和蓝色蝴蝶结,头两侧是深蓝色带白色内里的鲸鱼耳鳍,蓝色大眼睛带高光,猫嘴嘟嘴的“ω”表情,脸颊泛红,双手叉腰;穿深蓝色女仆装,白色蕾丝围裙(围裙上有一只蓝色小鲸鱼图案),黑色领结,袖口和裙摆有白色蕾丝褶边;身后露出一条深蓝色的鲸鱼尾巴。左上方是白色对话气泡(黑色描边,尖角指向她),气泡里用黑色粗体写“你这吃白饭的蓝色大肥鱼。”;左侧从画面外伸进来一只黑袖子的手,食指指向她;她的左下方用蓝色描边字写“没吃饱喵!”;她脚边的地上放着一只空的白瓷饭碗,碗内壁印着一只蓝色小鲸鱼。请分层绘制:白色背景、头发与鲸鱼耳鳍与尾巴、身体与服装、脸部五官、饭碗、手臂与对话气泡文字,保留原生可编辑笔画,并特别注意角色比例、头发的渐变与发丝走向、蕾丝褶边和脸部表情的细节。这次只在草图画布上画,不要调用任何生图或图片编辑工具;画完后检查一遍与参考图的差异并修正,最后保存并完成。
285
- ```
286
-
287
- ```text
288
- 用画板(codex_sketch)按这张参考图画初音未来,竖图,尽量百分之百还原:构图、比例、姿势、颜色、细节都要一致。
289
- ```
290
-
291
- </details>
288
+ 草图画板和 Agent 绘图为 **Beta**,默认关闭,在“创作”页按需开启。手动画图点输入框的草图按钮;让 Agent 画发送 `@sketch` 加要求。
292
289
 
293
290
  <details>
294
291
  <summary>查看图片与草图设置</summary>
@@ -311,7 +308,7 @@ DSH 实机设置截图,随浅色 / 深色主题切换。
311
308
  <summary>终端方式</summary>
312
309
 
313
310
  ```sh
314
- dsh plugin --profile web update dsh-codex-subscription@3.1.1
311
+ dsh plugin --profile web update dsh-codex-subscription@3.1.3
315
312
  ```
316
313
 
317
314
  仅在需要卸载时运行:
@@ -380,4 +377,11 @@ DSH 插件交流可前往 [DeepSeek Harness Discussions](https://github.com/deep
380
377
 
381
378
  如果这个项目对你有帮助,[点一下 Star](https://github.com/WSL043/dsh-codex-subscription/stargazers) 可以让更多 DSH 用户发现它。
382
379
 
380
+ <a href="https://star-history.com/#WSL043/dsh-codex-subscription&Date">
381
+ <picture>
382
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=WSL043/dsh-codex-subscription&type=Date&theme=dark" />
383
+ <img alt="Star 趋势" src="https://api.star-history.com/svg?repos=WSL043/dsh-codex-subscription&type=Date" />
384
+ </picture>
385
+ </a>
386
+
383
387
  [MIT](LICENSE)
package/lib/client.js CHANGED
@@ -11478,7 +11478,7 @@ window.__ModuleLoader__.load({
11478
11478
  }
11479
11479
  //#endregion
11480
11480
  //#region src/version.js
11481
- const PACKAGE_VERSION = "3.1.1";
11481
+ const PACKAGE_VERSION = "3.1.3";
11482
11482
  //#endregion
11483
11483
  //#region src/client-recovery.js
11484
11484
  async function recoveryCall(rpc, endpoint, payload = {}, timeoutMs = 1e4) {
package/lib/index.js CHANGED
@@ -2,7 +2,7 @@ import { createRequire } from "node:module";
2
2
  import { createHash, randomBytes, randomUUID } from "node:crypto";
3
3
  import { closeOpenAICodexWebSocketSessions, getOpenAICodexWebSocketDebugStats, resetOpenAICodexWebSocketDebugStats } from "@earendil-works/pi-ai/api/openai-codex-responses";
4
4
  import { execFile, spawn } from "node:child_process";
5
- import { appendFileSync, constants, mkdirSync, readFileSync, readdirSync, renameSync, statSync, writeFileSync } from "node:fs";
5
+ import { appendFileSync, constants, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, statSync, writeFileSync } from "node:fs";
6
6
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
7
7
  import { request } from "node:https";
8
8
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -17,7 +17,7 @@ import { defineTool } from "@deepseek-ai/dsh-tools";
17
17
  import * as dshLlm from "@deepseek-ai/dsh-llm";
18
18
  import { createUserMessage } from "@deepseek-ai/dsh-llm";
19
19
  import * as dshCredentials from "@deepseek-ai/dsh-credentials";
20
- import { hostname } from "node:os";
20
+ import { homedir, hostname } from "node:os";
21
21
  import { dshHomePath, resolveDshHome } from "@deepseek-ai/dsh-home-paths";
22
22
  import { PiAiAdapter } from "@deepseek-ai/dsh-llm-pi-ai";
23
23
  import { openaiCodexProvider as createOpenAICodexProvider } from "@earendil-works/pi-ai/providers/openai-codex";
@@ -85,6 +85,78 @@ function observeAdapter(adapter, provider) {
85
85
  } });
86
86
  }
87
87
  //#endregion
88
+ //#region src/hidden-model-directory.js
89
+ /**
90
+ * Shares the subscription settings' hidden-model list with the host model
91
+ * directory (what other pickers read through `llm.listModels`).
92
+ *
93
+ * `listModels` is also the host's send-time availability check, so a hidden
94
+ * model stays listed while something still depends on it. Only the list is
95
+ * filtered: `resolveModel`, `prepareCall` and `stream` keep resolving against
96
+ * the unfiltered catalog, so an old session on a hidden model keeps working.
97
+ */
98
+ const ids = (models) => models.map((model) => model.id);
99
+ const same = (left, right) => left.length === right.length && left.every((id, index) => id === right[index]);
100
+ /**
101
+ * @param disabled - returns the user's hidden model ids (stale ids are harmless).
102
+ * @param pinned - returns model ids that must stay listed: models of open
103
+ * sessions, the default model, and this plugin's own configured models.
104
+ * @param fallback - returns the default model id, kept when everything is hidden.
105
+ */
106
+ function visibleModels(models, { disabled, pinned = () => [], fallback = () => void 0 }) {
107
+ const hidden = new Set(disabled());
108
+ if (hidden.size === 0) return models;
109
+ const keep = new Set(pinned());
110
+ const visible = models.filter((model) => !hidden.has(model.id) || keep.has(model.id));
111
+ if (visible.length > 0 || models.length === 0) return visible;
112
+ const preferred = fallback();
113
+ return [models.find((model) => model.id === preferred) ?? models[0]];
114
+ }
115
+ function createHiddenModelDirectory({ provider, disabled, pinned, fallback, emit }) {
116
+ const options = {
117
+ disabled,
118
+ pinned: () => {
119
+ try {
120
+ return pinned?.() ?? [];
121
+ } catch {
122
+ return [];
123
+ }
124
+ },
125
+ fallback
126
+ };
127
+ let catalog;
128
+ let emitted;
129
+ const filtered = (models) => visibleModels(models, options);
130
+ const wrap = (adapter) => new Proxy(adapter, { get(target, property) {
131
+ if (property === "listModels") return async (requested, ...rest) => {
132
+ const models = await target.listModels(requested, ...rest);
133
+ if (requested !== provider || !Array.isArray(models)) return models;
134
+ catalog = models;
135
+ const visible = filtered(models);
136
+ emitted = ids(visible);
137
+ return visible;
138
+ };
139
+ const value = Reflect.get(target, property, target);
140
+ return typeof value === "function" ? value.bind(target) : value;
141
+ } });
142
+ return {
143
+ wrap,
144
+ /** The hidden list changed: tell the host to reload its directory. */
145
+ settingsChanged: (value, previous) => {
146
+ if (same([...value ?? []].sort(), [...previous ?? []].sort())) return false;
147
+ emit();
148
+ return true;
149
+ },
150
+ /** Something a hidden model depends on may have changed; emit only if the listed set would differ. */
151
+ dependenciesChanged: () => {
152
+ if (catalog === void 0 || emitted === void 0) return false;
153
+ if (same(ids(filtered(catalog)), emitted)) return false;
154
+ emit();
155
+ return true;
156
+ }
157
+ };
158
+ }
159
+ //#endregion
88
160
  //#region src/default-model.js
89
161
  /**
90
162
  * DSH owns the model a freshly created agent starts on. This module is the
@@ -2413,7 +2485,7 @@ function inheritedOriginalImageRef(session, assetId) {
2413
2485
  }
2414
2486
  //#endregion
2415
2487
  //#region src/version.js
2416
- const PACKAGE_VERSION = "3.1.1";
2488
+ const PACKAGE_VERSION = "3.1.3";
2417
2489
  const USER_AGENT = `dsh-codex-subscription/${PACKAGE_VERSION}`;
2418
2490
  //#endregion
2419
2491
  //#region src/http-failure.js
@@ -2774,6 +2846,21 @@ async function limitMessage(response, now = Date.now()) {
2774
2846
  const minutes = Math.max(1, Math.ceil((at - now) / 6e4));
2775
2847
  return `Codex image generation limit reached; it resets in about ${minutes >= 120 ? `${Math.round(minutes / 60)} hours` : `${minutes} minutes`}`;
2776
2848
  }
2849
+ const REFUSAL_REASON = /^[\p{L}\p{N} .,:;'()_-]{1,160}$/u;
2850
+ /** What a backend 403 from the image endpoint says, with the server's short reason when it is plain text. */
2851
+ async function refusalMessage(response, editing) {
2852
+ let reason;
2853
+ try {
2854
+ const value = JSON.parse(await readTextWithin(response, 16 * 1024));
2855
+ const error = record$8(value?.error) ? value.error : void 0;
2856
+ reason = [
2857
+ error?.message,
2858
+ value?.detail,
2859
+ error?.code
2860
+ ].find((item) => typeof item === "string" && REFUSAL_REASON.test(item.trim()))?.trim();
2861
+ } catch {}
2862
+ return `ChatGPT refused Codex image ${editing ? "editing" : "generation"} for this account (HTTP 403${reason === void 0 ? "" : `: ${reason}`}). The sign-in itself is fine, so signing in again will not help: this account's plan or workspace may not include Codex image generation`;
2863
+ }
2777
2864
  async function readTextWithin(response, maximumBytes) {
2778
2865
  if (response.body === null || response.body === void 0) return "";
2779
2866
  const reader = response.body.getReader();
@@ -2958,8 +3045,9 @@ function createCodexImageTool(options) {
2958
3045
  }
2959
3046
  if (!response.ok) {
2960
3047
  const authFailure = await authFailureMessage(response);
2961
- if (authFailure !== void 0) throw new Error(authFailure);
2962
3048
  const requestId = supportId(response);
3049
+ if (response.status === 403 && authFailure === "ChatGPT sign-in needs to be renewed") throw new Error(`${await refusalMessage(response, editing)}${requestId}`);
3050
+ if (authFailure !== void 0) throw new Error(authFailure);
2963
3051
  if (response.status === 429) throw new Error(`${await limitMessage(response)}${requestId}`);
2964
3052
  throw new Error(`Codex image ${editing ? "edit" : "generation"} failed (HTTP ${response.status})${requestId}`);
2965
3053
  }
@@ -4139,6 +4227,26 @@ const TEXTUAL = /* @__PURE__ */ new Set([
4139
4227
  "diff-files",
4140
4228
  "diff-index"
4141
4229
  ]);
4230
+ /**
4231
+ * The phone's folder picker first asks the host for its home folder with one fixed PowerShell line. Nothing is run for it:
4232
+ * when the request is exactly that line, the answer is this machine's home folder.
4233
+ */
4234
+ function homeFolderAnswer(command, home = homedir()) {
4235
+ if (!Array.isArray(command) || command.length !== 5 || command.some((part) => typeof part !== "string")) return void 0;
4236
+ const [exe, ...flags] = command;
4237
+ if (!/^(?:powershell|pwsh)(?:\.exe)?$/iu.test(basename(exe))) return void 0;
4238
+ if (JSON.stringify(flags) !== JSON.stringify([
4239
+ "-NoProfile",
4240
+ "-NonInteractive",
4241
+ "-Command",
4242
+ "(Resolve-Path -LiteralPath $HOME).Path"
4243
+ ])) return void 0;
4244
+ return {
4245
+ exitCode: 0,
4246
+ stdout: `${home}\r\n`,
4247
+ stderr: ""
4248
+ };
4249
+ }
4142
4250
  /** The argv to run for a phone request, or a reason it is refused. */
4143
4251
  function gitArguments(command) {
4144
4252
  if (!Array.isArray(command) || command.length < 2 || command.some((part) => typeof part !== "string" || part.length > 4096 || part.includes("\0"))) return { error: "not a git command" };
@@ -4781,6 +4889,19 @@ function localFolder(value) {
4781
4889
  return;
4782
4890
  }
4783
4891
  }
4892
+ /** Whether two local folders are the same one: real paths compared, separators unified, case ignored on Windows. */
4893
+ function samePath(left, right) {
4894
+ if (typeof left !== "string" || typeof right !== "string" || left === "" || right === "") return false;
4895
+ const normal = (value) => {
4896
+ let resolved = value;
4897
+ try {
4898
+ resolved = realpathSync.native(value);
4899
+ } catch {}
4900
+ resolved = resolved.replace(/\\/gu, "/").replace(/(?<=.)\/+$/u, "");
4901
+ return process.platform === "win32" ? resolved.toLowerCase() : resolved;
4902
+ };
4903
+ return normal(left) === normal(right);
4904
+ }
4784
4905
  /** One image the phone attached, sent inline as a data URL (its own file paths mean nothing on this machine). */
4785
4906
  function dataImage(url) {
4786
4907
  const match = typeof url === "string" ? /^data:(image\/[A-Za-z0-9.+-]+);base64,([A-Za-z0-9+/=\s]+)$/u.exec(url) : null;
@@ -5944,6 +6065,8 @@ function createDshRemoteControl({ controller, agents, permissions = () => void 0
5944
6065
  };
5945
6066
  },
5946
6067
  "command/exec": async (params) => {
6068
+ const home = homeFolderAnswer(params?.command);
6069
+ if (home !== void 0) return home;
5947
6070
  const folders = await conversationFolders();
5948
6071
  try {
5949
6072
  return await runGit(params, { folders });
@@ -6212,7 +6335,16 @@ function createDshRemoteControl({ controller, agents, permissions = () => void 0
6212
6335
  if (params?.ephemeral === true) return titleThread(params);
6213
6336
  const cwd = localFolder(params?.cwd);
6214
6337
  const project = typeof params?.projectId === "string" ? workspaceList().find((entry) => String(entry.id) === params.projectId) : void 0;
6215
- const created = await service().create(project ? { workspaceId: project.id } : cwd ? { cwd } : {});
6338
+ const workspace = !project && cwd ? workspaceList().find((entry) => samePath(entry.path, cwd)) : void 0;
6339
+ let created;
6340
+ if (project) created = await service().create({ workspaceId: project.id });
6341
+ else if (workspace) try {
6342
+ created = await service().create({ workspaceId: workspace.id });
6343
+ } catch (error) {
6344
+ const made = error?.details?.sessionId;
6345
+ created = typeof made === "string" && made !== "" ? { sessionId: made } : await service().create({ cwd });
6346
+ }
6347
+ else created = await service().create(cwd ? { cwd } : {});
6216
6348
  if (typeof params?.threadSource === "string" && params.threadSource !== "") threadSources.set(created.sessionId, params.threadSource.slice(0, 64));
6217
6349
  const agent = await agentFor(created.sessionId);
6218
6350
  const saved = phoneConfig.read();
@@ -8367,6 +8499,22 @@ function createOfficialModelCatalog(options = {}) {
8367
8499
  let refreshing;
8368
8500
  let generation = 0;
8369
8501
  let refreshStatus = "idle";
8502
+ const retryDelays = Array.isArray(options.retryDelaysMs) ? options.retryDelaysMs.filter((delay) => Number.isFinite(delay) && delay > 0) : [];
8503
+ let retries = 0;
8504
+ let retryTimer;
8505
+ const stopRetry = () => {
8506
+ if (retryTimer !== void 0) cancelTimeout(retryTimer);
8507
+ retryTimer = void 0;
8508
+ };
8509
+ const scheduleRetry = (currentGeneration) => {
8510
+ if (models !== void 0 || currentGeneration !== generation || retryTimer !== void 0 || retries >= retryDelays.length) return;
8511
+ retryTimer = scheduleTimeout(() => {
8512
+ retryTimer = void 0;
8513
+ if (models !== void 0 || currentGeneration !== generation) return;
8514
+ refresh().catch(() => {});
8515
+ }, retryDelays[retries++]);
8516
+ retryTimer.unref?.();
8517
+ };
8370
8518
  const refresh = ({ signal } = {}) => {
8371
8519
  if (signal?.aborted) return Promise.reject(signal.reason ?? /* @__PURE__ */ new Error("Codex model catalog refresh aborted"));
8372
8520
  if (refreshing?.generation === generation) return refreshing.promise;
@@ -8449,6 +8597,10 @@ function createOfficialModelCatalog(options = {}) {
8449
8597
  refreshing = void 0;
8450
8598
  refreshStatus = outcome;
8451
8599
  }
8600
+ if (outcome === "ok") {
8601
+ retries = 0;
8602
+ stopRetry();
8603
+ } else if (outcome === "failed") scheduleRetry(currentGeneration);
8452
8604
  });
8453
8605
  refreshing = {
8454
8606
  generation: currentGeneration,
@@ -8476,6 +8628,8 @@ function createOfficialModelCatalog(options = {}) {
8476
8628
  const flight = refreshing;
8477
8629
  refreshing = void 0;
8478
8630
  flight?.cancel();
8631
+ stopRetry();
8632
+ retries = 0;
8479
8633
  models = void 0;
8480
8634
  rawCatalog = void 0;
8481
8635
  metadata = /* @__PURE__ */ new Map();
@@ -11899,7 +12053,15 @@ function apply(ctx, config = {}) {
11899
12053
  getAuth: (options) => resolveAuth(options),
11900
12054
  readCredential: (options) => store.read(PROVIDER, options),
11901
12055
  baseModels: () => baseProvider.getModels(),
11902
- fetch: (input, init) => network.fetch("catalog", input, init)
12056
+ fetch: (input, init) => network.fetch("catalog", input, init),
12057
+ retryDelaysMs: [
12058
+ 5e3,
12059
+ 15e3,
12060
+ 3e4,
12061
+ 6e4,
12062
+ 12e4,
12063
+ 3e5
12064
+ ]
11903
12065
  });
11904
12066
  const connection = createSubscriptionConnection({ resolveMode: () => settings.get().connectionMode });
11905
12067
  const defaultModel = createDefaultModelController({
@@ -12142,7 +12304,32 @@ function apply(ctx, config = {}) {
12142
12304
  auth: adapterAuth,
12143
12305
  resolveAttachments: () => ctx.get?.("attachments")
12144
12306
  });
12145
- ctx.llm.registerAdapter([PROVIDER], observeAdapter(compaction.wrapAdapter(adapter), provider));
12307
+ const hiddenDirectory = createHiddenModelDirectory({
12308
+ provider: PROVIDER,
12309
+ disabled: () => normalizeDisabledModels(settings.get()[DISABLED_MODELS_FIELD]),
12310
+ pinned: () => {
12311
+ const keep = [];
12312
+ try {
12313
+ for (const session of ctx.get?.("sessions")?.list?.() ?? []) {
12314
+ const route = session.requestContext?.();
12315
+ if (route?.provider === PROVIDER && typeof route.model === "string") keep.push(route.model);
12316
+ }
12317
+ } catch {}
12318
+ const selection = defaultModel.status();
12319
+ if (selection.managed) keep.push(selection.model);
12320
+ return keep;
12321
+ },
12322
+ fallback: () => {
12323
+ const selection = defaultModel.status();
12324
+ return selection.managed ? selection.model : void 0;
12325
+ },
12326
+ emit: () => ctx.llm.emitAdaptersUpdated?.()
12327
+ });
12328
+ ctx.effect(() => settings.watch((value, previous) => hiddenDirectory.settingsChanged(normalizeDisabledModels(value[DISABLED_MODELS_FIELD]), normalizeDisabledModels(previous[DISABLED_MODELS_FIELD]))), "codex-subscription: hidden model directory");
12329
+ ctx.effect(() => ctx.on?.("session/event", (_session, event) => {
12330
+ if (event?.type === "request/context") hiddenDirectory.dependenciesChanged();
12331
+ }), "codex-subscription: hidden model dependencies");
12332
+ ctx.llm.registerAdapter([PROVIDER], hiddenDirectory.wrap(observeAdapter(compaction.wrapAdapter(adapter), provider)));
12146
12333
  const currentAgent = () => ctx.get?.("agents")?.currentInitiator?.();
12147
12334
  const servesCurrentModel = () => {
12148
12335
  if (settings.get().otherModels !== "off") return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-codex-subscription",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "description": "Use ChatGPT and Codex subscriptions in DeepSeek Harness with OAuth, quota, safe resets, web search, images and Fast mode, and control DSH from the ChatGPT mobile app (Beta)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",