dsh-connect-trae 4.6.6 → 4.6.7
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 +49 -0
- package/lib/client.js +13 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.6.7 (2026-10-30)
|
|
4
|
+
|
|
5
|
+
> **「最早到期:23:59」是明天晚上,不是今晚。** 输入框积分面板用一个只输出时分的
|
|
6
|
+
> 格式化函数渲染「未来某天」的到期时刻,于是 36 小时后的到期被显示成今晚——整整差一天,
|
|
7
|
+
> 而这句文案的全部价值就在「还剩多久」。同一个插件里,同一句文案在卡片中用另一套格式化,
|
|
8
|
+
> 渲染出的是带日期的正确结果。
|
|
9
|
+
|
|
10
|
+
### 修复
|
|
11
|
+
|
|
12
|
+
- **积分面板的「最早到期」补上日期**(#71,报告人
|
|
13
|
+
[@ManYue259](https://github.com/ManYue259))。
|
|
14
|
+
- **现象**:国内版输入框积分面板显示
|
|
15
|
+
`有 164 积分将在 7 天内过期(1 个套餐)` / `最早到期:23:59`,读起来是「今晚 23:59」。
|
|
16
|
+
实际那一包是 **明天** 23:59 到期(取样时刻 2026-10-30 11:26 +08:00,
|
|
17
|
+
`earliestExpiresAtMs = 1793462399000` → `2026-10-31 23:59:59`,距取样 36.6 小时)。
|
|
18
|
+
- **根因**:`ComposerPoints.tsx` 用 `formatClock` 渲染到期时刻,而 `formatClock` 只为
|
|
19
|
+
**同一天内**的时刻而写(`composer.lastRefresh` 也在用它,那个用途是对的)。它被顺手
|
|
20
|
+
复用到「未来某天」的到期上,于是丢掉日期这一半。更糟的是它把 locale 硬编码成
|
|
21
|
+
`'zh-CN'`,英文界面下仍按中文习惯排。
|
|
22
|
+
- **修法**:该处改用 `display.ts` 早已导出、卡片就在用的 `formatDateTime`(跟随读者
|
|
23
|
+
locale,年月日时分)。`formatClock` 保留,但补上注释说明它只可用于同一天的即时时刻,
|
|
24
|
+
并写明被误用过一次、造成什么后果。
|
|
25
|
+
- **为什么这是缺陷而非取舍**:同一个 locale key `row.expiryEarliest` 在同一个插件里有
|
|
26
|
+
两套渲染粒度——卡片 `TraeAccountPanel.tsx` 走 `formatDateTime`(`最早到期:2026/10/31 23:59`),
|
|
27
|
+
面板走 `formatClock`(`最早到期:23:59`)。同一个 key 不该有两种含义。
|
|
28
|
+
- **不变的部分**:文案 key 与全部文案原样不动;「最近刷新」仍是纯时分(它永远是当天);
|
|
29
|
+
卡片的渲染路径未改;`soonestExpiryOf` 的取值逻辑未改。
|
|
30
|
+
|
|
31
|
+
### 测试
|
|
32
|
+
|
|
33
|
+
- 新增 **2** 例 `tests/composer-points.spec.tsx`:
|
|
34
|
+
- **到期行必须带日期**:用 issue 给出的真实样本,断言渲染文本包含 `formatDateTime` 的结果
|
|
35
|
+
与一个四位年份,并且**不等于**旧代码产出的那个字符串。此前全仓对到期渲染**没有任何断言**
|
|
36
|
+
(该文件 24 例中零命中),格式化走偏无人挡。
|
|
37
|
+
- **同一行的「最近刷新」仍是纯时分**:防止修复越界,把 `lastRefresh` 也改成带日期而撑宽
|
|
38
|
+
窄面板的底部。
|
|
39
|
+
- **变异验证**:把该处改回 `formatClock`,新增用例立刻转红(1 failed / 25 passed)。
|
|
40
|
+
- 全仓 **1224** 例通过(96 文件,较 4.6.6 净增 2 例,已用 `git stash` 基线对拍确认),
|
|
41
|
+
双 tsconfig 类型检查通过,构建通过。
|
|
42
|
+
|
|
43
|
+
### 说明
|
|
44
|
+
|
|
45
|
+
- 本版**不含** issue #71 的另外两条位置建议(积分读数从 `conversation.input.left` 挪到
|
|
46
|
+
`conversation.input.right`、以及三姊妹插件同步),那是视觉/交互口径变更而非缺陷,
|
|
47
|
+
待单独决策后处理。
|
|
48
|
+
- issue 提到的 `within3d` 桶未参与 `soonestExpiryOf`/文案阶梯一事,经核对**结论正确**
|
|
49
|
+
(`within7d ⊇ within3d`,且 24h 桶为空时两桶取到同一个最小 `earliestExpiresAtMs`),
|
|
50
|
+
但「2 天后到期显示 7 天内」属产品口径,留待单独 issue。
|
|
51
|
+
|
|
3
52
|
## 4.6.6 (2026-10-30)
|
|
4
53
|
|
|
5
54
|
> **对齐宿主 DSH 0.2.1-rc.5(经停 rc.4):纯版本推进,插件代码零改动。**
|
package/lib/client.js
CHANGED
|
@@ -6398,6 +6398,18 @@ window.__ModuleLoader__.load({
|
|
|
6398
6398
|
packs: String(expiry.expired.packs)
|
|
6399
6399
|
});
|
|
6400
6400
|
}
|
|
6401
|
+
/**
|
|
6402
|
+
* A clock time, for the ONE thing in this panel that is always the same day:
|
|
6403
|
+
* `composer.lastRefresh`, which is "now" by construction.
|
|
6404
|
+
*
|
|
6405
|
+
* DO NOT reuse this for credit expiry. It was reused for that once (issue #71)
|
|
6406
|
+
* and produced `最早到期:23:59` for a pack expiring TOMORROW at 23:59 — a full
|
|
6407
|
+
* day earlier than the truth, in the one sentence whose entire job is "how long
|
|
6408
|
+
* do I have left". The card already rendered the same locale key
|
|
6409
|
+
* (`row.expiryEarliest`) through `formatDateTime`, so one key had two
|
|
6410
|
+
* granularities in one plugin. Expiry goes through `formatDateTime`; only
|
|
6411
|
+
* same-day instants may use this.
|
|
6412
|
+
*/
|
|
6401
6413
|
function formatClock(value) {
|
|
6402
6414
|
return new Date(value).toLocaleTimeString("zh-CN", {
|
|
6403
6415
|
hour: "2-digit",
|
|
@@ -6728,7 +6740,7 @@ window.__ModuleLoader__.load({
|
|
|
6728
6740
|
role: "status",
|
|
6729
6741
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: expiryMessageOf(signedIn.credits.expiry, t) }), soonestExpiryOf(signedIn.credits.expiry) === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6730
6742
|
className: "dsm-trae-expiry-detail",
|
|
6731
|
-
children: t("row.expiryEarliest", { time:
|
|
6743
|
+
children: t("row.expiryEarliest", { time: formatDateTime(soonestExpiryOf(signedIn.credits.expiry)) })
|
|
6732
6744
|
})]
|
|
6733
6745
|
}) : null,
|
|
6734
6746
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dsh-connect-trae",
|
|
3
3
|
"displayName": "DSH Connect Trae",
|
|
4
4
|
"description": "把本机登录的 Trae 模型接入 DeepSeek Harness:国内版与国际版双供应商并行,提供用量/积分概览与每日签到领取。",
|
|
5
|
-
"version": "4.6.
|
|
5
|
+
"version": "4.6.7",
|
|
6
6
|
"author": "dingminhua",
|
|
7
7
|
"copyright": "Copyright (c) 2026 LaoDing",
|
|
8
8
|
"license": "MIT",
|