dsh-connect-trae 1.1.2 → 1.2.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,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.0 (2026-09-04)
4
+
5
+ ### Changes
6
+
7
+ - 适配 DSH v0.1.2-rc.1 上游重构(`dsh-plugin-desktop` 2.0.5),同一份构建继续兼容 0.1.1 宿主:
8
+ - `@deepseek-ai/dsh-settings` 在 0.1.2 的 npm 包中移除了 `settingsNamespace` / `installSettingsSection` 自由函数(桌面宿主内置兼容垫片,npm 安装没有;缺失导出会在 ESM 链接期直接报错)。设置接线改为双轨:从模块命名空间读取旧自由函数,存在则使用(0.1.1 宿主与带垫片的 0.1.2 桌面宿主),否则回退 `settings` 服务的 `installSection` 方法(无垫片的 0.1.2 npm 环境);`TRAE_SETTINGS_NS` 改为字面量 `'trae'`。
9
+ - `@deepseek-ai/dsh-client-runtime` 包在上游被拆分删除:客户端入口的 `ClientContext` 类型改从 `@deepseek-ai/cordis` 导入,`slots` / `settingsScope` / `locale` 服务类型分别通过 `dsh-client-ui-renderer/client`、`dsh-client-ui-settings/client`、`dsh-client-locale/client` 的类型增广获得;`package.json` 的 `dsh.client.inject` 相应把 `@deepseek-ai/dsh-client-runtime` 替换为 `@deepseek-ai/dsh-client-ui-renderer`(0.1.2 中 `slots` 服务的提供方,该包在 0.1.1 中同样存在)。
10
+ - `llm.registerModelDiscovery` 的取消信号从 `request.signal` 移到回调第二个参数:发现回调改用 `(request, signal)` 签名并透传给 Trae 发现请求,修复 0.1.2 宿主下取消不再传播的问题;0.1.1 宿主回退读取 `request.signal`。
11
+ - devDependencies 升级至 `@deepseek-ai/dsh-*@0.1.2-rc.1`、`cordis@^4.0.2`、`schemastery@3.18.2`、`pi-ai@0.84.2`(新增 `dsh-client-ui-renderer`、`dsh-client-ui-settings`,移除已删除的 `dsh-client-runtime`),`pnpm run check` 现在直接面向 0.1.2 类型与运行时验证;`peerDependencies` 维持 `>=0.1.2-0 <0.2.0-0` 不变。
12
+
3
13
  ## 1.1.2 (2026-08-31)
4
14
 
5
15
  ### Fixes
package/README.en.md CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  <p align="center">
18
18
  <a href="https://www.npmjs.com/package/dsh-connect-trae"><img src="https://img.shields.io/npm/v/dsh-connect-trae?style=flat-square&label=npm&color=cb3837" alt="npm version"></a>
19
- <a href="https://www.npmjs.com/package/dsh-connect-trae"><img src="https://img.shields.io/npm/dm/dsh-connect-trae?style=flat-square&label=downloads" alt="npm downloads"></a>
19
+ <a href="https://www.npmjs.com/package/dsh-connect-trae"><img src="https://img.shields.io/npm/d18m/dsh-connect-trae?style=flat-square&label=downloads&color=cb3837" alt="npm downloads"></a>
20
20
  <a href="https://github.com/dingminhua/dsh-connect-trae/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/dingminhua/dsh-connect-trae/ci.yml?branch=main&style=flat-square&label=tests" alt="test status"></a>
21
21
  <a href="LICENSE"><img src="https://img.shields.io/github/license/dingminhua/dsh-connect-trae?style=flat-square" alt="MIT license"></a>
22
22
  <a href="https://github.com/dingminhua/dsh-connect-trae/stargazers"><img src="https://img.shields.io/github/stars/dingminhua/dsh-connect-trae?style=flat-square" alt="GitHub stars"></a>
package/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  <p align="center">
18
18
  <a href="https://www.npmjs.com/package/dsh-connect-trae"><img src="https://img.shields.io/npm/v/dsh-connect-trae?style=flat-square&label=npm&color=cb3837" alt="npm version"></a>
