@eddyskywalker/dsh-chatgpt-subscription 0.2.11 → 0.2.14

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/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.13 - 2026-09-10
4
+
5
+ - 回退 Codex 与 Antigravity 模型上新增的 `systemPromptUpdate: 'in-history'` 声明:Responses 线路把系统提示词放在顶层 `instructions`,Antigravity 把它放在固定的 `systemInstruction` 加一条 user turn,两条路由都无法把"历史中最后一条 system 消息"当作完整系统提示词。声明该能力会让 DSH 在提示词变化时改为追加 system 节点并保留旧节点,而两个 mapper 会把新旧提示词一并发出。Codex mapper 同时改为只取最新一条非空 system 消息,避免将来重新声明时再次拼接过期提示词。
6
+ - 移除 `src/compat.ts` 对 `@deepseek-ai/dsh-llm` 的 `ContentBlockMap.file` / `LlmResolvedModelInfo.systemPromptUpdate` 模块增强:本地 DSH(`packages/llm/llm`,0.1.5-rc.1)已经声明 `'file': FileBlock`,与增强中的 `Record<string, unknown>` 冲突(TS2717),对着本地依赖编译会直接失败。
7
+ - 移除两个 mapper 中不可达的 `file` 内容块处理:DSH 内核在进入适配器之前已把文件块投影为 `fileHandleText`(`dsh-llm` 的 `projectFilesToText`),适配器永远收不到 `file` 块;原实现读取的 `byteSize` / `savedPath` 在真实 `FileAttachmentRef` 中也不存在(真实字段是 `bytes`)。
8
+ - 移除只完成一半的「智能体团队混合模型规则」(`teamModelRules`):该功能当时只有偏好存储、路由白名单校验、匹配函数和 64 条中英文案,没有任何地方据此选择子代理模型(DSH 内核对子代理模型走 `subagent/model-selection-policy`),因此连同 DTO、schema、路由处理、单测与未引用文案一并移除,等 DSH 提供介入点后再实现。
9
+ - 修复 Antigravity 新账号开通在全部端点失败时静默返回成功:`onboardUser` 现在会在候选端点循环结束后抛出最后一次失败,而不是让调用方误以为已开通。
10
+ - 修复登出竞态:`clearCachedQuota()` 增加 epoch 标记,登出时仍在途的配额请求不再回写 `cachedQuota`,也不再为已登出账号写入模型目录;in-flight 槽位改为按持有者清理,避免"清理后重新拉取"丢失新的在途请求。
11
+ - `/antigravity/api/status` 改用导出的 `ANTIGRAVITY_QUOTA_CACHE_TTL_MS`,不再内联 120000。
12
+ - 移除 Antigravity 设置页与输入框配额胶囊里重复的 `POST /quota`:Host 在 `/status` 中已经会刷新过期缓存,客户端再发一次会让单次挂载产生 2–4 次上游配额请求;配额空态改为明确提示(新增 `quotaEmpty` / `googleValidation` 文案,不再硬编码中文)。
13
+ - `parseEnvProxy` 新增 `envFile` 注入点:`$DSH_HOME/.env` 兜底代理探测现在有测试覆盖(含 `export` 前缀、引号、注释、空值、环境变量优先),既有"无代理返回 null"的断言也不再依赖运行机器上是否真的存在 `~/.dsh/.env`。
14
+ - Antigravity User-Agent 恢复按真实平台填写 `os_type` / `arch`(仍可用 `DSH_ANTIGRAVITY_OS` / `DSH_ANTIGRAVITY_ARCH` 覆盖),不再默认冒充 darwin/arm64。
15
+ - 移除未被引用的 `SANDBOX_ENDPOINT` 并修正端点注释;DSH 依赖区间末项由 `^0.1.5` 改为 `^0.1.5-rc.1`(`^0.1.5` 不匹配本地实际依赖 0.1.5-rc.1),并同步了长期滞后的 `package-lock.json` 根信息。
16
+
17
+ ## 0.2.12 - 2026-09-10
18
+
19
+ - Antigravity 登录与开通:对齐官方 2.8.0 User-Agent 格式并支持环境变量覆盖,新增 `loadCodeAssist` 详情解析、免费层资格校验与 Google 账号安全验证链接提取,以及新账号的 `onboardUser` LRO 轮询开通。
20
+ - Antigravity 配额:`/status` 按 2 分钟 TTL 自动拉取配额,`/quota` 支持强制刷新并在并发调用间去重;Web 设置页与输入框配额胶囊自动获取配额,不再需要手动刷新。
21
+ - 代理:`auto` 模式在进程环境之外新增 `$DSH_HOME/.env` 兜底探测。
22
+ - 依赖:`@deepseek-ai/*` peer/dev 版本区间扩展到 `^0.1.3` / `^0.1.4` / `^0.1.5`。
23
+
3
24
  ## 0.2.10 - 2026-09-06
