dsh-sidecard-ask 1.3.1 → 1.3.2

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,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.2
4
+
5
+ **主题:核对并适配 DSH 桌面版(Electron,0.2.0-rc.2)。**
6
+
7
+ 核对结论(实测,详见 README §5.3):
8
+
9
+ - 桌面版是**独立运行形态**:Electron-as-Node 跑 `app.asar\dsh\...\dsh-desktop-host`,框架包全在 `app.asar` 内,
10
+ 自带 node 24.18.1 + pnpm 11.7.0;`DSH_PROFILE=desktop`,与 web 版的 `profiles\web` **各自独立**;
11
+ - 本插件在桌面 profile 中已登记(`link:D:/Users/34332/AI/dsh-sidecard-ask` + `dsh.profile.bundles`),
12
+ **无需改动即加载**:宿主半 `v1.3.1` 正常,客户端自检上报显示三个槽位落点正常、两个适配器均可用,
13
+ 真机 `start→reasoning×106→delta×46→status→done`(1.89 s)通过;
14
+ - 桌面版用的 dsh-better-sidebar 是 **0.24.1**:与 0.22.1 的消费端契约差异**纯增量**
15
+ (`target` 增加 `'side'`、新增可选 `preferNewPane`),本插件不传这两项 → 不受影响。
16
+
17
+ **桌面特有修改:窗口拖拽区防御。** 桌面外壳把顶层元素标记为窗口拖拽区(`-webkit-app-region: drag`),
18
+ 落在其中的点击会变成拖动窗口;同生态的 dsh-better-sidebar 为此专门带了一条防御,而本插件的浮层此前没有。
19
+ 现在样式表为每个自有根节点声明 `-webkit-app-region:no-drag`(`.dsa-layer/.dsa-trigger/.dsa-pop/.dsa-stack/
20
+ .dsa-card/.dsa-toast/.dsa-settings`),并有回归测试锁定该规则(含"该规则是真实规则而非只出现在注释里"的断言)。
21
+ 该属性在浏览器中无效,web 版不受影响。
22
+
23
+ **确认无需改动的部分**:`styles.insert` / `host.call` 只属于**动态**客户端半(本插件是静态形态,官方等价做法
24
+ 就是手工插 `<style>`,宿主通信走自有 HTTP 路由);名为 `shortcuts` 与 `conversation` 的客户端服务在运行实例中
25
+ **都不存在**(inspection 报 `no catalogued Service`),因此快捷键与 composer 草稿保持既有实现与占位降级。
26
+
27
+ 自测 327 → **336 项**(verify 53 / contract 149 / smoke 134)。
28
+
3
29
  ## 1.3.1
4
30
 
5
31
  **主题:让"两半代际不一致"成为一个被处理的状态,而不是噪声。**
package/README.md CHANGED
@@ -221,6 +221,50 @@ better-sidebar 会把收到的每个 tab 描述符**镜像注册进同一个原
221
221
 
222
222
  两者共存、均 `active: true` —— 即"同 kind 冲突"已被消除,`auto` 默认走原生右侧栏,强制 `sideSurface: better-sidebar` 仍可用。
223
223
 
