@eddyskywalker/dsh-chatgpt-subscription 0.68.0 → 0.69.0

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +2 -2
  3. package/lib/client.js +22 -2
  4. package/lib/client.js.map +1 -1
  5. package/lib/codemode.js +440 -18
  6. package/lib/{entry-plan-mode-gqE4UeU5.js → entry-plan-mode-5DBZA4Il.js} +38 -11
  7. package/lib/index.js +116 -17
  8. package/lib/plan-mode-pipeline.js +20 -6
  9. package/lib/plan-mode.js +1 -1
  10. package/lib/types/client/codemode/CodeRunToolView.d.ts.map +1 -1
  11. package/lib/types/client/opendesign/OpenDesignSection.d.ts.map +1 -1
  12. package/lib/types/compat.d.ts +1 -1
  13. package/lib/types/entry-codemode.d.ts.map +1 -1
  14. package/lib/types/entry-plan-mode-pipeline.d.ts.map +1 -1
  15. package/lib/types/host/antigravity/adapter.d.ts +2 -0
  16. package/lib/types/host/antigravity/adapter.d.ts.map +1 -1
  17. package/lib/types/host/antigravity/types.d.ts +21 -0
  18. package/lib/types/host/antigravity/types.d.ts.map +1 -1
  19. package/lib/types/host/codemode/transport.d.ts +61 -5
  20. package/lib/types/host/codemode/transport.d.ts.map +1 -1
  21. package/lib/types/host/common/idle-watchdog.d.ts +10 -2
  22. package/lib/types/host/common/idle-watchdog.d.ts.map +1 -1
  23. package/lib/types/host/dispatch-execution-guard.d.ts.map +1 -1
  24. package/lib/types/host/opendesign/adapter.d.ts.map +1 -1
  25. package/lib/types/host/opendesign/mapper.d.ts +13 -1
  26. package/lib/types/host/opendesign/mapper.d.ts.map +1 -1
  27. package/lib/types/host/opendesign/routes.d.ts.map +1 -1
  28. package/lib/types/index.d.ts +23 -0
  29. package/lib/types/index.d.ts.map +1 -1
  30. package/lib/types/shared/opendesign-contracts.d.ts +1 -1
  31. package/lib/types/shared/opendesign-contracts.d.ts.map +1 -1
  32. package/package.json +19 -19
