@kira905/dsh-butler-panel 0.9.3 → 0.9.5

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/cordis.patch.yml CHANGED
@@ -3,6 +3,14 @@
3
3
  # latest changelog, memory pulse). The node half (exports ".") serves
4
4
  # GET /api/dsh-butler/state; the `dsh.client` declaration makes the browser
5
5
  # half (exports "./client") load in the web GUI sidebar bottom area.
6
+ #
7
+ # 🔴 name 必须等于 package.json#name(发行名带 scope)。
8
+ # 0.9.3 及更早写的是不带 scope 的 `dsh-butler-panel` —— 那是"本地手放实体"时代的
9
+ # 名字。从注册表装(`dsh plugin --profile <p> add @kira905/dsh-butler-panel`)时,
10
+ # profile 里只有 `@kira905/dsh-butler-panel` 这个包,宿主解析不到 `dsh-butler-panel`
11
+ # 那一行 ⇒ **宿主半根本没挂上 ⇒ 它的 dsh.client 也不会被扫进 boot graph ⇒ 侧边栏连
12
+ # 入口都不出现,而且没有任何报错**(2026-11-09 A-8 关 4 实测,桌面版上就是这个症状)。
13
+ # 同一处坑在 @kira905/dsh-task-board-local 的 patch 里已有同文提醒,这里是同一类错误。
6
14
  - insert:
7
15
  - id: butler-panel
8
- name: 'dsh-butler-panel'
16
+ name: '@kira905/dsh-butler-panel'
package/lib/client.js CHANGED
@@ -15,7 +15,13 @@
15
15
  // 前缀 hack;拿不到 slots/React 时自动回落旧 self-heal 注入路径(规范 docs\侧边栏UI按钮对齐规范.md)。
16
16
  // 跳转为实验特性(主包 sessionRow 行 React onClick 模拟点击),失败降级复制会话 id。
17
17
  window.__ModuleLoader__.load({
18
- id: "dsh-butler-panel",
18
+ // 🔴【0.9.5 · 2026-11-09】这里的 id 必须是 **package.json#name**(带 scope)。
19
+ // 客户端模块表按这个 id 登记,而宿主的 boot graph 行 id 也来自包的真名 ——
20
+ // 写成不带 scope 的 "dsh-butler-panel" 会对不上行 id,宿主直接报
21
+ // `…/client.js already executed without registering "@kira905/dsh-butler-panel"`
22
+ // 然后**整个桌面版起不来**(2026-11-09 A-8 关 4 真机实测那份崩溃弹窗)。
23
+ // 同一个病根在本包一共三处:挂载条目 name、这句 id、require 适配层的名字。
24
+ id: "@kira905/dsh-butler-panel",
19
25
  factory: (require) => {
20
26
  var module = { exports: {} };
21
27
  var exports = module.exports;
@@ -28,8 +34,19 @@ window.__ModuleLoader__.load({
28
34
  * 浏览器 bundle 拿不到各包的 lib/host-adapter.js 副本(宿主按 exports["./client"] **单文件**
29
35
  * serve),故由 dsh-host-adapter-client 的 client 面提供常量;本包 package.json 的
30
36
  * `dsh.client.external` 已声明它 —— 宿主据此排序 boot graph,保证依赖先 register,
31
- * 同步 require 才命中模块表(不声明 = require MISS = 整个 client bundle 崩)。 */
32
- const ADAPTER = require("dsh-host-adapter-client");
37
+ * 同步 require 才命中模块表(不声明 = require MISS = 整个 client bundle 崩)。
38
+ *
39
+ * 🔴【0.9.4 · 2026-11-09】两条曾经把整个面板打死的事实:
40
+ * ① 从注册表装的是 **@kira905/dsh-host-adapter-client**(package.json#name 带 scope),
41
+ * 而 boot graph 的行 id = 那个 name ⇒ 裸 `require("dsh-host-adapter-client")` 找不到行、
42
+ * 整个 client bundle 在 factory 顶层就抛,侧边栏连入口都不出现(没有任何错误提示)。
43
+ * ② 老 profile 里那份是**不带 scope** 的本地件(name = dsh-host-adapter-client)。
44
+ * ⇒ 两个名字都试,谁在就用谁;都没有也只是缺一个常量,本面板照常挂(下面有同值兜底),
45
+ * 绝不因为一个依赖名字对不上而整块消失。 */
46
+ let ADAPTER = null;
47
+ try { ADAPTER = require("@kira905/dsh-host-adapter-client"); } catch (e1) {
48
+ try { ADAPTER = require("dsh-host-adapter-client"); } catch (e2) { ADAPTER = null; }
49
+ }
33
50
  //#region consts
34
51
  const ENTRY_ATTR = "data-dsh-butler-entry";
35
52
  const ENTRY_SELECTOR = "[" + ENTRY_ATTR + "]";
@@ -62,7 +79,10 @@ window.__ModuleLoader__.load({
62
79
  const COLD_MS_DEFAULT = 3200;
63
80
  const SLOW_MS = 1000; // "重算慢"阈值(连续退化判据的一半)
64
81
  const DEGRADE_STREAK_ALERT = 3; // 连续退化 ≥3 次 → 显式提示(别让主人以为一直正常)
65
- const inject = [ADAPTER.SVC.slots];
82
+ // 【0.9.4】适配层只在常量层需要:拿不到就退回同值字面量("slots")。
83
+ // 这一条就是当年"适配层名字对不上 ⇒ 整个面板消失"的兜底;不是新语义,值与 ADAPTER.SVC.slots 相同。
84
+ const SLOTS_SERVICE = (ADAPTER && ADAPTER.SVC && ADAPTER.SVC.slots) || "slots";
85
+ const inject = [SLOTS_SERVICE];
66
86
  // 大管家图标(账本清单,16px 描边,与生态面板 grid 同视觉语言)
67
87
  const ICON = "<svg viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M2.6 3.2h6.8M2.6 8h6.8M2.6 12.8h6.8\"/><path d=\"M11.4 4.6l1.4 1.4 2.6-2.8M11.4 9.4l1.4 1.4 2.6-2.8\"/></svg>";
68
88
  const CSS_ID = "dsh-butler-panel-css";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kira905/dsh-butler-panel",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "大管家的可视化面板:在 DSH 侧边栏看今天该看什么(结论 / 待处理 / 资产 / 流水 / 健康),只读为主;另带 P5 写入守门人(可挂可摘)。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -39,7 +39,7 @@
39
39
  "node": ">=18.17"
40
40
  },
41
41
  "dependencies": {
42
- "dsh-host-adapter-client": "npm:@kira905/dsh-host-adapter-client@^0.1.2"
42
+ "dsh-host-adapter-client": "npm:@kira905/dsh-host-adapter-client@^0.2.0"
43
43
  },
44
44
  "peerDependencies": {},
45
45
  "license": "AGPL-3.0-only",
@@ -52,6 +52,7 @@
52
52
  },
53
53
  "client": {
54
54
  "external": [
55
+ "@kira905/dsh-host-adapter-client",
55
56
  "dsh-host-adapter-client"
56
57
  ],
57
58
  "inject": [],