Skip to content

插件 Manifest 参数说明

本页基于当前 schema 定义 plugin.manifest.json 的完整字段。所有字段描述以实际代码识别的为准。

顶层字段

字段必填类型说明
idstring插件唯一标识,用于命令命名空间和去重
namestring展示名称
versionstring版本号(建议语义化版本)
kindstring插件类型:tool / channel / skill
descriptionstring插件功能说明
capabilitiesstring[]能力声明(如 ["tool:command"]["channel:dingtalk"]
permissionsstring[]权限声明
config_schemaobject用户配置的 JSON Schema 定义
ui_schemaobject配置表单界面渲染提示
entrypointsobject入口点定义(命令入口、渠道适配器)
commandsCommand[]命令定义列表(tool 类型插件的快捷方式)
compatibilityModestring兼容模式,默认 native
openclawobjectOpenClaw 兼容配置(仅 openclaw 模式需要)
signingobject签名信息
min_runtime_versionstring最低运行时版本要求
metadataobject额外扩展信息

kind

kind 决定插件类型,仅接受以下值:

说明
tool命令型、本地工具型扩展
channel渠道连接、消息收发
skill技能桥接兼容或技能类扩展

WARNING

填写其他值将导致 schema 校验失败。


commands

commands 定义插件暴露的命令列表。每个命令自动注册为 plugin.<plugin-id>.<command-name> 格式。

命令字段

字段必填类型说明
namestring命令名(同一插件内唯一)
descriptionstring命令说明
typestring命令执行类型
responsestring固定响应内容(type: response 时使用)
response_templatestring模板响应(type: template 时使用,支持 {‌{config.xxx}‌}
programstring外部程序路径(type: process / stdio 时使用)
argsstring[]程序参数
required_configstring[]依赖的配置项
timeout_secondsnumber超时时间(秒)

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字段类型:stringnumberbooleanarrayobject
title显示标题
description字段说明文本
placeholder输入框提示文本
default默认值
enum枚举选项列表
items数组项定义(type: "array" 时使用)
properties嵌套对象字段(type: "object" 时使用)
required嵌套必填字段列表
format格式提示(如 emailuri
widgetUI 组件提示(如 textareapassword
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_wsWebSocket 直连(Telegram、Discord)
direct_stream流式直连
direct_polling轮询直连

lifecycle 钩子

可声明的生命周期阶段:

installvalidateconnectdisconnectreceivesendhealthroutearchive_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

说明
nativeWorkova 原生接入(默认)
openclaw兼容 OpenClaw 桥接协议
skill_bridge技能桥接兼容层

openclaw

compatibilityModeopenclaw 时必须提供:

字段必填类型说明
adapterstring桥接适配器名称
entrystring入口文件路径
capabilitiesstring[]能力列表

最小可用示例

工具插件

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.adapteropenclaw.entry
渠道适配器报错缺少 supported_channels添加至少一个渠道标识
命令未出现命令 name 为空确保每个命令都有非空 name

相关文档

Workova 官方文档