224
+ ### 5.3 与 DSH 桌面版(Electron)的适配核对(2026-09-30)
225
+
226
+ 桌面版与命令行/web 版**不是同一套运行形态**,核对结论如下。
227
+
228
+ | 维度 | 事实(实测) |
229
+ |---|---|
230
+ | 桌面 App | `DeepSeek Harness.exe` **0.2.0-rc.2**(`resources\app-update.yml` 更新通道 `nightly`,源 `download.deepseek.com/dsh-desk/feeds/win-x64/`) |
231
+ | 运行形态 | Electron-as-Node 跑 `app.asar\dsh\node_modules\@deepseek-ai\dsh-desktop-host\lib\index.js`;**框架包全部打包在 `app.asar` 内**(121 MB 归档,普通 shell/glob/grep 读不到,只能靠运行实例的 inspection 查) |
232
+ | 自带运行时 | `resources\runtime\versions.json`:node **24.18.1** + pnpm **11.7.0**(装插件用的是它自带的 pnpm) |
233
+ | profile | **`DSH_PROFILE=desktop` → `C:\Users\34332\.dsh\profiles\desktop`**,与 web 版的 `profiles\web` **互相独立**:两者各有自己的 `package.json`/`node_modules`/`dsh.profile.bundles`,插件必须分别安装 |
234
+ | 本插件安装状态 | 桌面 profile 的 `package.json` 中为 `"dsh-sidecard-ask": "link:D:/Users/34332/AI/dsh-sidecard-ask"`,且已在 `dsh.profile.bundles` 内 → **无需改动即加载** |
235
+ | 宿主半 | `GET http://127.0.0.1:19387/sidecard-ask/api/state` → `dsh-sidecard-ask v1.3.1`、`sideEngine=true`(provider `spawn,fork`)、`capabilities.parent` 正常、配置落点 `~/.dsh/sidecard-ask/config.json` |
236
+ | 客户端半 | 由本插件自己的自检上报读出:`version=1.3.1`、`slots={overlay: shell.overlay, settings: settings.section, sessionProbe: conversation.input.right}`、`native.available=true`、`better.available=true` 且 `better.version=0.24.1` |
237
+ | 端到端 | 真机 `start→reasoning×106→delta×46→status→done`,1.89 s,`done.text` 是真实答案(子代理 + 流式帧 + 只读工具白名单全部正常) |
238
+ | 客户端服务目录 | 与 web 版**完全一致**(layout / locale / sessions / slots / theme / timer / uiWorkspace / workspaces),无桌面专属差异 |
239
+
240
+ **桌面版用到的 dsh-better-sidebar 是 0.24.1**(比上轮核对的 0.22.1 新):0.22.1 → 0.24.1 的
241
+ `lib/types/client/service.d.ts` 差异是**纯增量**——`target?: 'right' | 'bottom'` 增加 `'side'`(右侧栏第二窗格),
242
+ 并新增可选 `preferNewPane?: boolean`;`SIDEBAR_FEATURES` 仍含 `tabMeta`,`dsh.client.inject` 未变。
243
+ 本插件不传这两个字段 → **不受影响**(默认落点行为未变)。
244
+
245
+ **桌面版特有的适配修改(1.3.2):窗口拖拽区。** 桌面外壳会把顶层元素标记为窗口拖拽区
246
+ (`-webkit-app-region: drag`),落在拖拽区内的点击会**变成拖动窗口**而不是点中 UI。同生态的
247
+ dsh-better-sidebar 为此专门带了一条防御(`html[data-platform] body>[data-dsh-better-sidebar]{-webkit-app-region:initial}`
248
+ + `[data-dsh-panel-host]>*{-webkit-app-region:no-drag}`)。本插件的浮层此前**没有这条防御**,现已在样式表里为
249
+ 每个自有根节点声明 `-webkit-app-region:no-drag`
250
+ (`.dsa-layer/.dsa-trigger/.dsa-pop/.dsa-stack/.dsa-card/.dsa-toast/.dsa-settings`),并加回归测试锁定该规则。
251
+ 该属性在浏览器里无效,不影响 web 版。
252
+
253
+ **桌面形态下确认「不需要改」的两点**:
254
+
255
+ - `styles.insert` / `host.call` 属于**动态运行时**的插件能力(inspection 的 `Builtin` 定义就是
256
+ "Plain-JavaScript symbols available to a **dynamic** Client half")。本插件是**静态**客户端半
257
+ (`__ModuleLoader__.load` + `require('react')`),官方形态就是手工插入 `<style>`——同为静态形态的
258
+ `uiskin-theme` 在源码里注明 "the static twin of the dynamic runner's `styles.insert`";宿主通信走自有的
259
+ `/sidecard-ask/api` 路由;
260
+ - 名为 `shortcuts` 与 `conversation` 的客户端服务**都不在运行实例的服务目录里**(inspection 明确报
261
+ `no catalogued Service named ...`)。所以"并入宿主快捷键注册表"与"使用 composer 草稿服务"两条路都不存在:
262
+ 本插件继续自带 keydown 监听(快捷键可配置)与 `PLACEHOLDER: composer-draft` 降级路径。
263
+
264
+ **仍未验证的部分(如实记录)**:桌面窗口内的**视觉与点击行为**(本工作区无 GUI 自动化,无法点按验证);
265
+ `Alt+Q` 是否会撞上桌面 App 的菜单加速键(Electron 的菜单加速键由菜单先处理,页面的 keydown 可能收不到;
266
+ 若冲突,在设置页改成 `Ctrl+Alt+Q` 之类即可);Electron 下 `navigator.clipboard` 的写入权限(已有"选中文本"降级兜底)。
267
+
224
268
  ---
