- core 协议:Plugin 接口/注册器(重名拒绝/生命周期正序逆序/dispose幂等/错误隔离不连坐)+受控面 PluginContext(禁直透 littlejsengine)——前任agent核心设计17测绿收编(死于收尾的工具调用解析失败,续作字节级未碰) - _example 空插件样例五件全(克隆母本)+PLUGIN-TEMPLATE 六节规格+manifest schema+零依赖校验器(负例自检逮6违规) - scripts:esbuild锁参build/增量法size/test.sh遍历;browser-evidence harness纯计算口径冻结(FNV-1a/直方图/几何,CDP四函数=集成段占位) - 22/22 测全绿(RESULT.txt 留档);ESM JS+JSDoc+手写d.ts 零工具链纪律全程 - rc 状态:待 Gate0.1 受控面补丁(input/audio+per-plugin派生RNG+useContext守卫)后冻结 core-protocol-v0 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
73 lines
2.8 KiB
JSON
73 lines
2.8 KiB
JSON
{
|
||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||
"$id": "https://zaomeng.ai/schemas/plugin-manifest/v0",
|
||
"title": "Plugin Manifest (core-protocol-v0)",
|
||
"description": "LittleJS 增强发行版每个插件的 manifest.json 契约。owner=T1b-α lane-core。字段封闭(additionalProperties:false),新增字段须改本 schema 走 Gate0 评审,防 lane 私自塞玩法/美术语义入插件元数据。",
|
||
"type": "object",
|
||
"additionalProperties": false,
|
||
"required": ["name", "version", "gzBudgetBytes", "exports"],
|
||
"properties": {
|
||
"name": {
|
||
"type": "string",
|
||
"description": "插件唯一名(注册键,与 Plugin.name 一致)。kebab-case,无玩法/品类语义。",
|
||
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
|
||
"minLength": 2,
|
||
"maxLength": 40
|
||
},
|
||
"version": {
|
||
"type": "string",
|
||
"description": "插件 semver 版本(与 Plugin.version 一致)。随发行版整体演进;只增不破坏既有 API。",
|
||
"pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$"
|
||
},
|
||
"gzBudgetBytes": {
|
||
"type": "integer",
|
||
"description": "本插件 gz 字节配额(自律线,集成段 size.mjs 增量法实测对照)。超配额触发评审(执行版 §5)。",
|
||
"minimum": 1,
|
||
"maximum": 65536
|
||
},
|
||
"dependencies": {
|
||
"type": "array",
|
||
"description": "声明依赖的其它插件 name 列表(与 Plugin.dependencies 一致)。注册器 init 前校验是否已注册;本波不做拓扑重排。可空。",
|
||
"items": {
|
||
"type": "string",
|
||
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
|
||
},
|
||
"uniqueItems": true,
|
||
"default": []
|
||
},
|
||
"exports": {
|
||
"type": "object",
|
||
"description": "导出规则:声明本插件对外暴露的能力面入口(供 agent/lane 读取与构建索引)。只描述能力面位置与命名,不含实现。",
|
||
"additionalProperties": false,
|
||
"required": ["impl", "types"],
|
||
"properties": {
|
||
"impl": {
|
||
"type": "string",
|
||
"description": "实现入口文件(相对插件目录),ESM JS。如 'impl.js'。",
|
||
"pattern": "^[A-Za-z0-9_.-]+\\.js$"
|
||
},
|
||
"types": {
|
||
"type": "string",
|
||
"description": "手写类型门面文件(相对插件目录),.d.ts。如 'api.d.ts'。",
|
||
"pattern": "^[A-Za-z0-9_.-]+\\.d\\.ts$"
|
||
},
|
||
"named": {
|
||
"type": "array",
|
||
"description": "本插件导出的具名符号清单(供索引/校验「能力面无玩法语义」)。可空。",
|
||
"items": {
|
||
"type": "string",
|
||
"pattern": "^[A-Za-z_$][A-Za-z0-9_$]*$"
|
||
},
|
||
"uniqueItems": true,
|
||
"default": []
|
||
}
|
||
}
|
||
},
|
||
"description": {
|
||
"type": "string",
|
||
"description": "一句话能力描述(engine 级,无玩法语义)。可选。",
|
||
"maxLength": 200
|
||
}
|
||
}
|
||
}
|