Appearance
插件 Manifest 参数说明
本页基于当前 schema 定义 plugin.manifest.json 的完整字段。所有字段描述以实际代码识别的为准。
顶层字段
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
id | 是 | string | 插件唯一标识,用于命令命名空间和去重 |
name | 是 | string | 展示名称 |
version | 是 | string | 版本号(建议语义化版本) |
kind | 是 | string | 插件类型:tool / channel / skill |
description | 否 | string | 插件功能说明 |
capabilities | 否 | string[] | 能力声明(如 ["tool:command"]、["channel:dingtalk"]) |
permissions | 否 | string[] | 权限声明 |
config_schema | 否 | object | 用户配置的 JSON Schema 定义 |
ui_schema | 否 | object | 配置表单界面渲染提示 |
entrypoints | 否 | object | 入口点定义(命令入口、渠道适配器) |
commands | 否 | Command[] | 命令定义列表(tool 类型插件的快捷方式) |
compatibilityMode | 否 | string | 兼容模式,默认 native |
openclaw | 否 | object | OpenClaw 兼容配置(仅 openclaw 模式需要) |
signing | 否 | object | 签名信息 |
min_runtime_version | 否 | string | 最低运行时版本要求 |
metadata | 否 | object | 额外扩展信息 |
kind
kind 决定插件类型,仅接受以下值:
| 值 | 说明 |
|---|---|
tool | 命令型、本地工具型扩展 |
channel | 渠道连接、消息收发 |
skill | 技能桥接兼容或技能类扩展 |
WARNING
填写其他值将导致 schema 校验失败。
commands
commands 定义插件暴露的命令列表。每个命令自动注册为 plugin.<plugin-id>.<command-name> 格式。
命令字段
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
name | 是 | string | 命令名(同一插件内唯一) |
description | 否 | string | 命令说明 |
type | 否 | string | 命令执行类型 |
response | 否 | string | 固定响应内容(type: response 时使用) |
response_template | 否 | string | 模板响应(type: template 时使用,支持 {{config.xxx}}) |
program | 否 | string | 外部程序路径(type: process / stdio 时使用) |
args | 否 | string[] | 程序参数 |
required_config | 否 | string[] | 依赖的配置项 |
timeout_seconds | 否 | number | 超时时间(秒) |
type 取值
| 值 | 说明 | 示例场景 |
|---|---|---|
response | 返回固定文本 | 帮助信息、版本号 |
template | 返回模板渲染结果 | 基于配置的动态回复 |
process | 启动外部进程 | 调用 bash 脚本、Python 脚本 |
stdio | 标准输入输出通信 | 需要交互的外部程序 |
命令示例
json
{
"commands": [
{
"name": "greet",
"type": "template",
"description": "基于配置返回欢迎语",
"response_template": "{{config.welcome_text}}"
},
{
"name": "run-script",
"type": "process",
"description": "执行自定义脚本",
"program": "node",
"args": ["scripts/run.js"],
"timeout_seconds": 30,
"required_config": ["api_key"]
}
]
}config_schema
config_schema 声明插件的用户配置项,采用 JSON Schema 格式。Workova 根据此定义自动渲染配置表单。
基本结构
json
{
"config_schema": {
"type": "object",
"properties": {
"field_name": {
"type": "string",
"title": "字段标题",
"description": "字段说明"
}
},
"required": ["field_name"]
}
}WARNING
最外层必须是 {"type": "object", "properties": {...}}。直接写字段定义(缺少 type: "object" 包裹)会导致表单无法渲染。
字段属性
| 属性 | 说明 |
|---|---|
type | 字段类型:string、number、boolean、array、object |
title | 显示标题 |
description | 字段说明文本 |
placeholder | 输入框提示文本 |
default | 默认值 |
enum | 枚举选项列表 |
items | 数组项定义(type: "array" 时使用) |
properties | 嵌套对象字段(type: "object" 时使用) |
required | 嵌套必填字段列表 |
format | 格式提示(如 email、uri) |
widget | UI 组件提示(如 textarea、password) |
secret | 是否为敏感信息(true 时前端以密码形式显示) |
配置示例
json
{
"config_schema": {
"type": "object",
"properties": {
"api_key": {
"type": "string",
"title": "API Key",
"description": "用于认证的密钥",
"secret": true,
"widget": "password"
},
"mode": {
"type": "string",
"title": "运行模式",
"enum": ["production", "development"],
"default": "production"
},
"max_retries": {
"type": "number",
"title": "最大重试次数",
"default": 3
},
"description": {
"type": "string",
"title": "备注",
"widget": "textarea"
}
},
"required": ["api_key"]
}
}ui_schema
ui_schema 补充表单展示层信息,不影响数据校验,仅作为界面渲染建议。
entrypoints
entrypoints 定义插件的入口点。
entrypoints.commands
命令入口点,与顶层 commands 字段等效。推荐使用顶层 commands。
entrypoints.channel_adapter
渠道型插件的核心配置段。
| 字段 | 必填 | 说明 |
|---|---|---|
mode | 是 | 接入模式 |
supported_channels | 是 | 支持的渠道列表(如 ["dingtalk", "feishu"]) |
channel_type | 否 | 渠道类型标识 |
lifecycle | 否 | 生命周期钩子定义 |
INFO
supported_channels 也可写作 camelCase 形式 supportedChannels,两种写法均被识别。
mode 取值
| 值 | 说明 |
|---|---|
managed_webhook | 托管 Webhook(钉钉、飞书) |
direct_ws | WebSocket 直连(Telegram、Discord) |
direct_stream | 流式直连 |
direct_polling | 轮询直连 |
lifecycle 钩子
可声明的生命周期阶段:
install、validate、connect、disconnect、receive、send、health、route、archive_media
每个钩子的值可以是:
true/false— 启用或禁用- 字符串路径 — 指向处理脚本(如
"scripts/lifecycle.js")
渠道适配器示例
json
{
"entrypoints": {
"channel_adapter": {
"mode": "managed_webhook",
"supported_channels": ["dingtalk"],
"lifecycle": {
"validate": "scripts/lifecycle.js",
"receive": "scripts/lifecycle.js",
"send": "scripts/lifecycle.js",
"health": true
}
}
}
}compatibilityMode
| 值 | 说明 |
|---|---|
native | Workova 原生接入(默认) |
openclaw | 兼容 OpenClaw 桥接协议 |
skill_bridge | 技能桥接兼容层 |
openclaw
当 compatibilityMode 为 openclaw 时必须提供:
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
adapter | 是 | string | 桥接适配器名称 |
entry | 是 | string | 入口文件路径 |
capabilities | 否 | string[] | 能力列表 |
最小可用示例
工具插件
json
{
"id": "demo-tool",
"name": "Demo Tool",
"version": "1.0.0",
"kind": "tool",
"commands": [
{
"name": "hello",
"type": "response",
"response": "hello workova"
}
]
}渠道插件
json
{
"id": "demo-channel",
"name": "Demo Channel",
"version": "1.0.0",
"kind": "channel",
"capabilities": ["channel:demo"],
"entrypoints": {
"channel_adapter": {
"mode": "managed_webhook",
"supported_channels": ["demo"],
"lifecycle": {
"receive": "scripts/handler.js",
"send": "scripts/handler.js"
}
}
}
}常见错误
| 错误 | 原因 | 解决方案 |
|---|---|---|
| kind 校验失败 | kind 值不是 tool/channel/skill | 修正为合法值 |
| config_schema 表单不渲染 | 缺少外层 type: "object" | 用 {"type": "object", "properties": {...}} 包裹 |
| openclaw 模式报错 | 设为 openclaw 但缺少配置段 | 补充 openclaw.adapter 和 openclaw.entry |
| 渠道适配器报错 | 缺少 supported_channels | 添加至少一个渠道标识 |
| 命令未出现 | 命令 name 为空 | 确保每个命令都有非空 name |