125 lines
3.2 KiB
JSON
125 lines
3.2 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 Action manifest 通用契约(schemaVersion 1)",
|
||
"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"]
|
||
},
|
||
"scalarArg": {
|
||
"type": ["string", "number", "boolean"]
|
||
},
|
||
"inputProperty": {
|
||
"type": "object",
|
||
"required": ["type"],
|
||
"additionalProperties": true,
|
||
"properties": {
|
||
"type": {
|
||
"type": "string",
|
||
"enum": ["string", "number", "boolean", "object"]
|
||
},
|
||
"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" }
|
||
}
|
||
}
|
||
},
|
||
"confirmation": {
|
||
"type": "object",
|
||
"required": ["message"],
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"message": {
|
||
"type": "string",
|
||
"minLength": 1
|
||
}
|
||
}
|
||
},
|
||
"action": {
|
||
"type": "object",
|
||
"required": ["id", "label", "description", "placements", "entrypoint"],
|
||
"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" }
|
||
},
|
||
"entrypoint": { "$ref": "#/$defs/entrypoint" },
|
||
"inputSchema": { "$ref": "#/$defs/inputSchema" },
|
||
"confirmation": { "$ref": "#/$defs/confirmation" }
|
||
}
|
||
}
|
||
}
|
||
}
|