问题
客户端把「渲染器插槽」当成一等插件能力,但插件中心的发布接口不认声明它的三个清单字段,导致用插槽画 UI 的插件无法上架。
客户端侧(PI-Desktop 0.16.1,macOS)这套能力是完整落地的:
- 清单字段
renderer / rendererActions / rendererCallMethods,权限 renderer.extension(界面上写的是 "Draw UI in chat slots"),都能正常加载。
- 规格:
docs/plugin-plan/ui/composer/ 与 docs/plugin-plan/ui/self-dialog/(后者状态已是 finalized,原话「全屏弹窗与角落浮层由插件自理——无槽、无注册」)。
- SDK 类型:
packages/plugin-sdk/src/renderer.ts(PLUGIN_RENDERER_SLOTS、PluginComposerControlSlotProps、PluginLayer、PLUGIN_RENDERER_ACTIONS)。
- 官方示例:
examples/plugins/ui-slots-lab(renderer/index.mjs 给每个插槽都挂了一个样例),并有 e2e 覆盖 apps/desktop/test/e2e/plugin-ui-slots/。
- 宿主二进制里的清单结构也带这些字段(
PluginManifest 共 16 个元素,含 rendererActions / rendererCallMethods)。
发布端不认。 对默认目录源(https://plugins.aiuo.net/mcp,服务端 pi-plugin-center 0.2.0):
- 三个发布工具都拒绝未知字段:
pack_plugin、create_plugin、submit_version 一律返回 the arguments are not valid for this tool: json: unknown field "renderer"。去掉 renderer 只发 rendererActions 同样被拒(unknown field "rendererActions")。
- 文档里的字段表(
get_skill / skill.md)只列 ui、contributes、activationEvents、fs、net 作为「host load contract」原样接收的对象,没有任何 renderer*。
- 也没有绕过办法:平台会按字段重建
manifest.json。把插件自己的 manifest.json 作为 files 的一项发过去会被接受(无 blocker),但返回的 .piplug 里那份是重建过的,字段消失。解包实测:
发送 files:19 个(含 manifest.json)
成品包内 manifest 顶层键:author, categories, changelog, contributes, description, engines,
homepage, i18n, id, license, main, name, permissions, safetyNotes, schemaVersion, version
成品包内 manifest 是否含 renderer:False
renderer.extension 对中心也是未知权限,会返回 MAN013 unknown permission requires host-policy review: renderer.extension。该权限既不在 docs/spec/07-plugins/13-plugin-permissions-matrix.md,也不在内置开发指南 apps/desktop/resources/skills/plugin-development.md(那份指南里 slots / composerControl / rendererActions 一个字都没有)。
后果:界面靠输入框控件或自绘角落浮层实现的插件,只能往中心发一个「没有按钮」的裁剪版,真正的构建得靠 GitHub Release 发 .piplug。于是目录页写的和用户装到的不是一回事,中心做的源码绑定与审核也覆盖不到用户实际运行的那份代码。
期望改动
- 给发布接口补上
renderer / rendererActions / rendererCallMethods(pack_plugin、create_plugin、submit_version 三个都要),并同步 skill.md / get_skill 的字段表,让平台重建出的 manifest 与宿主接受的一致。
- 给
docs/spec/07-plugins/13-plugin-permissions-matrix.md 补上 renderer.extension 并给出风险档位。宿主本来就把它当一个总括权限(形态与 agent.extension 一致),中心也认得出这个名字,只是没有档位。
- 在内置开发指南
apps/desktop/resources/skills/plugin-development.md 里补上渲染器插槽。现在只照那份指南写插件的作者,根本发现不了 composerControl、entryExtra、toolCard、blockRenderer、userAction、assistantAction、composerTrigger 和自绘层。
- 可选(为了让包与目录始终一致):要么接受带自己
manifest.json 的预构建 .piplug 并原样使用,要么对 files 里名为 manifest.json 的项明确报错,而不是悄悄重建。
其他方案
- 往中心发纯命令版、真正的构建放 GitHub Release。不接受:目录条目会与实际装到的东西不符,我做的改动也落在中心的审核范围之外。
- 改用中心已经接受的字段来表达插槽。
ui 确实被接受,客户端的市场元数据类型也带它(PluginUiMeta:panel、width、height、shape、alwaysOnTop、resizable),所以面板类 UI 今天就能上架——但 ui 表达不了输入框控件、消息操作栏、工具卡片和角落浮层。
- 用
ui.panel + ui.shape: "widget" 做角落按钮来替代自绘层。也不接受:widget 窗口的位置不可控(pi.ui.openPanel() 不接受 x / y,窗口能执行的动作只有 getState / minimize / toggleMaximize / close / contextMenu,位置也不持久化),它只能落在屏幕正中、压住内容。
补充信息
环境:PI-Desktop 0.16.1(macOS),默认目录源 https://plugins.aiuo.net/catalog.json,MCP 端点 https://plugins.aiuo.net/mcp,发布账号 w1ndys。
最小复现(干跑,不落库):
TOKEN=$(cat ~/.pi-desktop/plugin-center.token)
curl -sS -X POST https://plugins.aiuo.net/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H "Authorization: Bearer $TOKEN" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"pack_plugin","arguments":{
"id":"io.github.w1ndys.pi-open-in-vscode","version":"0.5.0","name":"用 VSCode 打开",
"description":"用 Visual Studio Code 打开当前工作目录。",
"main":"main.js","releaseNotes":"dry run","sourceRef":"<commit-sha>",
"permissions":["renderer.extension","notify"],
"renderer":"renderer/index.mjs",
"rendererActions":["plugin.call"],
"rendererCallMethods":["openWorkspace"],
"files":[{"path":"main.js","content":"module.exports = {};"}]}}}'
# → the arguments are not valid for this tool: json: unknown field "renderer"
对照(同一个端点,都是干跑):
| 载荷 |
结果 |
带 renderer / rendererActions |
json: unknown field "renderer",不出包 |
files 里带 manifest.json |
blockers 0,但包内 manifest 被重建、renderer 丢失 |
ui = widget + ui.panel,无 renderer* |
blockers: 0, findings: [], readyToPublish: true(可发布) |
受影响的插件(我自己的公开仓):https://github.com/w1ndys/pi-open-in-vscode —— v0.3.0(纯命令版)在中心上;带两个按钮的构建因此只能本地使用。
问题
客户端把「渲染器插槽」当成一等插件能力,但插件中心的发布接口不认声明它的三个清单字段,导致用插槽画 UI 的插件无法上架。
客户端侧(PI-Desktop 0.16.1,macOS)这套能力是完整落地的:
renderer/rendererActions/rendererCallMethods,权限renderer.extension(界面上写的是 "Draw UI in chat slots"),都能正常加载。docs/plugin-plan/ui/composer/与docs/plugin-plan/ui/self-dialog/(后者状态已是 finalized,原话「全屏弹窗与角落浮层由插件自理——无槽、无注册」)。packages/plugin-sdk/src/renderer.ts(PLUGIN_RENDERER_SLOTS、PluginComposerControlSlotProps、PluginLayer、PLUGIN_RENDERER_ACTIONS)。examples/plugins/ui-slots-lab(renderer/index.mjs给每个插槽都挂了一个样例),并有 e2e 覆盖apps/desktop/test/e2e/plugin-ui-slots/。PluginManifest共 16 个元素,含rendererActions/rendererCallMethods)。发布端不认。 对默认目录源(
https://plugins.aiuo.net/mcp,服务端pi-plugin-center0.2.0):pack_plugin、create_plugin、submit_version一律返回the arguments are not valid for this tool: json: unknown field "renderer"。去掉renderer只发rendererActions同样被拒(unknown field "rendererActions")。get_skill/skill.md)只列ui、contributes、activationEvents、fs、net作为「host load contract」原样接收的对象,没有任何renderer*。manifest.json。把插件自己的manifest.json作为files的一项发过去会被接受(无 blocker),但返回的.piplug里那份是重建过的,字段消失。解包实测:renderer.extension对中心也是未知权限,会返回MAN013 unknown permission requires host-policy review: renderer.extension。该权限既不在docs/spec/07-plugins/13-plugin-permissions-matrix.md,也不在内置开发指南apps/desktop/resources/skills/plugin-development.md(那份指南里 slots /composerControl/rendererActions一个字都没有)。后果:界面靠输入框控件或自绘角落浮层实现的插件,只能往中心发一个「没有按钮」的裁剪版,真正的构建得靠 GitHub Release 发
.piplug。于是目录页写的和用户装到的不是一回事,中心做的源码绑定与审核也覆盖不到用户实际运行的那份代码。期望改动
renderer/rendererActions/rendererCallMethods(pack_plugin、create_plugin、submit_version三个都要),并同步skill.md/get_skill的字段表,让平台重建出的 manifest 与宿主接受的一致。docs/spec/07-plugins/13-plugin-permissions-matrix.md补上renderer.extension并给出风险档位。宿主本来就把它当一个总括权限(形态与agent.extension一致),中心也认得出这个名字,只是没有档位。apps/desktop/resources/skills/plugin-development.md里补上渲染器插槽。现在只照那份指南写插件的作者,根本发现不了composerControl、entryExtra、toolCard、blockRenderer、userAction、assistantAction、composerTrigger和自绘层。manifest.json的预构建.piplug并原样使用,要么对files里名为manifest.json的项明确报错,而不是悄悄重建。其他方案
ui确实被接受,客户端的市场元数据类型也带它(PluginUiMeta:panel、width、height、shape、alwaysOnTop、resizable),所以面板类 UI 今天就能上架——但ui表达不了输入框控件、消息操作栏、工具卡片和角落浮层。ui.panel+ui.shape: "widget"做角落按钮来替代自绘层。也不接受:widget 窗口的位置不可控(pi.ui.openPanel()不接受x/y,窗口能执行的动作只有getState/minimize/toggleMaximize/close/contextMenu,位置也不持久化),它只能落在屏幕正中、压住内容。补充信息
环境:PI-Desktop 0.16.1(macOS),默认目录源
https://plugins.aiuo.net/catalog.json,MCP 端点https://plugins.aiuo.net/mcp,发布账号w1ndys。最小复现(干跑,不落库):
对照(同一个端点,都是干跑):
renderer/rendererActionsjson: unknown field "renderer",不出包files里带manifest.jsonrenderer丢失ui= widget +ui.panel,无renderer*blockers: 0, findings: [], readyToPublish: true(可发布)受影响的插件(我自己的公开仓):https://github.com/w1ndys/pi-open-in-vscode ——
v0.3.0(纯命令版)在中心上;带两个按钮的构建因此只能本地使用。