{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sk-intellix-wiki.pages.dev/docs/a2a/deviceagent-agentic-capability-card.schema.json",
  "title": "DeviceAgent Agentic Capability Card",
  "type": "object",
  "required": [
    "capability_id",
    "domain",
    "maturity",
    "planner_exposure",
    "runtime",
    "inputs",
    "context_reads",
    "resources",
    "lifecycle",
    "safety",
    "composition"
  ],
  "properties": {
    "capability_id": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]*$"
    },
    "display_name": {
      "type": "string"
    },
    "domain": {
      "enum": [
        "mobility",
        "cleaning",
        "environment",
        "vision",
        "security",
        "streaming",
        "voice_llm",
        "schedule",
        "interaction",
        "application",
        "maintenance",
        "system"
      ]
    },
    "maturity": {
      "enum": [
        "M3_MANAGED",
        "M2_OBSERVABLE",
        "M1_CALLABLE",
        "M0_INTERNAL",
        "NO_GO"
      ]
    },
    "planner_exposure": {
      "enum": [
        "direct_step",
        "terminal_step_only",
        "context_only",
        "blocked"
      ]
    },
    "runtime": {
      "type": "object",
      "required": ["owner", "task_methods", "queue"],
      "properties": {
        "owner": {
          "type": "string"
        },
        "task_methods": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "framework_methods": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "domain_methods": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "queue": {
          "type": "string"
        },
        "execution_mode": {
          "enum": ["DIRECT", "QUEUED_WAIT", "ASYNC", "DOMAIN_ONLY"]
        }
      },
      "additionalProperties": false
    },
    "inputs": {
      "type": "object",
      "required": ["required", "optional"],
      "properties": {
        "required": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "optional": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "context_reads": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "resources": {
      "type": "object",
      "required": ["exclusive", "shared"],
      "properties": {
        "exclusive": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "shared": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "lifecycle": {
      "type": "object",
      "required": [
        "accepted_evidence",
        "completion_targets",
        "terminal_events",
        "timeout_ms",
        "cancel_method",
        "compensation_method"
      ],
      "properties": {
        "accepted_evidence": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "completion_targets": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "terminal_events": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "timeout_ms": {
          "type": "integer",
          "minimum": 0
        },
        "cancel_method": {
          "type": ["string", "null"]
        },
        "compensation_method": {
          "type": ["string", "null"]
        }
      },
      "additionalProperties": false
    },
    "safety": {
      "type": "object",
      "required": ["device_gates", "privacy"],
      "properties": {
        "device_gates": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "privacy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "composition": {
      "type": "object",
      "required": [
        "may_follow",
        "may_overlap",
        "replan_on",
        "known_gaps"
      ],
      "properties": {
        "may_follow": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "may_overlap": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "replan_on": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "known_gaps": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
