{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://localendpoints.com/schemas/localendpoint.local-control-action-plan.schema.json",
  "title": "LocalEndpoint Local Control Action Plan",
  "description": "Approval-gated local desktop action plan for Phase 2.21.",
  "type": "object",
  "required": [
    "source",
    "operator_label",
    "requires_approval",
    "actions"
  ],
  "additionalProperties": false,
  "properties": {
    "source": {
      "enum": [
        "chatbox",
        "mcp",
        "manual",
        "test"
      ]
    },
    "operator_label": {
      "type": "string",
      "minLength": 1
    },
    "requires_approval": {
      "type": "boolean"
    },
    "approved": {
      "type": "boolean"
    },
    "actions": {
      "type": "array",
      "minItems": 1,
      "maxItems": 25,
      "items": {
        "type": "object",
        "required": [
          "action_type",
          "reason"
        ],
        "additionalProperties": false,
        "properties": {
          "action_type": {
            "enum": [
              "observe_screen",
              "read_active_window_title",
              "screenshot",
              "semantic_click",
              "type_text",
              "hotkey",
              "mouse_click",
              "wait"
            ]
          },
          "target_text": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "keys": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 4
          },
          "x": {
            "type": "integer",
            "minimum": 0
          },
          "y": {
            "type": "integer",
            "minimum": 0
          },
          "seconds": {
            "type": "number",
            "minimum": 0,
            "maximum": 30
          },
          "reason": {
            "type": "string",
            "minLength": 3,
            "maxLength": 500
          }
        }
      }
    },
    "non_claims": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  }
}
