dsh-xdpool 2.6.6 → 2.7.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 CHANGED
@@ -1,6 +1,103 @@
1
1
  # Changelog
2
2
  本项目的所有重要变更都会记录在此文件。
3
3
  版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
+ ## 2.7.0 — 豆包渠道(第 14 家)
5
+
6
+ > 浏览器扫码登录一次,对话与「工作任务」模型全部可用,外带额度看板。同时修掉
7
+ > CodeArts 每轮必报的 `The API does not exist`。
8
+
9
+ ### 豆包:三个请求头决定成败
10
+
11
+ 之前一直接不进来,根因不在请求体,在**三个必须精确匹配的请求头**:
12
+
13
+ | 头 | 必须的值 | 错了会怎样 |
14
+ | --- | --- | --- |
15
+ | `User-Agent` | 以 `SamanthaDoubao/2.31.4` 结尾 | 判成浏览器 |
16
+ | `Referer` | `chrome://doubao-chat/`(**不是** https) | 判成网页 |
17
+ | `sec-ch-ua` | `"Chromium";v="147", "Not.A/Brand";v="8"` | 客户端信息不符 |
18
+
19
+ 任一项不对,上游回 `710022004 rate limited`——**看起来像限流,其实是请求根本没被接受**。
20
+ 另外 `a_bogus` 签名并**不需要**:实测把它故意改坏仍返回 200,只有 cookie 起作用。
21
+
22
+ ### 登录:浏览器窗口,不是扫码接口
23
+
24
+ 豆包自己的二维码入口已关闭(`2035 非法请求`),所以没有可以轮询的扫码端点。
25
+ 插件拉起一个独立的 Chromium(专用 profile,不碰日常浏览器),用 `Storage.getCookies`
26
+ 取回会话——**浏览器级 API,一次调用拿到全部 cookie**,不需要附加页面、不与登录跳转抢时序。
27
+
28
+ profile 会保留,所以第二次通常不需要再扫码。
29
+
30
+ ### 模型
31
+
32
+ | 分组 | 模型 | 说明 |
33
+ | --- | --- | --- |
34
+ | 对话 | `0` 快速 · `3` 2.1 Turbo | 走普通对话额度 |
35
+ | 工作任务 | `seed-lite-7b` Lite · `5` Pro · `9` 自动 | 走会员付费额度 |
36
+ | 生图 | `image-gen` | Seedream,回复以 Markdown 图片返回 |
37
+
38
+ 推理强度三档(`reasoning_effort` 3/4/5),**思维链单独转发**,思考面板能看到。
39
+
40
+ ### 额度看板
41
+
42
+ 只读,读 `incentive_quota_section` 与 `window_limit_section`:活动赠送额度、5 小时限额、
43
+ 周额度,各带**重置倒计时**。数字来自上游,不是估算。
44
+
45
+ ### CodeArts:`The API does not exist` (#150)
46
+
47
+ 根因是请求头 **`maas_type: benefit`** 已被上游下线:带它首帧即 `InferHub.APIG.0101.404`,
48
+ 不带则同一模型、同一账号、同一 body 正常出字。
49
+
50
+ #149 把同一个错误读成「这两个 id 已停止发布」,但它的对照组换的是 **id 而不是头**,
51
+ 而它比较的每个 id 恰好都不在 benefit 名单里——变量从未被隔离。照它关掉模型会关掉两个
52
+ 本来能用的模型,而病灶还在。现在**永不发送**这个头。
53
+
54
+ ### 其他
55
+
56
+ - 登录渠道回到 **14 家**(豆包为第 14 家)
57
+ - 客户端 `mounted` 标志修复:React 严格模式下重挂载后该标志永久为 `false`,
58
+ 导致所有 `if (!mounted.current) return` 提前返回、界面永远显示旧数据
59
+
60
+ ## 2.6.7 — 路由链的渠道成员不再被双重加前缀
61
+
62
+ > 四张 issue:一条数据会被写坏的路由缺陷,两条真实代码缺陷,一条「说清楚」的改动。
63
+
64
+ ### 渠道成员 id 被加了两次前缀(#141)
65
+
66
+ 一条 9 成员的混合链在路由页报「这些成员暂时不在册」,实际存下来的形态是:
67
+
68
+ ```
69
+ trae/trae:deepseek-v4.1-flash
70
+ raccoon/raccoon:sn-deepseek-v4-1-flash-1017
71
+ cline/cline:deepseek/deepseek-v4.1-flash-1017:batch
72
+ ```
73
+
74
+ 两个根因叠加:
75
+
76
+ - `splitPlatforms` 按第一个 `/` 切分。`cline:deepseek/…` 被切成 provider `cline`、model `cline:deepseek/…`,编辑器于是显示双前缀。
77
+ - `flattenDraft` 给所有非池子泳道拼 `${owner}/${model}`,而渠道成员自己的 id(`raccoon:sn-…`)已经带着 owner。
78
+
79
+ 结果是运行时匹配不到任何成员,**在这种状态下保存会把双前缀写回配置**——报告里最危险的部分。
80
+
81
+ 修法是认冒号:`<channel>:<model>` 本身完整,`<owner>/<model>` 才是第三方 provider 行的写法。渠道头必须是裸标识符(字母、数字、`_`、`-`),所以 `https://host/x` 不会被误认成渠道 `https`。缺成员的归属判断也改成同一套规则,否则 `raccoon:sn-…` 会被归到 `workbuddy` 下。
82
+
83
+ ### 出网 fetch 在调用时才读全局(#140)
84
+
85
+ `options.fetchImpl ?? globalThis.fetch` 每次请求都重新读全局。billion-context 会打补丁拦截 `globalThis.fetch` 来做 8 MiB 直连闸门,于是那个补丁成了**所有渠道请求的传输层**——它不知道请求属于哪个会话,结果要么拒绝请求体(422,外层渲染成 400),要么丢掉渠道需要的会话归属。
86
+
87
+ 改成创建时捕获一次。显式传入的 `options.fetchImpl` 仍然优先,测试和嵌入方照旧可以替换。
88
+
89
+ ### 明确指定的模型不再被显示过滤挡住(#143)
90
+
91
+ 卡片勾选决定选择器**列出**什么,不该决定 provider **能服务**什么。`kimi-k3.1-pro` 在名册上、账号也能跑,却因为不在勾选的四项里报 `has no configured model`——拒绝来自一个显示过滤器。
92
+
93
+ 现在返回「勾选的在前、其余在后」的并集:默认选择不变,显式指定的 id 也能解析。图片开关和上下文预算仍取 `visible()` 的结果,因为那两项是用户明确说了算的。
94
+
95
+ ### zcode 无 code 的风控拒绝被当成裸 405(#132)
96
+
97
+ 截图里 `HTTP 405 · request has been blocked due to unusual activity` 被渲染成普通 HTTP 错误,而同一种情况在别处能得到正确的 3012 提示。原因是响应体没有 `code` 字段、状态码既不是 401 也不是 403,所有分支都没命中。
98
+
99
+ 这条车道只发一个固定的 POST,405 不可能是真的方法错误——那是 WAF 在回应一个它决定不检查的请求。现在按风控归类,用户看到的是冷却警告而不是一个无从下手的状态码。
100
+
4
101
  ## 2.6.6 — 免费线上游已关闭;国际版每日活跃;网关支持非流式
