{
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "minLength": 1
    },
    "agentic": {
      "const": "0.1.0-draft"
    },
    "origin": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256,
      "pattern": "^https?://[^/]+$"
    },
    "actions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*$"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "openapi": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^/[^/\\\\?#]+(?:/[^/\\\\?#]+)*$"
          },
          "submit": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*$"
          },
          "status": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*$"
          },
          "verify": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*$"
          },
          "request": {
            "type": "object",
            "properties": {
              "header": {
                "const": "Idempotency-Key"
              },
              "scope": {
                "const": "principal-action"
              },
              "retentionSeconds": {
                "type": "integer",
                "minimum": 60,
                "maximum": 604800
              }
            },
            "required": [
              "header",
              "scope",
              "retentionSeconds"
            ],
            "additionalProperties": false
          },
          "bindings": {
            "type": "object",
            "properties": {
              "statusRequestId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*$"
              },
              "verifyResourceId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*$"
              }
            },
            "required": [
              "statusRequestId",
              "verifyResourceId"
            ],
            "additionalProperties": false
          },
          "evidence": {
            "type": "object",
            "properties": {
              "resourceIdPointer": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "pattern": "^(?:/(?:[^~/]|~[01])*)+$"
              },
              "requestIdPointer": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "pattern": "^(?:/(?:[^~/]|~[01])*)+$"
              },
              "statePointer": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "pattern": "^(?:/(?:[^~/]|~[01])*)+$"
              },
              "successValues": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "minItems": 1,
                "maxItems": 10,
                "uniqueItems": true
              },
              "inputBindings": {
                "type": "array",
                "minItems": 1,
                "maxItems": 20,
                "items": {
                  "type": "object",
                  "properties": {
                    "inputPointer": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "pattern": "^(?:/(?:[^~/]|~[01])*)+$"
                    },
                    "resourcePointer": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "pattern": "^(?:/(?:[^~/]|~[01])*)+$"
                    }
                  },
                  "required": [
                    "inputPointer",
                    "resourcePointer"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "resourceIdPointer",
              "requestIdPointer",
              "statePointer",
              "successValues",
              "inputBindings"
            ],
            "additionalProperties": false
          },
          "recovery": {
            "type": "object",
            "properties": {
              "maxChecks": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10
              },
              "checkDelayMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 5000
              },
              "timeoutMs": {
                "type": "integer",
                "minimum": 100,
                "maximum": 10000
              },
              "retry": {
                "const": "never-automatically"
              }
            },
            "required": [
              "maxChecks",
              "checkDelayMs",
              "timeoutMs",
              "retry"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "description",
          "openapi",
          "submit",
          "status",
          "verify",
          "request",
          "bindings",
          "evidence",
          "recovery"
        ],
        "additionalProperties": false
      },
      "minItems": 1,
      "maxItems": 32
    }
  },
  "required": [
    "agentic",
    "origin",
    "actions"
  ],
  "additionalProperties": false,
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ruagentic.org/schemas/agentic-0.1.schema.json",
  "title": "Agentic Action Profile 0.1 draft"
}