package/CHANGELOG.md CHANGED
@@ -2,6 +2,32 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.69.0 - 2026-11-12
6
+
7
+ - **[codemode / 兼容] 对齐 DSH 0.2.2-rc.2:升级 `code_run` 图文混排投影、`scoped-repl` 顶层 `return` 自愈、一等 `PtcImage` 绑定与子代理血缘守卫**
8
+ - **有序图文输出与 `projectContent` 内联投影**:兼容 DSH `0.2.2-rc.2` 的 `PtcRunResult.output: PtcOutputBlock[]` 与旧代 `result.logs: string[]` 双轨协议;`code_run` 实现 `ToolDefinition.projectContent(exec, result)`,在成功时按 `inspect(...)` 顺序把文本与图片直接投射为 `ToolResultMessage.content` 中的有序多模态块,在程序报错时将报错前已 `inspect` 的文本和图片追加在错误块之后保留现场。
9
+ - **`scoped-repl` 默认格式识别与末尾顶层 `return` 自动修复**:`rules.ts` 与 `transport.ts` 将 `'scoped-repl'` / `'script'` 归入 REPL 格式(生成无 `return` 的 REPL 示例并补充 `inspect(...values)` 指引);新增词法状态机 `sanitizeReplTopLevelReturn`,在 TypeScript REPL 模式下自动剥离末尾顶层 `return <expr>`(对象字面量自动包 `({...})`),避免模型沿用 `function-body` 习惯导致 `SyntaxError: Return statement is not allowed here`。
10
+ - **一等 `PtcImage` 绑定与未检视图片兜底**:当宿主暴露 `resolveImageAttachmentAccess` 且当前运行时支持 `inspect` 时,`read_image` 与 `cua` 返回的图片封装为 `PtcImageLike`(`Symbol.for('dsh.ptc.image') === true`);若程序结束前未调用 `inspect(img)`,`transport.ts` 自动通过 `exec.deferContext(createImageContext(...))` 延迟注入,确保图片不丢失。
11
+ - **双快照子调用参数隔离与提前注册运行句柄**:`normalizeSubCallArgsPair` 为工具执行与 `tool/ptc-dispatch` 审计日志分别生成独立深拷贝快照;`host.trackRun` 提前至工作目录准备与沙箱提权弹窗之前注册,确保等待审批期间切沙箱或重置能立即中止。
12
+ - **子代理血缘与白名单提示词兼容 `0.2.2-rc.2`**:适配上游移除 `ctx.agents.roots()` / `isOwnedBy()` 的变更,`entry-plan-mode-pipeline.ts`(`assertLiveRoot`)与 `dispatch-execution-guard.ts`(`isDelegatedCaller` / `hasRunningChildSubagent`)优先通过 `session.header.origin === 'subagent'`、`session.header.parentSession` 及 `ctx.subagents.rootOf(agent)` 判定子代理身份与运行中子代,保留老代 `agents.roots()` 回退;`subagent-model-authorization.ts` 同步兼容 `0.2.2-rc.2` 的 `tool-subagent` 描述文案重写;`package.json` `peerDependencies` 扩展至 `0.2.2-rc.2`。
13
+
14
+ - **[antigravity / 流式] 慢思考模型不再被空闲看门狗判成死流:首个 chunk 之前单独给 240s 窗口**
15
+ - **现象**:`gemini-4-carbon`(`-medium` / `-high`)跑长上下文时,响应头回来之后一个字节都不来,120s 后本轮报 `Antigravity stream idle timeout after 120000ms`,DSH 从头发起重试(线上连续出现 1/5、3/5),每次重试还要再付一次预填充。
16
+ - **判据本身没错**:看门狗按**传输层字节**计时,`: ping` 注释帧也会重新计时(`adapter.ts` 的 read 循环与每帧各一次 `activity.pulse()`),所以报超时就意味着确实 120s 零字节。缺的是把**模型还没开口**和**流已经卡住**分开:两段静默共用一个预算,而带思考的模型可以在首帧之前静默数分钟。
17
+ - **改法**:共享 seam `wrapStreamWithWatchdog` 新增可选首值窗口 `firstValueTimeoutMs`——首帧之前用长预算,首个 chunk 一出去立刻切回原有预算,因此放宽首帧窗口不会让真正卡住的流多等;两段看门狗的 signal 都融合进传输层,无论哪一段到点连接都会被中止(`test/idle-watchdog.test.ts` 里"超时身份要送到 source"的断言两段都覆盖)。超时文案区分 `before the first chunk` 与普通一句,下次复发一眼看出静默落在哪一段。antigravity 线路传 `STREAM_FIRST_OUTPUT_TIMEOUT_MS = 240_000`,并新增插件配置 `antigravityFirstOutputTimeoutMs`(与共享值相等即退回单窗口)。
18
+ - **240s 是选定的上界,不是实测**:它仍比 undici 的 300s 传输判死早一分钟,真死流依旧由本线路报 `TIMEOUT` 而不是报成断连;仓库里没有按模型量过的首帧时间,carbon 的真实思考时长未知,所以留了配置项供部署自行加长(天花板仍是 300s)。
19
+ - **刻意不做**:不动共享 `DEFAULT_STREAM_IDLE_TIMEOUT_MS`——`test/stream-idle-budgets.test.ts` 把"所有线路同一预算且严格小于 300s"当作契约;不改其它线路的窗口;不把 `TIMEOUT` 改成不重试的终态。
20
+ - **验证**:`test/idle-watchdog.test.ts` 新增 3 例(首帧窗口内存活、首帧之后仍按共享预算判死、零字节到底仍超时且文案点名窗口);`test/stream-idle-budgets.test.ts` 断言 antigravity 首帧窗口大于共享值且小于传输层 300s;`test/stream-activity-idle.test.ts` 新增一条走真实适配器流的用例(静默 150s 后正常收尾,以及连 240s 都等不到仍 `TIMEOUT`)。**反向对照**:把 seam 临时改回单窗口后 3 例当场失败(`spends the first-value window…`、`names the first-value window…`、`survives silence longer than the shared idle budget…`),恢复后全绿。`npm run typecheck` 通过;全量 Vitest 为 384 文件通过 / 2 跳过(6996 例通过 / 9 例跳过 / 0 失败);`npm run build` 通过,`lib/` 已重建。
21
+
22
+ ## 0.68.1 - 2026-11-11
23
+
24
+ - **[opendesign / 号池] 套餐不含某个模型不再判成密钥失效,并补回清除失效标记的入口**
25
+ - **现象**:Go 档账号用 `deepseek-v4.1-flash` 偶发失败后,卡片把该账号标成「登录已失效 / 需替换 Key」,而同一把 Key 打同一个模型在下一次请求就成功;用户反复「重新登录」也只能换一个新账号,旧行一直是红的。
26
+ - **根因**:`isAuthenticationError` 把 **401 与 403 一律**判成 `AUTH`,`streamErrorCode` 因此把网关的 `tier_request_kind_not_entitled`(`membership tier "go" is not entitled to use this model for chat_completions`)与 `tier_model_not_entitled`(`Go/Plus 用户不允许访问最贵的模型`)也归到 `AUTH`,`standDown` 再写成 `authStatus: "invalid"`。这两种拒绝说的是**套餐与模型**,同一把 Key 对其余模型照常可用;而 `invalid` 只由 `clearAuthFailed` 解除,本线路的账号路由又没有该 action(实测 `POST {"action":"relogin"}` 返回 `Unsupported account action.`),于是正常账号被永久挂起。
27
+ - **改法**:`mapper.ts` 新增 `isModelEntitlementDenial`,`streamErrorCode` 在 `AUTH` 之前把它归为 `PROVIDER_ERROR`;`isAuthenticationError` 只在 401,或 403 的正文点名了密钥(`invalid_api_key` / `key was revoked` 等)时才返回真。`adapter.ts` 对权益类拒绝改成「跳过本账号、换下一个账号」,**不落任何标记**——号池里可能有更高档位的 Key,而当前账号对其余模型仍然有效。`routes.ts` 新增 `relogin`(清标记、不删账号),卡片「重新登录」改为先清标记再走登录,与同仓其余线路一致。
28
+ - **刻意不做**:不改 `PROVIDER_ERROR` 的重试语义、不动 `QUOTA` 判定,也不把 5xx 拉进这次分类——`database_unavailable` 已经是 `SERVER`,本来就不会挂起账号。
29
+ - **回归**:`test/opendesign-mapper.test.ts` 覆盖两种 `tier_*` 403、不带凭证线索的 403(现在是 `HTTP_403`,此前是 `AUTH`)、带凭证线索的 403 与 401;`test/opendesign-adapter.test.ts` 覆盖承重的一步——权益类 403 换到下一个账号、且该账号既不落 `invalid` 也不进冷却(合并后补齐,并做过反向对照:短路 `adapter.ts` 那条分支即失败);`test/opendesign-routes.test.ts` 覆盖 `relogin` 清标记后账号仍在、别名保留、`usable` 恢复。`npm run typecheck` 通过;四个 opendesign 测试文件 171 例全通过;全量 Vitest 为 384 文件通过 / 2 跳过,6991 例通过 / 9 跳过,0 失败。
30
+
5
31
  ## 0.68.0 - 2026-11-11
