From 01b853fd0ecd4d24df929b9405d0ab9baa5bc408 Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 12 Oct 2026 01:45:02 +0000 Subject: [PATCH] Render compiled plugin entries in the admin plugins list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: /api/plugins now merges compiled-in plugins (backend.mode=inproc); the list needed to badge them as builtin, count their commands, and stop printing a dangling "v" when the synthesized manifest has no version. Evidence: npx vitest run 100/100 green incl. design-guard; tsc --noEmit clean for src (../ui errors are the symlinked-deps environment only); CI (make test) is authoritative. Impact: PluginsSection label hides empty versions, desc adds a command count and falls back to manifest intent counts, and inproc entries get a "内置" badge next to the api badge. No token or color changes. Refs: WP3-I4; task card feature-plugins-compiled-listing. --- src/components/adminSections.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/adminSections.tsx b/src/components/adminSections.tsx index ee05113..15faddf 100644 --- a/src/components/adminSections.tsx +++ b/src/components/adminSections.tsx @@ -193,9 +193,18 @@ export function PluginsSection() { {plugins.length === 0 && 暂无已装载插件
(插件目录在 设置 → 常规 → 插件目录;示例见 Dev 仓 plugins/example)
} {plugins.map(p => ( - api {p.manifest.apiVersion} + label={p.manifest.name + (p.manifest.version ? ` v${p.manifest.version}` : '')} + desc={[ + `工具 ${p.manifest.provides.tools?.length ?? 0}`, + `命令 ${p.manifest.provides.commands?.length ?? 0}`, + `面板 ${p.panels?.length ?? 0}`, + `意图 ${p.intents?.length ?? p.manifest.provides.intents?.length ?? 0}`, + `工作流 ${p.workflows?.length ?? 0}`, + ].join(' · ')}> + + {p.manifest.backend?.mode === 'inproc' && 内置} + api {p.manifest.apiVersion} + ))}