dsh-plugin-panel 0.0.0-stage → 0.1.0

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 CHANGED
@@ -1,3 +1,65 @@
1
- # Temporary Holding Version
1
+ # 插件管理 · dsh-plugin-panel
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 给 DeepSeek Harness 右侧栏用的插件管理器。装上以后右侧栏会多一个「插件管理」标签,把已安装的插件列出来,并且告诉你每个插件到底从哪里进。
4
+
5
+ ![插件管理面板](docs/screenshot.png)
6
+
7
+ ## 它解决什么
8
+
9
+ 插件一多,问题不是「有没有装」,而是「装了我怎么打开」。有的插件在右侧栏,有的藏在设置页,有的只是加了一个工具、根本没有界面。翻半天找不到入口,是常态。
10
+
11
+ 这个面板把两件事放到一起:
12
+
13
+ - 你装了哪些插件
14
+ - 每个插件从哪进
15
+
16
+ ## 功能
17
+
18
+ - **按来源筛选**:用户安装 / 系统内置 / 全部。
19
+ - **标出入口位置**:右侧栏、设置、左侧菜单、无界面入口。列表按这个顺序排,有界面的在前,没有界面的沉底。
20
+ - **置顶**:常用插件钉在最前,背景加一层灰做区分。
21
+ - **两种视图**:列表(一行一个)和卡片(一行三列)。卡片模式下,打开、取消置顶这些按钮鼠标移上去才出现。
22
+ - **详情**:介绍、模块、入口、运行状态、包名、版本、来源、说明文档。
23
+ - **一键打开**:有右侧栏页面的插件,直接切到它的页面。
24
+ - **打开所在位置**:在访达里定位到这个插件的实际目录。
25
+ - **启停**:不必回设置页,详情里直接停用或启用。
26
+
27
+ ## 安装
28
+
29
+ ```bash
30
+ dsh plugin --profile desktop add dsh-plugin-panel
31
+ ```
32
+
33
+ 装完打开右侧栏,应该能看到「插件管理」标签。没出现就去设置 → 插件确认它已启用。
34
+
35
+ ## 使用
36
+
37
+ 1. 右侧栏点「插件管理」。
38
+ 2. 上面一排筛选:用户安装 / 系统内置 / 全部。
39
+ 3. 每个插件名字下面标着入口:`右侧栏`、`设置`、`左侧菜单`,或者 `无界面入口`。
40
+ 4. 点卡片看详情;点「打开」跳到那个插件的页面;点「打开所在位置」在访达里打开它的目录。
41
+
42
+ ## 说明文档从哪来
43
+
44
+ 优先读插件自己声明的 `meta.detail`,没有就读它的 `README.md`。两样都没有,才会显示「没有说明文档」。
45
+
46
+ ## 边界
47
+
48
+ - 只读扫描本机 profile 里的插件,不修改任何插件代码。
49
+ - 不记录插件调用历史,所以面板里没有「被调用多少次」这类数据。
50
+ - 纯界面插件不会出现在工具列表里,这是正常的。
51
+ - 置顶和视图选择存在浏览器本地,换机器不跟随。
52
+
53
+ ## 开发
54
+
55
+ ```bash
56
+ git clone https://github.com/jqlong17/dsh-plugins-ui.git
57
+ cd dsh-plugins-ui
58
+ node --check client.js
59
+ ```
60
+
61
+ 插件由 Host 半(`index.js`)和浏览器半(`client.js`)组成,入口在 `cordis.patch.yml`。
62
+
63
+ ## License
64
+
65
+ MIT
package/catalog.js ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Plugin list rules shared by the host catalog and tests.
3
+ *
4
+ * The browser bundle cannot import this file. client.js keeps a matching
5
+ * originOf / sort. If these rules change, update both and the tests.
6
+ *
7
+ * Active time is the package directory mtime, not a call log. DSH does not
8
+ * record when a plugin was invoked.
9
+ */
10
+
11
+ export function originOf(moduleName) {
12
+ const name = String(moduleName || '')
13
+ if (name.startsWith('cordis:')) return 'system'
14
+ if (name.startsWith('@deepseek-ai/')) return 'builtin'
15
+ return 'installed'
16
+ }
17
+
18
+
@@ -0,0 +1,13 @@
1
+ import test from 'node:test'
2
+ import assert from 'node:assert/strict'
3
+ import { originOf } from './catalog.js'
4
+
5
+ test('origin splits built-in, installed, and structural rows', () => {
6
+ assert.equal(originOf('@deepseek-ai/dsh-agent'), 'builtin')
7
+ assert.equal(originOf('dsh-promo'), 'installed')
8
+ assert.equal(originOf('file:///tmp/dsh-promo/lib/index.js'), 'installed')
9
+ assert.equal(originOf('cordis:include'), 'system')
10
+ assert.equal(originOf(''), 'installed')
11
+ })
12
+
13
+