6
32
 
7
33
  - **[cline-pass / 路由] 移除客户端上游钉选,模型路由完全交还 Cline 网关**
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  插件最初为接入 ChatGPT Plus / Pro / Business 订阅的 Codex 模型而建,现已演进为统一的**多订阅服务中枢(Subscription Hub)与编码 Agent 增强套件**:在单一插件包内同时提供 **13 条独立模型供应线路**、跨平台加密多账号池、多模态生图/视频工具链、前缀缓存零漂移保护,以及随包分发的 `dispatch` 多子代理编排预设。
6
6
 
7
7
  - **跨平台支持**:Windows、macOS、Linux(含无桌面密钥环的远程服务器部署模式)
8
- - **跨代际兼容**:单一代码库兼容 `@deepseek-ai/dsh` **0.1.2-alpha.5 至 0.2.2-rc.1** 全系列版本
8
+ - **跨代际兼容**:单一代码库兼容 `@deepseek-ai/dsh` **0.1.2-alpha.5 至 0.2.2-rc.2** 全系列版本
9
9
  - **全栈多语言**:Web 设置中心与宿主侧提示/报错完整支持 **简体中文(`zh`)/ English(`en`)/ Русский(`ru`)**
10
10
 
11
11
  ---
@@ -76,7 +76,7 @@
76
76
 
