{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://localendpoints.com/schemas/localendpoint.chatbox-action-plan.schema.json",
  "title": "LocalEndpoint Chatbox Action Plan",
  "description": "Reviewable action plan for the local loopback chatbox desktop control runner.",
  "type": "object",
  "required": [
    "planVersion",
    "workspaceLabel",
    "approvalMode",
    "approvedByOperator",
    "createdUtc",
    "actions",
    "nonClaims"
  ],
  "properties": {
    "planVersion": {
      "type": "string"
    },
    "workspaceLabel": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "approvalMode": {
      "type": "string",
      "enum": [
        "review-each-action",
        "session-approved",
        "dry-run"
      ]
    },
    "approvedByOperator": {
      "type": "boolean"
    },
    "createdUtc": {
      "type": "string",
      "pattern": "Z$"
    },
    "actions": {
      "type": "array",
      "minItems": 1,
      "maxItems": 25,
      "items": {
        "type": "object",
        "required": [
          "actionId",
          "actionType",
          "reason",
          "approvedByOperator"
        ],
        "properties": {
          "actionId": {
            "type": "string"
          },
          "actionType": {
            "type": "string",
            "enum": [
              "observe_screen",
              "read_active_window_title",
              "screenshot",
              "semantic_click",
              "focus_window",
              "type_text",
              "hotkey",
              "mouse_click",
              "wait",
              "open_url",
              "semantic_click_text",
              "list_windows",
              "local_approved_macro"
            ]
          },
          "target": {
            "type": "string"
          },
          "text": {
            "type": "string",
            "maxLength": 4000
          },
          "hotkey": {
            "type": "string"
          },
          "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"
          }
        },
        "additionalProperties": false
      }
    },
    "nonClaims": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "additionalProperties": false
}