4
25
 
5
26
  - 修复 Antigravity 模型元数据校验失败导致 Provider 整体消失的问题:在 `resolveModel` 中清洗并安全兜底 `defaultEffort`,确保透传给 DSH 内核的 `defaultEffort` 必定存在于当前模型的 `efforts` 清单内;解决 `gemini-3.1-pro` 等模型(仅支持 `low` / `high`)因默认回退 `medium` 触发 `@deepseek-ai/dsh-llm` 的 `INVALID_MODEL_REASONING` 校验异常导致 Provider 从模型选择列表中消失的问题(Issue #4)。
package/lib/client.js CHANGED
@@ -1712,7 +1712,7 @@ window.__ModuleLoader__.load({
1712
1712
  .dsh-codex-image-preview{background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-border-l2);border-radius:8px;display:block;max-height:260px;max-width:min(100%,360px);object-fit:contain}
1713
1713
  .dsh-codex-image-loading,.dsh-codex-image-failed{border:0.5px dashed var(--dsw-alias-border-l2);border-radius:8px;color:var(--dsw-alias-label-tertiary);display:inline-flex;font-size:12px;line-height:1.4;padding:18px 20px}
1714
1714
  .dsh-codex-image-failed{color:var(--dsw-alias-label-danger,#d94b4b)}
1715
- @keyframes dsh-codex-pulse{0%,100%{opacity:.55}50%{opacity:1}}
1715
+ @keyframes dsh-codex-pulse{0%,100%{opacity:.45}50%{opacity:.85}}
1716
1716
  @media(max-width:560px){.dsh-codex-row,.dsh-codex-pref-row,.dsh-codex-quota-fact,.dsh-codex-reset-credits{align-items:flex-start;flex-direction:column;gap:3px}.dsh-codex-value,.dsh-codex-quota-fact strong{text-align:left}.dsh-codex-actions{justify-content:flex-start}.dsh-codex-grouphead{align-items:flex-start;flex-direction:column;gap:0;padding:12px 0}.dsh-codex-meter-meta{align-items:flex-start;flex-direction:column;gap:2px}.dsh-codex-errorbar{align-items:flex-start;flex-direction:column}.dsh-codex-segments{width:100%}.dsh-codex-select{max-width:none;width:100%}.dsh-codex-context-row{align-items:flex-start;flex-direction:column;gap:5px}.dsh-codex-segments label{flex:1}.dsh-codex-segments span{text-align:center}.dsh-codex-image-tool{max-width:100%;margin-left:0}}
1717
1717
  @media(prefers-reduced-motion:reduce){.dsh-codex-meter>span{transition:none}.dsh-codex-skeleton span{animation:none}}
1718
1718
  `;
@@ -1766,6 +1766,8 @@ window.__ModuleLoader__.load({
1766
1766
  quotaDesc: "数据来自 Google Cloud Code Assist 配额服务,页面可见时最多每 60 秒刷新一次。",
1767
1767
  refreshQuota: "刷新用量",
1768
1768
  refreshingQuota: "刷新中...",
1769
+ quotaEmpty: "暂无配额数据,点击「刷新用量」重试。",
1770
+ googleValidation: "前往 Google 完成账号验证",
1769
1771
  resetPrefix: "重置: {time}",
1770
1772
  resetUnavailable: "重置: n/a",
1771
1773
  resetNow: "现在",
@@ -1815,6 +1817,8 @@ window.__ModuleLoader__.load({
1815
1817
  quotaDesc: "Data from Google Cloud Code Assist quota service; refreshes up to once every 60 seconds when visible.",
1816
1818
  refreshQuota: "Refresh quota",
1817
1819
  refreshingQuota: "Refreshing...",
1820
+ quotaEmpty: "No quota data yet — use “Refresh quota” to retry.",
1821
+ googleValidation: "Verify the account with Google",
1818
1822
  resetPrefix: "Reset: {time}",
1819
1823
  resetUnavailable: "Reset: n/a",
1820
1824
  resetNow: "now",
@@ -1903,7 +1907,6 @@ window.__ModuleLoader__.load({
1903
1907
  try {
1904
1908
  const data = await fetchApi$1("/status");
1905
1909
  setStatus(data);
1906
- if (data.authenticated && (!data.quota || data.quota.groups.length === 0)) fetchApi$1("/quota", { method: "POST" }).then((updated) => setStatus(updated)).catch(() => void 0);
1907
1910
  const drafts = {};
1908
1911
  for (const m of data.models) {
1909
1912
  const val = data.contextWindowOverrides[m.id] || m.defaultContextWindow;
@@ -2333,7 +2336,7 @@ window.__ModuleLoader__.load({
2333
2336
  children: t.signedOut
2334
2337
  }) : groups.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2335
2338
  className: "dsha-empty",
2336
- children: busy === "quota" ? t.refreshingQuota : "正在获取配额用量数据..."
2339
+ children: busy === "quota" ? t.refreshingQuota : t.quotaEmpty
2337
2340
  }) : groups.map((group, gIdx) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2338
2341
  className: "dsha-quota-card",
2339
2342
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -2383,7 +2386,7 @@ window.__ModuleLoader__.load({
2383
2386
  padding: "4px 10px",
2384
2387
  fontSize: "12px"
2385
2388
  },
2386
- children: "前往 Google 完成账号验证"
2389
+ children: t.googleValidation
2387
2390
  })
2388
2391
  })]
2389
2392
  })
@@ -2523,12 +2526,7 @@ window.__ModuleLoader__.load({
2523
2526
  setLoading(true);
2524
2527
  try {
2525
2528
  const data = refresh ? await fetchApi("/quota", { method: "POST" }) : await fetchApi("/status");
2526
- if (mountedRef.current) {
2527
- setStatus(data);
2528
- if (data.authenticated && (!data.quota || data.quota.groups.length === 0) && !refresh) fetchApi("/quota", { method: "POST" }).then((updated) => {
2529
- if (mountedRef.current) setStatus(updated);
2530
- }).catch(() => void 0);
2531
- }
2529
+ if (mountedRef.current) setStatus(data);
2532
2530
  } catch {} finally {
2533
2531
  if (mountedRef.current) setLoading(false);
2534
2532
  }
@@ -2704,7 +2702,7 @@ window.__ModuleLoader__.load({
2704
2702
  <button type="button" class="dsh-mermaid-modal-btn" data-action="zoom-out" title="缩小">− 缩小</button>
2705
2703
  <button type="button" class="dsh-mermaid-modal-btn" data-action="zoom-in" title="放大">+ 放大</button>
2706
2704
  <button type="button" class="dsh-mermaid-modal-btn" data-action="reset" title="重置">⟳ 重置</button>
2707
- <button type="button" class="dsh-mermaid-modal-btn" data-action="close" title="关闭">✕ 关闭</button>
2705
+ <button type="button" class="dsh-mermaid-modal-btn" data-action="close" title="关闭">关闭</button>
2708
2706
  </div>
2709
2707
  <div class="dsh-mermaid-modal-stage">
2710
2708
  <div class="dsh-mermaid-zoom-container">${svgHtml}</div>