167 lines
5.4 KiB
JSON
167 lines
5.4 KiB
JSON
{
|
||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||
"$id": "https://openclaw.local/skill-template/skill-actions.schema.json",
|
||
"title": "SkillActionManifest",
|
||
"description": "匠厂 skill-template 对新技能的严格 Action manifest 规范(schemaVersion 1)。additionalProperties=false 表示模板推荐契约;宿主运行时可能为兼容历史 manifest 接受部分缺省字段,但新技能不应依赖缺省行为。",
|
||
"type": "object",
|
||
"required": ["schemaVersion", "skill", "actions"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"schemaVersion": {
|
||
"type": "integer",
|
||
"const": 1
|
||
},
|
||
"skill": {
|
||
"type": "string",
|
||
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
|
||
"description": "与 SKILL.md metadata.openclaw.slug 一致"
|
||
},
|
||
"actions": {
|
||
"type": "array",
|
||
"minItems": 1,
|
||
"items": { "$ref": "#/$defs/action" }
|
||
}
|
||
},
|
||
"$defs": {
|
||
"placement": {
|
||
"type": "string",
|
||
"enum": ["toolbar", "row", "batch", "cron", "agent", "skill-detail"],
|
||
"description": "稳定支持 toolbar/cron/agent/skill-detail;row/batch 为预留入口,新技能示例不得使用。placements 与 executionProfile 正交,不做条件限制。"
|
||
},
|
||
"scalarArg": {
|
||
"type": ["string", "number", "boolean"]
|
||
},
|
||
"inputProperty": {
|
||
"type": "object",
|
||
"required": ["type"],
|
||
"additionalProperties": true,
|
||
"properties": {
|
||
"type": {
|
||
"type": "string",
|
||
"enum": ["string", "number", "boolean", "object"],
|
||
"description": "模板 Phase 1 仅推荐 string/number/boolean;根 inputSchema.type=object 的 properties 使用基础标量类型"
|
||
},
|
||
"title": { "type": "string" },
|
||
"description": { "type": "string" },
|
||
"default": {},
|
||
"enum": {
|
||
"type": "array",
|
||
"minItems": 1
|
||
},
|
||
"sensitive": { "type": "boolean" }
|
||
}
|
||
},
|
||
"inputSchema": {
|
||
"type": "object",
|
||
"required": ["type", "properties"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"type": { "const": "object" },
|
||
"required": {
|
||
"type": "array",
|
||
"items": { "type": "string" }
|
||
},
|
||
"properties": {
|
||
"type": "object",
|
||
"additionalProperties": { "$ref": "#/$defs/inputProperty" }
|
||
}
|
||
}
|
||
},
|
||
"entrypoint": {
|
||
"type": "object",
|
||
"required": ["type", "command", "args"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"type": { "const": "cli" },
|
||
"command": {
|
||
"type": "string",
|
||
"minLength": 1
|
||
},
|
||
"args": {
|
||
"type": "array",
|
||
"items": { "$ref": "#/$defs/scalarArg" },
|
||
"description": "仅允许 string/number/boolean 标量数组"
|
||
}
|
||
}
|
||
},
|
||
"confirmation": {
|
||
"type": "object",
|
||
"required": ["message"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"message": {
|
||
"type": "string",
|
||
"minLength": 1
|
||
}
|
||
}
|
||
},
|
||
"bind": {
|
||
"type": "object",
|
||
"required": ["tables"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"tables": {
|
||
"type": "array",
|
||
"minItems": 1,
|
||
"uniqueItems": true,
|
||
"items": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"pattern": "^[a-z][a-z0-9_]*$",
|
||
"description": "英文 snake_case 业务表名;须真实存在于技能 SQLite / _jiangchang_tables"
|
||
},
|
||
"description": "数据管理表级绑定:决定 toolbar Action 出现在哪些表。宿主兼容旧技能时,缺失 bind 可视为全表展示;新技能 toolbar Action 必须显式声明。"
|
||
}
|
||
},
|
||
"description": "Phase 1 仅沉淀 bind.tables;不包含 selection/inputMapping/columns/row/concurrency/locks"
|
||
},
|
||
"action": {
|
||
"type": "object",
|
||
"required": ["id", "label", "description", "placements", "entrypoint", "executionProfile"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
|
||
"minLength": 1
|
||
},
|
||
"label": {
|
||
"type": "string",
|
||
"minLength": 1
|
||
},
|
||
"description": {
|
||
"type": "string",
|
||
"minLength": 1
|
||
},
|
||
"placements": {
|
||
"type": "array",
|
||
"minItems": 1,
|
||
"items": { "$ref": "#/$defs/placement" },
|
||
"description": "决定 Action 出现在哪里;与 executionProfile 正交"
|
||
},
|
||
"entrypoint": { "$ref": "#/$defs/entrypoint" },
|
||
"inputSchema": { "$ref": "#/$defs/inputSchema" },
|
||
"confirmation": { "$ref": "#/$defs/confirmation" },
|
||
"executionProfile": {
|
||
"type": "string",
|
||
"enum": ["sync", "async"],
|
||
"description": "sync=调用方等待结构化结果(不建 Job);async=宿主建后台 Job 并进任务中心。必须显式写出;长耗时建议 async,但不限制 placements。"
|
||
},
|
||
"bind": { "$ref": "#/$defs/bind" }
|
||
},
|
||
"if": {
|
||
"properties": {
|
||
"placements": {
|
||
"contains": { "const": "toolbar" }
|
||
}
|
||
},
|
||
"required": ["placements"]
|
||
},
|
||
"then": {
|
||
"required": ["bind"]
|
||
},
|
||
"description": "concurrency/locks 为未稳定预留字段,勿写入新技能 manifest。placements 含 toolbar 时必须声明 bind.tables。"
|
||
}
|
||
}
|
||
}
|