OhoDevelopers
参考

Manifest 参考

oho.plugin.json 的身份、贡献、Runtime、权限和兼容性字段。

每个 Plugin 的根目录包含 oho.plugin.json。Oho 在运行 Plugin 代码前先解析这份可审查契约。

最小本地 Node Plugin

{
  "schemaVersion": 2,
  "id": "text-inspector",
  "version": "0.1.0",
  "name": "Text Inspector",
  "description": "Count characters, words, and UTF-8 bytes in text.",
  "icon": "assets/icon.svg",
  "publisher": {
    "id": "publisher-id-from-oho",
    "name": "Publisher Name",
    "avatar": "assets/publisher-avatar.svg"
  },
  "categories": ["utilities"],
  "contributors": [],
  "repository": "https://github.com/example/text-inspector",
  "contributes": {
    "skills": [],
    "commands": [],
    "tools": [
      {
        "id": "text.stats",
        "label": "统计文本",
        "description": "Count characters, words, and UTF-8 bytes in text.",
        "inputSchema": {
          "type": "object",
          "properties": { "text": { "type": "string" } },
          "required": ["text"],
          "additionalProperties": false
        },
        "outputSchema": {
          "type": "object",
          "properties": {
            "characters": { "type": "integer" },
            "words": { "type": "integer" },
            "utf8_bytes": { "type": "integer" }
          },
          "required": ["characters", "words", "utf8_bytes"],
          "additionalProperties": false
        },
        "risk": "low",
        "sideEffect": "none",
        "network": "none",
        "timeoutMs": 2000,
        "maxCallsPerRun": 4,
        "executionMode": "parallel",
        "defaultMode": "allowed"
      }
    ],
    "connections": []
  },
  "runtime": { "kind": "node", "entry": "src/index.mjs" },
  "connectionFields": [],
  "permissions": { "network": [], "secrets": [] },
  "compatibility": { "ohoPluginApi": "2" }
}

身份

字段规则
id小写 kebab-case,最多 64 字符,发布后保持稳定
version语义化版本
name最多 80 字符的显示名称
publisher.id当前 Oho 账号的稳定 ID
iconpublisher.avatarassets/ 下的安全相对图片路径
categories1–3 个 Oho 维护的市场类别
contributors除发布者之外的共同维护者
repositoryPlugin 的公开 HTTP(S) 源代码地址

Registry 详情页将根目录 README.md 作为“概述”,将 CHANGELOG.md 作为“版本记录”。发布时两者都必须存在。

本地 Node Runtime

schemaVersion2runtime.kindnodecompatibility.ohoPluginApi"2"。Runtime 默认导出 tools 数组,Tool ID 和顺序必须与 Manifest 一致:

export default {
  tools: [
    {
      id: "text.stats",
      execute({ text }) {
        const value = String(text);
        return {
          characters: Array.from(value).length,
          words: value.trim() ? value.trim().split(/\s+/u).length : 0,
          utf8_bytes: new TextEncoder().encode(value).length,
        };
      },
    },
  ],
};

内容型 Plugin

只贡献 Skill、Command 或 Connection 元数据时,不声明 Runtime,使用 schemaVersion: 1compatibility.ohoPackApi: "1"。内容型 Plugin 不能声明可执行 Tool。

Remote MCP

Remote MCP 使用 schemaVersion: 1,必须声明:

  • runtime.kind: "remote_mcp"
  • MCP 协议版本 2025-06-18
  • Endpoint 和 Bearer Token 对应的连接字段;
  • toolPolicy.allow、每个 Tool 的风险和默认模式;
  • 写工具的目标策略。

MCP Tool 来自 discovery,不能同时放进 contributes.tools

路径与 Schema

  • Runtime 入口只允许安全相对 .js.mjs 路径;
  • Skill 和 Command 入口必须是至少两段的相对 .md 路径;
  • 发布图片必须位于 assets/
  • 对象输入和输出应显式声明 additionalProperties: false
  • Tool 返回 undefined 或不符合输出 Schema 时,本次调用失败。