参考
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 |
icon、publisher.avatar | assets/ 下的安全相对图片路径 |
categories | 1–3 个 Oho 维护的市场类别 |
contributors | 除发布者之外的共同维护者 |
repository | Plugin 的公开 HTTP(S) 源代码地址 |
Registry 详情页将根目录 README.md 作为“概述”,将 CHANGELOG.md 作为“版本记录”。发布时两者都必须存在。
本地 Node Runtime
schemaVersion 为 2,runtime.kind 为 node,compatibility.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: 1 和 compatibility.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 时,本次调用失败。