@tinyforge/dsh-plugin-manager-wj 1.5.0 → 1.7.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
@@ -4,20 +4,21 @@
4
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
5
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
6
 
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 **Tools**.
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 five views switch without leaving the page: **Plugins**, **Health**, **Configuration**, **Skills** and **Tools**.
8
8
 
9
9
  ## Features
10
10
 
11
- - **Switchable views:** one tab strip switches between plugin health, configuration, the skill catalog, and tool registration ownership. A visited view stays mounted, so a configuration draft and the search term survive switching.
11
+ - **Switchable views:** one tab strip switches between the plugin list, health findings, configuration, the skill catalog, and tool registration ownership. A visited view stays mounted, so a configuration draft and the search term survive switching.
12
12
  - **Harness Core:** consumes the Host's plugin registry, configuration resolver, conflict detector, lifecycle/dependency manager, and settings services.
13
13
  - **Management API:** shows plugin state, derived activation findings, configuration provenance, and tool runtime registrations. It can enable or disable profile-addressable plugins.
14
- - **Management UI:** filters the active view, edits non-secret scalar settings through the existing schema-backed `configForms`, and reports each tool's scope with its owner (an MCP server, or the plugin package the Host half matched).
14
+ - **Management UI:** filters the active view, edits non-secret scalar settings through the existing schema-backed `configForms`, and reports each tool's scope with its owner (an MCP server, or the plugin package the Host half matched). Plugin rows show the package's localized title and introduction; a Loader-internal entry that carries no package metadata states that instead of leaving a blank line.
15
15
 
16
16
  ### Views
17
17
 
18
18
  | View | Source | Notes |
19
19
  | --- | --- | --- |
20
- | Plugins | the Loader projection from `pluginInventory.list()` | Enable/disable addressable entries; findings are derived from failed fibers and their `diagnostic`. |
20
+ | Plugins | the Loader projection from `pluginInventory.list()` | Enable/disable addressable entries and show each package's localized title and introduction. |
21
+ | Health | the same Loader projection | Derived only from entries whose startup failed (the fiber reached `failed`) and their `diagnostic`; a zero count says no entry failed to start instead of showing "no records". |
21
22
  | Configuration | `configForms.describe`, `pluginManager.getConfigProvenance` | Secret fields are omitted; provenance shows layers and redacted identities. |
22
23
  | 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
24
  | Tools | this package's Host half, `GET /api/wj/tool-inventory` | Runtime tool registrations, with the plugin that provides each tool and the scope it applies to. |
@@ -55,11 +56,11 @@ npm install @tinyforge/dsh-plugin-manager-wj
55
56
  ## Release
56
57
 
57
58
  ```sh
58
- npm test # node --test: 27 checks (views, tool ownership, Host route, inject contract, module id, patch shape)
59
+ npm test # node --test: 31 checks (views, findings, tool ownership, Host route, inject contract, module id, patch shape)
59
60
  npm publish --access public # writes to registry.npmjs.org
60
61
  ```
61
62
 
62
- 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.5.0 && git push --tags`) so the GitHub history matches the registry.
63
+ 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.7.0 && git push --tags`) so the GitHub history matches the registry.
63
64
 
64
65
  ## Development
65
66
 
package/README.zh.md CHANGED
@@ -4,20 +4,21 @@
4
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
5
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
6
 
7
- **WJ 插件管理中心**是 DeepSeek Harness 三层插件管理架构的 Web 管理层,扩展现有独立 WJ bundle,并在 **设置 → 插件** 下添加管理标签页。页面内有 **插件 / 配置 / Skill / 工具** 四个视图,可直接切换,不需要离开当前页面。
7
+ **WJ 插件管理中心**是 DeepSeek Harness 三层插件管理架构的 Web 管理层,扩展现有独立 WJ bundle,并在 **设置 → 插件** 下添加管理标签页。页面内有 **插件 / 健康诊断 / 配置 / Skill / 工具** 五个视图,可直接切换,不需要离开当前页面。
8
8
 
9
9
  ## 功能
10
10
 
11
- - **可切换视图:**一条标签栏在插件健康、配置、Skill 目录与工具注册归属之间切换。已访问过的视图保持挂载,因此切换时配置草稿和搜索词都不会丢失。
11
+ - **可切换视图:**一条标签栏在插件清单、健康诊断、配置、Skill 目录与工具注册归属之间切换。已访问过的视图保持挂载,因此切换时配置草稿和搜索词都不会丢失。
12
12
  - **Harness Core:**使用 Host 提供的插件注册表、配置解析、冲突检测、生命周期与依赖管理,以及设置服务。
13
13
  - **Management API:**查看插件状态、激活诊断、配置来源和工具运行时注册;可启停当前 Profile 能寻址的插件。
