dsh-connect-trae 4.0.0 → 4.0.1
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 +36 -0
- package/README.en.md +6 -0
- package/README.md +6 -0
- package/lib/client.js +63 -0
- package/lib/index.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.1 (2026-10-19)
|
|
4
|
+
|
|
5
|
+
> CN 区模型卡「最大输出」整列空白(issue #42)修复:上游**是**发布输出上限的——`get_detail_param` 的
|
|
6
|
+
> CN 80 个 config **80/80** 都带 `model_detail_list[].max_tokens`——但目录合并 `mergeTraeModelSources()`
|
|
7
|
+
> 把 wire 侧的 `maxTokens` 丢掉了。这个字段从合并函数诞生那天(1.1.0)起就没被复制过,卡片、
|
|
8
|
+
> `/models/refresh` 与 DSH 模型注册因此永远收到「未知」。附带落地同一 issue 的批量请求:整区上下文
|
|
9
|
+
> 一键切换两个按钮。
|
|
10
|
+
|
|
11
|
+
### 修复
|
|
12
|
+
|
|
13
|
+
- **目录合并带上 wire 的 `max_tokens`**(`fix(catalog)`)。合并时其余字段(contextWindow / maxContextWindow /
|
|
14
|
+
倍率 / reasoning / multimodal / config_name)一路都复制了,唯独漏了 `maxTokens` 一行。修复后 CN 实测
|
|
15
|
+
32 行目录 30 行带值;**仍空白的行是诚实的**——`kimi-k2.8-preview`、`qwen3.8-flash` 这类 TraeCode 通道行
|
|
16
|
+
在 SOLO 名单里没有对应 config,拿不到候选值,宁空白不编造。取值链其余部分不动:`collectModels` 读
|
|
17
|
+
`model_detail_list[0]` 实测无损(71/80 config 的双项 `__dev`/`__max` 上限恒等)。该值是**元数据**,
|
|
18
|
+
请求体照旧不下发 `max_tokens`(上限由 Trae 服务端决定),行为无变化。
|
|
19
|
+
- 报告人「想确认的一点」(输出上限是否挂在后面的 detail 项或别的键)已逐项 dump 排除,全文见
|
|
20
|
+
`docs/ISSUE42_DIAGNOSIS.md`,取证脚本 `scripts/probe-cn-maxtokens.mjs`(只读,随仓库提交)。
|
|
21
|
+
|
|
22
|
+
### 新增
|
|
23
|
+
|
|
24
|
+
- **卡片模型管理区两个批量上下文按钮**(`feat(card)`,issue #42 附带需求):「**整区切到 Max**」给本区
|
|
25
|
+
每个带 Max 档的模型一次性写入其 `maxContextWindow`(正是 `applyContextBudgets` 认的精确值),
|
|
26
|
+
没有 Max 档的行不动、已有手动预算保留;「**全部恢复默认上下文**」清空本区预算。二者作用于草稿、
|
|
27
|
+
按「保存」生效,落盘形状与逐行单选完全一致——因此**没有**新增 `contextBudgetMode` 配置键,
|
|
28
|
+
运行时零新分支、旧配置零迁移。报告人数的 18 次点击现在是一次。
|
|
29
|
+
- README 新增「最大输出与上下文预算」一节(issue #42 建议 1 换内容采纳:事实已变,文档写明上游发布该值、
|
|
30
|
+
空白行另有其因)。
|
|
31
|
+
|
|
32
|
+
### 测试
|
|
33
|
+
|
|
34
|
+
- 新增合并回归用例(修复前必红:wire 行带 `maxTokens` → 合并行必须保留;join-miss 行必须缺席)与
|
|
35
|
+
5 例卡片用例(批量按钮的落盘内容、既有手动预算的保留、两按钮各自禁用条件)。
|
|
36
|
+
- 全仓 **901** 例通过,0 skipped;`tsc` 两个工程干净;`build` 通过。修复前后各跑一次实时探针对照
|
|
37
|
+
(0/32 → 30/32)。
|
|
38
|
+
|
|
3
39
|
## 4.0.0 (2026-10-19)
|
|
4
40
|
|
|
5
41
|
> 移除 issue #29 的「跟随 Trae 桌面端当前登录」整套机制,连同它派生的两处 UI。
|
package/README.en.md
CHANGED
|
@@ -127,6 +127,12 @@ That is the upstream refusal stated plainly, rather than a silent failure or som
|
|
|
127
127
|
|
|
128
128
|
To use these three models today, use the **Trae IDE itself**.
|
|
129
129
|
|
|
130
|
+
## Max output and context budgets
|
|
131
|
+
|
|
132
|
+
The "最大输出" (max output) on the model card comes from `model_detail_list[].max_tokens` in Trae's `get_detail_param` — upstream **does** publish it (live-verified: 80/80 CN configs carry it). As of 4.0.1 the value travels through the catalog merge all the way to the card, `/models/refresh` and DSH model registration; before that the merge step dropped the field, so the whole region rendered blank (issue #42 — full diagnosis in `docs/ISSUE42_DIAGNOSIS.md`). **Rows that are still blank are being honest**: models the directory lists but the SOLO roster has no config for (the three TraeCode rows above) have no candidate value to show — we prefer a blank over an invented cap. The value is metadata only; the plugin never puts `max_tokens` into request bodies (the server decides the real cap).
|
|
133
|
+
|
|
134
|
+
Context windows are a per-model choice between Trae's default (dev) window and its Max window, stored per panel as `contextBudgets`. For a whole-region switch, the model section now has two buttons: "**Switch all to Max**" (writes each Max-capable row's `maxContextWindow`, leaves no-Max rows and existing manual budgets alone) and "**Restore default context**" (clears the region's budget dict). Both act on the draft and take effect on Save, producing exactly the same stored shape as the per-row radios (issue #42 side request — 18 Max rows in CN used to mean 18 clicks).
|
|
135
|
+
|
|
130
136
|
## Install
|
|
131
137
|
|
|
132
138
|
```sh
|
package/README.md
CHANGED
|
@@ -140,6 +140,12 @@ Trae does not serve this model under the SOLO function the request used
|
|
|
140
140
|
|
|
141
141
|
如果你现在就要用这 3 个模型,请直接在 **Trae IDE 本体**中使用。
|
|
142
142
|
|
|
143
|
+
## 最大输出与上下文预算
|
|
144
|
+
|
|
145
|
+
模型卡上的「最大输出」来自 Trae `get_detail_param` 的 `model_detail_list[].max_tokens` —— 上游**是**发布这个值的(CN 实测 80/80 config 都带)。4.0.1 起它随目录合并一路带到卡片、`/models/refresh` 与 DSH 模型注册;此前合并层漏传了这个字段,整区模型全部显示空白(issue #42,诊断见 `docs/ISSUE42_DIAGNOSIS.md`)。**仍然空白的行是诚实的**:目录里有、但 SOLO 名单里没有对应 config 的模型(上面那 3 个 TraeCode 通道行)拿不到任何候选值,宁可空白也不编一个上限。这个值是元数据,插件不把它写进请求体(输出上限由 Trae 服务端决定)。
|
|
146
|
+
|
|
147
|
+
上下文窗口在 Trae 公布的默认(dev)档与 Max 档之间二选一,按面板逐模型存成 `contextBudgets`。想整区一次切换:模型管理区有「**整区切到 Max**」(给每个带 Max 档的行写入其 `maxContextWindow`,没有 Max 档的行不动)和「**全部恢复默认上下文**」(清空本区预算)两个按钮,作用在草稿上、按「保存」生效,与逐行单选落盘的结果完全一致(issue #42 附带需求——CN 有 18 个 Max 模型,以前要点 18 次)。
|
|
148
|
+
|
|
143
149
|
## 安装
|
|
144
150
|
|
|
145
151
|
推荐使用 DSH 插件命令安装 npm 已发布版本:
|
package/lib/client.js
CHANGED
|
@@ -679,6 +679,10 @@ window.__ModuleLoader__.load({
|
|
|
679
679
|
color:var(--dsw-alias-brand-primary,#2563eb);font-size:11px;line-height:16px;
|
|
680
680
|
}
|
|
681
681
|
.dsm-trae-models-hint{margin:4px 0 0;color:var(--dsw-alias-label-tertiary,#999);font-size:11px;line-height:16px}
|
|
682
|
+
/* Bulk context-budget row (issue #42): under the model list, above the
|
|
683
|
+
capability note. Wraps on narrow cards; keeps the two buttons visually a
|
|
684
|
+
pair and distinct from the save footer below. */
|
|
685
|
+
.dsm-trae-context-bulk{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
|
|
682
686
|
/* Verdict badge. Only a real refusal is coloured as a warning; an unknown
|
|
683
687
|
verdict stays neutral because an inconclusive probe is not evidence against
|
|
684
688
|
the model. */
|
|
@@ -3879,6 +3883,39 @@ window.__ModuleLoader__.load({
|
|
|
3879
3883
|
};
|
|
3880
3884
|
});
|
|
3881
3885
|
};
|
|
3886
|
+
/**
|
|
3887
|
+
* Bulk context-budget switch (issue #42 side request). The per-model radios
|
|
3888
|
+
* stay exactly as they are; these two act on the whole region draft at once.
|
|
3889
|
+
* The reporter counted 18 CN models whose Max window differs from the
|
|
3890
|
+
* default and described clicking 18 times per region — 「整区切到 Max」 is
|
|
3891
|
+
* those 18 clicks as one button. It writes `maxContextWindow` per row, which
|
|
3892
|
+
* is precisely the spelling `applyContextBudgets` recognizes (a budget equal
|
|
3893
|
+
* to the native Max window widens the effective window), so bulk and per-row
|
|
3894
|
+
* paths land on identical saved state. Models without a Max window are left
|
|
3895
|
+
* untouched — inventing a budget for them would be filtered out anyway.
|
|
3896
|
+
*/
|
|
3897
|
+
const setAllContextMax = () => {
|
|
3898
|
+
editDraft((current) => {
|
|
3899
|
+
const next = { ...current.contextBudgets };
|
|
3900
|
+
for (const model of current.models) if (model.maxContextWindow !== void 0) next[model.id] = model.maxContextWindow;
|
|
3901
|
+
return {
|
|
3902
|
+
...current,
|
|
3903
|
+
contextBudgets: next
|
|
3904
|
+
};
|
|
3905
|
+
});
|
|
3906
|
+
};
|
|
3907
|
+
/**
|
|
3908
|
+
* 「恢复默认上下文」 clears every override in this region's draft. Empty
|
|
3909
|
+
* dict = every row falls back to its default window (the same state as a
|
|
3910
|
+
* region that was never configured), and clearing is what makes the bulk
|
|
3911
|
+
* action reversible without 18 more clicks.
|
|
3912
|
+
*/
|
|
3913
|
+
const resetAllContextBudgets = () => {
|
|
3914
|
+
editDraft((current) => ({
|
|
3915
|
+
...current,
|
|
3916
|
+
contextBudgets: {}
|
|
3917
|
+
}));
|
|
3918
|
+
};
|
|
3882
3919
|
const discardModels = () => {
|
|
3883
3920
|
setDrafts((prev) => {
|
|
3884
3921
|
const next = { ...prev };
|
|
@@ -4589,6 +4626,24 @@ window.__ModuleLoader__.load({
|
|
|
4589
4626
|
})]
|
|
4590
4627
|
}, model.id))
|
|
4591
4628
|
}),
|
|
4629
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4630
|
+
className: "dsm-trae-context-bulk",
|
|
4631
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4632
|
+
type: "button",
|
|
4633
|
+
className: "dsm-btn dsm-btn-outline",
|
|
4634
|
+
disabled: busy || saving || settingsScope?.getSnapshot().writable !== true || !visibleModels.some((model) => model.maxContextWindow !== void 0),
|
|
4635
|
+
title: t("row.contextAllMaxHint"),
|
|
4636
|
+
onClick: setAllContextMax,
|
|
4637
|
+
children: t("row.contextAllMax")
|
|
4638
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4639
|
+
type: "button",
|
|
4640
|
+
className: "dsm-btn dsm-btn-outline",
|
|
4641
|
+
disabled: busy || saving || settingsScope?.getSnapshot().writable !== true || Object.keys(activeContextBudgets).length === 0,
|
|
4642
|
+
title: t("row.contextAllDefaultHint"),
|
|
4643
|
+
onClick: resetAllContextBudgets,
|
|
4644
|
+
children: t("row.contextAllDefault")
|
|
4645
|
+
})]
|
|
4646
|
+
}),
|
|
4592
4647
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4593
4648
|
className: "dsm-trae-model-capability-note",
|
|
4594
4649
|
children: t("row.modelCapabilityPending")
|
|
@@ -5507,6 +5562,10 @@ window.__ModuleLoader__.load({
|
|
|
5507
5562
|
"row.expiryEarliest": "Earliest: {time}",
|
|
5508
5563
|
"row.settingsDirty": "Unsaved changes",
|
|
5509
5564
|
"row.modelsTestEmpty": "Enable at least one model first.",
|
|
5565
|
+
"row.contextAllMax": "Switch all to Max",
|
|
5566
|
+
"row.contextAllMaxHint": "Sets the DSH context budget of every model in this region that has a Max window to its Max window at once. Still a draft — press Save to apply. Models without a Max window are left alone.",
|
|
5567
|
+
"row.contextAllDefault": "Restore default context",
|
|
5568
|
+
"row.contextAllDefaultHint": "Clears every context-budget override in this region, so all models go back to Trae's default window. Still a draft — press Save to apply.",
|
|
5510
5569
|
"row.modelsTestError": "Test failed: {message}",
|
|
5511
5570
|
"row.modelsTestDone": "{available} of {total} answered.",
|
|
5512
5571
|
"row.probeAvailable": "works",
|
|
@@ -5823,6 +5882,10 @@ window.__ModuleLoader__.load({
|
|
|
5823
5882
|
"row.expiryEarliest": "最早到期:{time}",
|
|
5824
5883
|
"row.settingsDirty": "有未保存的修改",
|
|
5825
5884
|
"row.modelsTestEmpty": "请先启用至少一个模型。",
|
|
5885
|
+
"row.contextAllMax": "整区切到 Max",
|
|
5886
|
+
"row.contextAllMaxHint": "把本区所有带 Max 档的模型的 DSH 上下文预算一次性设为各自的 Max 档。这只是草稿——要按「保存」才生效。没有 Max 档的模型不会被改动。",
|
|
5887
|
+
"row.contextAllDefault": "全部恢复默认上下文",
|
|
5888
|
+
"row.contextAllDefaultHint": "清掉本区所有上下文预算覆盖,让每个模型都回到 Trae 的默认窗口。这只是草稿——要按「保存」才生效。",
|
|
5826
5889
|
"row.modelsTestError": "测试失败:{message}",
|
|
5827
5890
|
"row.modelsTestDone": "{total} 个里有 {available} 个正常应答。",
|
|
5828
5891
|
"row.probeAvailable": "可用",
|
package/lib/index.js
CHANGED
|
@@ -242,6 +242,7 @@ function mergeTraeModelSources(remote, wire) {
|
|
|
242
242
|
...model.maxContextWindow === void 0 ? {} : { maxContextWindow: model.maxContextWindow },
|
|
243
243
|
...creditMultiplier === void 0 ? {} : { creditMultiplier },
|
|
244
244
|
input: ["text"],
|
|
245
|
+
...wireModel?.maxTokens === void 0 ? {} : { maxTokens: wireModel.maxTokens },
|
|
245
246
|
...model.multimodal === void 0 ? {} : { multimodal: model.multimodal },
|
|
246
247
|
reasoningSupported: model.reasoningSupported,
|
|
247
248
|
...model.reasoning === void 0 ? {} : {
|
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.0.
|
|
5
|
+
"version": "4.0.1",
|
|
6
6
|
"author": "dingminhua",
|
|
7
7
|
"copyright": "Copyright (c) 2026 LaoDing",
|
|
8
8
|
"license": "MIT",
|