dsh-composer-ux 0.15.2 → 0.15.3
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.md +3 -3
- package/lib/client.js +676 -568
- package/lib/client.js.map +4 -4
- package/lib/index.js +24 -7
- package/lib/index.js.map +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [0.15.3] — 2026-09-30(修好重启被 403 挡住的根因 + 按参考插件把按钮摆到标题栏条)
|
|
6
|
+
|
|
7
|
+
起因(用户原话):**「参考一下这个,看这个的重启方式是怎么样的,并把按钮位置调成这个插件的样子
|
|
8
|
+
https://github.com/HHHEEEWWW/dsh-quick-restart」**。
|
|
9
|
+
|
|
10
|
+
### 1. 根因:来源判据太窄,桌面版必然被拒
|
|
11
|
+
|
|
12
|
+
读它的 `lib/index.js` 逐字看到这一行:`if (!origin || origin === 'null' || /^dsh-app:\/\//iu.test(origin)) return ''`
|
|
13
|
+
—— **桌面版壳的页面来源是 `dsh-app://`,它直接放行**,跨站防线交给客户端必须带的自定义头
|
|
14
|
+
(`x-dsh-quick-restart: 1`,跨站页面加不了自定义头)。我们原来的判据要求 `Origin` 与 `Host` 逐字同源,
|
|
15
|
+
于是桌面版**两枚按钮都 403**。现在对齐它的判据:
|
|
16
|
+
|
|
17
|
+
- 放行 `dsh-app://`、没有 Origin、`Origin: null`;
|
|
18
|
+
- http 来源仍要求与 Host 同源,且 Host 必须是回环(新增 `origin-not-loopback`);
|
|
19
|
+
- 转发头多认一个 `x-forwarded-host`;
|
|
20
|
+
- 新增防跨站头 `x-composer-ux-restart: 1`(宿主先卡它、再判来源;客户端两处请求都带上)。
|
|
21
|
+
|
|
22
|
+
### 2. 按钮按它的摆放挪到标题栏条(只改位置,不重做样式)
|
|
23
|
+
|
|
24
|
+
新增一枚挂在 `shell.overlay`:贴顶 + `right: calc(100% - env(titlebar-area-x) - env(titlebar-area-width))`,
|
|
25
|
+
正好落在原生「最小化」按钮左边;高 28px、最小宽 104px;`-webkit-app-region: no-drag`(否则点不着);
|
|
26
|
+
只在 `data-windows-titlebar` 存在时(Windows 桌面壳)渲染。颜色与两步确认仍是我们自己的,
|
|
27
|
+
侧边栏与设置页那两枚**保留**。
|
|
28
|
+
|
|
29
|
+
## 验证
|
|
30
|
+
|
|
31
|
+
- `npm test`:**2356 passed / 0 failed**(23 个套件;守卫断言按新判据重写 + 槽位 8→9)。
|
|
32
|
+
- 变异测试:**161/161 全部被咬住**(新增 FI `dsh-app://` 又被拒 / FJ 转发头少认一个;
|
|
33
|
+
移除旧的 A —— 它挡的是"来源判据",现在由 FI/FJ 直接钉在判据本身上)。
|
|
34
|
+
- `typecheck` 0 错误。
|
|
35
|
+
|
|
36
|
+
## 升级说明
|
|
37
|
+
|
|
38
|
+
- 装完**需要手动重启一次 DSH**(界面上的按钮在旧版本里还是 403):
|
|
39
|
+
`C:\Users\fangwen\.dsh\launcher\restart-webui.bat`。
|
|
40
|
+
|
|
5
41
|
## [0.15.2] — 2026-09-30(重启被挡时,现在会说清是哪一条不满足)
|
|
6
42
|
|
|
7
43
|
起因(用户截图):**侧边栏与设置页两枚「重启」都报** `restart is limited to same-origin loopback requests`。
|
package/README.md
CHANGED
|
@@ -506,7 +506,7 @@ Windows 上 DSH 给模型的终端工具是 **PowerShell**(工具名 `pwsh`)
|
|
|
506
506
|
| 工具循环的消息形状 / 轮次封顶 / 异常必须降级 | 同上第 6 节(假 llm 驱动整条循环,逐条检查 `role:'tool'` 与 `toolCallId`) |
|
|
507
507
|
| 工具路径:默认关、开了才派、**查完吐散文必须回落**、拿不到工作目录就不派 | `test/quick-commands.mjs` 5g 节(13 条,真路由 + 假 llm) |
|
|
508
508
|
| 工具读到的内容不进台账 | 同 5g 节:断言台账里只有工具名与次数、没有读到的文件内容 |
|
|
509
|
-
| 变异守卫真的会咬人,且**必须是指定的那条测试变红** | `npm run test:mutations`:**
|
|
509
|
+
| 变异守卫真的会咬人,且**必须是指定的那条测试变红** | `npm run test:mutations`:**161 条全部咬住**(判据是 `red.some(line => line.includes(item.expect))`,不是"有红就行") |
|
|
510
510
|
| 发布门禁三条判据 | `npm run gates` 全过;`check:tag` 实测 `v0.12.0` 的 tag 名与所指提交里的版本一致 |
|
|
511
511
|
| 三平台 CI | GitHub Actions:ubuntu / windows / macos × Node 20(`npm ci → typecheck → build → test → check:pack → check:docs`) |
|
|
512
512
|
|
|
@@ -640,9 +640,9 @@ node build.mjs # 产出 lib/index.js + lib/client.js
|
|
|
640
640
|
# ⚠️ 宿主半会**内联** schemastery / cosmokit:
|
|
641
641
|
# 优先用 DSH 检出里的 vendor 副本,检出不在时退到 node_modules
|
|
642
642
|
# 里同版本的 npm 包(两者逐字节相同)——CI 上走的就是退路
|
|
643
|
-
npm test # 23 个套件;当前
|
|
643
|
+
npm test # 23 个套件;当前 2356 passed, 0 failed(2026-09-29 实测;CI 三平台同样全绿)
|
|
644
644
|
# 走 scripts/run-tests.mjs:顺带把"多少套件/多少条"记进 test/.last-run.json
|
|
645
|
-
npm run test:mutations # 手动跑:变异测试,证明那套护栏真的在咬人(
|
|
645
|
+
npm run test:mutations # 手动跑:变异测试,证明那套护栏真的在咬人(161 条,须单独跑)
|
|
646
646
|
# 同样记录结果,供下面的文档门禁核对
|
|
647
647
|
npm run gates # 发版门禁三条一起跑:tag 指向 / 包内容 / 文档数字
|
|
648
648
|
npm run check:tag # ① tag 名里的版本 == 该 tag 所指提交里的 package.json 版本
|