dsh-codex-subscription 1.4.0 → 1.4.1

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/AGENTS.md CHANGED
@@ -6,7 +6,7 @@ Use this guide when a user asks an Agent to install, update, verify, or remove
6
6
  ## Safety
7
7
 
8
8
  - Confirm the target DSH installation and profile. Use `web` only when it is the user's target.
9
- - Use the exact `1.4.0` package below; do not install a moving branch.
9
+ - Use the exact `1.4.1` package below; do not install a moving branch.
10
10
  - Never print OAuth credentials, account IDs, authorization callbacks, or credential-store contents.
11
11
  - Preserve the DSH profile, unrelated plugins, sessions, and saved sign-in.
12
12
  - Do not start, stop, or restart DSH without explicit permission.
@@ -14,23 +14,19 @@ Use this guide when a user asks an Agent to install, update, verify, or remove
14
14
 
15
15
  ## Locate DSH
16
16
 
17
- On Windows, check the command and common Portable entry points without recursively scanning disks:
17
+ On Windows, check the standard DSH and official npm entry points without recursively scanning disks:
18
18
 
19
19
  ```powershell
20
20
  Get-Command dsh -ErrorAction SilentlyContinue
21
21
  Get-Command npx -ErrorAction SilentlyContinue
22
- Test-Path -LiteralPath '.\dsh.exe' -PathType Leaf
23
- Test-Path -LiteralPath "$env:USERPROFILE\Downloads\DSH-Portable\dsh.exe" -PathType Leaf
24
22
  Get-CimInstance Win32_Process -Filter "Name = 'node.exe'" |
25
23
  Where-Object { $_.CommandLine -match '@deepseek-ai[\\/]dsh[\\/]lib[\\/]bin\.js' } |
26
24
  Select-Object ExecutablePath, CommandLine
27
25
  ```
28
26
 
29
- A current DSH-Portable includes `dsh.exe`. Missing system Node.js or pnpm is normal; do not install
30
- either globally for this plugin. If the Portable copy does not contain `dsh.exe`, update DSH-Portable
31
- instead of recreating its package-manager environment in this installer. For a matching running process,
32
- the Portable root is the parent of `runtime`; use its `dsh.exe`. If several targets remain possible, stop
33
- and ask the user which one to change.
27
+ DSH-Portable exposes the same standard `dsh plugin` contract. Missing system pnpm is normal; do not
28
+ install it globally for this plugin. If several targets remain possible, stop and ask the user which one
29
+ to change.
34
30
 
35
31
  ## Install or update
36
32
 
@@ -38,19 +34,13 @@ For an official DSH installation run through npm, keep the complete `npx` prefix
38
34
  run command does not create a global `dsh` command:
39
35
 
40
36
  ```sh
41
- npx -y @deepseek-ai/dsh@0.1.1-rc.2 plugin --profile web add dsh-codex-subscription@1.4.0
37
+ npx -y @deepseek-ai/dsh@0.1.1-rc.2 plugin --profile web add dsh-codex-subscription@1.4.1
42
38
  ```
43
39
 
44
40
  With an existing global `dsh` command:
45
41
 
46
42
  ```sh
47
- dsh plugin --profile web add dsh-codex-subscription@1.4.0
48
- ```
49
-
50
- From a DSH-Portable folder:
51
-
52
- ```powershell
53
- .\dsh.exe plugin --profile web add dsh-codex-subscription@1.4.0
43
+ dsh plugin --profile web add dsh-codex-subscription@1.4.1
54
44
  ```
55
45
 
56
46
  Use the same `add` command to update or repair. This is the complete package-changing operation.
@@ -66,11 +56,9 @@ dsh plugin --profile web list dsh-codex-subscription --depth 0
66
56
  dsh --profile web --dump-config
67
57
  ```
68
58
 
69
- For DSH-Portable, replace `dsh` with `.\dsh.exe`. Static acceptance requires:
70
-
71
59
  For the official npm route, run the same checks with `npx -y @deepseek-ai/dsh@0.1.1-rc.2` in place of `dsh`.
72
60
 
73
- 1. `dsh-codex-subscription` version `1.4.0` appears exactly once.
61
+ 1. `dsh-codex-subscription` version `1.4.1` appears exactly once.
74
62
  2. `codex-subscription` appears exactly once in the composed config.
75
63
  3. No unrelated plugin or profile was changed and DSH was not restarted.
76
64
 
@@ -85,12 +73,6 @@ the user explicitly asks for a live model, search, or image-generation check.
85
73
  dsh plugin --profile web remove dsh-codex-subscription
86
74
  ```
87
75
 
88
- For DSH-Portable:
89
-
90
- ```powershell
91
- .\dsh.exe plugin --profile web remove dsh-codex-subscription
92
- ```
93
-
94
76
  For the official npm route:
95
77
 
96
78
  ```sh
package/README.md CHANGED
@@ -37,7 +37,7 @@ With an existing `dsh` command, install with:
37
37
  dsh plugin --profile web add dsh-codex-subscription
38
38
  ```
39
39
 
40
- From a DSH-Portable product folder, run `./dsh plugin ...` (`.\dsh.exe plugin ...` in Windows PowerShell). See below for the complete official npm, Agent, update, and uninstall routes.
40
+ DSH-Portable exposes the same standard plugin command, so the command above also applies there. See below for the complete official npm, Agent, update, and uninstall routes.
41
41
 
42
42
  ## Why this plugin
43
43
 
@@ -117,7 +117,7 @@ npx -y @deepseek-ai/dsh@0.1.1-rc.2 --profile web --dump-config
117
117
  </details>
118
118
 
119
119
  <details>
120
- <summary>An existing <code>dsh</code> command or a DSH-Portable folder</summary>
120
+ <summary>An existing <code>dsh</code> command</summary>
121
121
 
122
122
  ```sh
123
123
  dsh plugin --profile web add dsh-codex-subscription
@@ -125,8 +125,7 @@ dsh plugin --profile web list dsh-codex-subscription --depth 0
125
125
  dsh --profile web --dump-config
126
126
  ```
127
127
 
128
- For DSH-Portable, replace `dsh` with `./dsh` (`.\dsh.exe` in PowerShell). The plugin list should contain
129
- one `dsh-codex-subscription`, and the config should contain one `codex-subscription` entry.
128
+ The plugin list should contain one `dsh-codex-subscription`, and the config should contain one `codex-subscription` entry.
130
129
 
131
130
  </details>
132
131
 
@@ -198,14 +197,10 @@ dsh plugin --profile web remove dsh-codex-subscription
198
197
 
199
198
  </details>
200
199
 
201
- From a DSH-Portable folder, replace `dsh` above with `.\dsh.exe`.
202
-
203
200
  ## Troubleshooting
204
201
 
205
202
  - **`dsh` is not recognized:** the official npm route does not create a global `dsh` command; use the complete `npx -y @deepseek-ai/dsh@0.1.1-rc.2 ...` command above;
206
- - **`dsh.exe` is not recognized:** that file is not in the current folder; enter the DSH-Portable folder first or use the one-line Windows setup;
207
- - **DSH-Portable is not found:** enter its folder and rerun setup, or run `.\dsh.exe plugin --profile web add dsh-codex-subscription` directly;
208
- - **More than one DSH exists:** the one-line setup combines running copies with Portable folders detected in common locations; enter its number. For an Agent, use the intended folder or pass `-DshPath` explicitly;
203
+ - **More than one DSH exists:** run the standard command from the intended DSH environment. For an Agent, specify the target or pass `-DshPath` explicitly;
209
204
  - **Setup still fails:** send the Agent guide above to an Agent. Do not delete the profile or change the system PATH to force an install.