14
- - **Management UI:**按视图过滤,通过现有 schema 表单 `configForms` 编辑非密钥标量配置;工具视图给出每个工具的作用域与归属(MCP 服务器或推断出的插件包)。
14
+ - **Management UI:**按视图过滤,通过现有 schema 表单 `configForms` 编辑非密钥标量配置;工具视图给出每个工具的作用域与归属(MCP 服务器或推断出的插件包)。插件行显示包本地化的标题与说明;Loader 内部条目若没有包元数据,会明确写出这一点,而不是留空。
15
15
 
16
16
  ### 视图
17
17
 
18
18
  | 视图 | 数据来源 | 说明 |
19
19
  | --- | --- | --- |
20
- | 插件 | `pluginInventory.list()` 的 Loader 投影 | 启停当前 Profile 能寻址的条目,并由失败 fiber 派生激活诊断。 |
20
+ | 插件 | `pluginInventory.list()` 的 Loader 投影 | 启停当前 Profile 能寻址的条目,并显示包本地化的标题与说明。 |
21
+ | 健康诊断 | 同一份 Loader 投影 | 只由启动失败(fiber 进入 `failed`)的条目及其 `diagnostic` 派生;数量为 0 时明确说明没有启动失败,而不是显示"暂无记录"。 |
21
22
  | 配置 | `configForms.describe`、`pluginManager.getConfigProvenance` | 隐藏密钥字段;来源只显示层名称与脱敏标识。 |
22
23
  | Skill | 通过当前会话读取 `skills/list` | 按会话解析,目录来自会话工作目录,并在活动会话变化时自动重新加载;模型可调用与仅用户可调用分开标记。 |
23
24
  | 工具 | 本包 Host 半边的 `GET /api/wj/tool-inventory` | 运行时工具注册清单,以及每个工具由哪个插件提供、作用于哪个范围。 |
@@ -55,11 +56,11 @@ npm install @tinyforge/dsh-plugin-manager-wj
55
56
  ## 发布
56
57
 
57
58
  ```sh
58
- npm test # node --test:27 项检查(视图、工具归属、Host 路由、inject 契约、模块 id、patch 结构)
59
+ npm test # node --test:31 项检查(视图、健康诊断、工具归属、Host 路由、inject 契约、模块 id、patch 结构)
59
60
  npm publish --access public # 发布到 registry.npmjs.org
60
61
  ```
61
62
 
62
- 包名带 scope,发布新版本需要 `@tinyforge` npm scope 的维护者权限。发布后给对应提交打 tag(`git tag v1.5.0 && git push --tags`),让 GitHub 历史与 registry 版本对应。
63
+ 包名带 scope,发布新版本需要 `@tinyforge` npm scope 的维护者权限。发布后给对应提交打 tag(`git tag v1.7.0 && git push --tags`),让 GitHub 历史与 registry 版本对应。
63
64
 
64
65
  ## 开发
65
66
 