5
102
 
6
103
  > 三处独立改动:一个必须如实说明的坏消息,两个来自社区的修复。
package/lib/bin.js CHANGED
@@ -4954,6 +4954,53 @@ ${new Date(until).toISOString()}
4954
4954
  }
4955
4955
  };
4956
4956
  //#endregion
4957
+ //#region src/doubao-catalog.ts
4958
+ /**
4959
+ * IMAGEGEN_LABEL_OVERLAY: 生图版本名以插件根目录的 image-models.json 为准,
4960
+ * 该文件由 doubao_imagemodels.py --sync 从服务端 get_item_conf 生成。
4961
+ */
4962
+ function imageModelLabelFromOverlay() {
4963
+ try {
4964
+ const url = new URL("../image-models.json", import.meta.url);
4965
+ const parsed = JSON.parse(readFileSync(url, "utf8"));
4966
+ return typeof parsed.label === "string" && parsed.label !== "" ? parsed.label : void 0;
4967
+ } catch {
4968
+ return;
4969
+ }
4970
+ }
4971
+ imageModelLabelFromOverlay();
4972
+ randomUUID();
4973
+ Object.freeze([
4974
+ "priority",
4975
+ "round-robin",
4976
+ "balanced",
4977
+ "sticky",
4978
+ "expiry"
4979
+ ]);
4980
+ /**
4981
+ * The schedule every automation job falls back to.
4982
+ *
4983
+ * Shared by both halves on purpose. The host uses it when a configured hour
4984
+ * list arrives empty (the settings schema materializes "never configured" into
4985
+ * `[]`), and the card uses it when it writes the `automation` block back, so a
4986
+ * document that already holds an empty list is healed instead of being saved
4987
+ * back as an unrunnable schedule.
4988
+ *
4989
+ * This lives here rather than in `scheduler.ts` because the browser half cannot
4990
+ * import the host module: `scheduler.ts` pulls in `node:crypto` and the whole
4991
+ * upstream client, none of which exists in the browser bundle. Two hand-written
4992
+ * copies would drift, and the drift is invisible — the card would write a
4993
+ * schedule the scheduler does not run.
4994
+ */
4995
+ const DEFAULT_AUTOMATION_HOURS = {
4996
+ checkin: [9],
4997
+ report: [10],
4998
+ tasks: [11],
4999
+ streak: [12],
5000
+ travel: [9, 21],
5001
+ compensation: [13]
5002
+ };
5003
+ //#endregion
4957
5004
  //#region src/catalog.ts
4958
5005
  /**
4959
5006
  * Model catalog with per-model credit multipliers.
@@ -5346,36 +5393,6 @@ function catalogFromUpstream(models, region = "cn") {
5346
5393
  if (models.length === 0) return fallbackModelsFor(region);
5347
5394
  return models.map(toModelInfo);
5348
5395
  }
5349
- Object.freeze([
5350
- "priority",
5351
- "round-robin",
5352
- "balanced",
5353
- "sticky",
5354
- "expiry"
5355
- ]);
5356
- /**
5357
- * The schedule every automation job falls back to.
5358
- *
5359
- * Shared by both halves on purpose. The host uses it when a configured hour
5360
- * list arrives empty (the settings schema materializes "never configured" into
5361
- * `[]`), and the card uses it when it writes the `automation` block back, so a
5362
- * document that already holds an empty list is healed instead of being saved
5363
- * back as an unrunnable schedule.
5364
- *
5365
- * This lives here rather than in `scheduler.ts` because the browser half cannot
5366
- * import the host module: `scheduler.ts` pulls in `node:crypto` and the whole
5367
- * upstream client, none of which exists in the browser bundle. Two hand-written
5368
- * copies would drift, and the drift is invisible — the card would write a
5369
- * schedule the scheduler does not run.
5370
- */
5371
- const DEFAULT_AUTOMATION_HOURS = {
5372
- checkin: [9],
5373
- report: [10],
5374
- tasks: [11],
5375
- streak: [12],
5376
- travel: [9, 21],
5377
- compensation: [13]
5378
- };
5379
5396
  //#endregion
5380
5397
  //#region src/channels.ts
5381
5398
  /**