@eddyskywalker/dsh-chatgpt-subscription 0.3.9 → 0.4.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.
- package/CHANGELOG.md +28 -1
- package/lib/client.js +386 -99
- package/lib/client.js.map +1 -1
- package/lib/index.js +711 -102
- package/lib/types/client/CodexSubscriptionSection.d.ts.map +1 -1
- package/lib/types/client/antigravity/AntigravitySection.d.ts.map +1 -1
- package/lib/types/client/antigravity/locales.d.ts +78 -0
- package/lib/types/client/antigravity/locales.d.ts.map +1 -1
- package/lib/types/client/antigravity/styles.d.ts.map +1 -1
- package/lib/types/client/command-code/CommandCodeSection.d.ts.map +1 -1
- package/lib/types/client/command-code/locales.d.ts +12 -6
- package/lib/types/client/command-code/locales.d.ts.map +1 -1
- package/lib/types/client/kimi-code/KimiCodeSection.d.ts.map +1 -1
- package/lib/types/client/kimi-code/locales.d.ts +12 -6
- package/lib/types/client/kimi-code/locales.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +9 -3
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/host/antigravity/account-pool.d.ts +50 -0
- package/lib/types/host/antigravity/account-pool.d.ts.map +1 -0
- package/lib/types/host/antigravity/adapter.d.ts +3 -1
- package/lib/types/host/antigravity/adapter.d.ts.map +1 -1
- package/lib/types/host/antigravity/mapper.d.ts.map +1 -1
- package/lib/types/host/antigravity/oauth.d.ts +1 -1
- package/lib/types/host/antigravity/oauth.d.ts.map +1 -1
- package/lib/types/host/antigravity/routes.d.ts +3 -2
- package/lib/types/host/antigravity/routes.d.ts.map +1 -1
- package/lib/types/host/antigravity/token-store.d.ts +3 -0
- package/lib/types/host/antigravity/token-store.d.ts.map +1 -1
- package/lib/types/host/command-code/adapter.d.ts.map +1 -1
- package/lib/types/host/command-code/mapper.d.ts.map +1 -1
- package/lib/types/host/command-code/routes.d.ts +1 -1
- package/lib/types/host/command-code/routes.d.ts.map +1 -1
- package/lib/types/host/command-code/token-store.d.ts +3 -0
- package/lib/types/host/command-code/token-store.d.ts.map +1 -1
- package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
- package/lib/types/host/kimi-code/mapper.d.ts.map +1 -1
- package/lib/types/host/kimi-code/routes.d.ts +1 -1
- package/lib/types/host/kimi-code/routes.d.ts.map +1 -1
- package/lib/types/host/kimi-code/token-store.d.ts +3 -0
- package/lib/types/host/kimi-code/token-store.d.ts.map +1 -1
- package/lib/types/host/model-catalog.d.ts.map +1 -1
- package/lib/types/host/preferences.d.ts.map +1 -1
- package/lib/types/host/token-store-windows.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/antigravity-contracts.d.ts +18 -0
- package/lib/types/shared/antigravity-contracts.d.ts.map +1 -1
- package/lib/types/shared/command-code-contracts.d.ts +2 -0
- package/lib/types/shared/command-code-contracts.d.ts.map +1 -1
- package/lib/types/shared/contracts.d.ts +2 -0
- package/lib/types/shared/contracts.d.ts.map +1 -1
- package/lib/types/shared/kimi-code-contracts.d.ts +2 -0
- package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -1
- package/lib/types/shared/preferences.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 0.3.9 - 2026-09-19
|
|
4
|
+
|
|
5
|
+
- **修复工具结果内嵌图像到不了模型**(command-code / antigravity / kimi-code 三条线路,合入 PR #7):三条线路的 mapper 此前都以「只看消息顶层 content」为前提,因此带图的工具结果(截图类工具、`read_image`)在模型侧全部失明——收集阶段看不到 `tool-result` 内部的图像块,压平阶段又把整条工具结果降级成 `[image: 名字]` 文本,像素从来没有上车的机会。更危险的是模型不知道自己瞎了,会凭空编造图片内容作答。用户在聊天框直接粘贴的顶层图片不受影响,这正是问题看起来像「模型不支持视觉」的原因。
|
|
6
|
+
- 三个 `collectImageRefs` 改为递归进入 `tool-result` 的嵌套 content(`continue` 式,不对块顺序做假设);DSH 本体 `dsh-llm` 的对应函数同样递归,此处属实现遗漏。
|
|
7
|
+
- **command-code 的 Anthropic 路径**:`tool_result.content` 在带图时改为块数组(原生 `text` + `image.base64`),无图时仍返回纯字符串,逐字节不变。
|
|
8
|
+
- **command-code / kimi-code 的 OpenAI 路径**:`role: "tool"` 消息装不下图像,因此扫描**整段连续 tool 消息**收集全部图像,在段末统一追加**一条** `role: "user"` 消息挂 `image_url`。不逐条插入是硬约束:parallel tool calls 会产生连续的 tool 段,把 user 消息插进段中间会被严格上游拒绝(`tool_calls` 未被连续应答)。kimi 变体的 `declarationSlots` 语义逐语句保持等价,无 slot 漂移。
|
|
9
|
+
- **antigravity(Gemini)**:`functionResponse` 装不下图像,图像以 `inlineData` part 追加到同一条 user content 的 parts 数组(Gemini 允许同一 content 混合二者);无图时 parts 数组与改前完全一致。
|
|
10
|
+
- 图像读不到(附件缺失或 media type 不支持)时降级为明确的 `[image unavailable: …]` 文本块,绝不静默丢弃。
|
|
11
|
+
- 行为不变性:11 类无图场景 × 5 条 wire 共 55 份请求体与改前**逐字节一致**(差分验证 0 处差异),只有真正带图的结果才改变行为。
|
|
12
|
+
- 新增 `test/tool-result-images.test.ts`(16 条,映射层)与 `test/tool-result-images-wire.test.ts`(4 条,从桩传输读回实际发出的请求体);两者在未修复源码上分别有 9 条与 2 条失败,可证明其有效性。
|
|
13
|
+
- 已知限制:`offloadOldestRequestImages` 的字节统计仍未递归 `tool-result`(`collectRequestImageBytes` 只扫顶层)。这是有意保持的最小改动——若只让统计递归而替换逻辑仍只处理顶层块,会造成「计数按递归、替换按顶层」的新不一致。后果是工具结果内嵌图像的 base64 体积不计入 `MAX_REQUEST_IMAGE_BYTES` 预算,极端情况下可能发出偏大的请求;修复方向是让统计与替换同时递归,作为独立改动处理。
|
|
14
|
+
- **优化 Antigravity 提示词与工具进度输出**:在系统提示词后置注入进度规则,引导模型在调用工具前输出简要进展;过滤冗余格式与前导思考文本。
|
|
15
|
+
- **优化 Kimi Code 工具 Schema 兼容性**:递归解析并内联工具参数中的本地 `$ref` 引用,避免上游网关因引用定义不存在而报错。
|
|
16
|
+
- **支持自由停用供应商与清空模型列表**(修复 Issue #8 中反馈的供应商强制常驻与选择器受挤占问题):
|
|
17
|
+
- 四大供应商(ChatGPT、Antigravity、Command Code、Kimi Code)均增加「启用此供应商」总开关;当关闭供应商或全部取消勾选模型时,Adapter 返回空列表,DSH 会话模型选择器将完全隐藏该供应商,不再遮蔽或挤占原生 DeepSeek 及其他第三方供应商模型。
|
|
18
|
+
- 彻底移除前端与后端中「最少保留一个模型」的硬编码拦截,支持全选与全不选自由切换。
|
|
19
|
+
- 修复 Command Code 和 Kimi Code 适配器在已选模型为空时误回退到全量展示(导致 30+ 款模型意外暴露)的严重缺陷。
|
|
20
|
+
- Antigravity 路线注册增加柔性容错与路由冲突监听,避免与其他 Antigravity 插件(如 `dsh-agy-link`)共存时引发崩溃。
|
|
21
|
+
- **Antigravity 多账号池与轮询/接力调度**(落实 Issue #8 中建议 3):
|
|
22
|
+
- 支持绑定并管理多个 Google Antigravity 账号,账号池数据通过系统底层安全存储加密隔离(Windows DPAPI / macOS Keychain / Linux Secret Service),首次使用自动平滑迁移旧版单凭据为主账号,零破坏、免重新授权。
|
|
23
|
+
- **双重调度策略**:
|
|
24
|
+
- **顺序耗尽 (Sequential Drain)**:优先使用主账号;遇 429 限流或额度耗尽时自动进入冷却,并在同一次生成请求中无缝接力切换至下一个健康账号,不中断对话;
|
|
25
|
+
- **轮询调度 (Round-Robin)**:基于 LRU(最久未使用)跨账号循环分摊调用,均衡多个账号的配额消耗。
|
|
26
|
+
- **429 智能冷却与自动接力**:检测到上游 429 配额耗尽时,自动为该账号挂起冷却倒计时(优先解析 Retry-After 头,默认 15 分钟),立即自动重试下一个账号。
|
|
27
|
+
- **界面风格严谨统一且无 emoji**:完全遵从当前设计系统提供多账号卡片列表、主账号标识、当前活跃态、冷却倒计时徽章、设为主账号、手动重置冷却与注销操作。
|
|
28
|
+
- **修测试写坏真实凭据**:账号池默认落在 `$DSH_HOME/storages/antigravity-pool.json`,而多个 Antigravity 测试文件会构造使用默认路径的池,并在并行 worker 里互相覆盖同一个文件——一次 `npm test` 就能把开发者本机的真实账号覆盖成 `{"access":"test-token"}`,随后刷新报 `Missing Antigravity refresh token`。现在由 `test/setup/isolated-home.ts` 为每个测试文件分配私有 `$DSH_HOME`,测试全程不接触真实主目录(已在真机上按文件长度与 mtime 校验零改动)。
|
|
29
|
+
- **读取不再有副作用**:`AccountPoolStore.read()` 原先在从旧版单凭据迁移时顺手落盘,而所有改动池的调用者紧接着都会自己写回,等于白做一次加密往返;一个 getter 悄悄重写加密存储,正是上面那类事故能发生的条件。迁移现在只体现在返回值里,由随后的显式写入落盘,并新增断言锁定该性质。
|
|
30
|
+
- 登录流程因此多了一次加密池写入,`test/antigravity-proxy.test.ts` 的等待预算相应从默认 1s 调整为有界的 10s(实测约 2s 完成,仍能对真正卡死的流程报错)。
|
|
4
31
|
|
|
5
32
|
## 0.3.6 - 2026-09-17
|
|
6
33
|
|