dsh-connect-trae 4.6.6 → 4.6.8
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 +102 -0
- package/lib/client.js +18 -5
- package/lib/index.d.ts +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,107 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.6.8 (2026-10-30)
|
|
4
|
+
|
|
5
|
+
> **积分读数从「权限切换器旁边」挪到「模型选择器左边」。** 两者原本相隔 8px 且都是
|
|
6
|
+
> 可点元素——想去点「完全权限」,结果点到读数、弹出积分浮层。读数不是操作按钮,
|
|
7
|
+
> 紧贴操作按钮只会制造误触。宿主的 `conversation.input.right` 正是渲染在模型选择器
|
|
8
|
+
> 之前的座位,迁过去即可,宿主无需改动。
|
|
9
|
+
|
|
10
|
+
### 变更
|
|
11
|
+
|
|
12
|
+
- **积分读数改挂 `conversation.input.right`**(#71 第二条建议)。
|
|
13
|
+
- **动机**:`conversation.input.left` 渲染在 `div.tools` 的**最末尾**,紧挨
|
|
14
|
+
`div.modes` 里的权限选择器,间距只有 8px。两个都是可点元素,误触后弹出的是
|
|
15
|
+
积分浮层——一个纯读数被当成了操作目标。
|
|
16
|
+
- **新位置**:宿主把 `conversation.input.right` 渲染在 `div.trailing` 的
|
|
17
|
+
`standardControls` 内、`conversation.input.model`(模型选择器)**之前**,
|
|
18
|
+
引用 `dsh-client-ui-conversation` 的 `InputBar` 结构:
|
|
19
|
+
`standardControls: [ renderSlot("conversation.input.right"), renderSlot("conversation.input.model") ]`。
|
|
20
|
+
迁过去后与权限选择器之间隔开整段空白。
|
|
21
|
+
- **宿主不需要改**:`conversation.input.right` 早已是 `kind: list` / `scope: session`
|
|
22
|
+
的现成座位。
|
|
23
|
+
- **老 profile 无需迁移**:`creditPosition` 的两个取值(`composer` / `stats`)、
|
|
24
|
+
设置名、`order: 4` 全部不变。`composer` 的含义是「带模型选择器的那一行」,
|
|
25
|
+
而 `input.right` 渲染的正是那一行——所以已保存的设置照旧生效。
|
|
26
|
+
- **「输入框下方」那一档不受影响**:`stats` 仍挂 `conversation.composer.dock`,
|
|
27
|
+
未改动。
|
|
28
|
+
- **文案不改(重要,且与 issue 的建议相反)**:设置里的 `row.creditPositionComposer`
|
|
29
|
+
值是「输入框工具栏」,hint 写的是「与模型选择同一行」——描述的是**整行**,
|
|
30
|
+
不是行内某个位置。迁移后读数仍在「与模型选择同一行」,文案依然准确。
|
|
31
|
+
这一条是核对原文后确认的,不是想当然。
|
|
32
|
+
|
|
33
|
+
### 说明:本版只改 trae 一家
|
|
34
|
+
|
|
35
|
+
`dsh-connect-workbuddy` 与 `dsh-connect-qoder` 目前仍注册在
|
|
36
|
+
`conversation.input.left`。三家同步是 issue #71 的第三条建议,但本版刻意只做
|
|
37
|
+
trae 一家,原因:
|
|
38
|
+
|
|
39
|
+
- 先在单仓验证视觉效果与挤占情况,回退成本最低(一家的包 vs 三家的包);
|
|
40
|
+
- 那两个仓库当时工作树不干净(workbuddy 有未提交改动、qoder 有 `.tmp-restore/`),
|
|
41
|
+
在其上改位置会让问题归因变难。
|
|
42
|
+
|
|
43
|
+
**因此本版发布后,同一台机器上三个插件的读数位置是分叉的**——trae 在右侧,
|
|
44
|
+
另两家仍在左侧。这是已知且有意的中间状态;同步改动待单独发布。
|
|
45
|
+
|
|
46
|
+
### 测试
|
|
47
|
+
|
|
48
|
+
- `tests/client-activation.spec.tsx` 的座位名单断言与座位过滤条件同步改为
|
|
49
|
+
`conversation.input.right`。
|
|
50
|
+
- **变异验证**:把注册改回 `conversation.input.left`,该用例立刻转红
|
|
51
|
+
(完整名单 `toEqual` 不等),证明守卫真的锁住了座位。
|
|
52
|
+
- 全仓 **1224** 例通过(96 文件),双 tsconfig 类型检查通过。
|
|
53
|
+
- 实测:构建后宿主进程存活(无 `DEVELOPMENT.md` 记录的渲染进程崩溃),
|
|
54
|
+
`lib/client.js` 中只剩一处座位注册且指向 `conversation.input.right`。
|
|
55
|
+
|
|
56
|
+
## 4.6.7 (2026-10-30)
|
|
57
|
+
|
|
58
|
+
> **「最早到期:23:59」是明天晚上,不是今晚。** 输入框积分面板用一个只输出时分的
|
|
59
|
+
> 格式化函数渲染「未来某天」的到期时刻,于是 36 小时后的到期被显示成今晚——整整差一天,
|
|
60
|
+
> 而这句文案的全部价值就在「还剩多久」。同一个插件里,同一句文案在卡片中用另一套格式化,
|
|
61
|
+
> 渲染出的是带日期的正确结果。
|
|
62
|
+
|
|
63
|
+
### 修复
|
|
64
|
+
|
|
65
|
+
- **积分面板的「最早到期」补上日期**(#71,报告人
|
|
66
|
+
[@ManYue259](https://github.com/ManYue259))。
|
|
67
|
+
- **现象**:国内版输入框积分面板显示
|
|
68
|
+
`有 164 积分将在 7 天内过期(1 个套餐)` / `最早到期:23:59`,读起来是「今晚 23:59」。
|
|
69
|
+
实际那一包是 **明天** 23:59 到期(取样时刻 2026-10-30 11:26 +08:00,
|
|
70
|
+
`earliestExpiresAtMs = 1793462399000` → `2026-10-31 23:59:59`,距取样 36.6 小时)。
|
|
71
|
+
- **根因**:`ComposerPoints.tsx` 用 `formatClock` 渲染到期时刻,而 `formatClock` 只为
|
|
72
|
+
**同一天内**的时刻而写(`composer.lastRefresh` 也在用它,那个用途是对的)。它被顺手
|
|
73
|
+
复用到「未来某天」的到期上,于是丢掉日期这一半。更糟的是它把 locale 硬编码成
|
|
74
|
+
`'zh-CN'`,英文界面下仍按中文习惯排。
|
|
75
|
+
- **修法**:该处改用 `display.ts` 早已导出、卡片就在用的 `formatDateTime`(跟随读者
|
|
76
|
+
locale,年月日时分)。`formatClock` 保留,但补上注释说明它只可用于同一天的即时时刻,
|
|
77
|
+
并写明被误用过一次、造成什么后果。
|
|
78
|
+
- **为什么这是缺陷而非取舍**:同一个 locale key `row.expiryEarliest` 在同一个插件里有
|
|
79
|
+
两套渲染粒度——卡片 `TraeAccountPanel.tsx` 走 `formatDateTime`(`最早到期:2026/10/31 23:59`),
|
|
80
|
+
面板走 `formatClock`(`最早到期:23:59`)。同一个 key 不该有两种含义。
|
|
81
|
+
- **不变的部分**:文案 key 与全部文案原样不动;「最近刷新」仍是纯时分(它永远是当天);
|
|
82
|
+
卡片的渲染路径未改;`soonestExpiryOf` 的取值逻辑未改。
|
|
83
|
+
|
|
84
|
+
### 测试
|
|
85
|
+
|
|
86
|
+
- 新增 **2** 例 `tests/composer-points.spec.tsx`:
|
|
87
|
+
- **到期行必须带日期**:用 issue 给出的真实样本,断言渲染文本包含 `formatDateTime` 的结果
|
|
88
|
+
与一个四位年份,并且**不等于**旧代码产出的那个字符串。此前全仓对到期渲染**没有任何断言**
|
|
89
|
+
(该文件 24 例中零命中),格式化走偏无人挡。
|
|
90
|
+
- **同一行的「最近刷新」仍是纯时分**:防止修复越界,把 `lastRefresh` 也改成带日期而撑宽
|
|
91
|
+
窄面板的底部。
|
|
92
|
+
- **变异验证**:把该处改回 `formatClock`,新增用例立刻转红(1 failed / 25 passed)。
|
|
93
|
+
- 全仓 **1224** 例通过(96 文件,较 4.6.6 净增 2 例,已用 `git stash` 基线对拍确认),
|
|
94
|
+
双 tsconfig 类型检查通过,构建通过。
|
|
95
|
+
|
|
96
|
+
### 说明
|
|
97
|
+
|
|
98
|
+
- 本版**不含** issue #71 的另外两条位置建议(积分读数从 `conversation.input.left` 挪到
|
|
99
|
+
`conversation.input.right`、以及三姊妹插件同步),那是视觉/交互口径变更而非缺陷,
|
|
100
|
+
待单独决策后处理。
|
|
101
|
+
- issue 提到的 `within3d` 桶未参与 `soonestExpiryOf`/文案阶梯一事,经核对**结论正确**
|
|
102
|
+
(`within7d ⊇ within3d`,且 24h 桶为空时两桶取到同一个最小 `earliestExpiresAtMs`),
|
|
103
|
+
但「2 天后到期显示 7 天内」属产品口径,留待单独 issue。
|
|
104
|
+
|
|
3
105
|
## 4.6.6 (2026-10-30)
|
|
4
106
|
|
|
5
107
|
> **对齐宿主 DSH 0.2.1-rc.5(经停 rc.4):纯版本推进,插件代码零改动。**
|
package/lib/client.js
CHANGED
|
@@ -6278,7 +6278,8 @@ window.__ModuleLoader__.load({
|
|
|
6278
6278
|
//#endregion
|
|
6279
6279
|
//#region src/client/ComposerPoints.tsx
|
|
6280
6280
|
/**
|
|
6281
|
-
* Credit readout for the composer
|
|
6281
|
+
* Credit readout for the composer row (`conversation.input.right`, rendered
|
|
6282
|
+
* immediately before the model picker).
|
|
6282
6283
|
*
|
|
6283
6284
|
* Shows the bound CN account's general credit balance, but ONLY while the
|
|
6284
6285
|
* session's selected model belongs to this plugin. That condition is the whole
|
|
@@ -6398,6 +6399,18 @@ window.__ModuleLoader__.load({
|
|
|
6398
6399
|
packs: String(expiry.expired.packs)
|
|
6399
6400
|
});
|
|
6400
6401
|
}
|
|
6402
|
+
/**
|
|
6403
|
+
* A clock time, for the ONE thing in this panel that is always the same day:
|
|
6404
|
+
* `composer.lastRefresh`, which is "now" by construction.
|
|
6405
|
+
*
|
|
6406
|
+
* DO NOT reuse this for credit expiry. It was reused for that once (issue #71)
|
|
6407
|
+
* and produced `最早到期:23:59` for a pack expiring TOMORROW at 23:59 — a full
|
|
6408
|
+
* day earlier than the truth, in the one sentence whose entire job is "how long
|
|
6409
|
+
* do I have left". The card already rendered the same locale key
|
|
6410
|
+
* (`row.expiryEarliest`) through `formatDateTime`, so one key had two
|
|
6411
|
+
* granularities in one plugin. Expiry goes through `formatDateTime`; only
|
|
6412
|
+
* same-day instants may use this.
|
|
6413
|
+
*/
|
|
6401
6414
|
function formatClock(value) {
|
|
6402
6415
|
return new Date(value).toLocaleTimeString("zh-CN", {
|
|
6403
6416
|
hour: "2-digit",
|
|
@@ -6728,7 +6741,7 @@ window.__ModuleLoader__.load({
|
|
|
6728
6741
|
role: "status",
|
|
6729
6742
|
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
6743
|
className: "dsm-trae-expiry-detail",
|
|
6731
|
-
children: t("row.expiryEarliest", { time:
|
|
6744
|
+
children: t("row.expiryEarliest", { time: formatDateTime(soonestExpiryOf(signedIn.credits.expiry)) })
|
|
6732
6745
|
})]
|
|
6733
6746
|
}) : null,
|
|
6734
6747
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -8081,8 +8094,8 @@ window.__ModuleLoader__.load({
|
|
|
8081
8094
|
registerCard("plugins.bundle.config", "dsh-connect-trae");
|
|
8082
8095
|
registerCard("plugins.row.config", "dsh-connect-trae#dsh-connect-trae");
|
|
8083
8096
|
/**
|
|
8084
|
-
* Credit readout in the composer
|
|
8085
|
-
* session-scope list slot).
|
|
8097
|
+
* Credit readout in the composer row (`conversation.input.right`, a
|
|
8098
|
+
* session-scope list slot rendered immediately before the model picker).
|
|
8086
8099
|
*
|
|
8087
8100
|
* Provider-scoped on purpose: it renders only while the session's selected
|
|
8088
8101
|
* model belongs to this plugin. That is what keeps two connector plugins
|
|
@@ -8123,7 +8136,7 @@ window.__ModuleLoader__.load({
|
|
|
8123
8136
|
console.error(`[dsh-connect-trae] points slot "${slotName}" failed to register (host provider unaffected):`, error);
|
|
8124
8137
|
}
|
|
8125
8138
|
};
|
|
8126
|
-
registerPointsSlot("conversation.input.
|
|
8139
|
+
registerPointsSlot("conversation.input.right", "dsh-connect-trae-composer-points", 4, "composer");
|
|
8127
8140
|
registerPointsSlot("conversation.composer.dock", "dsh-connect-trae-stats-points", 10, "stats");
|
|
8128
8141
|
/**
|
|
8129
8142
|
* The upstream's activity badge in the HOST's model picker (ported from the
|
package/lib/index.d.ts
CHANGED
|
@@ -1236,7 +1236,8 @@ declare function nextRegionEnabled(value: unknown, panel: TraePanel, enabled: bo
|
|
|
1236
1236
|
/**
|
|
1237
1237
|
* The two seats this region's credit readout can occupy.
|
|
1238
1238
|
*
|
|
1239
|
-
* `composer` is the composer
|
|
1239
|
+
* `composer` is the composer row (`conversation.input.right`, rendered just before
|
|
1240
|
+
* the model picker); `stats` is
|
|
1240
1241
|
* the ambient dock below the composer card (`conversation.composer.dock`),
|
|
1241
1242
|
* beside the shell's own round/step/token pills.
|
|
1242
1243
|
*
|
|
@@ -4569,7 +4570,7 @@ interface TraeRegionState {
|
|
|
4569
4570
|
*
|
|
4570
4571
|
* Two seats, because the first one is not always available:
|
|
4571
4572
|
*
|
|
4572
|
-
* - `composer` — the composer
|
|
4573
|
+
* - `composer` — the composer row (`conversation.input.right`), shared
|
|
4573
4574
|
* with the shell's own controls. It is the closer, more glanceable seat,
|
|
4574
4575
|
* and it is the default so nothing moves for anyone who does not choose.
|
|
4575
4576
|
* - `stats` — the ambient dock below the composer card
|
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.8",
|
|
6
6
|
"author": "dingminhua",
|
|
7
7
|
"copyright": "Copyright (c) 2026 LaoDing",
|
|
8
8
|
"license": "MIT",
|