225
269
 
226
270
  ## 六、未知 DSH API:占位接口与替换方式
@@ -396,7 +440,7 @@ node test/smoke-test.mjs # 端到端:流式/截断/取消/持久化/失
396
440
  ```
397
441
 
398
442
  三个脚本都以 `process.exitCode` 反映结果,失败会列出具体条目;测试会把 `DSH_HOME` 指向临时目录,不会污染真实配置。
399
- 当前规模:verify 53 项 + contract 140 项 + smoke 134 项 = **327 项全部通过**。
443
+ 当前规模:verify 53 项 + contract 149 项 + smoke 134 项 = **336 项全部通过**。
400
444
 
401
445
  ### 10.2 版本能力探测(§7 矩阵的来源)
402
446
 
package/client.js CHANGED
@@ -47,7 +47,7 @@ window.__ModuleLoader__.load({
47
47
  * the Host and the module's `api.version` both read it, so a report can
48
48
  * never claim a generation the browser is not actually running.
49
49
  */
50
- const CLIENT_VERSION = '1.3.1'
50
+ const CLIENT_VERSION = '1.3.2'
51
51
 
52
52
  /**
53
53
  * Tab kind served by the DSH native right rail (also its implementation id).
@@ -1032,6 +1032,17 @@ window.__ModuleLoader__.load({
1032
1032
 
1033
1033
  /** Theme-token-only stylesheet. Every class is prefixed `dsa-`. */
1034
1034
  const CSS_TEXT = `
1035
+ /* Desktop (Electron) window-drag guard.
1036
+ The DSH desktop shell marks top-level elements as window-drag regions
1037
+ (\`-webkit-app-region: drag\`), and a click landing inside such a region MOVES
1038
+ THE WINDOW instead of reaching the UI — which would make the floating trigger,
1039
+ the question popover and the cards unclickable in the desktop app. A
1040
+ descendant of a drag region must opt out explicitly; dsh-better-sidebar ships
1041
+ exactly this guard for its own host
1042
+ (\`html[data-platform] body>[data-dsh-better-sidebar]{-webkit-app-region:initial}\`
1043
+ plus \`[data-dsh-panel-host]>*{-webkit-app-region:no-drag}\`).
1044
+ Every surface we draw declares it. The property is inert in a browser. */
1045
+ .dsa-layer,.dsa-trigger,.dsa-pop,.dsa-stack,.dsa-card,.dsa-toast,.dsa-settings{-webkit-app-region:no-drag}
1035
1046
  .dsa-layer{pointer-events:none;position:relative;z-index:60}
1036
1047
  .dsa-trigger{pointer-events:auto;position:fixed;display:flex;align-items:center;gap:4px;
1037
1048
  padding:4px 8px;border-radius:8px;border:1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.35));
package/index.js CHANGED
@@ -42,7 +42,7 @@ export const name = 'dsh-sidecard-ask'
42
42
  export const inject = ['webServer']
43
43
 
44
44
  /** Version of this plugin (kept in step with package.json by test/verify.mjs). */
45
- export const PLUGIN_VERSION = '1.3.1'
45
+ export const PLUGIN_VERSION = '1.3.2'
46
46
 
47
47
  /** Route prefix of the plugin's own API. */
48
48
  export const ROUTE_PREFIX = '/sidecard-ask/api'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-sidecard-ask",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "DSH 划词追问(侧边卡片作答):在聊天区与任务区选中文本就地追问,答案由独立子代理在侧边卡片里流式呈现,也可选择落回主对话。",
5
5
  "type": "module",
6
6
  "main": "index.js",