dsh-xdpool 2.6.7 → 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,62 @@
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
+
4
60
  ## 2.6.7 — 路由链的渠道成员不再被双重加前缀
5
61
 
6
62
  > 四张 issue:一条数据会被写坏的路由缺陷,两条真实代码缺陷,一条「说清楚」的改动。
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
  /**