{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "WantPrompt _agent_actions envelope",
  "description": "Envelope block placed at the front of a WantPrompt static API JSON file. Lists the valid next actions from the state that file describes. Version 2: every param name verified against the live relay's Code.gs dispatch; behaviors that exist only in un-deployed v1.1.2 are labeled, never stated as live.",
  "type": "object",
  "properties": {
    "envelope_version": {
      "type": "string",
      "description": "Envelope format version. 2 = params verified against Code.gs + live probes, version-labeled behaviors."
    },
    "relay_version_live": {
      "type": "string",
      "description": "Relay version the envelope was verified against (GET ?action=health)."
    },
    "catalog": {
      "type": "string",
      "format": "uri",
      "description": "Canonical action catalog: https://wantprompt.com/api/agent-actions.json"
    },
    "_agent_actions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "action",
          "method",
          "target",
          "params",
          "required",
          "precondition",
          "effect"
        ],
        "properties": {
          "action": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST",
              "READ"
            ]
          },
          "target": {
            "type": "string"
          },
          "params": {
            "type": "object",
            "description": "Field name -> 'type — description'. A param listed here with no required entry is optional."
          },
          "required": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "precondition": {
            "type": "string"
          },
          "effect": {
            "type": "string"
          },
          "content_type": {
            "type": "string",
            "description": "POST only. text/plain — the relay cannot answer an application/json CORS preflight."
          },
          "available_in": {
            "type": "string",
            "description": "'live 1.1.1' or '1.1.2 (not deployed)'."
          },
          "live_note": {
            "type": "string",
            "description": "How live behavior differs from the patched version, with the proof date."
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Exact error strings the relay returns."
          },
          "returns": {
            "type": "string",
            "description": "Success response shape."
          }
        }
      }
    }
  },
  "required": [
    "envelope_version",
    "relay_version_live",
    "catalog",
    "_agent_actions"
  ]
}