dsh-paoding 0.3.1 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-paoding",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "庖丁 — DSH (DeepSeek Harness) 编排模式安装器:host 感知的角色工具过滤 + Web 设置页可视化配置器",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,12 +1,26 @@
1
1
  /**
2
2
  * paoding-config-ui — DSH Web client bundle (手写,零构建)
3
3
  *
4
- * 加载机制(借鉴 dsh-better-sidebar,DSH 0.1.1-rc.1 实测通过):
5
- * - dsh-client-modules 节点半扫描本包 package.json 的 dsh.client 声明 +
4
+ * 加载机制(借鉴 dsh-better-sidebar,DSH 0.1.1-rc.1 实测通过;注册 id
5
+ * 自 0.3.2 起改为从图行 URL 动态解析):
6
+ * - dsh-client-modules 节点半扫描挂载包 package.json 的 dsh.client 声明 +
6
7
  * exports["./client"],把本文件编入 window.__DSH_BOOT__ 并以
7
- * /plugins/paoding-config-ui/client.js 服务(图行 id = 包名)。
8
+ * /plugins/<挂载包名>/client.js 服务(图行 id = 挂载包名)。
8
9
  * - 浏览器内核为 manifest 中每个插件创建 loader 条目并激活,故本文件
9
- * 必然被拉取执行;__ModuleLoader__.load 的 id 必须等于包名(图行 id)。
10
+ * 必然被拉取执行;__ModuleLoader__.load 的 id 必须等于图行 id(挂载
11
+ * 包名),否则首次加载的后置校验(factories.has(图行 id))必失败 →
12
+ * import 报错 → 二次加载重复执行本文件 → 撞 "duplicate factory
13
+ * registration" 守卫。挂载名有二:本机 install.sh --config-ui 为
14
+ * 子包 paoding-config-ui(用户层 patch),发布 `dsh plugin add
15
+ * dsh-paoding` 为主包 dsh-paoding(bundle 层 patch)。
16
+ * - id 解析(0.3.3):宿主把多个插件的 client.js 逗号拼成一个合并
17
+ * bundle script 请求(/plugins/a/client.js,b/client.js&rev=…),
18
+ * "/plugins/" 全串只出现一次且后跟带 scope 的首行,任何
19
+ * /plugins/<名>/client.js 正则都必失配(0.3.2 的解析因此回退错名,
20
+ * 后置校验必失败);且合并 bundle 下所有插件共享同一 URL,无法
21
+ * 泛化定位"哪段是我"。挂载名是封闭二选一集合,且宿主保证本行
22
+ * URL <挂载名>/client.js 必在 script src 里(否则本代码不会被执行),
23
+ * 故直接在 currentScript.src 里找候选名,未命中回退主包名。
10
24
  * - factory 内 require() 只解析平台 seed 模块(react / cordis /
11
25
  * ui-slots / ui-primitives 与已物化模块);本 bundle 依赖 react 与
12
26
  * @deepseek-ai/dsh-client-ui-primitives。
@@ -24,8 +38,9 @@
24
38
  * (Button / Pill / 图标)+ 原生 checkbox / textarea(原生语义与焦点)。
25
39
  * 数据走同源 /api/paoding/*(Node 半注册,带浏览器信任围栏)。
26
40
  */
41
+ var __dshSrc = (document.currentScript && document.currentScript.src) || "";
27
42
  window.__ModuleLoader__.load({
28
- id: "paoding-config-ui",
43
+ id: __dshSrc.indexOf("paoding-config-ui/client.js") !== -1 ? "paoding-config-ui" : "dsh-paoding",
29
44
  factory: (require) => {
30
45
  var module = { exports: {} };
31
46
  var exports = module.exports;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paoding-config-ui",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "index.mjs",