package/client.js CHANGED
@@ -11,11 +11,14 @@ window.__ModuleLoader__.load({
11
11
  const NS = 'settings.pluginManagerWj'
12
12
  // MCP server management is owned by the Host's MCP settings bundle, so this page shows no MCP
13
13
  // server list of its own: a second list here duplicated that page and read the same remote.
14
- const TAB_ORDER = ['plugins', 'config', 'skill', 'tools']
14
+ const TAB_ORDER = ['plugins', 'findings', 'config', 'skill', 'tools']
15
15
  const TAB_KEY = 'dsh-plugin-manager-wj/tab'
16
16
  // The Host half serves the tool registry on the shared authenticated `/api` channel; the
17
17
  // official Remote table carries no tool namespace, so this route is the only way in.
18
18
  const TOOL_INVENTORY_URL = '/api/wj/tool-inventory'
19
+ // The Host may answer slowly (its snapshot scans package sources), but a read that never settles
20
+ // must surface as a retryable failure instead of a spinner that never ends.
21
+ const TOOL_INVENTORY_TIMEOUT_MS = 20_000
19
22
 
20
23
  function unwrap(result, name) {
21
24
  if (!result || result.ok !== true) throw new Error(`${name}: ${result?.error?.message ?? 'unavailable'}`)
@@ -63,6 +66,20 @@ window.__ModuleLoader__.load({
63
66
  return source ? `${t(source.layer)} · ${source.identity}` : t('sourceUnknown')
64
67
  }
65
68
 
69
+ // `LocalizedText` is a plain string or a map keyed by lowercase locale id with an English
70
+ // fallback. The locale service resolves the current UI language; this reader keeps titles and
71
+ // descriptions readable where that service is absent, and never renders an object.
72
+ function localized(value) {
73
+ if (typeof value === 'string') return value
74
+ if (value !== null && typeof value === 'object') {
75
+ const english = value.en
76
+ if (typeof english === 'string') return english
77
+ const first = Object.values(value).find(entry => typeof entry === 'string')
78
+ return typeof first === 'string' ? first : undefined
79
+ }
80
+ return undefined
81
+ }
82
+
66
83
  // The official Host projects the Loader, not a health model: a failed fiber plus its diagnostic
67
84
  // is the whole of what it still reports, and it is exactly what this page diagnoses.
68
85
  function findingsOf(entries) {
@@ -137,6 +154,7 @@ window.__ModuleLoader__.load({
137
154
  row: { display: 'grid', gap: 10, padding: '14px 16px', borderBottom: '1px solid color-mix(in srgb, CanvasText 9%, Canvas)' },
138
155
  rowHead: { display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', gap: 14, flexWrap: 'wrap' },
139
156
  rowTitle: { margin: 0, fontSize: 14, fontWeight: 650, overflowWrap: 'anywhere' },
157
+ rowDescription: { margin: '3px 0 0', color: 'GrayText', fontSize: 12, lineHeight: 1.5, display: '-webkit-box', WebkitLineClamp: 3, WebkitBoxOrient: 'vertical', overflow: 'hidden' },
140
158
  meta: { display: 'flex', gap: '5px 14px', flexWrap: 'wrap', color: 'GrayText', fontSize: 12, lineHeight: 1.5 },
141
159
  badge: { display: 'inline-flex', alignItems: 'center', minHeight: 22, padding: '1px 9px', border: '1px solid color-mix(in srgb, CanvasText 14%, Canvas)', borderRadius: 999, fontSize: 11, fontWeight: 600 },
142
160
  warning: { borderColor: 'color-mix(in srgb, #d18a00 35%, Canvas)', background: 'color-mix(in srgb, #d18a00 9%, Canvas)' },
@@ -266,31 +284,25 @@ window.__ModuleLoader__.load({
266
284
  }, h('span', null, item.label), item.count === undefined ? null : h('span', { style: styles.tabCount }, String(item.count)))))
267
285
  }
268
286
 
269
- function PluginsPanel({ pluginRows, findings, plugins, query, busy, canManage, onToggle, t }) {
270
- const name = row => row.meta?.title?.en ?? row.meta?.title?.zh ?? row.moduleName
271
- const severity = value => t(SEVERITY_KEY[value] ?? 'severityInfo')
287
+ function PluginsPanel({ pluginRows, query, busy, canManage, onToggle, resolve, t }) {
288
+ // A row's display title and introduction are package metadata, not the module specifier.
289
+ // The Host localizes both; a Loader-internal entry that carries no package metadata says so
290
+ // instead of leaving the line empty, so a short technical name is never mistaken for a bug.
291
+ const name = row => resolve(row.meta?.title) || row.moduleName
292
+ const description = row => {
293
+ const declared = resolve(row.meta?.description)
294
+ if (declared) return declared
295
+ if (row.meta?.error) return resolve(row.meta.error) || row.meta.error
296
+ return row.meta === undefined ? t('pluginNoMeta') : t('pluginNoDescription')
297
+ }
272
298
  return h('div', { style: styles.page },
273
299
  h('p', { style: styles.description }, t('pluginsIntro')),
274
- h(Section, { id: 'findings', title: t('findingsTitle'), count: `${findings.length} ${t('items')}`, empty: t(query ? 'noMatches' : 'noRows') },
275
- findings.length ? h('ul', { style: styles.list }, findings.map(finding => {
276
- const severe = finding.severity === 'error'
277
- const affected = finding.affectedEntryIds.map(id => plugins.find(plugin => plugin.entryId === id)?.moduleName ?? id).join(', ')
278
- return h('li', { key: finding.id, style: styles.row },
279
- h('div', { style: styles.rowHead },
280
- h('div', null,
281
- h('h3', { style: styles.rowTitle }, t(finding.code)),
282
- h('div', { style: styles.meta }, h('span', null, `${t('severity')}: ${severity(finding.severity)}`), affected ? h('span', null, `${t('affected')}: ${affected}`) : null)),
283
- h('span', { style: { ...styles.badge, ...(severe ? styles.error : styles.warning) } }, severity(finding.severity))),
284
- finding.evidence?.name || finding.evidence?.serverName || finding.evidence?.packageName
285
- ? h('div', { style: styles.meta }, `${t('evidence')}: ${finding.evidence.name ?? finding.evidence.serverName ?? finding.evidence.packageName}`)
286
- : null,
287
- finding.evidence?.detail ? h('p', { style: { ...styles.message, padding: '4px 0 0' } }, finding.evidence.detail) : null)
288
- })) : null),
289
300
  h(Section, { id: 'plugins', title: t('pluginsTitle'), count: `${pluginRows.length} ${t('items')}`, empty: t(query ? 'noMatches' : 'noRows') },
290
301
  pluginRows.length ? h('ul', { style: styles.list }, pluginRows.map(row => h('li', { key: row.entryId, style: styles.row },
291
302
  h('div', { style: styles.rowHead },
292
303
  h('div', null,
293
304
  h('h3', { style: styles.rowTitle }, name(row)),
305
+ h('p', { style: styles.rowDescription }, description(row)),
294
306
  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)),
295
307
  h('button', {
296
308
  type: 'button', style: { ...styles.button, ...(row.enabled ? styles.primary : {}) },
@@ -300,6 +312,31 @@ window.__ModuleLoader__.load({
300
312
  row.diagnostic ? h('p', { style: styles.meta }, t('activationFailed')) : null))) : null))
301
313
  }
302
314
 
315
+ // Findings answer "is anything broken", which is a different question from "which plugin is
316
+ // enabled", so they get their own view and tab instead of hiding at the top of the plugin list.
317
+ function FindingsPanel({ findings, plugins, query, t }) {
318
+ const severity = value => t(SEVERITY_KEY[value] ?? 'severityInfo')
319
+ return h('div', { style: styles.page },
320
+ h('p', { style: styles.description }, t('findingsIntro')),
321
+ h(Section, {
322
+ id: 'findings', title: t('findingsTitle'), count: `${findings.length} ${t('items')}`,
323
+ empty: t(query ? 'noMatches' : 'findingsEmpty'),
324
+ }, findings.length ? h('ul', { style: styles.list }, findings.map(finding => {
325
+ const severe = finding.severity === 'error'
326
+ const affected = finding.affectedEntryIds.map(id => plugins.find(plugin => plugin.entryId === id)?.moduleName ?? id).join(', ')
327
+ return h('li', { key: finding.id, style: styles.row },
328
+ h('div', { style: styles.rowHead },
329
+ h('div', null,
330
+ h('h3', { style: styles.rowTitle }, t(finding.code)),
331
+ h('div', { style: styles.meta }, h('span', null, `${t('severity')}: ${severity(finding.severity)}`), affected ? h('span', null, `${t('affected')}: ${affected}`) : null)),
332
+ h('span', { style: { ...styles.badge, ...(severe ? styles.error : styles.warning) } }, severity(finding.severity))),
333
+ finding.evidence?.name || finding.evidence?.serverName || finding.evidence?.packageName
334
+ ? h('div', { style: styles.meta }, `${t('evidence')}: ${finding.evidence.name ?? finding.evidence.serverName ?? finding.evidence.packageName}`)
335
+ : null,
336
+ finding.evidence?.detail ? h('p', { style: { ...styles.message, padding: '4px 0 0' } }, finding.evidence.detail) : null)
337
+ })) : null))
338
+ }
339
+
303
340
  function ConfigPanel({ settings, settingsReady, plugins, forms, provenance, t }) {
304
341
  const namespaces = settings?.namespaces ?? []
305
342
  return h('div', { style: styles.page },
@@ -373,7 +410,7 @@ window.__ModuleLoader__.load({
373
410
  row.description ? h('p', { style: styles.muted }, row.description) : null))) : null))
374
411
  }
375
412
 
376
- function ManagerPage({ list, manager, forms, loadSkills, loadTools, readSessionId, watchSessions, t }) {
413
+ function ManagerPage({ list, manager, forms, loadSkills, loadTools, readSessionId, watchSessions, resolveText, t }) {
377
414
  const initialTab = readStoredTab()
378
415
  const [tab, setTab] = React.useState(initialTab)
379
416
  const [visited, setVisited] = React.useState([initialTab])
@@ -459,19 +496,32 @@ window.__ModuleLoader__.load({
459
496
  return () => { live = false }
460
497
  }, [list, manager, forms, revision])
461
498
 
462
- // The tool registry is session-wide Host state and the route scans package sources once, so
463
- // it loads when the view is first opened, and again only when the page is refreshed.
499
+ // The tool registry is session-wide Host state, so it loads as soon as this page mounts rather
500
+ // than when the Tools view is opened: the summary stat and the tab count would otherwise read
501
+ // "—" until the first visit, which looks like a broken read. It reloads on refresh.
502
+ //
503
+ // The loaded revision is held in a ref rather than in this effect's dependencies. A dependency
504
+ // on `tools` re-ran this effect right after it set the loading state; React then disposed the
505
+ // first run, its cleanup flipped `live` off, and the read that finally arrived was dropped —
506
+ // the view stayed on "loading" forever in the browser (the deferred test runtime happened to
507
+ // resolve the read before the cleanup, which is why it never showed).
508
+ const loadedToolsRevision = React.useRef(undefined)
464
509
  React.useEffect(() => {
465
- if (tab !== 'tools' || typeof loadTools !== 'function') return undefined
466
- if (tools.kind !== 'idle' && tools.revision === revision) return undefined
510
+ if (typeof loadTools !== 'function') return undefined
511
+ if (loadedToolsRevision.current === revision) return undefined
467
512
  let live = true
468
513
  setTools({ kind: 'loading', revision })
469
514
  Promise.resolve()
470
515
  .then(() => loadTools())
471
- .then(result => { if (live) setTools({ ...result, revision }) })
516
+ .then(result => {
517
+ if (!live) return
518
+ // Only a completed read is worth remembering; a failed one retries when the view reopens.
519
+ if (result?.kind === 'ready') loadedToolsRevision.current = revision
520
+ setTools({ ...result, revision })
521
+ })
472
522
  .catch(() => { if (live) setTools({ kind: 'error', revision }) })
473
523
  return () => { live = false }
474
- }, [loadTools, tab, revision, tools.kind, tools.revision])
524
+ }, [loadTools, revision])
475
525
 
476
526
  const refresh = () => {
477
527
  setState(current => ({ kind: 'loading', snapshot: current.snapshot }))
@@ -513,7 +563,17 @@ window.__ModuleLoader__.load({
513
563
  const settings = current?.settings
514
564
  const needle = query.trim().toLocaleLowerCase()
515
565
  const matches = values => !needle || values.filter(Boolean).some(value => String(value).toLocaleLowerCase().includes(needle))
516
- const pluginRows = plugins.filter(row => matches([row.moduleName, row.entryId, row.meta?.title?.en, row.meta?.title?.zh, row.meta?.description]))
566
+ // The locale service picks the current UI language for package titles and introductions;
567
+ // without it, `localized` keeps the declared English fallback.
568
+ const resolve = value => {
569
+ if (value === undefined || value === null) return undefined
570
+ let text
571
+ try { text = typeof resolveText === 'function' ? resolveText(value) : undefined } catch (_error) { text = undefined }
572
+ return typeof text === 'string' && text !== '' ? text : localized(value)
573
+ }
574
+ const pluginTitle = row => resolve(row.meta?.title) || row.moduleName
575
+ const pluginDescription = row => resolve(row.meta?.description) || row.meta?.error
576
+ const pluginRows = plugins.filter(row => matches([row.moduleName, row.entryId, pluginTitle(row), pluginDescription(row)]))
517
577
  const findings = (health?.findings ?? []).filter(row => matches([row.id, row.code, row.evidence?.name, row.evidence?.detail]))
518
578
  // Legacy Hosts answered the inventory with registrations of their own; a Host served by this
519
579
  // package answers the `/api` route instead, so either source fills the same rows.
@@ -525,6 +585,7 @@ window.__ModuleLoader__.load({
525
585
 
526
586
  const tabs = [
527
587
  { id: 'plugins', label: t('tabs.plugins'), count: plugins.length },
588
+ { id: 'findings', label: t('tabs.findings'), count: findings.length },
528
589
  { id: 'config', label: t('tabs.config'), count: settings?.namespaces?.length },
529
590
  { id: 'skill', label: t('tabs.skill'), count: skills?.kind === 'ready' ? skills.items.length : undefined },
530
591
  { id: 'tools', label: t('tabs.tools'), count: toolsView.kind === 'ready' ? toolRows.length : undefined },
@@ -544,7 +605,7 @@ window.__ModuleLoader__.load({
544
605
  [health?.enabledCount ?? plugins.filter(row => row.enabled).length, 'enabled'],
545
606
  [health ? health.findings.length : '—', 'findings'],
546
607
  [skills?.kind === 'ready' ? skills.items.length : '—', 'skills'],
547
- [toolsView.kind === 'ready' ? toolRows.length : '—', 'toolsStat'],
608
+ [toolsView.kind === 'ready' ? toolRows.length : toolsView.kind === 'loading' ? '…' : '—', 'toolsStat'],
548
609
  ]
549
610
  const showStats = state.kind === 'ready' && current !== undefined
550
611
 
@@ -568,9 +629,10 @@ window.__ModuleLoader__.load({
568
629
  h('button', { type: 'button', style: styles.button, onClick: refresh }, t('retry'))) : null,
569
630
  notice ? h('p', { role: 'status', style: styles.message }, notice) : null,
570
631
  panel('plugins', h(PluginsPanel, {
571
- pluginRows, findings, plugins, query: needle, busy, canManage,
572
- onToggle: toggle, t,
632
+ pluginRows, query: needle, busy, canManage,
633
+ onToggle: toggle, resolve, t,
573
634
  })),
635
+ panel('findings', h(FindingsPanel, { findings, plugins, query: needle, t })),
574
636
  panel('config', h(ConfigPanel, { settings, settingsReady: settings !== undefined, plugins, forms, provenance: current?.provenance, t })),
575
637
  panel('skill', h(SkillPanel, { skills, needle, onRetry: refresh, t })),
576
638
  panel('tools', h(ToolsPanel, { tools: toolsView, toolRows, rows: toolRows, needle, onRetry: refresh, t })))
@@ -586,8 +648,9 @@ window.__ModuleLoader__.load({
586
648
  const zh = {
587
649
  tab: '插件管理', search: '搜索当前视图的插件、配置、Skill 或工具', refresh: '刷新', loading: '正在读取 Host 状态…', loadingShort: '读取中…',
588
650
  eyebrow: '插件健康与管理', heading: '插件管理', description: '查看插件状态与冲突,追踪配置来源,浏览 Skill 目录与工具注册归属,并通过受控操作修复问题。', summary: '当前状态', items: '项',
589
- viewsLabel: '管理视图', 'tabs.plugins': '插件', 'tabs.config': '配置', 'tabs.skill': 'Skill', 'tabs.tools': '工具',
651
+ viewsLabel: '管理视图', 'tabs.plugins': '插件', 'tabs.findings': '健康诊断', 'tabs.config': '配置', 'tabs.skill': 'Skill', 'tabs.tools': '工具',
590
652
  pluginsIntro: '实时插件清单、健康诊断与启停操作。只列出当前 Profile 可寻址的插件。',
653
+ pluginNoDescription: '该包未声明说明。', pluginNoMeta: 'Loader 内部条目,无包元数据。',
591
654
  configIntro: '按 Host schema 编辑非密钥配置,并查看每个字段的有效来源与被覆盖层。',
592
655
  skillIntro: '当前会话可用的 Skill 目录,按会话工作目录解析,并随会话切换自动刷新;模型可调用与仅用户可调用的条目分开标记。',
593
656
  toolsIntro: '运行时工具注册清单,以及每个工具由哪个插件提供、作用于哪个范围。',
@@ -595,7 +658,7 @@ window.__ModuleLoader__.load({
595
658
  error: '无法读取运行时清单。', retry: '重试', noRows: '暂无记录。', noMatches: '没有匹配的记录。',
596
659
  loadingTools: '正在读取工具注册清单…', toolInventoryUnavailable: '此 Host 未提供工具注册清单路由(/api/wj/tool-inventory),工具视图不可用。', toolInventoryError: '无法读取工具注册清单。',
597
660
  ownerUnknown: '未记录(Host 未暴露归属)', ownerMcp: 'MCP 服务器', ownerInferred: '推断',
598
- findingsTitle: '健康诊断', pluginsTitle: '插件', configurationTitle: '配置管理', plugins: '插件', enabled: '已启用', findings: '发现项', severity: '严重程度', affected: '相关插件', evidence: '证据',
661
+ findingsTitle: '健康诊断', findingsIntro: '插件健康诊断来自启动失败(fiber 进入 failed)的条目及其失败原因;已停用或尚未加载的条目不算异常。', findingsEmpty: '未发现插件健康问题:当前没有启动失败的条目。', pluginsTitle: '插件', configurationTitle: '配置管理', plugins: '插件', enabled: '已启用', findings: '发现项', severity: '严重程度', affected: '相关插件', evidence: '证据',
599
662
  configEmpty: 'Host 未暴露可编辑的配置命名空间。', configUnavailable: '此 Host 未提供设置表单接口,配置视图不可用。',
600
663
  skillsTitle: 'Skill 目录', skillEmpty: '当前会话没有可用的 Skill。', skillUnsupported: '此 Host 未提供 skills 接口,Skill 目录不可用。', skillNoSession: '尚无可用会话。打开或切换会话后,这里会自动加载,无需刷新。', skillError: '无法读取 Skill 目录。', loadingSkills: '正在读取 Skill 目录…',
601
664
  skillModelInvocable: '模型可调用', skillUserOnly: '仅用户可调用', skillWhenToUse: '适用场景', skillPath: '指令文件',
@@ -612,8 +675,9 @@ window.__ModuleLoader__.load({
612
675
  const en = {
613
676
  tab: 'Plugin management', search: 'Search the current view for plugins, settings, skills or tools', refresh: 'Refresh', loading: 'Reading Host state…', loadingShort: 'Loading…',
614
677
  eyebrow: 'PLUGIN HEALTH AND MANAGEMENT', heading: 'Plugin management', description: 'Review plugin status and conflicts, trace configuration sources, browse the skill catalog and tool ownership, and repair issues through bounded actions.', summary: 'Current status', items: 'items',
615
- viewsLabel: 'Management views', 'tabs.plugins': 'Plugins', 'tabs.config': 'Configuration', 'tabs.skill': 'Skills', 'tabs.tools': 'Tools',
678
+ viewsLabel: 'Management views', 'tabs.plugins': 'Plugins', 'tabs.findings': 'Health', 'tabs.config': 'Configuration', 'tabs.skill': 'Skills', 'tabs.tools': 'Tools',
616
679
  pluginsIntro: 'Live plugin inventory, health findings and enable/disable actions. Only plugins addressable by the active profile are listed.',
680
+ pluginNoDescription: 'The package declares no description.', pluginNoMeta: 'Loader-internal entry; no package metadata.',
617
681
  configIntro: 'Edit non-secret settings through the Host schema and see each field’s effective source and shadowed layers.',
618
682
  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.',
619
683
  toolsIntro: 'Runtime tool registrations, with the plugin that provides each tool and the scope it applies to.',
@@ -621,7 +685,7 @@ window.__ModuleLoader__.load({
621
685
  error: 'The runtime inventory could not be read.', retry: 'Retry', noRows: 'No records.', noMatches: 'No matching records.',
622
686
  loadingTools: 'Reading the tool registry…', toolInventoryUnavailable: 'This Host does not serve the tool registry route (/api/wj/tool-inventory); the tool view is unavailable.', toolInventoryError: 'The tool registry could not be read.',
623
687
  ownerUnknown: 'Not recorded (the Host exposes no owner)', ownerMcp: 'MCP server', ownerInferred: 'inferred',
624
- findingsTitle: 'Health findings', pluginsTitle: 'Plugins', configurationTitle: 'Configuration', plugins: 'plugins', enabled: 'enabled', findings: 'findings', severity: 'Severity', affected: 'Affected plugins', evidence: 'Evidence',
688
+ findingsTitle: 'Health findings', findingsIntro: 'Plugin health findings derive from entries whose startup failed (the fiber reached “failed”) and the diagnostic the Host returned; disabled or not-yet-loaded entries are not findings.', findingsEmpty: 'No plugin health findings: no addressable entry failed to start.', pluginsTitle: 'Plugins', configurationTitle: 'Configuration', plugins: 'plugins', enabled: 'enabled', findings: 'findings', severity: 'Severity', affected: 'Affected plugins', evidence: 'Evidence',
625
689
  configEmpty: 'The Host exposes no editable configuration namespaces.', configUnavailable: 'This Host does not expose settings forms; configuration is unavailable.',
626
690
  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…',
627
691
  skillModelInvocable: 'Model-invocable', skillUserOnly: 'User-only', skillWhenToUse: 'When to use', skillPath: 'Instruction file',
@@ -654,11 +718,21 @@ window.__ModuleLoader__.load({
654
718
  // `ctx.remote` carries no tool namespace and a Client plugin cannot add one.
655
719
  const loadTools = async () => {
656
720
  if (typeof fetch !== 'function') return { kind: 'unavailable' }
721
+ const controller = typeof AbortController === 'function' ? new AbortController() : undefined
722
+ const timer = controller !== undefined && typeof setTimeout === 'function'
723
+ ? setTimeout(() => { try { controller.abort() } catch (_error) { /* already settled */ } }, TOOL_INVENTORY_TIMEOUT_MS)
724
+ : undefined
657
725
  let response
658
726
  try {
659
- response = await fetch(TOOL_INVENTORY_URL, { credentials: 'same-origin', headers: { accept: 'application/json' } })
727
+ response = await fetch(TOOL_INVENTORY_URL, {
728
+ credentials: 'same-origin',
729
+ headers: { accept: 'application/json' },
730
+ ...(controller === undefined ? {} : { signal: controller.signal }),
731
+ })
660
732
  } catch (_error) {
661
733
  return { kind: 'error' }
734
+ } finally {
735
+ if (timer !== undefined) clearTimeout(timer)
662
736
  }
663
737
  if (!response || response.ok !== true) return { kind: 'unavailable' }
664
738
  try {
@@ -716,12 +790,19 @@ window.__ModuleLoader__.load({
716
790
  }
717
791
  }
718
792
 
793
+ // Package titles and introductions are `LocalizedText`; the locale service resolves the
794
+ // current UI language, and the page falls back to the declared English text without it.
795
+ const localeService = ctx.locale ?? service('locale')
796
+ const resolveText = typeof localeService?.resolveText === 'function'
797
+ ? text => localeService.resolveText(text)
798
+ : undefined
799
+
719
800
  // No `mcpClientStatus/list` probe lives here: the MCP settings bundle owns MCP server state
720
801
  // and its page, and reading that remote from two pages is what made the two views conflict.
721
802
  ctx.slots.inject('plugins.tab', () => ctx.slots.register({
722
803
  name: 'plugins.tab', id: 'wj-registration-inventory', order: 20,
723
804
  label: () => t('tab'), locale: NS,
724
- inject: () => ({ list, manager: namespace('pluginManager'), forms, loadSkills, loadTools, readSessionId: activeSessionId, watchSessions }),
805
+ inject: () => ({ list, manager: namespace('pluginManager'), forms, loadSkills, loadTools, readSessionId: activeSessionId, watchSessions, resolveText }),
725
806
  }, ManagerPage))
726
807
  },
727
808
  }
package/icon.webp ADDED
Binary file
package/index.js CHANGED
@@ -13,7 +13,7 @@
13
13
  * MCP tool names (their names carry the server) and falls back to a package-source scan, which is
14
14
  * marked `inferred` so the page never presents a guess as a Host fact.
15
15
  */
16
- import { readFileSync } from 'node:fs'
16
+ import { readFileSync, statSync } from 'node:fs'
17
17
  import { dirname, isAbsolute, join } from 'node:path'
18
18
 
19
19
  /** Absolute path below the shared `/api` channel. */
@@ -196,6 +196,7 @@ export function readPackageSources(ctx, options = {}) {
196
196
  const packages = optional(ctx, 'pluginPackages')
197
197
  const entries = typeof loader?.entries === 'function' ? loader.entries() : []
198
198
  const readFile = options.readFile ?? readFileSync
199
+ const statFile = options.statFile ?? statSync
199
200
  const maxFiles = options.maxFiles ?? FILE_BUDGET
200
201
  const maxBytes = options.maxBytes ?? TOTAL_LIMIT_BYTES
201
202
 
@@ -219,6 +220,10 @@ export function readPackageSources(ctx, options = {}) {
219
220
  const manifest = JSON.parse(readFile(manifestPath, 'utf8'))
220
221
  const main = typeof manifest?.main === 'string' && manifest.main.length > 0 ? manifest.main : 'index.js'
221
222
  const file = isAbsolute(main) ? main : join(dirname(manifestPath), main)
223
+ // A bundle above the limit is discarded after the read anyway; some plugin entry bundles are
224
+ // tens of megabytes, and reading one only to drop it blocks the Host for no result.
225
+ const size = statFile(file)?.size
226
+ if (typeof size === 'number' && size > FILE_LIMIT_BYTES) continue
222
227
  const text = readFile(file, 'utf8')
223
228
  if (typeof text !== 'string' || text.length === 0 || text.length > FILE_LIMIT_BYTES) continue
224
229
  files += 1
package/locale/en.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "meta": {
3
- "title": "WJ Plugin Management"
3
+ "title": "WJ Plugin Management",
4
+ "description": "One management page for plugin health findings, configuration provenance, the skill catalog and tool ownership. For MCP server management, install @tinyforge/dsh-mcp-settings, which provides the MCP settings page."
4
5
  },
5
6
  "tab": "Plugin management",
6
7
  "views": {
@@ -18,7 +19,7 @@
18
19
  "empty": "There are no plugin or tool records yet.",
19
20
  "unsupported": "This Harness Host does not provide plugin management and runtime inventory. Upgrade Harness to manage plugins.",
20
21
  "tools": "Tool registrations",
21
- "mcpNote": "Adding and connecting MCP servers belongs to the Host's MCP settings page; this page covers plugin-side ownership only.",
22
+ "mcpNote": "Adding and connecting MCP servers belongs to the MCP settings page provided by @tinyforge/dsh-mcp-settings; this page covers plugin-side ownership only.",
22
23
  "owner": "Owning plugin",
23
24
  "scope": "Scope",
24
25
  "global": "Global",
package/locale/zh.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "meta": {
3
- "title": "WJ 插件管理"
3
+ "title": "WJ 插件管理",
4
+ "description": "插件健康诊断、配置来源、Skill 目录与工具注册归属的统一管理页。MCP 服务器管理推荐安装 @tinyforge/dsh-mcp-settings,由它提供 MCP 设置页。"
4
5
  },
5
6
  "tab": "插件管理",
6
7
  "views": {
@@ -18,7 +19,7 @@
18
19
  "empty": "当前没有插件或工具记录。",
19
20
  "unsupported": "当前 Harness Host 未提供插件管理和运行时清单,请升级 Harness 后管理插件。",
20
21
  "tools": "工具注册",
21
- "mcpNote": "MCP 服务器的添加与连接由 Host 的 MCP 设置页负责;本页只做插件侧的注册归属诊断。",
22
+ "mcpNote": "MCP 服务器的添加与连接由 @tinyforge/dsh-mcp-settings 提供的 MCP 设置页负责;本页只做插件侧的注册归属诊断。",
22
23
  "owner": "所属插件",
23
24
  "scope": "作用域",
24
25
  "global": "全局",
package/package.json CHANGED
@@ -1,16 +1,20 @@
1
1
  {
2
2
  "name": "@tinyforge/dsh-plugin-manager-wj",
3
- "version": "1.5.0",
4
- "description": "Switchable plugin, configuration, skill and tool-ownership views with health diagnostics, configuration provenance, and tool inventory for DeepSeek Harness.",
3
+ "version": "1.7.0",
4
+ "description": "Plugin health, configuration provenance, skill catalog and tool-ownership views for DeepSeek Harness; MCP server management is recommended through @tinyforge/dsh-mcp-settings.",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
+ "icon": "icon.webp",
7
8
  "scripts": { "test": "node --test" },
8
9
  "exports": {
9
10
  ".": "./index.js",
10
11
  "./client": "./client.js",
12
+ "./cordis.patch.yml": "./cordis.patch.yml",
13
+ "./icon": "./icon.webp",
14
+ "./package.json": "./package.json",
11
15
  "./locale/*.json": "./locale/*.json"
12
16
  },
13
- "files": ["index.js", "client.js", "cordis.patch.yml", "locale/*.json", "README.md", "README.zh.md", "LICENSE"],
17
+ "files": ["index.js", "client.js", "cordis.patch.yml", "icon.webp", "locale/*.json", "README.md", "README.zh.md", "LICENSE"],
14
18
  "dsh": {
15
19
  "bundle": { "patch": "./cordis.patch.yml" },
16
20
  "client": {