@restregular/dsh-skill-center 0.2.1 → 0.2.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/README.md +36 -3
- package/client/client.js +18 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# dsh-skill-center · 技能中心
|
|
1
|
+
# dsh-skill-center · 技能中心
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@restregular/dsh-skill-center)
|
|
4
4
|
[](./LICENSE)
|
|
@@ -67,7 +67,7 @@ Then add the package to the profile's bundle list and restart:
|
|
|
67
67
|
// <profile>/package.json
|
|
68
68
|
{
|
|
69
69
|
"dsh": { "profile": { "bundles": [/* … */ "@restregular/dsh-skill-center"] } },
|
|
70
|
-
"dependencies": { "@restregular/dsh-skill-center": "^0.2.
|
|
70
|
+
"dependencies": { "@restregular/dsh-skill-center": "^0.2.2" }
|
|
71
71
|
}
|
|
72
72
|
```
|
|
73
73
|
|
|
@@ -83,8 +83,25 @@ because the client registers `sidebar.panellist` with `order: 1`.
|
|
|
83
83
|
> no sidebar row, `/plugins/@restregular/dsh-skill-center/client.js` returns `404`, and nothing is
|
|
84
84
|
> logged. 0.2.1 fixed exactly this; 0.2.0 shipped the bare name.
|
|
85
85
|
|
|
86
|
+
> [!IMPORTANT]
|
|
87
|
+
> The client bundle must also call `__ModuleLoader__.load({ id: '@restregular/dsh-skill-center' })` —
|
|
88
|
+
> **the package name, not the plugin id**. The browser module graph numbers rows by package name, and
|
|
89
|
+
> `ClientModuleSystem.invalidate(id, rev)` (what the HMR `rebuilt` frame and `entries.reload` use)
|
|
90
|
+
> deletes factory entries **by row id only**. A registration id that differs from the row id leaves
|
|
91
|
+
> the stale factory in place, so the next bundle revision throws
|
|
92
|
+
> `client-modules: duplicate factory registration … (bundle executed twice without invalidate?)`
|
|
93
|
+
> and the whole web boot reports `1 entry did not activate`. 0.2.2 fixed this; 0.2.0/0.2.1 used the
|
|
94
|
+
> bare plugin id. The bundle additionally skips registration when that id is already present, so a
|
|
95
|
+
> double execution can no longer take the boot down.
|
|
96
|
+
|
|
86
97
|
To uninstall: remove the bundle entry and the dependency, then restart.
|
|
87
98
|
|
|
99
|
+
> [!WARNING]
|
|
100
|
+
> Do not leave a bare-name junction/link for this package in the profile's `node_modules`
|
|
101
|
+
> (e.g. `node_modules\dsh-skill-center` → the repo). Both the link and the scoped package register
|
|
102
|
+
> the same plugin, which is exactly the two-sources situation behind the duplicate-registration
|
|
103
|
+
> crash. Install the scoped package and nothing else.
|
|
104
|
+
|
|
88
105
|
## Troubleshooting
|
|
89
106
|
|
|
90
107
|
Nothing appears in the sidebar after install + restart? Check in this order:
|
|
@@ -269,7 +286,7 @@ pnpm add @restregular/dsh-skill-center
|
|
|
269
286
|
// <profile>/package.json
|
|
270
287
|
{
|
|
271
288
|
"dsh": { "profile": { "bundles": [/* … */ "@restregular/dsh-skill-center"] } },
|
|
272
|
-
"dependencies": { "@restregular/dsh-skill-center": "^0.2.
|
|
289
|
+
"dependencies": { "@restregular/dsh-skill-center": "^0.2.2" }
|
|
273
290
|
}
|
|
274
291
|
```
|
|
275
292
|
|
|
@@ -283,8 +300,24 @@ pnpm add @restregular/dsh-skill-center
|
|
|
283
300
|
> 但浏览器半边会被**静默丢弃** —— 侧栏没有「技能中心」、`/plugins/@restregular/dsh-skill-center/client.js`
|
|
284
301
|
> 返回 `404`,而且日志里一个字都没有。0.2.1 修的就是这个;0.2.0 发出去的是裸名。
|
|
285
302
|
|
|
303
|
+
> [!IMPORTANT]
|
|
304
|
+
> 客户端 bundle 还必须用**包名**注册:`__ModuleLoader__.load({ id: '@restregular/dsh-skill-center' })`,
|
|
305
|
+
> 不能用插件 id `dsh-skill-center`。浏览器模块图是按包名给行编号的,而
|
|
306
|
+
> `ClientModuleSystem.invalidate(id, rev)`(HMR 的 `rebuilt` 帧 → `entries.reload` 走的正是它)
|
|
307
|
+
> **只按行 id** 删工厂表里的条目:注册 id 与行 id 不一致 → 旧工厂删不掉 → 下一版 bundle 一执行就
|
|
308
|
+
> `client-modules: duplicate factory registration … (bundle executed twice without invalidate?)`,
|
|
309
|
+
> 整条 web boot 变成「1 entry did not activate」并弹「应用无法启动或已意外停止」。
|
|
310
|
+
> 0.2.2 修的就是这个。bundle 另外加了一道幂等保护:该 id 已在工厂表里就跳过注册,
|
|
311
|
+
> 重复执行最多是空转,不会再打挂启动。
|
|
312
|
+
|
|
286
313
|
卸载:删掉上面两处清单项,重启即可。
|
|
287
314
|
|
|
315
|
+
> [!WARNING]
|
|
316
|
+
> 不要在 profile 的 `node_modules` 里给这个包留裸名链接/junction
|
|
317
|
+
> (例如 `node_modules\dsh-skill-center` → 本仓库)。链接和真正的 scoped 包会各自注册同一个插件,
|
|
318
|
+
> 正好构成「同一插件两个来源」——也就是上面那个 duplicate registration 崩溃的现场。
|
|
319
|
+
> 只装 scoped 包,别的都清掉。
|
|
320
|
+
|
|
288
321
|
### 装完侧栏没出现?按顺序查这五步
|
|
289
322
|
|
|
290
323
|
1. **宿主半边活着吗**:`http://127.0.0.1:19387/dsh-skill-center/api?op=ping` 应回 `{"ok":true,…}`。
|
package/client/client.js
CHANGED
|
@@ -6,11 +6,27 @@
|
|
|
6
6
|
* `order: 1` 使其排在 `plugins`(order 0)下方;
|
|
7
7
|
* 2. `main`(keyed, root, key = "skill-center")— 中央区域的面板本体。
|
|
8
8
|
*
|
|
9
|
+
* 注册 id **必须逐字等于包名**(`@restregular/dsh-skill-center`)。浏览器模块图是按
|
|
10
|
+
* 包名给行编号的,`ClientModuleSystem.invalidate`/`reload`(HMR 的 `rebuilt` 帧走的
|
|
11
|
+
* 就是它)只按**行 id** 清理工厂表:注册 id 与行 id 不一致时,旧工厂不会被删掉,
|
|
12
|
+
* 新版 bundle 一到就撞成
|
|
13
|
+
* `client-modules: duplicate factory registration ... (bundle executed twice without invalidate?)`,
|
|
14
|
+
* 于是整条 web boot 变成 "1 entry did not activate"。
|
|
15
|
+
*
|
|
9
16
|
* 数据与写操作全部走宿主同源回环路由 `/dsh-skill-center/api`(见 ../lib/index.js)。
|
|
10
17
|
* 样式只用宿主主题令牌 `--dsw-*`,不 import 任何 Harness Client 包。
|
|
11
18
|
*/
|
|
19
|
+
const MODULE_ID = '@restregular/dsh-skill-center';
|
|
20
|
+
|
|
21
|
+
/** 该 id 是否已经注册过工厂(宿主 facade 暴露 factories 表;取不到就当作没注册)。 */
|
|
22
|
+
function alreadyRegistered() {
|
|
23
|
+
const factories = window.__ModuleLoader__?.factories;
|
|
24
|
+
return factories !== undefined && typeof factories.has === 'function' && factories.has(MODULE_ID);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (!alreadyRegistered()) {
|
|
12
28
|
window.__ModuleLoader__.load({
|
|
13
|
-
id:
|
|
29
|
+
id: MODULE_ID,
|
|
14
30
|
factory: (require) => {
|
|
15
31
|
const React = require('react');
|
|
16
32
|
const h = React.createElement;
|
|
@@ -765,3 +781,4 @@ window.__ModuleLoader__.load({
|
|
|
765
781
|
return { apply, inject };
|
|
766
782
|
},
|
|
767
783
|
});
|
|
784
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@restregular/dsh-skill-center",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "技能中心 — DeepSeek Harness 技能管理面板:浏览当前会话可见的所有技能、查看正文、开关模型/用户调用、新建与删除。 · Skill Center for DeepSeek Harness: browse and manage the skills visible to the current session.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|