{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://localendpoints.com/schemas/localendpoint.chat-control-plan.schema.json",
  "title": "LocalEndpoint Chat Control Action Plan",
  "description": "Local-only action plan for the user-started chatbox desktop control bridge.",
  "type": "object",
  "required": [
    "planVersion",
    "workspaceLabel",
    "approvalMode",
    "approvedByOperator",
    "createdUtc",
    "actions"
  ],
  "additionalProperties": false,
  "properties": {
    "planVersion": {
      "type": "string",
      "const": "1.0"
    },
    "workspaceLabel": {
      "type": "string",
      "minLength": 1
    },
    "approvalMode": {
      "type": "string",
      "enum": [
        "review-each-action",
        "session-approved",
        "dry-run"
      ]
    },
    "approvedByOperator": {
      "type": "boolean"
    },
    "createdUtc": {
      "type": "string",
      "format": "date-time",
      "pattern": "Z$"
    },
    "actions": {
      "type": "array",
      "minItems": 1,
      "maxItems": 25,
      "items": {
        "type": "object",
        "required": [
          "actionId",
          "actionType",
          "reason",
          "approvedByOperator"
        ],
        "additionalProperties": false,
        "properties": {
          "actionId": {
            "type": "string",
            "minLength": 1
          },
          "actionType": {
            "type": "string",
            "enum": [
              "observe_screen",
              "read_active_window_title",
              "screenshot",
              "focus_window",
              "type_text",
              "hotkey",
              "mouse_click",
              "wait",
              "open_url"
            ]
          },
          "target": {
            "type": "string"
          },
          "text": {
            "type": "string",
            "maxLength": 4000
          },
          "hotkey": {
            "type": "string",
            "enum": [
              "ctrl+c",
              "ctrl+v",
              "ctrl+a",
              "ctrl+s",
              "ctrl+l",
              "ctrl+tab",
              "alt+tab",
              "enter",
              "escape",
              "tab",
              "shift+tab",
              "win+d"
            ]
          },
          "x": {
            "type": "integer",
            "minimum": 0
          },
          "y": {
            "type": "integer",
            "minimum": 0
          },
          "seconds": {
            "type": "number",
            "minimum": 0,
            "maximum": 30
          },
          "reason": {
            "type": "string",
            "minLength": 1
          },
          "approvedByOperator": {
            "type": "boolean"
          }
        }
      }
    },
    "nonClaims": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  }
}