{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/apiosk-com/json-schema/apiosk-com-continuation-schema.json",
  "title": "Continuation",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/apiosk-com-openapi.json#/components/schemas/Continuation",
  "type": "object",
  "required": [
    "state",
    "actions"
  ],
  "properties": {
    "state": {
      "$ref": "#/$defs/ContinuationState"
    },
    "actions": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "action_id",
          "kind",
          "label",
          "requires_authorization",
          "input_schema"
        ],
        "properties": {
          "action_id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "select_entity",
              "supply_input"
            ]
          },
          "label": {
            "type": "string"
          },
          "requires_authorization": {
            "type": "boolean",
            "const": false
          },
          "input_schema": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    }
  },
  "$defs": {
    "ContinuationState": {
      "type": "object",
      "additionalProperties": false,
      "description": "Signed snapshot returned by this run. Copy unchanged.",
      "required": [
        "schema_version",
        "state_ref",
        "revision",
        "expires_at",
        "focus",
        "state_token"
      ],
      "properties": {
        "schema_version": {
          "type": "string",
          "enum": [
            "2"
          ]
        },
        "state_ref": {
          "type": "string",
          "format": "uuid"
        },
        "revision": {
          "type": "integer",
          "minimum": 0
        },
        "expires_at": {
          "type": "string",
          "format": "date-time"
        },
        "focus": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "entity_refs",
            "goal_refs"
          ],
          "properties": {
            "entity_refs": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            },
            "goal_refs": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          }
        },
        "state_token": {
          "type": "string"
        }
      }
    }
  }
}