19
- <a href="https://www.npmjs.com/package/dsh-connect-trae"><img src="https://img.shields.io/npm/dm/dsh-connect-trae?style=flat-square&label=downloads" alt="npm downloads"></a>
19
+ <a href="https://www.npmjs.com/package/dsh-connect-trae"><img src="https://img.shields.io/npm/d18m/dsh-connect-trae?style=flat-square&label=downloads&color=cb3837" alt="npm downloads"></a>
20
20
  <a href="https://github.com/dingminhua/dsh-connect-trae/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/dingminhua/dsh-connect-trae/ci.yml?branch=main&style=flat-square&label=tests" alt="test status"></a>
21
21
  <a href="LICENSE"><img src="https://img.shields.io/github/license/dingminhua/dsh-connect-trae?style=flat-square" alt="MIT license"></a>
22
22
  <a href="https://github.com/dingminhua/dsh-connect-trae/stargazers"><img src="https://img.shields.io/github/stars/dingminhua/dsh-connect-trae?style=flat-square" alt="GitHub stars"></a>
package/lib/index.d.ts CHANGED
@@ -1020,7 +1020,15 @@ declare function registerTraeUsageRoute(ctx: Context, deps: TraeUsageRouteOption
1020
1020
  //#region src/index.d.ts
1021
1021
  declare const name = "dsh-connect-trae";
1022
1022
  declare const inject: string[];
1023
- declare const TRAE_SETTINGS_NS: import("@deepseek-ai/dsh-settings").SettingsNamespace;
1023
+ /**
1024
+ * Settings namespace, as a plain lowercase literal. DSH 0.1.2 removed the
1025
+ * `settingsNamespace` brand constructor from the npm package (the Desktop
1026
+ * host still ships it as a legacy shim), and every consumer of this constant —
1027
+ * `registerModelDiscovery`, `registerConfigurableProviders`,
1028
+ * `settings.installSection`, the settings test — takes it as a kebab string,
1029
+ * so no branding is needed for either host generation.
1030
+ */
1031
+ declare const TRAE_SETTINGS_NS = "trae";
1024
1032
  interface Config {
1025
1033
  authFile?: string;
1026
1034
  edition?: 'auto' | 'cn' | 'sg' | 'solo' | 'solo-sg';
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
- import { installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-settings";
2
+ import * as dshSettings from "@deepseek-ai/dsh-settings";
3
3
  import { createProvider } from "@earendil-works/pi-ai";
4
4
  import { openAICompletionsApi } from "@earendil-works/pi-ai/api/openai-completions.lazy";
5
5
  import { resolveRetryPolicy } from "@deepseek-ai/dsh-llm";
@@ -2734,7 +2734,15 @@ var UnconfiguredTraeUpstreamClient = class {
2734
2734
  //#region src/index.ts
2735
2735
  const name = "dsh-connect-trae";
2736
2736
  const inject = ["llm"];
2737
- const TRAE_SETTINGS_NS = settingsNamespace("trae");
2737
+ /**
2738
+ * Settings namespace, as a plain lowercase literal. DSH 0.1.2 removed the
2739
+ * `settingsNamespace` brand constructor from the npm package (the Desktop
2740
+ * host still ships it as a legacy shim), and every consumer of this constant —
2741
+ * `registerModelDiscovery`, `registerConfigurableProviders`,
2742
+ * `settings.installSection`, the settings test — takes it as a kebab string,
2743
+ * so no branding is needed for either host generation.
2744
+ */
2745
+ const TRAE_SETTINGS_NS = "trae";
2738
2746
  const modelConfig = z.object({
2739
2747
  id: z.string().required(),
2740
2748
  name: z.string().required(),
@@ -2867,7 +2875,7 @@ function apply(ctx, config) {
2867
2875
  discoverModels,
2868
2876
  rawDiagnostic: () => rawDiagnostic()
2869
2877
  }));
2870
- installSettingsSection(ctx, TRAE_SETTINGS_NS, Config, config, {
2878
+ const sectionHooks = {
2871
2879
  setSource(source) {
2872
2880
  current = source;
2873
2881
  },
@@ -2877,6 +2885,11 @@ function apply(ctx, config) {
2877
2885
  catalog.set(configuredModels(next));
2878
2886
  invalidateAdapter();
2879
2887
  }
2888
+ };
2889
+ const legacyInstallSettingsSection = dshSettings.installSettingsSection;
2890
+ if (typeof legacyInstallSettingsSection === "function") legacyInstallSettingsSection(ctx, TRAE_SETTINGS_NS, Config, config, sectionHooks);
2891
+ else ctx.inject(["settings"], (settingsCtx) => {
2892
+ settingsCtx.settings.installSection(ctx, TRAE_SETTINGS_NS, Config, config, sectionHooks);
2880
2893
  });
2881
2894
  let stopped = false;
2882
2895
  ctx.effect(() => () => {
@@ -2903,9 +2916,10 @@ function apply(ctx, config) {
2903
2916
  let releaseDirectory;
2904
2917
  try {
2905
2918
  releaseAdapter = ctx.llm.registerAdapter([TRAE_PROVIDER], trae.adapter);
2906
- ctx.llm.registerModelDiscovery(TRAE_SETTINGS_NS, async (request) => {
2919
+ ctx.llm.registerModelDiscovery(TRAE_SETTINGS_NS, async (request, signal) => {
2907
2920
  if (request.provider !== "trae") return [];
2908
- return applyImageSelection(await discoverModels(request.signal), imageSet(current())).map((model) => ({
2921
+ const cancellation = signal ?? request.signal;
2922
+ return applyImageSelection(await discoverModels(cancellation), imageSet(current())).map((model) => ({
2909
2923
  id: model.id,
2910
2924
  name: model.name,
2911
2925
  ...model.contextWindow === void 0 ? {} : { contextWindow: model.contextWindow },
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dsh-connect-trae",
3
3
  "displayName": "DSH Connect Trae",
4
4
  "description": "Connect locally signed-in Trae models to DeepSeek Harness, plus a read-only usage/credits summary.",
5
- "version": "1.1.2",
5
+ "version": "1.2.0",
6
6
  "author": "dingminhua",
7
7
  "copyright": "Copyright (c) 2026 LaoDing",
8
8
  "license": "MIT",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "client": {
55
55
  "inject": [
56
- "@deepseek-ai/dsh-client-runtime",
56
+ "@deepseek-ai/dsh-client-ui-renderer",
57
57
  "@deepseek-ai/dsh-client-ui-settings",
58
58
  "@deepseek-ai/dsh-client-ui-slots",
59
59
  "@deepseek-ai/dsh-client-ui-settings-plugins",
@@ -86,21 +86,22 @@
86
86
  "react": "^18.2.0"
87
87
  },
88
88
  "devDependencies": {
89
- "@deepseek-ai/cordis": "^4.0.1",
90
- "@deepseek-ai/dsh-atomic-write": "^0.1.1-rc.2",
91
- "@deepseek-ai/dsh-attachment": "^0.1.1-rc.2",
92
- "@deepseek-ai/dsh-client-locale": "0.1.1-rc.2",
93
- "@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
94
- "@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.1-rc.2",
95
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.1-rc.2",
96
- "@deepseek-ai/dsh-client-ui-slots": "0.1.1-rc.2",
97
- "@deepseek-ai/dsh-home-paths": "^0.1.1-rc.2",
98
- "@deepseek-ai/dsh-host-webserver": "0.1.1-rc.2",
99
- "@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
100
- "@deepseek-ai/dsh-llm-pi-ai": "^0.1.1-rc.2",
101
- "@deepseek-ai/dsh-settings": "^0.1.1-rc.2",
102
- "@deepseek-ai/schemastery": "3.18.1",
103
- "@earendil-works/pi-ai": "0.82.1",
89
+ "@deepseek-ai/cordis": "^4.0.2",
90
+ "@deepseek-ai/dsh-atomic-write": "^0.1.2-rc.1",
91
+ "@deepseek-ai/dsh-attachment": "^0.1.2-rc.1",
92
+ "@deepseek-ai/dsh-client-locale": "0.1.2-rc.1",
93
+ "@deepseek-ai/dsh-client-ui-renderer": "0.1.2-rc.1",
94
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.2-rc.1",
95
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.2-rc.1",
96
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1",
97
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.2-rc.1",
98
+ "@deepseek-ai/dsh-home-paths": "^0.1.2-rc.1",
99
+ "@deepseek-ai/dsh-host-webserver": "0.1.2-rc.1",
100
+ "@deepseek-ai/dsh-llm": "^0.1.2-rc.1",
101
+ "@deepseek-ai/dsh-llm-pi-ai": "^0.1.2-rc.1",
102
+ "@deepseek-ai/dsh-settings": "^0.1.2-rc.1",
103
+ "@deepseek-ai/schemastery": "3.18.2",
104
+ "@earendil-works/pi-ai": "0.84.2",
104
105
  "@types/node": "^22.20.0",
105
106
  "@types/react": "~18.3.31",
106
107
  "react": "^18.3.1",