67 lines
2.7 KiB
JSON
Executable File
67 lines
2.7 KiB
JSON
Executable File
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://cognitive-agent.local/schemas/capability-catalog.schema.json",
|
|
"title": "CapabilityCatalog",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["apiVersion", "kind", "metadata", "spec"],
|
|
"properties": {
|
|
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
|
|
"kind": {"const": "CapabilityCatalog"},
|
|
"metadata": {"$ref": "common.schema.json#/$defs/metadata"},
|
|
"spec": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["domain", "capabilities"],
|
|
"properties": {
|
|
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
|
"capabilities": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["name", "description", "target_devices", "parameters", "risk_level", "confirmation_policy"],
|
|
"properties": {
|
|
"name": {"type": "string", "pattern": "^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$"},
|
|
"description": {"type": "string", "minLength": 1, "maxLength": 1000},
|
|
"target_devices": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"uniqueItems": true,
|
|
"items": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}
|
|
},
|
|
"target_scopes": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"uniqueItems": true,
|
|
"items": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}
|
|
},
|
|
"parameters": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["name", "type", "required", "description"],
|
|
"properties": {
|
|
"name": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
|
"type": {"type": "string", "enum": ["number", "integer", "string", "boolean", "object", "array"]},
|
|
"unit": {"type": "string", "minLength": 1},
|
|
"required": {"type": "boolean"},
|
|
"description": {"type": "string", "minLength": 1, "maxLength": 500},
|
|
"minimum": {"type": "number"},
|
|
"maximum": {"type": "number"},
|
|
"allowed_values": {"type": "array", "minItems": 1}
|
|
}
|
|
}
|
|
},
|
|
"risk_level": {"type": "string", "enum": ["low", "medium", "high"]},
|
|
"confirmation_policy": {"type": "string", "enum": ["never", "on_ambiguity", "always"]}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|