77
77
  - **操作系统**:Windows(需内置 PowerShell 以支持 CurrentUser DPAPI)、macOS 或 Linux
78
78
  - **运行时**:Node.js **≥ 22.19**(内置 `undici` 8 的下限,已写入 `package.json` 的 `engines`;建议 24 LTS)与 npm
79
- - **宿主版本**:DeepSeek Harness `@deepseek-ai/dsh` `0.1.2-alpha.5` 至 `0.2.2-rc.1`
79
+ - **宿主版本**:DeepSeek Harness `@deepseek-ai/dsh` `0.1.2-alpha.5` 至 `0.2.2-rc.2`
80
80
 
81
81
  ---
82
82
 
package/lib/client.js CHANGED
@@ -17728,6 +17728,26 @@ window.__ModuleLoader__.load({
17728
17728
  });
17729
17729
  }).catch((cause) => setError(detail(cause)));
17730
17730
  }, [loginFlow]);
17731
+ /**
17732
+ * Re-authorize one account.
17733
+ *
17734
+ * The failure marker is cleared first and nothing is deleted, which is the
17735
+ * same contract every sibling line's card has. A row parked by a refusal that
17736
+ * was never about its key — the plan withholding one model answers 403 too —
17737
+ * comes back as soon as the marker is gone; a row whose key really is dead is
17738
+ * no worse off, because the next request parks it again for the same reason.
17739
+ */
17740
+ const reloginAccount = (0, react.useCallback)((accountId) => {
17741
+ (async () => {
17742
+ try {
17743
+ applyStatus(await API$3.accountAction("relogin", { accountId }));
17744
+ } catch (cause) {
17745
+ setError(detail(cause));
17746
+ return;
17747
+ }
17748
+ startLogin();
17749
+ })();
17750
+ }, [applyStatus, startLogin]);
17731
17751
  const run = (0, react.useCallback)(async (label, action) => {
17732
17752
  setBusy(label);
17733
17753
  setError(null);
@@ -17933,7 +17953,7 @@ window.__ModuleLoader__.load({
17933
17953
  busy,
17934
17954
  onLogin: startLogin,
17935
17955
  loginBusyLabel: t.loggingIn,
17936
- onRelogin: startLogin,
17956
+ onRelogin: reloginAccount,
17937
17957
  onSetPrimary: (id) => void run("set-primary", () => API$3.accountAction("set-primary", { accountId: id })),
17938
17958
  onDelete: (id) => void run("delete", () => API$3.accountAction("delete", { accountId: id })),
17939
17959
  onClearCooldown: (id) => void run("clear-cooldown", () => API$3.accountAction("clear-cooldown", { accountId: id })),
@@ -59920,7 +59940,7 @@ window.__ModuleLoader__.load({
59920
59940
  const errCode = block.error.code ?? "UNKNOWN";
59921
59941
  parts.push(`${errName}: ${errCode}`);
59922
59942
  }
59923
- const joined = parts.join("\n");
59943
+ const joined = parts.reduce((text, part, index) => text + (index === 0 || text.endsWith("\n") ? "" : "\n") + part, "");
59924
59944
  return joined === "" ? null : joined;
59925
59945
  }
59926
59946
  function resolveLanguage(meta) {