{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://a.skh.am/pi-daemon/session-api.schema.json",
  "title": "Pi Daemon additive session API v1",
  "description": "Language-neutral REST session resources, durable mutation tickets, bounded SHA-256 blob/session file transfer, framed Pi RPC attachment messages, and ACP transport messages. Raw Pi RPC uses the upstream Pi 0.82.1 shapes.",
  "oneOf": [
    {
      "$ref": "#/$defs/sessionCreateRequest"
    },
    {
      "$ref": "#/$defs/sessionUpdateRequest"
    },
    {
      "$ref": "#/$defs/sessionResource"
    },
    {
      "$ref": "#/$defs/ticketResource"
    },
    {
      "$ref": "#/$defs/dashboardServiceCapabilitiesEnvelope"
    },
    {
      "$ref": "#/$defs/dashboardDiagnosticsEnvelope"
    },
    {
      "$ref": "#/$defs/dashboardInventoryEnvelope"
    },
    {
      "$ref": "#/$defs/dashboardSessionInfoEnvelope"
    },
    {
      "$ref": "#/$defs/dashboardTranscriptEnvelope"
    },
    {
      "$ref": "#/$defs/dashboardActivationEnvelope"
    },
    {
      "$ref": "#/$defs/dashboardExportEnvelope"
    },
    {
      "$ref": "#/$defs/dashboardLeaseEnvelope"
    },
    {
      "$ref": "#/$defs/sessionRpcFrame"
    },
    {
      "$ref": "#/$defs/jsonRpcMessage"
    },
    {
      "$ref": "#/$defs/blobReservationRequest"
    },
    {
      "$ref": "#/$defs/blobMaterializationRequest"
    },
    {
      "$ref": "#/$defs/blobTransferResource"
    },
    {
      "$ref": "#/$defs/sessionUploadResource"
    }
  ],
  "$defs": {
    "apiVersion": {
      "type": "string",
      "pattern": "^1\\.[0-9]+$"
    },
    "identifier": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256,
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
    },
    "requestId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "path": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    },
    "timestamp": {
      "type": "string",
      "minLength": 20,
      "maxLength": 64
    },
    "thinkingLevel": {
      "enum": [
        "off",
        "minimal",
        "low",
        "medium",
        "high",
        "xhigh",
        "max"
      ]
    },
    "sessionTarget": {
      "type": "object",
      "required": [
        "mode"
      ],
      "properties": {
        "mode": {
          "enum": [
            "new",
            "continue",
            "open",
            "fork",
            "memory"
          ]
        },
        "path": {
          "$ref": "#/$defs/path"
        },
        "sourceSession": {
          "$ref": "#/$defs/identifier"
        },
        "entryId": {
          "$ref": "#/$defs/identifier"
        },
        "sessionDir": {
          "$ref": "#/$defs/path"
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "mode": {
                "const": "open"
              }
            },
            "required": [
              "mode"
            ]
          },
          "then": {
            "properties": {
              "path": {
                "$ref": "#/$defs/path"
              }
            },
            "required": [
              "path"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "mode": {
                "const": "fork"
              }
            },
            "required": [
              "mode"
            ]
          },
          "then": {
            "properties": {
              "sourceSession": {
                "$ref": "#/$defs/identifier"
              }
            },
            "required": [
              "sourceSession"
            ]
          }
        }
      ],
      "additionalProperties": false
    },
    "sessionModel": {
      "type": "object",
      "properties": {
        "provider": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "thinkingLevel": {
          "$ref": "#/$defs/thinkingLevel"
        },
        "scopedModels": {
          "type": "array",
          "maxItems": 128,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "sessionTools": {
      "type": "object",
      "properties": {
        "mode": {
          "enum": [
            "default",
            "none",
            "no-builtin",
            "allowlist"
          ]
        },
        "include": {
          "type": "array",
          "maxItems": 256,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "uniqueItems": true
        },
        "exclude": {
          "type": "array",
          "maxItems": 256,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "extensionFlags": {
      "type": "object",
      "maxProperties": 256,
      "propertyNames": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128
      },
      "additionalProperties": {
        "oneOf": [
          {
            "type": "boolean"
          },
          {
            "type": "string",
            "maxLength": 4096
          }
        ]
      }
    },
    "sessionResources": {
      "type": "object",
      "properties": {
        "extensions": {
          "type": "array",
          "maxItems": 128,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          }
        },
        "skills": {
          "type": "array",
          "maxItems": 128,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          }
        },
        "promptTemplates": {
          "type": "array",
          "maxItems": 128,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          }
        },
        "themes": {
          "type": "array",
          "maxItems": 128,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          }
        },
        "noExtensions": {
          "type": "boolean"
        },
        "noSkills": {
          "type": "boolean"
        },
        "noPromptTemplates": {
          "type": "boolean"
        },
        "noThemes": {
          "type": "boolean"
        },
        "noContextFiles": {
          "type": "boolean"
        },
        "inheritInstalledPackages": {
          "type": "boolean",
          "description": "Load only package resources already installed by the Pi CLI; never install or update packages."
        },
        "systemPrompt": {
          "type": "string",
          "maxLength": 262144
        },
        "appendSystemPrompt": {
          "type": "array",
          "maxItems": 64,
          "items": {
            "type": "string",
            "maxLength": 262144
          }
        },
        "projectTrust": {
          "enum": [
            "default",
            "approve",
            "deny"
          ]
        },
        "extensionFlags": {
          "$ref": "#/$defs/extensionFlags"
        }
      },
      "additionalProperties": false
    },
    "sessionEnvironment": {
      "type": "object",
      "description": "Input-only environment values. Raw values are memory-only and MUST NOT appear in responses, logs, manifests, journals, or metrics.",
      "writeOnly": true,
      "maxProperties": 256,
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
        "maxLength": 256
      },
      "additionalProperties": {
        "type": "string",
        "maxLength": 65536
      }
    },
    "sessionIsolation": {
      "type": "object",
      "required": [
        "mode"
      ],
      "properties": {
        "mode": {
          "const": "unisolated"
        }
      },
      "additionalProperties": false
    },
    "sessionSpecInput": {
      "type": "object",
      "required": [
        "cwd",
        "target"
      ],
      "properties": {
        "cwd": {
          "$ref": "#/$defs/path"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "agentDir": {
          "$ref": "#/$defs/path"
        },
        "target": {
          "$ref": "#/$defs/sessionTarget"
        },
        "model": {
          "$ref": "#/$defs/sessionModel"
        },
        "tools": {
          "$ref": "#/$defs/sessionTools"
        },
        "resources": {
          "$ref": "#/$defs/sessionResources"
        },
        "settings": {
          "type": "object",
          "maxProperties": 512
        },
        "env": {
          "$ref": "#/$defs/sessionEnvironment"
        },
        "isolation": {
          "$ref": "#/$defs/sessionIsolation"
        }
      },
      "additionalProperties": false
    },
    "sessionSpecOutput": {
      "type": "object",
      "required": [
        "cwd",
        "target"
      ],
      "properties": {
        "cwd": {
          "$ref": "#/$defs/path"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "agentDir": {
          "$ref": "#/$defs/path"
        },
        "target": {
          "$ref": "#/$defs/sessionTarget"
        },
        "model": {
          "$ref": "#/$defs/sessionModel"
        },
        "tools": {
          "$ref": "#/$defs/sessionTools"
        },
        "resources": {
          "$ref": "#/$defs/sessionResources"
        },
        "settings": {
          "type": "object",
          "maxProperties": 512
        },
        "isolation": {
          "$ref": "#/$defs/sessionIsolation"
        }
      },
      "additionalProperties": false
    },
    "sessionCreateRequest": {
      "type": "object",
      "required": [
        "requestId",
        "spec"
      ],
      "properties": {
        "requestId": {
          "$ref": "#/$defs/requestId"
        },
        "sessionId": {
          "$ref": "#/$defs/identifier"
        },
        "spec": {
          "$ref": "#/$defs/sessionSpecInput"
        }
      },
      "additionalProperties": false
    },
    "sessionUpdateRequest": {
      "type": "object",
      "required": [
        "requestId",
        "expectedGeneration",
        "expectedRevision",
        "spec"
      ],
      "properties": {
        "requestId": {
          "$ref": "#/$defs/requestId"
        },
        "expectedGeneration": {
          "type": "integer",
          "minimum": 1
        },
        "expectedRevision": {
          "type": "integer",
          "minimum": 1
        },
        "spec": {
          "$ref": "#/$defs/sessionSpecInput"
        }
      },
      "additionalProperties": false
    },
    "environmentSummary": {
      "type": "object",
      "required": [
        "keys",
        "persistence",
        "provisioned"
      ],
      "properties": {
        "keys": {
          "type": "array",
          "maxItems": 256,
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
          },
          "uniqueItems": true
        },
        "digest": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "persistence": {
          "enum": [
            "memory-only",
            "reference"
          ]
        },
        "provisioned": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "sessionRecoveryCondition": {
      "type": "object",
      "required": [
        "state",
        "code",
        "retryable"
      ],
      "properties": {
        "state": {
          "const": "reprovision_required"
        },
        "code": {
          "const": "tool_adapter_reprovision_required"
        },
        "retryable": {
          "const": true
        }
      },
      "additionalProperties": false
    },
    "sessionLinks": {
      "type": "object",
      "required": [
        "self",
        "rpc",
        "apc"
      ],
      "properties": {
        "self": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "rpc": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "apc": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        }
      },
      "additionalProperties": false
    },
    "sessionResource": {
      "type": "object",
      "required": [
        "sessionId",
        "generation",
        "revision",
        "residency",
        "state",
        "createdAt",
        "updatedAt",
        "lastUsedAt",
        "spec",
        "environment",
        "links"
      ],
      "properties": {
        "sessionId": {
          "$ref": "#/$defs/identifier"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "generation": {
          "type": "integer",
          "minimum": 0
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "residency": {
          "enum": [
            "resident",
            "dormant"
          ]
        },
        "state": {
          "enum": [
            "opening",
            "idle",
            "running",
            "failed",
            "closing"
          ]
        },
        "createdAt": {
          "$ref": "#/$defs/timestamp"
        },
        "updatedAt": {
          "$ref": "#/$defs/timestamp"
        },
        "lastUsedAt": {
          "$ref": "#/$defs/timestamp"
        },
        "spec": {
          "$ref": "#/$defs/sessionSpecOutput"
        },
        "environment": {
          "$ref": "#/$defs/environmentSummary"
        },
        "recovery": {
          "$ref": "#/$defs/sessionRecoveryCondition"
        },
        "lastTerminal": {
          "type": "object",
          "required": [
            "state",
            "at"
          ],
          "properties": {
            "state": {
              "enum": [
                "succeeded",
                "failed",
                "indeterminate"
              ]
            },
            "at": {
              "$ref": "#/$defs/timestamp"
            },
            "requestId": {
              "$ref": "#/$defs/identifier"
            },
            "errorCode": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          "additionalProperties": false
        },
        "links": {
          "$ref": "#/$defs/sessionLinks"
        }
      },
      "additionalProperties": false
    },
    "apiError": {
      "type": "object",
      "required": [
        "code",
        "message",
        "retryable"
      ],
      "properties": {
        "code": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "message": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "retryable": {
          "type": "boolean"
        },
        "details": {
          "type": "object"
        }
      },
      "additionalProperties": false
    },
    "apiEnvelopeBase": {
      "type": "object",
      "required": [
        "apiVersion",
        "requestId",
        "hostInstanceId",
        "ok"
      ],
      "properties": {
        "apiVersion": {
          "$ref": "#/$defs/apiVersion"
        },
        "requestId": {
          "$ref": "#/$defs/requestId"
        },
        "hostInstanceId": {
          "$ref": "#/$defs/identifier"
        },
        "ok": {
          "type": "boolean"
        }
      }
    },
    "apiErrorEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "error"
          ],
          "properties": {
            "ok": {
              "const": false
            },
            "error": {
              "$ref": "#/$defs/apiError"
            }
          }
        }
      ]
    },
    "sessionEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "#/$defs/sessionResource"
            }
          }
        }
      ]
    },
    "sessionListPage": {
      "type": "object",
      "required": [
        "sessions"
      ],
      "properties": {
        "sessions": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/$defs/sessionResource"
          }
        },
        "nextCursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        }
      },
      "additionalProperties": false
    },
    "sessionListEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "#/$defs/sessionListPage"
            }
          }
        }
      ]
    },
    "ticketLinks": {
      "type": "object",
      "required": [
        "self"
      ],
      "properties": {
        "self": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "session": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        }
      },
      "additionalProperties": false
    },
    "ticketResource": {
      "type": "object",
      "required": [
        "ticketId",
        "requestId",
        "idempotencyKey",
        "operation",
        "state",
        "submittedAt",
        "updatedAt",
        "links"
      ],
      "properties": {
        "ticketId": {
          "$ref": "#/$defs/identifier"
        },
        "requestId": {
          "$ref": "#/$defs/identifier"
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "operation": {
          "enum": [
            "create",
            "update",
            "delete",
            "prompt",
            "reserve_blob",
            "materialize_blob",
            "delete_blob",
            "delete_file"
          ]
        },
        "state": {
          "enum": [
            "queued",
            "running",
            "succeeded",
            "failed",
            "indeterminate"
          ]
        },
        "submittedAt": {
          "$ref": "#/$defs/timestamp"
        },
        "updatedAt": {
          "$ref": "#/$defs/timestamp"
        },
        "sessionId": {
          "$ref": "#/$defs/identifier"
        },
        "generation": {
          "type": "integer",
          "minimum": 0
        },
        "result": {},
        "error": {
          "$ref": "#/$defs/apiError"
        },
        "links": {
          "$ref": "#/$defs/ticketLinks"
        }
      },
      "additionalProperties": false
    },
    "ticketEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "#/$defs/ticketResource"
            }
          }
        }
      ]
    },
    "rpcAttachmentCapabilities": {
      "type": "object",
      "required": [
        "subprotocols",
        "host",
        "limits",
        "roles",
        "replay"
      ],
      "properties": {
        "subprotocols": {
          "type": "array",
          "items": {
            "enum": [
              "pi-rpc.v1",
              "pi-daemon-rpc.v1"
            ]
          },
          "uniqueItems": true
        },
        "host": {
          "type": "object",
          "required": [
            "sdkVersion",
            "commandTypes",
            "rawSessionEvents",
            "extensionUi",
            "processTransportOwned",
            "policyGatedCommands"
          ],
          "properties": {
            "sdkVersion": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "commandTypes": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "uniqueItems": true
            },
            "rawSessionEvents": {
              "const": true
            },
            "extensionUi": {
              "const": true
            },
            "processTransportOwned": {
              "const": false
            },
            "policyGatedCommands": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "uniqueItems": true
            }
          },
          "additionalProperties": false
        },
        "limits": {
          "type": "object",
          "required": [
            "maxHubs",
            "maxReplayEvents",
            "maxReplayBytes",
            "maxTotalReplayBytes",
            "maxMessageBytes",
            "maxOutboundBytesPerConnection",
            "maxInFlightCommandsPerConnection",
            "keepAliveMs",
            "residencyLeaseTtlMs"
          ],
          "properties": {
            "maxHubs": {
              "type": "integer",
              "minimum": 1
            },
            "maxReplayEvents": {
              "type": "integer",
              "minimum": 1
            },
            "maxReplayBytes": {
              "type": "integer",
              "minimum": 1
            },
            "maxTotalReplayBytes": {
              "type": "integer",
              "minimum": 1
            },
            "maxMessageBytes": {
              "type": "integer",
              "minimum": 1
            },
            "maxOutboundBytesPerConnection": {
              "type": "integer",
              "minimum": 1
            },
            "maxInFlightCommandsPerConnection": {
              "type": "integer",
              "minimum": 1
            },
            "keepAliveMs": {
              "type": "integer",
              "minimum": 1
            },
            "residencyLeaseTtlMs": {
              "type": "integer",
              "minimum": 1
            }
          },
          "additionalProperties": false
        },
        "roles": {
          "type": "array",
          "items": {
            "enum": [
              "controller",
              "observer"
            ]
          },
          "uniqueItems": true
        },
        "replay": {
          "const": true
        }
      },
      "additionalProperties": false
    },
    "acpAdapterCapabilities": {
      "type": "object",
      "required": [
        "protocol",
        "protocolVersion",
        "sdkVersion",
        "websocketSubprotocol",
        "upstreamAdapter",
        "inProcess",
        "limits"
      ],
      "properties": {
        "protocol": {
          "const": "ACP"
        },
        "protocolVersion": {
          "type": "integer",
          "minimum": 1
        },
        "sdkVersion": {
          "const": "1.2.0"
        },
        "websocketSubprotocol": {
          "const": "agent-client-protocol.v1"
        },
        "upstreamAdapter": {
          "type": "object",
          "required": [
            "name",
            "auditCommit",
            "license"
          ],
          "properties": {
            "name": {
              "const": "pi-acp"
            },
            "auditCommit": {
              "type": "string",
              "pattern": "^[a-f0-9]{40}$"
            },
            "license": {
              "const": "MIT"
            }
          },
          "additionalProperties": false
        },
        "inProcess": {
          "const": true
        },
        "limits": {
          "type": "object",
          "required": [
            "maxHubs",
            "maxConnectionsPerHub",
            "maxMessageBytes",
            "maxOutboundBytesPerConnection",
            "keepAliveMs",
            "maxListSessions"
          ],
          "properties": {
            "maxHubs": {
              "type": "integer",
              "minimum": 1
            },
            "maxConnectionsPerHub": {
              "type": "integer",
              "minimum": 1
            },
            "maxMessageBytes": {
              "type": "integer",
              "minimum": 1
            },
            "maxOutboundBytesPerConnection": {
              "type": "integer",
              "minimum": 1
            },
            "keepAliveMs": {
              "type": "integer",
              "minimum": 1
            },
            "maxListSessions": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "capabilities": {
      "type": "object",
      "required": [
        "apiVersion",
        "transports",
        "rpcSubprotocols",
        "rpc",
        "acp",
        "isolationModes",
        "authentication",
        "host",
        "schedules",
        "blobTransfers"
      ],
      "properties": {
        "apiVersion": {
          "$ref": "#/$defs/apiVersion"
        },
        "transports": {
          "type": "array",
          "items": {
            "enum": [
              "unix-ndjson",
              "http",
              "websocket"
            ]
          },
          "uniqueItems": true
        },
        "rpcSubprotocols": {
          "type": "array",
          "items": {
            "enum": [
              "pi-rpc.v1",
              "pi-daemon-rpc.v1"
            ]
          },
          "uniqueItems": true
        },
        "rpc": {
          "$ref": "#/$defs/rpcAttachmentCapabilities"
        },
        "acp": {
          "$ref": "#/$defs/acpAdapterCapabilities"
        },
        "isolationModes": {
          "type": "array",
          "items": {
            "const": "unisolated"
          },
          "uniqueItems": true
        },
        "authentication": {
          "const": "service-bearer"
        },
        "host": {
          "type": "object",
          "required": [
            "ready",
            "draining"
          ],
          "properties": {
            "ready": {
              "type": "boolean"
            },
            "draining": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "schedules": {
          "oneOf": [
            {
              "$ref": "https://a.skh.am/pi-daemon/schedule.schema.json#/$defs/scheduleCapabilities"
            },
            {
              "type": "object",
              "required": [
                "available"
              ],
              "properties": {
                "available": {
                  "const": false
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "dashboard": {
          "$ref": "https://a.skh.am/pi-daemon/dashboard-api.schema.json#/$defs/dashboardServiceCapabilities"
        },
        "blobTransfers": {
          "$ref": "#/$defs/blobTransferCapabilityStatus"
        }
      },
      "additionalProperties": false
    },
    "capabilitiesEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "#/$defs/capabilities"
            }
          }
        }
      ]
    },
    "scheduleList": {
      "type": "object",
      "required": [
        "schedules"
      ],
      "properties": {
        "schedules": {
          "type": "array",
          "maxItems": 1024,
          "items": {
            "$ref": "https://a.skh.am/pi-daemon/schedule.schema.json#/$defs/scheduleResource"
          }
        }
      },
      "additionalProperties": false
    },
    "scheduleStatus": {
      "type": "object",
      "required": [
        "timerRuntime",
        "externalTimersSupported",
        "scheduleCount",
        "enabledCount"
      ],
      "properties": {
        "timerRuntime": {
          "type": "boolean"
        },
        "externalTimersSupported": {
          "const": true
        },
        "scheduleCount": {
          "type": "integer",
          "minimum": 0
        },
        "enabledCount": {
          "type": "integer",
          "minimum": 0
        },
        "nextWakeAt": {
          "$ref": "#/$defs/timestamp"
        }
      },
      "additionalProperties": false
    },
    "scheduleResourceEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "https://a.skh.am/pi-daemon/schedule.schema.json#/$defs/scheduleResource"
            }
          }
        }
      ]
    },
    "scheduleListEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "#/$defs/scheduleList"
            }
          }
        }
      ]
    },
    "scheduleStatusEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "#/$defs/scheduleStatus"
            }
          }
        }
      ]
    },
    "dashboardServiceCapabilitiesEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "https://a.skh.am/pi-daemon/dashboard-api.schema.json#/$defs/dashboardServiceCapabilities"
            }
          }
        }
      ]
    },
    "dashboardDiagnosticsEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "https://a.skh.am/pi-daemon/dashboard-api.schema.json#/$defs/diagnostics"
            }
          }
        }
      ]
    },
    "dashboardInventoryEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "https://a.skh.am/pi-daemon/dashboard-api.schema.json#/$defs/inventoryPage"
            }
          }
        }
      ]
    },
    "dashboardSessionInfoEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "https://a.skh.am/pi-daemon/dashboard-api.schema.json#/$defs/sessionInfo"
            }
          }
        }
      ]
    },
    "dashboardTranscriptEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "https://a.skh.am/pi-daemon/dashboard-api.schema.json#/$defs/transcriptPage"
            }
          }
        }
      ]
    },
    "dashboardActivationEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "https://a.skh.am/pi-daemon/dashboard-api.schema.json#/$defs/activationTicket"
            }
          }
        }
      ]
    },
    "dashboardExportEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "https://a.skh.am/pi-daemon/dashboard-api.schema.json#/$defs/exportTicket"
            }
          }
        }
      ]
    },
    "dashboardLeaseEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "https://a.skh.am/pi-daemon/dashboard-api.schema.json#/$defs/dashboardLeaseResource"
            }
          }
        }
      ]
    },
    "piRpcCommand": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "type": {
          "enum": [
            "prompt",
            "steer",
            "follow_up",
            "abort",
            "new_session",
            "get_state",
            "set_model",
            "cycle_model",
            "get_available_models",
            "set_thinking_level",
            "cycle_thinking_level",
            "get_available_thinking_levels",
            "set_steering_mode",
            "set_follow_up_mode",
            "compact",
            "set_auto_compaction",
            "set_auto_retry",
            "abort_retry",
            "bash",
            "abort_bash",
            "get_session_stats",
            "export_html",
            "switch_session",
            "fork",
            "clone",
            "get_fork_messages",
            "get_entries",
            "get_tree",
            "get_last_assistant_text",
            "set_session_name",
            "get_messages",
            "get_commands"
          ]
        }
      },
      "additionalProperties": true
    },
    "piRpcResponse": {
      "type": "object",
      "required": [
        "type",
        "command",
        "success"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "type": {
          "const": "response"
        },
        "command": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "success": {
          "type": "boolean"
        },
        "data": {},
        "error": {
          "type": "string",
          "maxLength": 4096
        }
      },
      "additionalProperties": true
    },
    "piRpcEvent": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "minLength": 1,
          "not": {
            "const": "response"
          }
        }
      },
      "additionalProperties": true
    },
    "attachSnapshot": {
      "type": "object",
      "required": [
        "session",
        "requestState",
        "rpcState"
      ],
      "properties": {
        "session": {
          "$ref": "#/$defs/sessionResource"
        },
        "requestState": {
          "type": "object"
        },
        "rpcState": {
          "type": "object"
        },
        "leafId": {
          "oneOf": [
            {
              "$ref": "#/$defs/identifier"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "rpcCommandFrame": {
      "type": "object",
      "required": [
        "kind",
        "command"
      ],
      "properties": {
        "kind": {
          "const": "command"
        },
        "command": {
          "$ref": "#/$defs/piRpcCommand"
        }
      },
      "additionalProperties": false
    },
    "rpcResponseFrame": {
      "type": "object",
      "required": [
        "kind",
        "response"
      ],
      "properties": {
        "kind": {
          "const": "response"
        },
        "response": {
          "$ref": "#/$defs/piRpcResponse"
        }
      },
      "additionalProperties": false
    },
    "rpcExtensionUiResponseFrame": {
      "type": "object",
      "required": [
        "kind",
        "response"
      ],
      "properties": {
        "kind": {
          "const": "extension_ui_response"
        },
        "response": {
          "type": "object",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "const": "extension_ui_response"
            },
            "id": {
              "$ref": "#/$defs/identifier"
            }
          },
          "additionalProperties": true
        }
      },
      "additionalProperties": false
    },
    "rpcEventFrame": {
      "type": "object",
      "required": [
        "kind",
        "cursor",
        "sequence",
        "event"
      ],
      "properties": {
        "kind": {
          "const": "event"
        },
        "cursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "sequence": {
          "type": "integer",
          "minimum": 1
        },
        "event": {
          "$ref": "#/$defs/piRpcEvent"
        }
      },
      "additionalProperties": false
    },
    "rpcAttachReadyFrame": {
      "type": "object",
      "required": [
        "kind",
        "connectionId",
        "role",
        "hostInstanceId",
        "sessionId",
        "generation",
        "highWaterCursor",
        "snapshot"
      ],
      "properties": {
        "kind": {
          "const": "attach_ready"
        },
        "connectionId": {
          "$ref": "#/$defs/identifier"
        },
        "role": {
          "enum": [
            "controller",
            "observer"
          ]
        },
        "hostInstanceId": {
          "$ref": "#/$defs/identifier"
        },
        "sessionId": {
          "$ref": "#/$defs/identifier"
        },
        "generation": {
          "type": "integer",
          "minimum": 0
        },
        "highWaterCursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "oldestAvailableCursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "snapshot": {
          "$ref": "#/$defs/attachSnapshot"
        }
      },
      "additionalProperties": false
    },
    "rpcReplayGapFrame": {
      "type": "object",
      "required": [
        "kind",
        "reason",
        "requestedCursor",
        "highWaterCursor",
        "snapshotFollows"
      ],
      "properties": {
        "kind": {
          "const": "replay_gap"
        },
        "reason": {
          "enum": [
            "cursor_expired",
            "host_restarted",
            "generation_changed"
          ]
        },
        "requestedCursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "oldestAvailableCursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "highWaterCursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "snapshotFollows": {
          "const": true
        }
      },
      "additionalProperties": false
    },
    "rpcControlFrame": {
      "type": "object",
      "required": [
        "kind",
        "action"
      ],
      "properties": {
        "kind": {
          "const": "control"
        },
        "action": {
          "enum": [
            "request_control",
            "release_control",
            "control_granted",
            "control_denied"
          ]
        },
        "connectionId": {
          "$ref": "#/$defs/identifier"
        },
        "reason": {
          "type": "string",
          "maxLength": 4096
        }
      },
      "additionalProperties": false
    },
    "rpcTreeNavigateFrame": {
      "type": "object",
      "required": [
        "kind",
        "correlationId",
        "request"
      ],
      "properties": {
        "kind": {
          "const": "tree_navigate"
        },
        "correlationId": {
          "$ref": "#/$defs/identifier"
        },
        "request": {
          "type": "object",
          "required": [
            "entryId"
          ],
          "properties": {
            "entryId": {
              "$ref": "#/$defs/identifier"
            },
            "summarize": {
              "type": "boolean"
            },
            "customInstructions": {
              "type": "string",
              "minLength": 1,
              "maxLength": 65536
            },
            "replaceInstructions": {
              "type": "boolean"
            },
            "label": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "rpcTreeNavigateResultFrame": {
      "type": "object",
      "required": [
        "kind",
        "correlationId"
      ],
      "properties": {
        "kind": {
          "const": "tree_navigate_result"
        },
        "correlationId": {
          "$ref": "#/$defs/identifier"
        },
        "result": {
          "type": "object",
          "required": [
            "cancelled"
          ],
          "properties": {
            "cancelled": {
              "type": "boolean"
            },
            "aborted": {
              "type": "boolean"
            },
            "editorText": {
              "type": "string",
              "maxLength": 262144
            },
            "summaryEntryId": {
              "$ref": "#/$defs/identifier"
            }
          },
          "additionalProperties": false
        },
        "error": {
          "$ref": "#/$defs/apiError"
        }
      },
      "oneOf": [
        {
          "required": [
            "result"
          ],
          "properties": {
            "result": {},
            "error": false
          }
        },
        {
          "required": [
            "error"
          ],
          "properties": {
            "result": false,
            "error": {}
          }
        }
      ],
      "additionalProperties": false
    },
    "sessionRpcFrame": {
      "oneOf": [
        {
          "$ref": "#/$defs/rpcCommandFrame"
        },
        {
          "$ref": "#/$defs/rpcResponseFrame"
        },
        {
          "$ref": "#/$defs/rpcExtensionUiResponseFrame"
        },
        {
          "$ref": "#/$defs/rpcEventFrame"
        },
        {
          "$ref": "#/$defs/rpcAttachReadyFrame"
        },
        {
          "$ref": "#/$defs/rpcReplayGapFrame"
        },
        {
          "$ref": "#/$defs/rpcControlFrame"
        },
        {
          "$ref": "#/$defs/rpcTreeNavigateFrame"
        },
        {
          "$ref": "#/$defs/rpcTreeNavigateResultFrame"
        }
      ]
    },
    "jsonRpcMessage": {
      "type": "object",
      "required": [
        "jsonrpc"
      ],
      "properties": {
        "jsonrpc": {
          "const": "2.0"
        },
        "id": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 256
            },
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "method": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "params": {},
        "result": {},
        "error": {
          "type": "object",
          "required": [
            "code",
            "message"
          ],
          "properties": {
            "code": {
              "type": "integer"
            },
            "message": {
              "type": "string",
              "maxLength": 4096
            },
            "data": {}
          }
        }
      },
      "anyOf": [
        {
          "properties": {
            "method": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "required": [
            "method"
          ]
        },
        {
          "properties": {
            "result": {}
          },
          "required": [
            "result"
          ]
        },
        {
          "properties": {
            "error": {
              "type": "object",
              "required": [
                "code",
                "message"
              ],
              "properties": {
                "code": {
                  "type": "integer"
                },
                "message": {
                  "type": "string",
                  "maxLength": 4096
                },
                "data": {}
              }
            }
          },
          "required": [
            "error"
          ]
        }
      ],
      "additionalProperties": true
    },
    "blobId": {
      "type": "string",
      "pattern": "^blob-[A-Za-z0-9_-]{43}$"
    },
    "fileId": {
      "type": "string",
      "pattern": "^file-[A-Za-z0-9_-]{43}$"
    },
    "sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "blobMetadataInput": {
      "type": "object",
      "required": [
        "name",
        "mediaType"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "mediaType": {
          "type": "string",
          "minLength": 3,
          "maxLength": 255,
          "pattern": "^[A-Za-z0-9!#$&^_.+-]+/[A-Za-z0-9!#$&^_.+-]+$"
        }
      },
      "additionalProperties": false
    },
    "blobUntrustedMetadata": {
      "type": "object",
      "required": [
        "name",
        "mediaType",
        "trust"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "mediaType": {
          "type": "string",
          "minLength": 3,
          "maxLength": 255,
          "pattern": "^[A-Za-z0-9!#$&^_.+-]+/[A-Za-z0-9!#$&^_.+-]+$"
        },
        "trust": {
          "const": "untrusted"
        }
      },
      "additionalProperties": false
    },
    "blobTransferLimits": {
      "type": "object",
      "required": [
        "maxBlobs",
        "maxBlobsPerSession",
        "maxBlobBytes",
        "maxTotalBytes",
        "maxReferences",
        "maxReferencesPerBlob",
        "maxNameBytes",
        "maxMediaTypeBytes",
        "maxRecordBytes",
        "maxRecoveryBytes",
        "reservationTtlMs",
        "blobTtlMs",
        "referenceTtlMs"
      ],
      "properties": {
        "maxBlobs": {
          "type": "integer",
          "minimum": 1
        },
        "maxBlobsPerSession": {
          "type": "integer",
          "minimum": 1
        },
        "maxBlobBytes": {
          "type": "integer",
          "minimum": 1
        },
        "maxTotalBytes": {
          "type": "integer",
          "minimum": 1
        },
        "maxReferences": {
          "type": "integer",
          "minimum": 1
        },
        "maxReferencesPerBlob": {
          "type": "integer",
          "minimum": 1
        },
        "maxNameBytes": {
          "type": "integer",
          "minimum": 1
        },
        "maxMediaTypeBytes": {
          "type": "integer",
          "minimum": 1
        },
        "maxRecordBytes": {
          "type": "integer",
          "minimum": 1
        },
        "maxRecoveryBytes": {
          "type": "integer",
          "minimum": 1
        },
        "reservationTtlMs": {
          "type": "integer",
          "minimum": 0
        },
        "blobTtlMs": {
          "type": "integer",
          "minimum": 0
        },
        "referenceTtlMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "blobTransferCapabilities": {
      "type": "object",
      "required": [
        "contractVersion",
        "opaqueContent",
        "contentAddressedSha256",
        "untrustedMetadata",
        "cwdMaterialization",
        "quarantine",
        "limits"
      ],
      "properties": {
        "contractVersion": {
          "const": "1.0"
        },
        "opaqueContent": {
          "const": true
        },
        "contentAddressedSha256": {
          "const": true
        },
        "untrustedMetadata": {
          "const": true
        },
        "cwdMaterialization": {
          "const": false
        },
        "quarantine": {
          "const": true
        },
        "limits": {
          "$ref": "#/$defs/blobTransferLimits"
        }
      },
      "additionalProperties": false
    },
    "blobTransferCapabilityStatus": {
      "oneOf": [
        {
          "$ref": "#/$defs/blobTransferCapabilities"
        },
        {
          "type": "object",
          "required": [
            "available"
          ],
          "properties": {
            "available": {
              "const": false
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "blobReservationRequest": {
      "type": "object",
      "required": [
        "requestId",
        "expectedGeneration",
        "metadata",
        "sizeBytes",
        "sha256"
      ],
      "properties": {
        "requestId": {
          "$ref": "#/$defs/requestId"
        },
        "expectedGeneration": {
          "type": "integer",
          "minimum": 0
        },
        "metadata": {
          "$ref": "#/$defs/blobMetadataInput"
        },
        "sizeBytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 67108864
        },
        "sha256": {
          "$ref": "#/$defs/sha256"
        }
      },
      "additionalProperties": false
    },
    "blobMaterializationRequest": {
      "type": "object",
      "required": [
        "requestId",
        "expectedGeneration",
        "blobId"
      ],
      "properties": {
        "requestId": {
          "$ref": "#/$defs/requestId"
        },
        "expectedGeneration": {
          "type": "integer",
          "minimum": 0
        },
        "blobId": {
          "$ref": "#/$defs/blobId"
        }
      },
      "additionalProperties": false
    },
    "blobTransferLinks": {
      "type": "object",
      "required": [
        "self",
        "content",
        "materialize"
      ],
      "properties": {
        "self": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "content": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "materialize": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        }
      },
      "additionalProperties": false
    },
    "blobTransferResource": {
      "type": "object",
      "required": [
        "contractVersion",
        "blobId",
        "sessionId",
        "generation",
        "revision",
        "state",
        "metadata",
        "sizeBytes",
        "sha256",
        "referenceCount",
        "createdAt",
        "updatedAt",
        "expiresAt",
        "links"
      ],
      "properties": {
        "contractVersion": {
          "const": "1.0"
        },
        "blobId": {
          "$ref": "#/$defs/blobId"
        },
        "sessionId": {
          "$ref": "#/$defs/identifier"
        },
        "generation": {
          "type": "integer",
          "minimum": 0
        },
        "revision": {
          "type": "integer",
          "minimum": 0
        },
        "state": {
          "enum": [
            "reserved",
            "available",
            "quarantined"
          ]
        },
        "metadata": {
          "$ref": "#/$defs/blobUntrustedMetadata"
        },
        "sizeBytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 67108864
        },
        "sha256": {
          "$ref": "#/$defs/sha256"
        },
        "referenceCount": {
          "type": "integer",
          "minimum": 0
        },
        "createdAt": {
          "$ref": "#/$defs/timestamp"
        },
        "updatedAt": {
          "$ref": "#/$defs/timestamp"
        },
        "expiresAt": {
          "$ref": "#/$defs/timestamp"
        },
        "quarantineCode": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_]{0,63}$"
        },
        "links": {
          "$ref": "#/$defs/blobTransferLinks"
        }
      },
      "additionalProperties": false,
      "oneOf": [
        {
          "properties": {
            "state": {
              "const": "quarantined"
            },
            "quarantineCode": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            }
          },
          "required": [
            "state",
            "quarantineCode"
          ]
        },
        {
          "properties": {
            "state": {
              "enum": [
                "reserved",
                "available"
              ]
            },
            "quarantineCode": false
          },
          "required": [
            "state"
          ]
        }
      ]
    },
    "sessionUploadLinks": {
      "type": "object",
      "required": [
        "self",
        "content"
      ],
      "properties": {
        "self": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "content": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        }
      },
      "additionalProperties": false
    },
    "sessionUploadResource": {
      "type": "object",
      "required": [
        "contractVersion",
        "fileId",
        "sessionId",
        "generation",
        "blobId",
        "relativeRef",
        "metadata",
        "sizeBytes",
        "sha256",
        "createdAt",
        "expiresAt",
        "links"
      ],
      "properties": {
        "contractVersion": {
          "const": "1.0"
        },
        "fileId": {
          "$ref": "#/$defs/fileId"
        },
        "sessionId": {
          "$ref": "#/$defs/identifier"
        },
        "generation": {
          "type": "integer",
          "minimum": 0
        },
        "blobId": {
          "$ref": "#/$defs/blobId"
        },
        "relativeRef": {
          "type": "string",
          "pattern": "^uploads/file-[A-Za-z0-9_-]{43}$"
        },
        "metadata": {
          "$ref": "#/$defs/blobUntrustedMetadata"
        },
        "sizeBytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 67108864
        },
        "sha256": {
          "$ref": "#/$defs/sha256"
        },
        "createdAt": {
          "$ref": "#/$defs/timestamp"
        },
        "expiresAt": {
          "$ref": "#/$defs/timestamp"
        },
        "links": {
          "$ref": "#/$defs/sessionUploadLinks"
        }
      },
      "additionalProperties": false
    },
    "blobTransferEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "#/$defs/blobTransferResource"
            }
          }
        }
      ]
    },
    "sessionUploadEnvelope": {
      "allOf": [
        {
          "$ref": "#/$defs/apiEnvelopeBase"
        },
        {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "ok": {
              "const": true
            },
            "data": {
              "$ref": "#/$defs/sessionUploadResource"
            }
          }
        }
      ]
    }
  }
}