210
205
  - **Need to report a problem:** generate a **Support diagnostics** report at the bottom of Settings, then open the [bug report form](https://github.com/WSL043/dsh-codex-subscription/issues/new?template=install-problem.yml). The form collects exact DSH/plugin versions and reproduction steps. The generated report excludes credentials and account identifiers; still do not attach sign-in URLs, authorization codes, or browser callback addresses.
211
206
 
package/README.zh-CN.md CHANGED
@@ -38,7 +38,7 @@
38
38
  dsh plugin --profile web add dsh-codex-subscription
39
39
  ```
40
40
 
41
- DSH-Portable 用户在产品目录中运行 `./dsh plugin ...`,Windows PowerShell 使用 `.\dsh.exe plugin ...`。完整的官方 npm、Agent 安装、更新和卸载方式见下文。
41
+ DSH-Portable 也提供相同的标准插件命令,因此同样使用上面的命令。完整的官方 npm、Agent 安装、更新和卸载方式见下文。
42
42
 
43
43
  ## 核心优势
44
44
 
@@ -117,7 +117,7 @@ npx -y @deepseek-ai/dsh@0.1.1-rc.2 --profile web --dump-config
117
117
  </details>
118
118
 
119
119
  <details>
120
- <summary>已经能运行 <code>dsh</code>,或位于 DSH-Portable 目录</summary>
120
+ <summary>已经能运行 <code>dsh</code></summary>
121
121
 
122
122
  ```sh
123
123
  dsh plugin --profile web add dsh-codex-subscription
@@ -125,8 +125,7 @@ dsh plugin --profile web list dsh-codex-subscription --depth 0
125
125
  dsh --profile web --dump-config
126
126
  ```
127
127
 
128
- DSH-Portable 请把 `dsh` 换成 `./dsh`(PowerShell 使用 `.\dsh.exe`)。安装列表中应只有一个
129
- `dsh-codex-subscription`,配置中应只有一个 `codex-subscription` 条目。
128
+ 安装列表中应只有一个 `dsh-codex-subscription`,配置中应只有一个 `codex-subscription` 条目。
130
129
 
131
130
  </details>
132
131
 
@@ -196,14 +195,10 @@ dsh plugin --profile web remove dsh-codex-subscription
196
195
 
197
196
  </details>
198
197
 
199
- DSH-Portable 在其目录中把上述 `dsh` 换成 `.\dsh.exe`。
200
-
201
198
  ## 常见问题
202
199
 
203
200
  - **`dsh` 无法识别**:官方 npm 方式本来就不会创建全局 `dsh` 命令,请使用上面的完整 `npx -y @deepseek-ai/dsh@0.1.1-rc.2 ...` 命令;
204
- - **`dsh.exe` 无法识别**:当前目录没有该文件。请先进入 DSH-Portable 目录,或使用 Windows 单行助手;
205
- - **找不到 DSH-Portable**:进入它的目录后重新执行安装命令,或直接运行 `.\dsh.exe plugin --profile web add dsh-codex-subscription`;
206
- - **电脑上有多个 DSH**:单行助手会合并正在运行的副本与常用目录内检测到的 Portable,输入对应编号即可;交给 Agent 时让它进入目标目录,或明确传入 `-DshPath`;
201
+ - **电脑上有多个 DSH**:请在目标 DSH 环境中运行标准命令;交给 Agent 时明确目标,或传入 `-DshPath`;
207
202
  - **安装仍然失败**:把上面的 Agent 文档链接发给 Agent,不要删除 profile 或随意修改系统 PATH。
208
203
  - **需要提交问题**:在设置页底部生成“支持诊断”,然后打开[使用问题表单](https://github.com/WSL043/dsh-codex-subscription/issues/new?template=install-problem.yml)。表单会收集准确的 DSH/插件版本和复现步骤;报告不含凭据和账号标识,仍不要附上登录链接、授权码或浏览器回调地址。
209
204
 
package/lib/index.js CHANGED
@@ -503,7 +503,7 @@ function openaiCodexSubscriptionProvider({ resolveSpeedMode = () => void 0 } = {
503
503
  }
504
504
  //#endregion
505
505
  //#region src/version.js
506
- const PACKAGE_VERSION = "1.4.0";
506
+ const PACKAGE_VERSION = "1.4.1";
507
507
  const USER_AGENT = `dsh-codex-subscription/${PACKAGE_VERSION}`;
508
508
  //#endregion
509
509
  //#region src/codex-search.js
@@ -643,6 +643,13 @@ const nonEmpty = (value) => typeof value === "string" && value.trim().length > 0
643
643
  function encodedLimit(decodedBytes) {
644
644
  return Math.ceil(decodedBytes / 3) * 4;
645
645
  }
646
+ function validBase64Body(value, end) {
647
+ for (let index = 0; index < end; index += 1) {
648
+ const code = value.charCodeAt(index);
649
+ if (!(code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 43 || code === 47)) return false;
650
+ }
651
+ return true;
652
+ }
646
653
  async function readJsonWithin(response, maximumBytes) {
647
654
  const contentLength = Number(response.headers.get("content-length"));
648
655
  if (Number.isFinite(contentLength) && contentLength > maximumBytes) throw new Error("Codex image response exceeds the image size limit");
@@ -670,8 +677,8 @@ async function readJsonWithin(response, maximumBytes) {
670
677
  /** Strictly decode one PNG returned by the subscription backend. */
671
678
  function decodeCodexPng(value, maximumBytes) {
672
679
  const encoded = nonEmpty(value);
673
- if (encoded === void 0 || encoded.length % 4 !== 0 || !/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u.test(encoded)) throw new Error("Codex returned an invalid base64 PNG");
674
- const padding = encoded.endsWith("==") ? 2 : encoded.endsWith("=") ? 1 : 0;
680
+ const padding = encoded?.endsWith("==") ? 2 : encoded?.endsWith("=") ? 1 : 0;
681
+ if (encoded === void 0 || encoded.length % 4 !== 0 || !validBase64Body(encoded, encoded.length - padding)) throw new Error("Codex returned an invalid base64 PNG");
675
682
  const decodedBytes = encoded.length / 4 * 3 - padding;
676
683
  if (decodedBytes > maximumBytes) throw new Error("Codex image exceeds the image size limit");
677
684
  const data = Buffer.from(encoded, "base64");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-codex-subscription",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Use ChatGPT and Codex subscriptions in DeepSeek Harness with OAuth, quota, safe resets, web search, images, and Fast mode",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",