@eddyskywalker/dsh-chatgpt-subscription 0.48.4 → 0.49.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 (43) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/lib/client.js +2381 -179
  3. package/lib/client.js.map +1 -1
  4. package/lib/index.js +829 -29
  5. package/lib/types/client/index.d.ts +2 -0
  6. package/lib/types/client/index.d.ts.map +1 -1
  7. package/lib/types/client/kimi-code/KimiCodeSection.d.ts.map +1 -1
  8. package/lib/types/client/kimi-code/locales.d.ts +14 -2
  9. package/lib/types/client/kimi-code/locales.d.ts.map +1 -1
  10. package/lib/types/client/locales-ru/kimi-code.d.ts.map +1 -1
  11. package/lib/types/client/subagent/SubagentCard.d.ts +35 -0
  12. package/lib/types/client/subagent/SubagentCard.d.ts.map +1 -0
  13. package/lib/types/client/subagent/index.d.ts +28 -0
  14. package/lib/types/client/subagent/index.d.ts.map +1 -0
  15. package/lib/types/client/subagent/locales.d.ts +172 -0
  16. package/lib/types/client/subagent/locales.d.ts.map +1 -0
  17. package/lib/types/client/subagent/styles.d.ts +20 -0
  18. package/lib/types/client/subagent/styles.d.ts.map +1 -0
  19. package/lib/types/client/subagent/subagent-card-controller.d.ts +329 -0
  20. package/lib/types/client/subagent/subagent-card-controller.d.ts.map +1 -0
  21. package/lib/types/compat.d.ts +1 -1
  22. package/lib/types/host/common/request-images.d.ts +66 -0
  23. package/lib/types/host/common/request-images.d.ts.map +1 -1
  24. package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
  25. package/lib/types/host/kimi-code/mapper.d.ts +53 -3
  26. package/lib/types/host/kimi-code/mapper.d.ts.map +1 -1
  27. package/lib/types/host/kimi-code/routes.d.ts.map +1 -1
  28. package/lib/types/host/kimi-code/session-cache-state.d.ts +14 -0
  29. package/lib/types/host/kimi-code/session-cache-state.d.ts.map +1 -1
  30. package/lib/types/host/kimi-code/types.d.ts +29 -4
  31. package/lib/types/host/kimi-code/types.d.ts.map +1 -1
  32. package/lib/types/host/preferences.d.ts.map +1 -1
  33. package/lib/types/host/routes.d.ts.map +1 -1
  34. package/lib/types/host/subagent-model-authorization.d.ts +130 -2
  35. package/lib/types/host/subagent-model-authorization.d.ts.map +1 -1
  36. package/lib/types/index.d.ts.map +1 -1
  37. package/lib/types/shared/contracts.d.ts +28 -0
  38. package/lib/types/shared/contracts.d.ts.map +1 -1
  39. package/lib/types/shared/kimi-code-contracts.d.ts +10 -1
  40. package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -1
  41. package/lib/types/shared/preferences.d.ts +52 -1
  42. package/lib/types/shared/preferences.d.ts.map +1 -1
  43. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.49.0 - 2026-10-31
6
+
7
+ - **[kimi-code] 图片预算对齐原生 `kimi-cli`(20 MiB 高水位 / 10 MiB 低水位)并实现会话级粘性淘汰(Closes #79)**
8
+ - **预算提升与双水位迟滞**:`DEFAULT_MAX_REQUEST_IMAGE_BYTES` 从 2 MB 时代的 `1.5 MB` 提升至对齐原生 `kimi-cli`(`REQUEST_MEDIA_BUDGET_BYTES`)的 `20 MiB`(`20,971,520` bytes),触发淘汰时的恢复低水位设为 `10 MiB`(`10,485,760` bytes);支持 `DSH_KIMI_CODE_MAX_IMAGE_BYTES` 环境变量覆盖(自动以其 50% 作为恢复低水位)。保持 `src/host/common/request-images.ts` 的共享默认常量 `1,500,000` 不变,不影响其他线路。
9
+ - **会话级粘性淘汰(`budgetDropped`)与持久化**:新增图片身份标识 `requestImageKey`(`attachment:<id>` 或 `inline:<sha256>`)与 `offloadRequestImagesWithStickyBudget`。一旦某张旧图因超预算被替换为占位文本,该会话后续请求始终将其替换为占位文本,不再随每张新图进入而反复重算淘汰集合、打断前缀缓存;淘汰集合同步持久化到 `sessionCacheState`(`dsh-chatgpt-subscription-kimi-cache.json`),跨进程重启后依然保持稳定。
10
+ - **前缀漂移归因与设置页展示**:`KimiCodeCacheStatsDto['lastDrift']` 新增 `'image-offload'`(当本轮新淘汰了历史图片且前缀原本为 `'stable'` 时归因为「旧图片超预算淘汰(缓存重建)」);Kimi 设置页「缓存与 K3 调优」卡片新增「请求图片预算」行展示本轮图片体积、预算上限及低水位/已粘性淘汰张数(中/英/俄三语字典同步补齐)。
11
+
12
+ - **[subagent] 支持按主模型分别配置子代理模型白名单与运行时鉴权**
13
+ - 设置页「子代理模型授权」卡片支持为不同主模型绑定各自允许派发的子代理模型列表,并在运行时路由守卫中按当前会话主模型精确解析与校验白名单。
14
+
5
15
  ## 0.48.4 - 2026-10-31
6
16
 
7
17
  - **[llm-compat] 修复 `role: 'tool'` 消息的 `toolCallId` 读错位置:整轮请求被判 `11148 tool calls and tool results do not match`**