@tinyforge/dsh-plugin-manager-wj 1.2.2 → 1.3.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-plugin-manager-wj contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,14 +1,26 @@
1
1
  # dsh-plugin-manager-wj
2
2
 
3
- **WJ Plugin Management** is the Web management layer for DeepSeek Harness's three-layer plugin-management design. It extends the independent WJ bundle and adds a management tab under **Settings → Plugins**.
3
+ [![npm version](https://img.shields.io/npm/v/@tinyforge/dsh-plugin-manager-wj.svg)](https://www.npmjs.com/package/@tinyforge/dsh-plugin-manager-wj)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@tinyforge/dsh-plugin-manager-wj.svg)](https://www.npmjs.com/package/@tinyforge/dsh-plugin-manager-wj)
5
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
4
6
 
5
- ![Plugin management interface](assets/plugin-management.webp)
7
+ **WJ Plugin Management** is the Web management layer for DeepSeek Harness's three-layer plugin-management design. It extends the independent WJ bundle and adds a management tab under **Settings → Plugins** whose four views switch without leaving the page: **Plugins**, **Configuration**, **Skills** and **MCP**.
6
8
 
7
9
  ## Features
8
10
 
11
+ - **Switchable views:** one tab strip switches between plugin health, configuration, the skill catalog, and MCP/tool inventory. A visited view stays mounted, so a configuration draft and the search term survive switching.
9
12
  - **Harness Core:** consumes the Host's plugin registry, configuration resolver, conflict detector, lifecycle/dependency manager, and settings services.
10
13
  - **Management API:** shows plugin state and health findings, configuration provenance, and tool/MCP runtime registrations. It can enable or disable profile-addressable plugins.
11
- - **Management UI:** filters findings and plugins, edits non-secret scalar settings through the existing schema-backed `configForms`, and previews supported duplicate-registration repairs.
14
+ - **Management UI:** filters the active view, edits non-secret scalar settings through the existing schema-backed `configForms`, and previews supported duplicate-registration repairs.
15
+
16
+ ### Views
17
+
18
+ | View | Source | Notes |
19
+ | --- | --- | --- |
20
+ | Plugins | `pluginManager.listPlugins`, `pluginManager.getHealthSnapshot` | Enable/disable, findings, and bounded repair previews. |
21
+ | Configuration | `configForms.describe`, `pluginManager.getConfigProvenance` | Secret fields are omitted; provenance shows layers and redacted identities. |
22
+ | Skills | `skills/list` through the active session | Session-scoped, so the catalog resolves from the session working directory and reloads automatically when the active session changes. Model-invocable and user-only entries are marked separately. |
23
+ | MCP | `pluginInventory.list` | MCP client connections plus the owners of registered tools. |
12
24
 
13
25
  Enabling or disabling a plugin writes through the Host's existing profile manager. A change can apply immediately, require a restart, be overridden by a higher-priority layer, or be refused by the Host. Repair previews are short-lived and become invalid when their finding changes. Selecting a low-risk repair with one eligible target executes it automatically; a high-risk repair first shows the exact effect and requires an explicit confirmation click. The current repair action disables the selected plugin involved in a duplicate global tool or MCP registration.
14
26
 
@@ -16,21 +28,44 @@ Configuration fields are discovered from each Host-provided schema. Secret field
16
28
 
17
29
  ## Requirements and limitations
18
30
 
19
- Use a Harness Host that exposes the plugin-management Remote, settings forms, and runtime inventory. Older Hosts may show inventory only or report diagnostics as unavailable; upgrade Harness to use management actions. Only plugins addressable through the active profile can be toggled. The UI does not install/remove packages, edit credentials, or run arbitrary repair commands.
31
+ Use a Harness Host that exposes the plugin-management Remote, settings forms, and runtime inventory. Older Hosts may show inventory only or report diagnostics as unavailable; upgrade Harness to use management actions. Only plugins addressable through the active profile can be toggled.
32
+
33
+ The Skills view needs two optional client services: the skills Remote and a live session. Both are read through `ctx.get` at call time rather than declared in `inject`, because a Client plugin that lists an optional service in `inject` stays pending on a Host without it — which would take the whole tab down. The view therefore degrades instead of disappearing: no Remote means an explanatory message, and no session means a waiting state that loads the catalog by itself as soon as a session appears or the active session changes, with no manual refresh. The namespace is discovered rather than hardcoded (`skills`, `skill`, `skillCatalog`, then any registered `remote.*` name containing "skill"), so a Host that renames it needs no code change. Skills are read-only here; the UI never loads skill bodies. The UI does not install/remove packages, edit credentials, or run arbitrary repair commands.
20
34
 
21
35
  ## Install
22
36
 
23
- 1. Make this package available to the Harness package resolver, for example from a local checkout or published package.
37
+ Published on npm as [`@tinyforge/dsh-plugin-manager-wj`](https://www.npmjs.com/package/@tinyforge/dsh-plugin-manager-wj):
38
+
39
+ ```sh
40
+ npm install @tinyforge/dsh-plugin-manager-wj
41
+ ```
42
+
43
+ 1. Make the package available to the Harness package resolver — install it through the Host's plugin manager by package name, or with the command above.
24
44
  2. Add the `@tinyforge/dsh-plugin-manager-wj` bundle to the target Web profile.
25
- 3. Open **Settings → Plugins → Plugin management**.
45
+ 3. Open **Settings → Plugins → Plugin management** and use the view tabs.
26
46
 
27
47
  `dsh.client` loads the browser client, and `cordis.patch.yml` inserts the bundle into the Host. Remove the bundle from the profile to remove the management tab. Core registry and management services do not depend on this UI bundle.
28
48
 
29
- This repository does not publish the package or configure a package registry.
49
+ ## Release
50
+
51
+ ```sh
52
+ npm test # node --test: 4 view tests + 3 patch checks
53
+ npm publish --access public # writes to registry.npmjs.org
54
+ ```
55
+
56
+ The package name is scoped, so publishing a new version needs maintainer access to the `@tinyforge` npm scope. Tag the published commit (`git tag v1.3.1 && git push --tags`) so the GitHub history matches the registry.
30
57
 
31
58
  ## Development
32
59
 
33
- The package is an ES module. `index.js` is the Host entry point and `client.js` contains the browser UI. Localized package metadata is in `locale/`; the UI's full dictionaries are registered in `client.js`. Run `node --test` for the bundle behavior check and `node --check client.js` for a syntax check. Harness API and Host behavior are implemented and tested in the `deepseek-harness` repository.
60
+ The package is an ES module. `index.js` is the Host entry point and `client.js` contains the browser UI. Localized package metadata is in `locale/`; the UI's full dictionaries are registered in `client.js`.
61
+
62
+ - `node --test` runs the bundle behavior checks in `tests/client.test.js`: the four views render and switch, the visited views stay mounted, search and enable/disable act on the active view, a secret configuration object stays out of the editor, opening a session loads the skill catalog without a refresh, a renamed skills namespace is discovered, and a transient catalog failure recovers from the inline retry.
63
+ - `node --check client.js` checks the browser bundle syntax.
64
+ - `tests/patch.test.js` parses `cordis.patch.yml` and asserts no plain scalar starts with a reserved YAML indicator — the scoped package name must stay quoted, or the Host rejects the bundle patch.
65
+ - `tests/harness.html` mounts the real `client.js` against fixtures in a browser and asserts the same behavior without Node; open it directly from disk and read the JSON report.
66
+ - `tests/parse-check.html` is a minimal browser smoke page: it confirms `client.js` parses and registers `settings.plugins.tab`.
67
+
68
+ Harness API and Host behavior are implemented and tested in the `deepseek-harness` repository.
34
69
 
35
70
  ## License
36
71
 
package/README.zh.md CHANGED
@@ -1,14 +1,26 @@
1
1
  # dsh-plugin-manager-wj
2
2
 
3
- **WJ 插件管理中心**是 DeepSeek Harness 三层插件管理架构的 Web 管理层,扩展现有独立 WJ bundle,并在 **设置 → 插件** 下添加管理标签页。
3
+ [![npm version](https://img.shields.io/npm/v/@tinyforge/dsh-plugin-manager-wj.svg)](https://www.npmjs.com/package/@tinyforge/dsh-plugin-manager-wj)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@tinyforge/dsh-plugin-manager-wj.svg)](https://www.npmjs.com/package/@tinyforge/dsh-plugin-manager-wj)
5
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
4
6
 
5
- ![插件管理界面](assets/plugin-management.webp)
7
+ **WJ 插件管理中心**是 DeepSeek Harness 三层插件管理架构的 Web 管理层,扩展现有独立 WJ bundle,并在 **设置 → 插件** 下添加管理标签页。页面内有 **插件 / 配置 / Skill / MCP** 四个视图,可直接切换,不需要离开当前页面。
6
8
 
7
9
  ## 功能
8
10
 
11
+ - **可切换视图:**一条标签栏在插件健康、配置、Skill 目录与 MCP/工具清单之间切换。已访问过的视图保持挂载,因此切换时配置草稿和搜索词都不会丢失。
9
12
  - **Harness Core:**使用 Host 提供的插件注册表、配置解析、冲突检测、生命周期与依赖管理,以及设置服务。
10
13
  - **Management API:**查看插件状态、健康诊断、配置来源和工具/MCP 运行时注册;可启停当前 Profile 能寻址的插件。
11
- - **Management UI:**搜索插件与诊断,通过现有 schema 表单 `configForms` 编辑非密钥标量配置,并预览受支持的重复注册修复。
14
+ - **Management UI:**按视图过滤,通过现有 schema 表单 `configForms` 编辑非密钥标量配置,并预览受支持的重复注册修复。
15
+
16
+ ### 视图
17
+
18
+ | 视图 | 数据来源 | 说明 |
19
+ | --- | --- | --- |
20
+ | 插件 | `pluginManager.listPlugins`、`pluginManager.getHealthSnapshot` | 启停、健康诊断与受控修复预览。 |
21
+ | 配置 | `configForms.describe`、`pluginManager.getConfigProvenance` | 隐藏密钥字段;来源只显示层名称与脱敏标识。 |
22
+ | Skill | 通过当前会话读取 `skills/list` | 按会话解析,目录来自会话工作目录,并在活动会话变化时自动重新加载;模型可调用与仅用户可调用分开标记。 |
23
+ | MCP | `pluginInventory.list` | MCP 客户端连接状态,以及工具注册的归属插件。 |
12
24
 
13
25
  启停操作通过 Host 现有 Profile 管理器写入。更改可能即时生效、需要重启、被更高优先级配置覆盖,或被 Host 拒绝。修复预览有时效,并会在诊断项变化后失效。用户选择修复后,只有恰好存在一个可操作目标的低风险修复会自动执行;高风险修复先显示具体影响,再要求用户明确确认。当前修复动作是停用参与全局工具名或 MCP 名称冲突的所选插件。
14
26
 
@@ -16,21 +28,44 @@
16
28
 
17
29
  ## 要求与限制
18
30
 
19
- 需要提供插件管理 Remote、设置表单和运行时清单的 Harness Host。较旧 Host 可能只能查看清单,或显示诊断不可用;升级 Harness 后才能执行管理操作。只有当前 Profile 可寻址的插件可以启停。此界面不安装或卸载包、不编辑凭据,也不运行任意修复命令。
31
+ 需要提供插件管理 Remote、设置表单和运行时清单的 Harness Host。较旧 Host 可能只能查看清单,或显示诊断不可用;升级 Harness 后才能执行管理操作。只有当前 Profile 可寻址的插件可以启停。
32
+
33
+ Skill 视图需要两个可选客户端服务:skills Remote 与一个存活会话。两者都在调用时通过 `ctx.get` 读取,不写进 `inject`——把可选服务写进 `inject` 会让客户端插件在缺少该服务的 Host 上一直处于 pending 状态,整个标签页都不会出现。因此该视图只会降级而不会消失:没有 Remote 时给出说明;没有会话时进入等待状态,一旦出现会话或活动会话切换,就自动加载目录,无需手动刷新。命名空间是探测出来的而不是写死的(依次尝试 `skills`、`skill`、`skillCatalog`,再扫描任何含 “skill” 的已注册 `remote.*`),所以 Host 改名也不需要改代码。Skill 在这里是只读的,界面不会加载 skill 正文。此界面不安装或卸载包、不编辑凭据,也不运行任意修复命令。
20
34
 
21
35
  ## 安装
22
36
 
23
- 1. 让 Harness package resolver 能加载本包,例如使用本地检出版本或已发布包。
37
+ 已发布到 npm:[`@tinyforge/dsh-plugin-manager-wj`](https://www.npmjs.com/package/@tinyforge/dsh-plugin-manager-wj)。
38
+
39
+ ```sh
40
+ npm install @tinyforge/dsh-plugin-manager-wj
41
+ ```
42
+
43
+ 1. 让 Harness package resolver 能加载本包 —— 在 Host 插件管理里按包名安装,或执行上面的命令。
24
44
  2. 将 `@tinyforge/dsh-plugin-manager-wj` bundle 加入目标 Web profile。
25
- 3. 打开 **设置 → 插件 → 插件管理**。
45
+ 3. 打开 **设置 → 插件 → 插件管理**,使用视图标签切换。
26
46
 
27
47
  `dsh.client` 会加载浏览器客户端,`cordis.patch.yml` 会将 bundle 插入 Host。从 profile 移除该 bundle 即可移除管理标签页。Harness 核心注册表和管理服务不依赖此 UI bundle。
28
48
 
29
- 本仓库不会自动发布包或配置 package registry。
49
+ ## 发布
50
+
51
+ ```sh
52
+ npm test # node --test:4 个视图测试 + 3 个 patch 检查
53
+ npm publish --access public # 发布到 registry.npmjs.org
54
+ ```
55
+
56
+ 包名带 scope,发布新版本需要 `@tinyforge` npm scope 的维护者权限。发布后给对应提交打 tag(`git tag v1.3.1 && git push --tags`),让 GitHub 历史与 registry 版本对应。
30
57
 
31
58
  ## 开发
32
59
 
33
- 本包使用 ES module。`index.js` 是 Host 入口,`client.js` 是浏览器界面。本地化包元数据位于 `locale/`,界面完整词典在 `client.js` 中注册。运行 `node --test` 检查 bundle 行为,运行 `node --check client.js` 检查语法。Harness API 和 Host 行为在 `deepseek-harness` 仓库实现并测试。
60
+ 本包使用 ES module。`index.js` 是 Host 入口,`client.js` 是浏览器界面。本地化包元数据位于 `locale/`,界面完整词典在 `client.js` 中注册。
61
+
62
+ - `node --test` 运行 `tests/client.test.js` 的行为检查:四个视图渲染并可切换、访问过的视图保持挂载、搜索与启停作用于当前视图、密钥配置对象不会进入编辑器、打开会话后无需刷新即加载 Skill 目录、改名后的 skills 命名空间能被发现,以及瞬时目录失败可就地重试恢复。
63
+ - `node --check client.js` 检查浏览器 bundle 语法。
64
+ - `tests/patch.test.js` 解析 `cordis.patch.yml`,确保没有裸标量以 YAML 保留字符开头 —— 带 scope 的包名必须保持加引号,否则 Host 会拒绝该 bundle patch。
65
+ - `tests/harness.html` 在浏览器中用测试夹具挂载真实 `client.js`,不依赖 Node 也能断言同一批行为;直接从磁盘打开并读取 JSON 报告。
66
+ - `tests/parse-check.html` 是最小的浏览器冒烟页:确认 `client.js` 能解析并注册 `settings.plugins.tab`。
67
+
68
+ Harness API 和 Host 行为在 `deepseek-harness` 仓库实现并测试。
34
69
 
35
70
  ## 许可证
36
71
 
package/client.js CHANGED
@@ -1,9 +1,12 @@
1
+ // SPDX-License-Identifier: MIT
1
2
  window.__ModuleLoader__.load({
2
3
  id: 'dsh-plugin-manager-wj',
3
4
  factory(require) {
4
5
  const React = require('react')
5
6
  const h = React.createElement
6
7
  const NS = 'settings.pluginManagerWj'
8
+ const TAB_ORDER = ['plugins', 'config', 'skill', 'mcp']
9
+ const TAB_KEY = 'dsh-plugin-manager-wj/tab'
7
10
 
8
11
  function unwrap(result, name) {
9
12
  if (!result || result.ok !== true) throw new Error(`${name}: ${result?.error?.message ?? 'unavailable'}`)
@@ -51,8 +54,24 @@ window.__ModuleLoader__.load({
51
54
  return source ? `${t(source.layer)} · ${source.identity}` : t('sourceUnknown')
52
55
  }
53
56
 
57
+ const SEVERITY_KEY = { error: 'severityError', warning: 'severityWarning', info: 'severityInfo' }
58
+
59
+ function readStoredTab() {
60
+ try {
61
+ const stored = window.localStorage?.getItem(TAB_KEY)
62
+ return TAB_ORDER.includes(stored) ? stored : 'plugins'
63
+ } catch (_error) {
64
+ return 'plugins'
65
+ }
66
+ }
67
+
68
+ function storeTab(id) {
69
+ try { window.localStorage?.setItem(TAB_KEY, id) } catch (_error) { /* private mode: selection stays in memory */ }
70
+ }
71
+
54
72
  const styles = {
55
- page: { display: 'grid', gap: 20, maxWidth: 1080, color: 'CanvasText' },
73
+ root: { display: 'grid', gap: 16, maxWidth: 1080, color: 'CanvasText' },
74
+ page: { display: 'grid', gap: 16 },
56
75
  header: { display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', gap: 16, flexWrap: 'wrap' },
57
76
  eyebrow: { margin: '0 0 5px', color: 'GrayText', fontSize: 12, fontWeight: 650, letterSpacing: '.07em', textTransform: 'uppercase' },
58
77
  title: { margin: 0, fontSize: 23, lineHeight: 1.25, fontWeight: 680 },
@@ -65,6 +84,10 @@ window.__ModuleLoader__.load({
65
84
  search: { flex: '1 1 240px', minWidth: 0, height: 38, padding: '0 12px', border: '1px solid color-mix(in srgb, CanvasText 17%, Canvas)', borderRadius: 9, background: 'Canvas', color: 'CanvasText', font: 'inherit' },
66
85
  button: { minHeight: 36, padding: '7px 13px', border: '1px solid color-mix(in srgb, CanvasText 18%, Canvas)', borderRadius: 9, background: 'Canvas', color: 'CanvasText', font: 'inherit', fontWeight: 600, cursor: 'pointer' },
67
86
  primary: { borderColor: 'color-mix(in srgb, Highlight 45%, Canvas)', background: 'Highlight', color: 'HighlightText' },
87
+ tabs: { display: 'flex', gap: 4, flexWrap: 'wrap', padding: 4, border: '1px solid color-mix(in srgb, CanvasText 12%, Canvas)', borderRadius: 13, background: 'ButtonFace' },
88
+ tab: { display: 'inline-flex', alignItems: 'center', gap: 7, minHeight: 34, padding: '6px 13px', border: '1px solid transparent', borderRadius: 9, background: 'transparent', color: 'GrayText', font: 'inherit', fontSize: 13, fontWeight: 620, cursor: 'pointer' },
89
+ tabActive: { borderColor: 'color-mix(in srgb, CanvasText 16%, Canvas)', background: 'Canvas', color: 'CanvasText' },
90
+ tabCount: { minWidth: 20, padding: '0 6px', borderRadius: 999, background: 'color-mix(in srgb, CanvasText 8%, Canvas)', color: 'GrayText', fontSize: 11, fontWeight: 650, lineHeight: '18px', textAlign: 'center', fontVariantNumeric: 'tabular-nums' },
68
91
  section: { overflow: 'hidden', border: '1px solid color-mix(in srgb, CanvasText 12%, Canvas)', borderRadius: 13, background: 'Canvas' },
69
92
  sectionHead: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 12, padding: '13px 16px', borderBottom: '1px solid color-mix(in srgb, CanvasText 10%, Canvas)', background: 'ButtonFace' },
70
93
  sectionTitle: { margin: 0, fontSize: 15, fontWeight: 670 },
@@ -82,6 +105,9 @@ window.__ModuleLoader__.load({
82
105
  field: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 210px), 1fr))', alignItems: 'center', gap: 10, padding: '9px 0', borderBottom: '1px solid color-mix(in srgb, CanvasText 8%, Canvas)' },
83
106
  input: { boxSizing: 'border-box', width: '100%', minWidth: 0, minHeight: 34, padding: '6px 9px', border: '1px solid color-mix(in srgb, CanvasText 16%, Canvas)', borderRadius: 8, background: 'Canvas', color: 'CanvasText', font: 'inherit' },
84
107
  muted: { color: 'GrayText', fontSize: 11, lineHeight: 1.4 },
108
+ skillName: { margin: 0, fontSize: 14, fontWeight: 700, fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace', overflowWrap: 'anywhere' },
109
+ body: { margin: 0, fontSize: 13, lineHeight: 1.55, color: 'CanvasText' },
110
+ path: { fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace', overflowWrap: 'anywhere' },
85
111
  }
86
112
 
87
113
  function FieldEditor({ field, view, form, provenance, t }) {
@@ -166,19 +192,195 @@ window.__ModuleLoader__.load({
166
192
  view.secrets?.length ? h('p', { style: styles.muted }, t('secretsHidden', { count: String(view.secrets.length) })) : null)
167
193
  }
168
194
 
169
- function InventoryTab({ list, manager, forms, t }) {
195
+ function Section({ id, title, count, empty, children }) {
196
+ const body = children ?? (empty === undefined || empty === null ? null : typeof empty === 'string' ? h('p', { style: styles.message }, empty) : empty)
197
+ return h('section', { key: id, style: styles.section, 'aria-labelledby': `${id}-heading` },
198
+ h('div', { style: styles.sectionHead },
199
+ h('h2', { id: `${id}-heading`, style: styles.sectionTitle }, title),
200
+ count === undefined ? null : h('span', { style: styles.count }, count)),
201
+ body)
202
+ }
203
+
204
+ function TabBar({ tabs, active, onSelect, label }) {
205
+ return h('div', { role: 'tablist', 'aria-label': label, style: styles.tabs },
206
+ tabs.map(item => h('button', {
207
+ key: item.id,
208
+ type: 'button',
209
+ role: 'tab',
210
+ id: `wj-tab-${item.id}`,
211
+ 'aria-selected': String(item.id === active),
212
+ 'aria-controls': `wj-panel-${item.id}`,
213
+ tabIndex: item.id === active ? 0 : -1,
214
+ style: { ...styles.tab, ...(item.id === active ? styles.tabActive : {}) },
215
+ onClick: () => onSelect(item.id),
216
+ onKeyDown: event => {
217
+ const step = event.key === 'ArrowRight' ? 1 : event.key === 'ArrowLeft' ? -1 : event.key === 'Home' ? -tabs.length : event.key === 'End' ? tabs.length : 0
218
+ if (!step) return
219
+ event.preventDefault()
220
+ const index = tabs.findIndex(entry => entry.id === active)
221
+ const next = tabs[(index + step + tabs.length) % tabs.length]
222
+ onSelect(next.id)
223
+ try { event.currentTarget.ownerDocument?.getElementById(`wj-tab-${next.id}`)?.focus() } catch (_error) { /* focus stays put when the document is unavailable */ }
224
+ },
225
+ }, h('span', null, item.label), item.count === undefined ? null : h('span', { style: styles.tabCount }, String(item.count)))))
226
+ }
227
+
228
+ function PluginsPanel({ pluginRows, findings, plugins, query, busy, preview, onToggle, onPreview, onApplyPreview, onCancelPreview, t }) {
229
+ const name = row => row.meta?.title?.en ?? row.meta?.title?.zh ?? row.moduleName
230
+ const severity = value => t(SEVERITY_KEY[value] ?? 'severityInfo')
231
+ return h('div', { style: styles.page },
232
+ h('p', { style: styles.description }, t('pluginsIntro')),
233
+ preview ? h('section', { style: { ...styles.section, padding: 16 }, 'aria-label': t('repairPreview') },
234
+ h('h2', { style: styles.sectionTitle }, t('repairPreview')),
235
+ h('p', { style: styles.meta }, `${t('target')}: ${plugins.find(row => row.entryId === preview.targetEntryId)?.moduleName ?? preview.targetEntryId}`),
236
+ h('p', { style: styles.meta }, `${t('effect')}: ${t('disablePlugin')}`),
237
+ h('p', { style: styles.meta }, `${t('risk')}: ${t(preview.risk)} · ${t(preview.reversible ? 'reversible' : 'notReversible')}`),
238
+ h('div', { style: { display: 'flex', gap: 8, flexWrap: 'wrap' } },
239
+ h('button', { type: 'button', style: { ...styles.button, ...styles.primary }, disabled: busy === preview.previewId, onClick: () => { void onApplyPreview() } }, t(preview.requiresConfirmation ? 'confirmRepair' : 'applyRepair')),
240
+ h('button', { type: 'button', style: styles.button, onClick: onCancelPreview }, t('cancel')))) : null,
241
+ h(Section, { id: 'findings', title: t('findingsTitle'), count: `${findings.length} ${t('items')}`, empty: t(query ? 'noMatches' : 'noRows') },
242
+ findings.length ? h('ul', { style: styles.list }, findings.map(finding => {
243
+ const severe = finding.severity === 'error'
244
+ const affected = finding.affectedEntryIds.map(id => plugins.find(plugin => plugin.entryId === id)?.moduleName ?? id).join(', ')
245
+ return h('li', { key: finding.id, style: styles.row },
246
+ h('div', { style: styles.rowHead },
247
+ h('div', null,
248
+ h('h3', { style: styles.rowTitle }, t(finding.code)),
249
+ h('div', { style: styles.meta }, h('span', null, `${t('severity')}: ${severity(finding.severity)}`), affected ? h('span', null, `${t('affected')}: ${affected}`) : null)),
250
+ h('span', { style: { ...styles.badge, ...(severe ? styles.error : styles.warning) } }, severity(finding.severity))),
251
+ finding.evidence?.name || finding.evidence?.serverName || finding.evidence?.packageName
252
+ ? h('div', { style: styles.meta }, `${t('evidence')}: ${finding.evidence.name ?? finding.evidence.serverName ?? finding.evidence.packageName}`)
253
+ : null,
254
+ finding.remediationEntryIds.map(id => {
255
+ const target = plugins.find(plugin => plugin.entryId === id)
256
+ if (!target) return null
257
+ return h('button', { key: id, type: 'button', style: styles.button, disabled: busy === finding.id, onClick: () => { void onPreview(finding, id) } }, t('previewRepair', { name: target.moduleName }))
258
+ }))
259
+ })) : null),
260
+ h(Section, { id: 'plugins', title: t('pluginsTitle'), count: `${pluginRows.length} ${t('items')}`, empty: t(query ? 'noMatches' : 'noRows') },
261
+ pluginRows.length ? h('ul', { style: styles.list }, pluginRows.map(row => h('li', { key: row.entryId, style: styles.row },
262
+ h('div', { style: styles.rowHead },
263
+ h('div', null,
264
+ h('h3', { style: styles.rowTitle }, name(row)),
265
+ h('div', { style: styles.meta }, h('span', null, row.entryId), h('span', null, t(row.fiberPhase ?? 'notRunning')), row.readOnlyReason ? h('span', null, t(row.readOnlyReason)) : null)),
266
+ h('button', {
267
+ type: 'button', style: { ...styles.button, ...(row.enabled ? styles.primary : {}) },
268
+ 'aria-pressed': String(row.enabled), disabled: busy === row.entryId || row.readOnlyReason !== undefined,
269
+ onClick: () => { void onToggle(row) },
270
+ }, t(row.enabled ? 'disable' : 'enable'))),
271
+ row.diagnostic ? h('p', { style: styles.meta }, t('activationFailed')) : null))) : null))
272
+ }
273
+
274
+ function ConfigPanel({ settings, settingsReady, plugins, forms, provenance, t }) {
275
+ const namespaces = settings?.namespaces ?? []
276
+ return h('div', { style: styles.page },
277
+ h('p', { style: styles.description }, t('configIntro')),
278
+ h(Section, {
279
+ id: 'configuration', title: t('configurationTitle'),
280
+ count: `${namespaces.length} ${t('items')}`,
281
+ empty: settingsReady ? t('configEmpty') : t('configUnavailable'),
282
+ }, namespaces.length ? h('ul', { style: styles.list }, namespaces.map(view => h('li', { key: view.ns, style: styles.row },
283
+ h('div', { style: styles.rowTitle }, plugins.find(row => row.entryId === view.ns)?.meta?.title?.en ?? view.ns),
284
+ h(ConfigSection, { view, forms, provenance, t })))) : null))
285
+ }
286
+
287
+ function SkillPanel({ skills, needle, onRetry, t }) {
288
+ const items = skills?.kind === 'ready' ? skills.items : []
289
+ const matches = values => !needle || values.filter(Boolean).some(value => String(value).toLocaleLowerCase().includes(needle))
290
+ const rows = items.filter(skill => matches([skill.name, skill.description, skill.whenToUse, skill.path]))
291
+ const copy = skills?.kind === 'unsupported' ? t('skillUnsupported')
292
+ : skills?.kind === 'noSession' ? t('skillNoSession')
293
+ : skills?.kind === 'error' ? t('skillError')
294
+ : skills?.kind === 'loading' ? t('loadingSkills')
295
+ : needle ? t('noMatches') : t('skillEmpty')
296
+ const retryable = skills?.kind === 'error' || skills?.kind === 'noSession'
297
+ const empty = h('div', { style: { display: 'grid', gap: 10, justifyItems: 'start' } },
298
+ h('p', { style: styles.message }, copy),
299
+ retryable ? h('button', { type: 'button', style: styles.button, onClick: () => { if (onRetry) onRetry() } }, t('retry')) : null)
300
+ const skillRow = skill => h('li', { key: `${skill.name}:${skill.path ?? ''}`, style: styles.row },
301
+ h('div', { style: styles.rowHead },
302
+ h('div', { style: { display: 'grid', gap: 5 } },
303
+ h('h3', { style: styles.skillName }, `/${skill.name}`),
304
+ skill.description ? h('p', { style: styles.body }, skill.description) : null,
305
+ h('div', { style: styles.meta },
306
+ skill.whenToUse ? h('span', null, `${t('skillWhenToUse')}: ${skill.whenToUse}`) : null,
307
+ skill.path ? h('span', { style: styles.path }, `${t('skillPath')}: ${skill.path}`) : null)),
308
+ h('span', { style: { ...styles.badge, ...(skill.modelInvocable ? {} : styles.warning) } },
309
+ t(skill.modelInvocable ? 'skillModelInvocable' : 'skillUserOnly'))))
310
+ return h('div', { style: styles.page },
311
+ h('p', { style: styles.description }, t('skillIntro')),
312
+ h(Section, { id: 'skills', title: t('skillsTitle'), count: `${rows.length} ${t('items')}`, empty },
313
+ rows.length ? h('ul', { style: styles.list }, rows.map(skillRow)) : null))
314
+ }
315
+
316
+ function McpPanel({ inventory, mcpRows, toolRows, needle, t }) {
317
+ const owner = row => row.owner ? `${row.owner.moduleName} (${row.owner.entryId})` : '—'
318
+ return h('div', { style: styles.page },
319
+ h('p', { style: styles.description }, t('mcpIntro')),
320
+ h(Section, { id: 'mcp', title: t('mcp'), count: `${mcpRows.length} ${t('items')}`, empty: t(needle ? 'noMatches' : 'noRows') },
321
+ mcpRows.length ? h('ul', { style: styles.list }, mcpRows.map(row => h('li', { key: `${row.serverName}:${row.owner?.entryId ?? ''}`, style: styles.row },
322
+ h('div', { style: styles.rowHead },
323
+ h('h3', { style: styles.rowTitle }, row.serverName),
324
+ h('span', { style: { ...styles.badge, ...(row.state === 'connected' ? {} : styles.warning) } }, t(row.state))),
325
+ h('div', { style: styles.meta }, `${t('owner')}: ${owner(row)}`),
326
+ row.toolNames?.length ? h('div', { style: styles.meta }, `${t('toolNames')}: ${row.toolNames.join(', ')}`) : null))) : null),
327
+ h(Section, { id: 'tools', title: t('tools'), count: `${toolRows.length} ${t('items')}`, empty: t(needle ? 'noMatches' : 'noRows') },
328
+ toolRows.length ? h('ul', { style: styles.list }, toolRows.map(row => h('li', { key: `${row.name}:${row.owner?.entryId ?? ''}`, style: styles.row },
329
+ h('h3', { style: styles.rowTitle }, row.name),
330
+ h('div', { style: styles.meta }, `${t('owner')}: ${owner(row)} · ${t(row.scope)}`)))) : null),
331
+ inventory ? null : h('p', { style: styles.message }, t('inventoryUnavailable')))
332
+ }
333
+
334
+ function ManagerPage({ list, manager, forms, loadSkills, readSessionId, watchSessions, t }) {
335
+ const initialTab = readStoredTab()
336
+ const [tab, setTab] = React.useState(initialTab)
337
+ const [visited, setVisited] = React.useState([initialTab])
170
338
  const [state, setState] = React.useState({ kind: 'loading' })
171
339
  const [query, setQuery] = React.useState('')
172
340
  const [revision, setRevision] = React.useState(0)
173
341
  const [busy, setBusy] = React.useState('')
174
342
  const [notice, setNotice] = React.useState('')
175
343
  const [preview, setPreview] = React.useState(null)
344
+ const [sessionId, setSessionId] = React.useState(() => typeof readSessionId === 'function' ? readSessionId() : undefined)
345
+ const [skills, setSkills] = React.useState({ kind: 'loading' })
346
+ const [skillsRevision, setSkillsRevision] = React.useState(0)
347
+
348
+ // The catalog follows the active session: opening one (or switching) reloads it without a
349
+ // manual refresh, which is what a Host that requires a live session for `skills/list` needs.
350
+ React.useEffect(() => {
351
+ if (typeof readSessionId !== 'function') return undefined
352
+ const sync = () => {
353
+ try { setSessionId(readSessionId()) } catch (_error) { /* keep the last known session */ }
354
+ }
355
+ sync()
356
+ const off = typeof watchSessions === 'function' ? watchSessions(sync) : undefined
357
+ return typeof off === 'function' ? off : undefined
358
+ }, [readSessionId, watchSessions])
359
+
360
+ React.useEffect(() => {
361
+ let live = true
362
+ if (!sessionId) {
363
+ setSkills({ kind: 'noSession' })
364
+ return () => { live = false }
365
+ }
366
+ if (typeof loadSkills !== 'function') {
367
+ setSkills({ kind: 'unsupported' })
368
+ return () => { live = false }
369
+ }
370
+ setSkills({ kind: 'loading' })
371
+ Promise.resolve()
372
+ .then(() => loadSkills(sessionId))
373
+ .then(result => { if (live) setSkills(result ?? { kind: 'error' }) })
374
+ .catch(() => { if (live) setSkills({ kind: 'error' }) })
375
+ return () => { live = false }
376
+ }, [loadSkills, sessionId, skillsRevision])
176
377
 
177
378
  React.useEffect(() => {
178
379
  let live = true
179
380
  Promise.resolve().then(async () => {
180
381
  const [inventoryResult, pluginResult, healthResult, settingsResult] = await Promise.allSettled([
181
- list(), manager?.listPlugins ? manager.listPlugins() : Promise.reject(new Error('unavailable')),
382
+ list(),
383
+ manager?.listPlugins ? manager.listPlugins() : Promise.reject(new Error('unavailable')),
182
384
  manager?.getHealthSnapshot ? manager.getHealthSnapshot() : Promise.reject(new Error('unavailable')),
183
385
  forms?.describe ? forms.describe().ensure().then(() => forms.describe().getSnapshot()) : Promise.reject(new Error('unavailable')),
184
386
  ])
@@ -201,38 +403,37 @@ window.__ModuleLoader__.load({
201
403
  }
202
404
  }))
203
405
  }
204
- if (live) setState({ kind: 'ready', inventory, plugins, health, settings, provenance })
406
+ if (live) setState({ kind: 'ready', snapshot: { inventory, plugins, health, settings, provenance } })
205
407
  }).catch(() => {
206
- if (live) setState(previous => ({
207
- kind: 'error',
208
- snapshot: previous.snapshot ?? (previous.kind === 'ready' ? previous : undefined),
209
- }))
408
+ if (live) setState(previous => ({ kind: 'error', snapshot: previous.snapshot }))
210
409
  })
211
410
  return () => { live = false }
212
411
  }, [list, manager, forms, revision])
213
412
 
214
413
  const refresh = () => {
215
- setState(current => ({ kind: 'loading', snapshot: current.snapshot ?? current }))
414
+ setState(current => ({ kind: 'loading', snapshot: current.snapshot }))
216
415
  setRevision(value => value + 1)
416
+ setSkillsRevision(value => value + 1)
417
+ }
418
+
419
+ const select = id => {
420
+ setTab(id)
421
+ setVisited(previous => previous.includes(id) ? previous : [...previous, id])
422
+ storeTab(id)
423
+ }
424
+
425
+ const applyNotice = result => {
426
+ setNotice(result.application === 'applied' ? t('changeApplied')
427
+ : result.application === 'restart-required' ? t('restartRequired')
428
+ : result.application === 'overridden' ? t('changeOverridden')
429
+ : t('changeFailed'))
217
430
  }
218
- const current = state.snapshot ?? (state.kind === 'ready' ? state : undefined)
219
- const inventory = current?.inventory
220
- const plugins = current?.plugins ?? []
221
- const health = current?.health
222
- const settings = current?.settings
223
- const needle = query.trim().toLocaleLowerCase()
224
- const matches = values => !needle || values.filter(Boolean).some(value => String(value).toLocaleLowerCase().includes(needle))
225
- const pluginRows = plugins.filter(row => matches([row.moduleName, row.entryId, row.meta?.title, row.meta?.description]))
226
- const findings = (health?.findings ?? []).filter(row => matches([row.id, row.code, row.evidence?.name, row.evidence?.serverName, row.evidence?.packageName]))
227
- const runtimeTools = (inventory?.toolRegistrations ?? []).filter(row => matches([row.name, row.owner?.moduleName, row.owner?.entryId]))
228
- const runtimeClients = (inventory?.mcpClients ?? []).filter(row => matches([row.serverName, row.state, row.owner?.moduleName, ...(row.toolNames ?? [])]))
229
431
 
230
432
  const toggle = async row => {
231
433
  setBusy(row.entryId)
232
434
  setNotice('')
233
435
  try {
234
- const result = unwrap(await manager.setPluginEnabled(row.entryId, !row.enabled), 'pluginManager.setPluginEnabled')
235
- setNotice(result.application === 'applied' ? t('changeApplied') : result.application === 'restart-required' ? t('restartRequired') : result.application === 'overridden' ? t('changeOverridden') : t('changeFailed'))
436
+ applyNotice(unwrap(await manager.setPluginEnabled(row.entryId, !row.enabled), 'pluginManager.setPluginEnabled'))
236
437
  refresh()
237
438
  } catch (_error) {
238
439
  setNotice(t('changeFailed'))
@@ -248,8 +449,7 @@ window.__ModuleLoader__.load({
248
449
  const next = unwrap(await manager.previewRemediation({ findingId: finding.id, targetEntryId }), 'pluginManager.previewRemediation')
249
450
  if (next.requiresConfirmation) setPreview(next)
250
451
  else {
251
- const result = unwrap(await manager.applyRemediation(next.previewId, false), 'pluginManager.applyRemediation')
252
- setNotice(result.application === 'applied' ? t('changeApplied') : result.application === 'restart-required' ? t('restartRequired') : result.application === 'overridden' ? t('changeOverridden') : t('changeFailed'))
452
+ applyNotice(unwrap(await manager.applyRemediation(next.previewId, false), 'pluginManager.applyRemediation'))
253
453
  refresh()
254
454
  }
255
455
  } catch (_error) {
@@ -263,8 +463,7 @@ window.__ModuleLoader__.load({
263
463
  if (!preview) return
264
464
  setBusy(preview.previewId)
265
465
  try {
266
- const result = unwrap(await manager.applyRemediation(preview.previewId, preview.requiresConfirmation), 'pluginManager.applyRemediation')
267
- setNotice(result.application === 'applied' ? t('changeApplied') : result.application === 'restart-required' ? t('restartRequired') : result.application === 'overridden' ? t('changeOverridden') : t('changeFailed'))
466
+ applyNotice(unwrap(await manager.applyRemediation(preview.previewId, preview.requiresConfirmation), 'pluginManager.applyRemediation'))
268
467
  setPreview(null)
269
468
  refresh()
270
469
  } catch (_error) {
@@ -276,108 +475,121 @@ window.__ModuleLoader__.load({
276
475
  }
277
476
  }
278
477
 
279
- const section = (id, title, items, render) => h('section', { key: id, style: styles.section, 'aria-labelledby': `${id}-heading` },
280
- h('div', { style: styles.sectionHead },
281
- h('h2', { id: `${id}-heading`, style: styles.sectionTitle }, title),
282
- h('span', { style: styles.count }, `${items.length} ${t('items')}`)),
283
- items.length ? h('ul', { style: styles.list }, items.map(render)) : h('p', { style: styles.message }, t(needle ? 'noMatches' : 'noRows')))
478
+ const current = state.snapshot
479
+ const inventory = current?.inventory
480
+ const plugins = current?.plugins ?? []
481
+ const health = current?.health
482
+ const settings = current?.settings
483
+ const needle = query.trim().toLocaleLowerCase()
484
+ const matches = values => !needle || values.filter(Boolean).some(value => String(value).toLocaleLowerCase().includes(needle))
485
+ const pluginRows = plugins.filter(row => matches([row.moduleName, row.entryId, row.meta?.title, row.meta?.description]))
486
+ const findings = (health?.findings ?? []).filter(row => matches([row.id, row.code, row.evidence?.name, row.evidence?.serverName, row.evidence?.packageName]))
487
+ const toolRows = (inventory?.toolRegistrations ?? []).filter(row => matches([row.name, row.owner?.moduleName, row.owner?.entryId]))
488
+ const mcpRows = (inventory?.mcpClients ?? []).filter(row => matches([row.serverName, row.state, row.owner?.moduleName, ...(row.toolNames ?? [])]))
284
489
 
285
- const owner = row => row.owner ? `${row.owner.moduleName} (${row.owner.entryId})` : '—'
286
- const findingCard = finding => {
287
- const severe = finding.severity === 'error'
288
- const affected = finding.affectedEntryIds.map(id => plugins.find(plugin => plugin.entryId === id)?.moduleName ?? id).join(', ')
289
- return h('li', { key: finding.id, style: styles.row },
290
- h('div', { style: styles.rowHead },
291
- h('div', null,
292
- h('h3', { style: styles.rowTitle }, t(finding.code)),
293
- h('div', { style: styles.meta }, h('span', null, `${t('severity')}: ${t(finding.severity)}`), affected ? h('span', null, `${t('affected')}: ${affected}`) : null)),
294
- h('span', { style: { ...styles.badge, ...(severe ? styles.error : styles.warning) } }, t(finding.severity))),
295
- finding.evidence?.name || finding.evidence?.serverName || finding.evidence?.packageName
296
- ? h('div', { style: styles.meta }, `${t('evidence')}: ${finding.evidence.name ?? finding.evidence.serverName ?? finding.evidence.packageName}`)
297
- : null,
298
- finding.remediationEntryIds.map(id => {
299
- const target = plugins.find(plugin => plugin.entryId === id)
300
- if (!target) return null
301
- return h('button', { key: id, type: 'button', style: styles.button, disabled: busy === finding.id, onClick: () => { void makePreview(finding, id) } }, t('previewRepair', { name: target.moduleName }))
302
- }))
303
- }
490
+ const tabs = [
491
+ { id: 'plugins', label: t('tabs.plugins'), count: plugins.length },
492
+ { id: 'config', label: t('tabs.config'), count: settings?.namespaces?.length },
493
+ { id: 'skill', label: t('tabs.skill'), count: skills?.kind === 'ready' ? skills.items.length : undefined },
494
+ { id: 'mcp', label: t('tabs.mcp'), count: inventory?.mcpClients?.length },
495
+ ]
496
+
497
+ const panel = (id, children) => visited.includes(id) ? h('div', {
498
+ key: id,
499
+ role: 'tabpanel',
500
+ id: `wj-panel-${id}`,
501
+ 'aria-labelledby': `wj-tab-${id}`,
502
+ hidden: id !== tab,
503
+ style: id === tab ? styles.page : { display: 'none' },
504
+ }, children) : null
304
505
 
305
- return h('div', { style: styles.page, 'aria-busy': state.kind === 'loading' },
506
+ const stats = [
507
+ [health?.pluginCount ?? plugins.length, 'plugins'],
508
+ [health?.enabledCount ?? plugins.filter(row => row.enabled).length, 'enabled'],
509
+ [health ? health.findings.length : '—', 'findings'],
510
+ [skills?.kind === 'ready' ? skills.items.length : '—', 'skills'],
511
+ [inventory?.mcpClients?.length ?? '—', 'mcpStat'],
512
+ ]
513
+ const showStats = state.kind === 'ready' && current !== undefined
514
+
515
+ return h('div', { style: styles.root, 'aria-busy': state.kind === 'loading' },
306
516
  h('header', { style: styles.header },
307
517
  h('div', null,
308
518
  h('p', { style: styles.eyebrow }, t('eyebrow')),
309
519
  h('h1', { style: styles.title }, t('heading')),
310
520
  h('p', { style: styles.description }, t('description'))),
311
- health ? h('div', { style: styles.stats, 'aria-label': t('summary') },
312
- [[health.pluginCount, 'plugins'], [health.enabledCount, 'enabled'], [health.findings.length, 'findings']].map(([value, label]) => h('div', { key: label, style: styles.stat }, h('span', { style: styles.statValue }, String(value)), h('span', { style: styles.statLabel }, t(label))))
313
- ) : null),
521
+ showStats ? h('div', { style: styles.stats, 'aria-label': t('summary') },
522
+ stats.map(([value, label]) => h('div', { key: label, style: styles.stat },
523
+ h('span', { style: styles.statValue }, String(value)),
524
+ h('span', { style: styles.statLabel }, t(label))))) : null),
314
525
  h('div', { style: styles.toolbar },
315
526
  h('input', { type: 'search', value: query, 'aria-label': t('search'), placeholder: t('search'), onChange: event => setQuery(event.target.value), style: styles.search }),
316
527
  h('button', { type: 'button', onClick: refresh, style: styles.button, disabled: state.kind === 'loading' }, state.kind === 'loading' ? t('loadingShort') : t('refresh'))),
528
+ h(TabBar, { tabs, active: tab, onSelect: select, label: t('viewsLabel') }),
317
529
  state.kind === 'loading' && !inventory ? h('p', { role: 'status', style: styles.message }, t('loading')) : null,
318
- state.kind === 'error' ? h('div', { role: 'alert', style: styles.section }, h('p', { style: styles.message }, t('error')), h('button', { type: 'button', style: styles.button, onClick: refresh }, t('retry'))) : null,
530
+ state.kind === 'error' ? h('div', { role: 'alert', style: styles.section },
531
+ h('p', { style: styles.message }, t('error')),
532
+ h('button', { type: 'button', style: styles.button, onClick: refresh }, t('retry'))) : null,
319
533
  notice ? h('p', { role: 'status', style: styles.message }, notice) : null,
320
- !health ? h('p', { role: 'status', style: styles.message }, t('diagnosticsUnavailable')) : null,
321
- preview ? h('section', { style: { ...styles.section, padding: 16 }, 'aria-label': t('repairPreview') },
322
- h('h2', { style: styles.sectionTitle }, t('repairPreview')),
323
- h('p', { style: styles.meta }, `${t('target')}: ${plugins.find(row => row.entryId === preview.targetEntryId)?.moduleName ?? preview.targetEntryId}`),
324
- h('p', { style: styles.meta }, `${t('effect')}: ${t('disablePlugin')}`),
325
- h('p', { style: styles.meta }, `${t('risk')}: ${t(preview.risk)} · ${t(preview.reversible ? 'reversible' : 'notReversible')}`),
326
- h('div', { style: { display: 'flex', gap: 8, flexWrap: 'wrap' } },
327
- h('button', { type: 'button', style: { ...styles.button, ...styles.primary }, disabled: busy === preview.previewId, onClick: () => { void applyPreview() } }, t(preview.requiresConfirmation ? 'confirmRepair' : 'applyRepair')),
328
- h('button', { type: 'button', style: styles.button, onClick: () => { setPreview(null) } }, t('cancel')))) : null,
329
- section('findings', t('findingsTitle'), findings, findingCard),
330
- section('plugins', t('pluginsTitle'), pluginRows, row => h('li', { key: row.entryId, style: styles.row },
331
- h('div', { style: styles.rowHead },
332
- h('div', null,
333
- h('h3', { style: styles.rowTitle }, row.meta?.title?.en ?? row.meta?.title?.zh ?? row.moduleName),
334
- h('div', { style: styles.meta }, h('span', null, row.entryId), h('span', null, t(row.fiberPhase ?? 'notRunning')), row.readOnlyReason ? h('span', null, t(row.readOnlyReason)) : null)),
335
- h('button', {
336
- type: 'button', style: { ...styles.button, ...(row.enabled ? styles.primary : {}) },
337
- 'aria-pressed': String(row.enabled), disabled: !manager?.setPluginEnabled || row.readOnlyReason !== undefined || busy === row.entryId,
338
- onClick: () => { void toggle(row) },
339
- }, t(row.enabled ? 'disable' : 'enable'))),
340
- row.diagnostic ? h('p', { style: styles.meta }, t('activationFailed')) : null)),
341
- settings?.namespaces?.length ? section('configuration', t('configurationTitle'), settings.namespaces, view => h('li', { key: view.ns, style: styles.row },
342
- h('div', { style: styles.rowTitle }, plugins.find(row => row.entryId === view.ns)?.meta?.title?.en ?? view.ns),
343
- h(ConfigSection, { view, forms, provenance: current?.provenance, t }))) : null,
344
- inventory ? h(React.Fragment, null,
345
- section('tools', t('tools'), runtimeTools, row => h('li', { key: `${row.name}:${row.owner?.entryId ?? ''}`, style: styles.row },
346
- h('h3', { style: styles.rowTitle }, row.name), h('div', { style: styles.meta }, `${t('owner')}: ${owner(row)} · ${t(row.scope)}`))),
347
- section('mcp', t('mcp'), runtimeClients, row => h('li', { key: `${row.serverName}:${row.owner?.entryId ?? ''}`, style: styles.row },
348
- h('h3', { style: styles.rowTitle }, row.serverName), h('div', { style: styles.meta }, `${t('owner')}: ${owner(row)} · ${t(row.state)}`),
349
- row.toolNames?.length ? h('div', { style: styles.meta }, `${t('toolNames')}: ${row.toolNames.join(', ')}`) : null))) : null)
534
+ !health && state.kind === 'ready' ? h('p', { role: 'status', style: styles.message }, t('diagnosticsUnavailable')) : null,
535
+ panel('plugins', h(PluginsPanel, {
536
+ pluginRows, findings, plugins, query: needle, busy, preview,
537
+ onToggle: toggle, onPreview: makePreview, onApplyPreview: applyPreview, onCancelPreview: () => { setPreview(null) }, t,
538
+ })),
539
+ panel('config', h(ConfigPanel, { settings, settingsReady: settings !== undefined, plugins, forms, provenance: current?.provenance, t })),
540
+ panel('skill', h(SkillPanel, { skills, needle, onRetry: refresh, t })),
541
+ panel('mcp', h(McpPanel, { inventory, mcpRows, toolRows, needle, t })))
350
542
  }
351
543
 
352
544
  return {
353
545
  inject: ['slots', 'locale', 'remote', 'remote.pluginInventory', 'remote.pluginManager', 'configForms'],
354
546
  apply(ctx) {
355
547
  const zh = {
356
- tab: '插件管理', search: '搜索插件、诊断、工具或 MCP', refresh: '刷新', loading: '正在读取 Host 状态…', loadingShort: '读取中…',
357
- eyebrow: '插件健康与管理', heading: '插件管理', description: '查看插件状态与冲突,追踪配置来源,并通过受控操作修复问题。', summary: '当前状态', items: '项',
548
+ tab: '插件管理', search: '搜索当前视图的插件、配置、Skill 或 MCP', refresh: '刷新', loading: '正在读取 Host 状态…', loadingShort: '读取中…',
549
+ eyebrow: '插件健康与管理', heading: '插件管理', description: '查看插件状态与冲突,追踪配置来源,浏览 Skill 目录与 MCP 客户端,并通过受控操作修复问题。', summary: '当前状态', items: '项',
550
+ viewsLabel: '管理视图', 'tabs.plugins': '插件', 'tabs.config': '配置', 'tabs.skill': 'Skill', 'tabs.mcp': 'MCP',
551
+ pluginsIntro: '实时插件清单、健康诊断与启停操作。只列出当前 Profile 可寻址的插件。',
552
+ configIntro: '按 Host schema 编辑非密钥配置,并查看每个字段的有效来源与被覆盖层。',
553
+ skillIntro: '当前会话可用的 Skill 目录,按会话工作目录解析,并随会话切换自动刷新;模型可调用与仅用户可调用的条目分开标记。',
554
+ mcpIntro: '已组合的 MCP 客户端连接状态与工具注册归属。',
358
555
  error: '无法读取运行时清单。', retry: '重试', noRows: '暂无记录。', noMatches: '没有匹配的记录。', diagnosticsUnavailable: '此 Harness Host 尚未提供诊断接口;当前显示可用的插件和注册清单。',
556
+ inventoryUnavailable: '此 Host 未提供运行时清单接口,工具与 MCP 信息不可用。',
359
557
  findingsTitle: '健康诊断', pluginsTitle: '插件', configurationTitle: '配置管理', plugins: '插件', enabled: '已启用', findings: '发现项', severity: '严重程度', affected: '相关插件', evidence: '证据',
558
+ configEmpty: 'Host 未暴露可编辑的配置命名空间。', configUnavailable: '此 Host 未提供设置表单接口,配置视图不可用。',
559
+ skillsTitle: 'Skill 目录', skillEmpty: '当前会话没有可用的 Skill。', skillUnsupported: '此 Host 未提供 skills 接口,Skill 目录不可用。', skillNoSession: '尚无可用会话。打开或切换会话后,这里会自动加载,无需刷新。', skillError: '无法读取 Skill 目录。', loadingSkills: '正在读取 Skill 目录…',
560
+ skillModelInvocable: '模型可调用', skillUserOnly: '仅用户可调用', skillWhenToUse: '适用场景', skillPath: '指令文件',
561
+ mcpStat: 'MCP', skills: 'Skill',
360
562
  'plugin.activation-failed': '插件启动失败', 'tool.duplicate-name': '工具名称重复', 'mcp.connection-failed': 'MCP 连接异常', 'mcp.duplicate-name': 'MCP 名称重复',
361
- 'bundle.compatibility-rejected': '组合包版本不兼容', 'bundle.dependency-invalid': '所选依赖无效', error: '错误', errorSeverity: '错误', warning: '警告', info: '提示',
563
+ 'bundle.compatibility-rejected': '组合包版本不兼容', 'bundle.dependency-invalid': '所选依赖无效', severityError: '错误', severityWarning: '警告', severityInfo: '提示', warning: '警告', info: '提示',
362
564
  source: '配置来源', shadowed: '被覆盖来源', sourceUnknown: '未知(Host 未提供来源)', bundle: '组合包', profile: 'Profile', home: 'Home', invocation: '本次启动',
363
565
  save: '保存', reset: '恢复继承值', saved: '已保存', revisionConflict: '配置已被其他操作修改;草稿仍保留,请刷新后重试。', saveFailed: '保存失败,草稿已保留。', invalidNumber: '请输入有效数字。', loadingForm: '正在载入表单…', formUnavailable: '此配置表单当前不可用。', noSchemaFields: '没有可编辑的 schema 字段。', secretsHidden: '密钥字段已隐藏({count} 项)。',
364
566
  previewRepair: '诊断并修复 {name}', repairPreview: '修复预览', target: '目标', effect: '影响', disablePlugin: '关闭插件', risk: '风险', low: '低', high: '高', reversible: '可撤销', notReversible: '不可撤销', applyRepair: '执行修复', confirmRepair: '确认并执行', cancel: '取消', previewOrRepairFailed: '无法预览或执行此修复。', stalePreview: '修复预览已过期或状态已变化,请重新加载后再试。',
365
567
  changeApplied: '设置已保存并应用。', restartRequired: '设置已保存;重启后生效。', changeOverridden: '设置已保存,但被更高优先级配置覆盖。', changeFailed: 'Host 未能应用此更改。',
366
- enable: '启用', disable: '停用', enabledTag: '已启用', disabledTag: '已停用', active: '运行中', failed: '失败', loadingPhase: '加载中', pending: '等待中', unloading: '卸载中', notRunning: '未运行',
568
+ enable: '启用', disable: '停用', disabled: '已停用', enabledTag: '已启用', disabledTag: '已停用', active: '运行中', failed: '失败', loadingPhase: '加载中', pending: '等待中', unloading: '卸载中', notRunning: '未运行',
367
569
  'management-required': '管理服务受保护', unaddressable: '此条目无法通过当前 Profile 修改', activationFailed: '插件未能完成启动。', owner: '所属插件', tools: '工具注册', mcp: 'MCP 客户端', toolNames: '工具名称', global: '全局', scoped: '作用域', starting: '启动中', connected: '已连接', reconnecting: '正在重连', stopped: '已停止',
368
570
  }
369
571
  const en = {
370
- tab: 'Plugin management', search: 'Search plugins, findings, tools or MCP', refresh: 'Refresh', loading: 'Reading Host state…', loadingShort: 'Loading…',
371
- eyebrow: 'PLUGIN HEALTH AND MANAGEMENT', heading: 'Plugin management', description: 'Review plugin status and conflicts, trace configuration sources, and repair issues through bounded actions.', summary: 'Current status', items: 'items',
572
+ tab: 'Plugin management', search: 'Search the current view for plugins, settings, skills or MCP', refresh: 'Refresh', loading: 'Reading Host state…', loadingShort: 'Loading…',
573
+ eyebrow: 'PLUGIN HEALTH AND MANAGEMENT', heading: 'Plugin management', description: 'Review plugin status and conflicts, trace configuration sources, browse the skill catalog and MCP clients, and repair issues through bounded actions.', summary: 'Current status', items: 'items',
574
+ viewsLabel: 'Management views', 'tabs.plugins': 'Plugins', 'tabs.config': 'Configuration', 'tabs.skill': 'Skills', 'tabs.mcp': 'MCP',
575
+ pluginsIntro: 'Live plugin inventory, health findings and enable/disable actions. Only plugins addressable by the active profile are listed.',
576
+ configIntro: 'Edit non-secret settings through the Host schema and see each field’s effective source and shadowed layers.',
577
+ skillIntro: 'Skills available to the current session, resolved from its working directory and reloaded automatically when the session changes; model-invocable and user-only entries are marked separately.',
578
+ mcpIntro: 'Composed MCP client connections and the owners of registered tools.',
372
579
  error: 'The runtime inventory could not be read.', retry: 'Retry', noRows: 'No records.', noMatches: 'No matching records.', diagnosticsUnavailable: 'This Harness Host does not expose diagnostics yet. Available plugin and registration inventories are still shown.',
580
+ inventoryUnavailable: 'This Host does not expose the runtime inventory; tool and MCP details are unavailable.',
373
581
  findingsTitle: 'Health findings', pluginsTitle: 'Plugins', configurationTitle: 'Configuration', plugins: 'plugins', enabled: 'enabled', findings: 'findings', severity: 'Severity', affected: 'Affected plugins', evidence: 'Evidence',
582
+ configEmpty: 'The Host exposes no editable configuration namespaces.', configUnavailable: 'This Host does not expose settings forms; configuration is unavailable.',
583
+ skillsTitle: 'Skill catalog', skillEmpty: 'The current session has no available skills.', skillUnsupported: 'This Host does not expose the skills interface; the catalog is unavailable.', skillNoSession: 'No session yet. Open or switch a session and this view loads automatically — no refresh needed.', skillError: 'The skill catalog could not be read.', loadingSkills: 'Reading the skill catalog…',
584
+ skillModelInvocable: 'Model-invocable', skillUserOnly: 'User-only', skillWhenToUse: 'When to use', skillPath: 'Instruction file',
585
+ mcpStat: 'MCP', skills: 'skills',
374
586
  'plugin.activation-failed': 'Plugin activation failed', 'tool.duplicate-name': 'Duplicate tool name', 'mcp.connection-failed': 'MCP connection issue', 'mcp.duplicate-name': 'Duplicate MCP name',
375
- 'bundle.compatibility-rejected': 'Bundle version is incompatible', 'bundle.dependency-invalid': 'Selected dependency is invalid', error: 'Error', errorSeverity: 'Error', warning: 'Warning', info: 'Info',
587
+ 'bundle.compatibility-rejected': 'Bundle version is incompatible', 'bundle.dependency-invalid': 'Selected dependency is invalid', severityError: 'Error', severityWarning: 'Warning', severityInfo: 'Info', warning: 'Warning', info: 'Info',
376
588
  source: 'Configuration source', shadowed: 'Shadowed sources', sourceUnknown: 'Unknown (Host did not provide a source)', bundle: 'Bundle', profile: 'Profile', home: 'Home', invocation: 'This launch',
377
589
  save: 'Save', reset: 'Reset to inherited value', saved: 'Saved', revisionConflict: 'Configuration changed elsewhere. Your draft is kept; refresh before retrying.', saveFailed: 'Save failed. Your draft is kept.', invalidNumber: 'Enter a valid number.', loadingForm: 'Loading form…', formUnavailable: 'This configuration form is unavailable.', noSchemaFields: 'No editable schema fields.', secretsHidden: '{count} secret fields are hidden.',
378
590
  previewRepair: 'Diagnose and repair {name}', repairPreview: 'Repair preview', target: 'Target', effect: 'Effect', disablePlugin: 'Disable plugin', risk: 'Risk', low: 'Low', high: 'High', reversible: 'Reversible', notReversible: 'Not reversible', applyRepair: 'Apply repair', confirmRepair: 'Confirm and apply', cancel: 'Cancel', previewOrRepairFailed: 'Could not preview or apply this repair.', stalePreview: 'The preview expired or state changed. Reload and preview the repair again.',
379
591
  changeApplied: 'The change was saved and applied.', restartRequired: 'The change was saved and will apply after restart.', changeOverridden: 'The change was saved but overridden by a higher-priority configuration.', changeFailed: 'The Host could not apply this change.',
380
- enable: 'Enable', disable: 'Disable', enabledTag: 'Enabled', disabledTag: 'Disabled', active: 'Active', failed: 'Failed', loadingPhase: 'Loading', pending: 'Pending', unloading: 'Unloading', notRunning: 'Not running',
592
+ enable: 'Enable', disable: 'Disable', disabled: 'Disabled', enabledTag: 'Enabled', disabledTag: 'Disabled', active: 'Active', failed: 'Failed', loadingPhase: 'Loading', pending: 'Pending', unloading: 'Unloading', notRunning: 'Not running',
381
593
  'management-required': 'Management service is protected', unaddressable: 'This entry cannot be changed by the current profile', activationFailed: 'The plugin did not finish starting.', owner: 'Owner', tools: 'Tool registrations', mcp: 'MCP clients', toolNames: 'Tool names', global: 'Global', scoped: 'Scoped', starting: 'Starting', connected: 'Connected', reconnecting: 'Reconnecting', stopped: 'Stopped',
382
594
  }
383
595
  ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'plugin-manager-wj: dictionaries')
@@ -385,10 +597,66 @@ window.__ModuleLoader__.load({
385
597
  const list = async () => unwrap(await ctx.remote.pluginInventory.list(), 'pluginInventory.list')
386
598
  const manager = ctx.remote.pluginManager
387
599
  const forms = ctx.get('configForms')
600
+
601
+ // The skill catalog is session-scoped (`skills/list`) and optional. Both services are read
602
+ // through `ctx.get` rather than `inject`: a Client plugin that lists an optional service in
603
+ // `inject` stays pending on a Host without it, which would take the whole tab down. Names are
604
+ // probed instead of hardcoded so a differently named skills namespace needs no code change.
605
+ const service = name => {
606
+ try { return ctx.get(name) } catch (_error) { return undefined }
607
+ }
608
+ const namespace = name => {
609
+ const direct = service(`remote.${name}`)
610
+ if (direct) return direct
611
+ try { return ctx.get('remote')?.[name] } catch (_error) { return undefined }
612
+ }
613
+ const SKILL_NAMESPACE_NAMES = ['skills', 'skill', 'skillCatalog']
614
+ const skillsRemote = () => {
615
+ for (const name of SKILL_NAMESPACE_NAMES) {
616
+ const candidate = namespace(name)
617
+ if (candidate && typeof candidate.list === 'function') return candidate
618
+ }
619
+ let registered = []
620
+ try { registered = Object.keys(ctx.get('remote') ?? {}) } catch (_error) { registered = [] }
621
+ for (const name of registered.filter(entry => /skill/i.test(entry))) {
622
+ const candidate = namespace(name)
623
+ if (candidate && typeof candidate.list === 'function') return candidate
624
+ }
625
+ return undefined
626
+ }
627
+ const activeSessionId = () => {
628
+ try {
629
+ const rows = Object.values(service('sessions')?.list?.getSnapshot?.()?.byId ?? {})
630
+ const retained = rows.filter(row => (row?.retainedBy?.mainView ?? 0) > 0)
631
+ const chosen = retained.find(row => row?.cwd) ?? retained[0] ?? rows.find(row => row?.cwd) ?? rows[0]
632
+ return chosen?.id
633
+ } catch (_error) {
634
+ return undefined
635
+ }
636
+ }
637
+ const watchSessions = listener => {
638
+ const store = service('sessions')?.list
639
+ if (!store || typeof store.subscribe !== 'function') return undefined
640
+ try { return store.subscribe(listener) } catch (_error) { return undefined }
641
+ }
642
+ const loadSkills = async sessionId => {
643
+ const remote = skillsRemote()
644
+ if (!remote) return { kind: 'unsupported' }
645
+ const id = sessionId ?? activeSessionId()
646
+ if (!id) return { kind: 'noSession' }
647
+ try {
648
+ const value = unwrap(await remote.list({ sessionId: id }), 'skills/list')
649
+ return { kind: 'ready', items: Array.isArray(value?.skills) ? value.skills : [] }
650
+ } catch (_error) {
651
+ return { kind: 'error' }
652
+ }
653
+ }
654
+
388
655
  ctx.slots.inject('settings.plugins.tab', () => ctx.slots.register({
389
656
  name: 'settings.plugins.tab', id: 'wj-registration-inventory', order: 20,
390
- label: () => t('tab'), locale: NS, inject: () => ({ list, manager, forms }),
391
- }, InventoryTab))
657
+ label: () => t('tab'), locale: NS,
658
+ inject: () => ({ list, manager, forms, loadSkills, readSessionId: activeSessionId, watchSessions }),
659
+ }, ManagerPage))
392
660
  },
393
661
  }
394
662
  },
package/cordis.patch.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  - insert:
2
2
  - id: plugin-manager-wj
3
- name: @tinyforge/dsh-plugin-manager-wj
3
+ name: "@tinyforge/dsh-plugin-manager-wj"
package/index.js CHANGED
@@ -1,2 +1,3 @@
1
+ // SPDX-License-Identifier: MIT
1
2
  /** Host half: the inventory page runs in the Web Client. */
2
3
  export function apply() {}
package/locale/en.json CHANGED
@@ -3,15 +3,22 @@
3
3
  "title": "WJ Plugin Management"
4
4
  },
5
5
  "tab": "Plugin management",
6
- "search": "Search plugins, findings, tools or MCP",
6
+ "views": {
7
+ "label": "Management views",
8
+ "plugins": "Plugins",
9
+ "config": "Configuration",
10
+ "skill": "Skills",
11
+ "mcp": "MCP"
12
+ },
13
+ "search": "Search the current view for plugins, settings, skills or MCP",
7
14
  "refresh": "Refresh",
8
- "loading": "Reading runtime registrations…",
9
- "error": "The registration inventory could not be read.",
15
+ "loading": "Reading runtime state…",
16
+ "error": "The runtime inventory could not be read.",
10
17
  "retry": "Retry",
11
18
  "empty": "There are no plugin, tool or MCP records yet.",
12
19
  "unsupported": "This Harness Host does not provide plugin management and runtime inventory. Upgrade Harness to manage plugins.",
13
20
  "tools": "Tool registrations",
14
- "mcp": "MCP servers",
21
+ "mcp": "MCP clients",
15
22
  "owner": "Owning plugin",
16
23
  "scope": "Scope",
17
24
  "global": "Global",
@@ -19,5 +26,10 @@
19
26
  "conditional": "Conditional",
20
27
  "unconditional": "Always registered",
21
28
  "serverState": "Connection state",
22
- "toolNames": "Tool names"
29
+ "toolNames": "Tool names",
30
+ "skills": "Skill catalog",
31
+ "skillUnsupported": "This Host does not expose the skills interface; the catalog is unavailable.",
32
+ "skillNoSession": "The catalog is resolved per session; open a session and refresh.",
33
+ "skillModelInvocable": "Model-invocable",
34
+ "skillUserOnly": "User-only"
23
35
  }
package/locale/zh.json CHANGED
@@ -3,15 +3,22 @@
3
3
  "title": "WJ 插件管理"
4
4
  },
5
5
  "tab": "插件管理",
6
- "search": "搜索插件、诊断、工具或 MCP",
6
+ "views": {
7
+ "label": "管理视图",
8
+ "plugins": "插件",
9
+ "config": "配置",
10
+ "skill": "Skill",
11
+ "mcp": "MCP"
12
+ },
13
+ "search": "搜索当前视图的插件、配置、Skill 或 MCP",
7
14
  "refresh": "刷新",
8
- "loading": "正在读取运行时注册…",
9
- "error": "无法读取注册清单。",
15
+ "loading": "正在读取 Host 状态…",
16
+ "error": "无法读取运行时清单。",
10
17
  "retry": "重试",
11
18
  "empty": "当前没有插件、工具或 MCP 记录。",
12
19
  "unsupported": "当前 Harness Host 未提供插件管理和运行时清单,请升级 Harness 后管理插件。",
13
20
  "tools": "工具注册",
14
- "mcp": "MCP Server",
21
+ "mcp": "MCP 客户端",
15
22
  "owner": "所属插件",
16
23
  "scope": "作用域",
17
24
  "global": "全局",
@@ -19,5 +26,10 @@
19
26
  "conditional": "条件启用",
20
27
  "unconditional": "始终注册",
21
28
  "serverState": "连接状态",
22
- "toolNames": "工具名"
29
+ "toolNames": "工具名",
30
+ "skills": "Skill 目录",
31
+ "skillUnsupported": "此 Host 未提供 skills 接口,Skill 目录不可用。",
32
+ "skillNoSession": "Skill 目录按会话解析;请先打开一个会话后刷新。",
33
+ "skillModelInvocable": "模型可调用",
34
+ "skillUserOnly": "仅用户可调用"
23
35
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tinyforge/dsh-plugin-manager-wj",
3
- "version": "1.2.2",
4
- "description": "Three-layer plugin management, health diagnostics, configuration provenance, and tool/MCP inventory for DeepSeek Harness.",
3
+ "version": "1.3.1",
4
+ "description": "Switchable plugin, configuration, skill and MCP views with health diagnostics, configuration provenance, and tool/MCP inventory for DeepSeek Harness.",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "scripts": { "test": "node --test" },
@@ -10,7 +10,7 @@
10
10
  "./client": "./client.js",
11
11
  "./locale/*.json": "./locale/*.json"
12
12
  },
13
- "files": ["index.js", "client.js", "cordis.patch.yml", "locale/*.json", "README.md", "README.zh.md"],
13
+ "files": ["index.js", "client.js", "cordis.patch.yml", "locale/*.json", "README.md", "README.zh.md", "LICENSE"],
14
14
  "dsh": {
15
15
  "bundle": { "patch": "./cordis.patch.yml" },
16
16
  "client": {
@@ -23,6 +23,10 @@
23
23
  ]
24
24
  }
25
25
  },
26
+ "repository": { "type": "git", "url": "git+https://github.com/phoenixlucky/dsh-plugin-manager-wj.git" },
27
+ "homepage": "https://github.com/phoenixlucky/dsh-plugin-manager-wj#readme",
28
+ "bugs": { "url": "https://github.com/phoenixlucky/dsh-plugin-manager-wj/issues" },
29
+ "keywords": ["deepseek-harness", "dsh", "dsh-plugin", "plugin-manager", "mcp", "skills", "cordis"],
26
30
  "peerDependencies": { "@deepseek-ai/cordis": "*" },
27
31
  "license": "MIT"
28
32
  }